My Projects

Homepage My sites My photos My projects Mackinak Island from my family's vacation there in 2017

8mm film scanning device

Aug 12, 2020

My desire to archive my family videos started with our VHS and video8 videotapes. I already had an analog capture card so it was easy to convert these. I knew our family had film movies because we once watched them on the projector. The best way I had to convert these films at first was pointing the projector and a camera at the same section of a projection screen, however I was unhappy with the results, the films appeared in less detail than in person and the frame rate mismatch of the camera and the projector would cause a flickering effect.

After a few films converted this way I decided that I wanted to get a film scanner to get a higher quality of conversion. Instead of getting a scanner that would convert the whole film for me, I opted for one designed to take still pictures instead as it was a better budgeting option for a college student, and I figured I could find a way to move the film on my own. Before I designed a robot to move the film through the scanner I played around with the scanner to see how I would interface the robot with it and to get an idea of how the end result would look. I manually moved a section of film through the scanner and in about an hour I had this clip of my Grandparents wedding reception.

The film scanner I purchased took pictures slightly shorter than the height of a frame of super8 film, and the only way to take the pictures was via a button, so I used two motors. One motor, GPIO pins 24 and 25, pulls the film forward and the other, GPIO pins 18 and 23, presses the picture button. I used the Raspberry Pi 4 with a 6-volt motor controller to control both motors. I had the pulling motor pull the film about a half frame forward at a time so I could scan the full height of each frame with an overlap to stitch the pictures together.

I then needed to develop a program to stitch the pictures together. So I first tried manually stitching two pictures together in Krita and found that by having one of the pictures set as a subtraction layer (the RGB data from a subtraction layer is subtracted from the RGB data of the layers below it) It was easy to line up two pictures. Then by applying a gradient over the overlapping area there would be no visible line between the merged images. I then formulated this method in python code.

Doing this process to all the pictures from the film scanner I had built one tall picture of all the frames. I then measured the height of a frame in pixels and added code to cut the long picture into individual frames of the film, and this gave me a watchable video. However the video jumps up or down whenever there are two pictures that my program failed to merge correctly. This video of Disney’s “It’s a small world” shows how there tends to be more failures on parts of the film with low picture information or repeating vertical patterns. (for example text on a blank screen or the circular design at 2:40) The scrolling red green and blue lines on the right are markers I used to identify which pictures from the scanner are in use on a frame of video, this helps me identify the merging failures and correct them.

Sept 21, 2020

The next thing I did was have my program output data to a csv file, what it output was for each merge it output the two file numbers it was merging and how big the best overlap was. My plan was to take this data and find a way for my program to catch its errors and correct them. I ran my program through the small world scans again to obtain some data to test in excel.

I first tried taking the mean and standard deviation of all the merges but this gave me too many errors that did not actually exist. With a plot of the overlaps over time i saw that there were certain regions where the overlap would hang out for a while, my theory about this is that the batteries that driver the pulling motor do not stay at a fixed 6V and that the motor will pull a different amount which results in a different overlap size.

My next plan was to take a 10 point trailing average and standard deviation. Sure enough this got me a much better estimate of the localised merging errors, however it fails to recognise large groups of errors. To try and fix large groups of errors I tried marking anywhere where the trailing standard deviation was more than 400 as an error. Sure enough this caught most of the large sections of error.

I modified my program to recognise errors in this way as it went along and if it thought it had made an error it would try looking for the correct overlap length again but with a higher precision. This gave me a new problem, fixing these errors with a higher precision level would take far too long. The next time I have the chance to work on this I will have to come up with a more efficient algorithm to stitch the images together.

Jan 10, 2021

I had an idea for a new algorithm that would find the sprocket holes in my regular 8mm films and combine two consecutive pictures based on the known distance between sprocket holes. There are four cases to find the sprocket holes on one picture, the hole is sitting on the top, the bottom, in the middle or there is one hole on the top and one on the bottom.

After working out the math for each combination of these four cases I ran my program again on a set of data that I had previously ran with the old algorithm and not only did I get more accurate image combinations, but It also ran faster. However there were sections where this new algorithm performed much worse than the subtraction algorithm, so once again I collected data on the overlaps to see if I could predict some of these failures.

The overlaps were more consistent than with the subtraction algorithm, but when the hole finding algorithm fails it is much more inconsistent. I now fall back on the subtraction algorithm when the overlap is less than 300 pixels, more than 1200 pixels, when the trailing mean is more than 1000 and the trailing standard deviation is more than 375.

My Research:

https://en.wikipedia.org/wiki/Scale-invariant_feature_transform http://matthewalunbrown.com/papers/ijcv2007.pdf https://ai.stanford.edu/~syyeung/cvweb/tutorial2.html https://elischolar.library.yale.edu/cgi/viewcontent.cgi?article=1088&context=jcas https://medium.com/@brettmc1963/how-i-converted-my-old-super-8-film-to-digital-21afdd14a9c

About Me

Mountain View

Eagle Scout currently pursuing a computer science and engineering degree from the University of Iowa.