Showing posts with label SparkFun. Show all posts
Showing posts with label SparkFun. Show all posts

Tuesday, June 21, 2011

OpenTelecine, OpenCV, image processing


The two biggest challenges to overcome in the OpenTelecine project are optics and image processing. In previous blogs, we discussed some accomplishments in image processing for the rectangular geometries found in 8mm film frames and film spool holes. In this blog, we shall discuss the failures and upcoming challenges in configuring the camera and OpenTelecine optics to illuminate and capture 8mm frames.

The first image is a prototype of a projector using a SparkFun cardboard box, Petzl LED headlight, and an existing projector optical focus. An unusual attribute of this prototype is the lack of a well defined aperture. In optics, an aperture is a hole or an opening through which light travels. More specifically, the aperture of an optical system is the opening that determines the cone angle of a bundle of rays that come to a focus in the image plane. In our case, the aperture was cut out to be a large rectangular hole that spans multiple 8mm frames. Another unusual characteristic is that the film rests on a adjustable back-plane. This allows for the projector to have two optical parameters to adjust: the optical focus and the distance to the back-plane.



The prototype projector was set up in a dark room to project the 8mm film on a whiteboard. A Nikon D90 camera was set off to the side and capture a 10 second exposure of this image. Notice the imperfection in this photo, where the center spool hole is in perfect focus, whereas the left and right spool holes are not. Another unexpected discovery is that the images smear and streak off between frames, which is caused by the mechanical shutter and film transition. This is solved in practice by reducing the aperture size. 8mm film cameras generally have larger apertures then the projector, which causes a projector to display only a subset of each original frame. Striving to capture the maximum available frame in the OpenTelecine will be difficult because the frames will not have perfectly shaped rectangular frames and spool holes. The top of each frame will be smeared and streaked, whereas the spool holes are rounded rectangles.




Instead of capturing the film off the whiteboard, the camera and projector were placed inline to face each other directly. Notice that the images captured by using this approach are completely and totally unacceptable. Is this project doomed to fail?

Reflection, refraction, and chromatic dispersion are well understood, and there are precise mathematical solutions to this problem. My next attempt will come by a recommendation, which is to place the camera and project perpendicular to each, with a mirror between them at a 45 degree angle.

The project currently uses Ubuntu 11.04 (simular to Microsoft Windows), OpenCV, gimp (similar to Adobe), GNU gcc (similar to Microsoft .NET), and Eclipse. Photos are generally taken with a Nikon D90 or Sprint HTC Evo running CyanogenMod (simular to Windows mobile cell phone and iPhone).

Saturday, June 18, 2011

Open Telecine, OpenCV, image processing



"This is the second post about an attempt to make an open source telecine. Telecine is the process of transferring motion picture film into video form. The preliminary goal of this project is currently limited to converting 8mm film to DVD using a digital camera, while levering other open source projects. Telecine has had much success in using flatbed scanners and ones that record from modified film projectors. The frame-by-frame projector use by this project will be built from scratch, by using: two stepper motors, an arduino board, an EasyDriver (from SparkFun), a MakerBot for printing 3D components, a LEDs, and optics. The software to convert the images into a movie is yet to be determined, but here is an attempt."

The first image processing restrictions that was added (to identify rectangles with the desired proprieties) is the angle off the X/Y axis. 8mm film possesses two desired rectangular geometries, a picture frames and the spool holes. Since the project will capture all images (in strictly a vertical or horizontal orientation), additional code was added (to the OpenCV example) to only identify horizontal and vertical rectangles. In the first set of images, notice the tolerance of rectangles up to a 2.5 degree from the horizontal axis, where the 15 degree rectangle was ignored.


A second image processing restrictions that was added (to identify rectangles with the desired proprieties) is the X to Y proportion. Some of today's media comes in a 16:9 or 4:3 rectangular format, whereas 8mm has it's own ratios. The next set of images show the acceptance of rectangles with the ratios possessed by a 8mm picture frame and the spool hole.

The project currently uses Ubuntu 11.04 (simular to Microsoft Windows), OpenCV, GNU gcc, and Eclipse. The photo of the pottery vase was taken with an Sprint HTC Evo (simular to iPhone).

Thursday, June 16, 2011

Open Telecine, OpenCV, image processing



This is the first post about an attempt to make an open source telecine. Telecine is the process of transferring motion picture film into video form. The preliminary goal of this project is currently limited to converting 8mm film to DVD using a digital camera, while levering other open source projects. Telecine has had much success in using flatbed scanners and ones that record from modifyed film projectors. The frame-by-frame projector use by this project will be built from scratch, by using: two stepper motors, an arduino board, an EasyDriver (from SparkFun), a MakerBot for printing 3D components, a LEDs, and optics. The software to convert the images into a movie is yet to be determined, but here is the first attempt.

The first set of images are a mockup of frames being capture and processed to determined the film spool holes. The 8mm spool holes need to be determined in order to perform cropping correctly, and to uniquely identify each frame. The green squares were automatically identified by image processing. An example (e.g. squares.cpp) contained within OpenCV was modified to enhance the discovery of rectangles with greater accuracy. The image processing is as follows: pyramid scaling (for smoothing imaging and filtering out some noise), Canny algorithm (for edge detection), initial contours detection, Douglas-Peucker algorithm (for reducing the number of points in a curve), and finally rectangle detection (for eliminating other types of polygons). The next task is to add code that will only detect rectangles with the correct proportions for a 8mm spool hole.




The second set of images are from Flatbed Scanner Digital Telecine (FSDT) to give a more realistic test. Notice that the image processing failed to detect one of the spool hole. Near perfection is paramount, because of the number of frames contained on large spools of film.

The project currently uses Ubuntu 11.04 (simular to Microsoft Windows), OpenCV, GNU gcc, and Eclipse. The photo of the pottery vase was taken with an Sprint HTC Evo (simular to iPhone).