Jump to content

DIY Film Scanner (With Samples)


Josh Gladstone

Recommended Posts

These are the c# source files I made for my telecine project.

Please note I am a complete c# novice so don't except clean code.. But it works !

Suggestions to improve my skills are welcome...

 

It was written in Visual studio community 2015, and you problably need to install the Microsoft.Tpl.Dataflow.4.5.14 package.

TelecineV1_PFI.zip

Edited by Pol Fieldman
Link to comment
Share on other sites

Yes, basic current driven LEDs would suffice in this situation as you only need to get a rough match to the pass band of the bayer filters.

It only needs to be a fixed source. Colour balancing is best done in post where you can more easily fine tune, on a shot by shot basis, whatever is required

 

And it's a good insight with respect to PWM and short exposure time.

As you suggest, at 10 pulses per exposure, it means there would be a 10% variability in the illumination due to a 10% variability in the phase between exposure and pulses.

One might alleviate this a little by increasing the exposure time (but by how much?) or otherwise triggering the camera on the same phase as the LED pulses.

But direct current drive otherwise solves it.

 

There is a technique called HDR scanning where one exposes for shadows in one scan, and highlights in a second scan of the same frame, merging the two in post.

Basically scanning each film frame twice, using different exposure times (or different light level, or different f/stop).

With a 12 bit camera you'd get instead a 24 bits (per colour component) result.

The results obtainable by this method are really quite extraordinary.

 

Processing the frames isn't a direct merge as one needs to exclude the contribution of clipped pixels in each scan.

Or do so more smoothly by decreasing the contributing strength of pixels as a function of their proximity to the clipping point.

HDR scanning allows film originated material to really punch in terms of colour.

 

Great work Pol.

 

C

Link to comment
Share on other sites

  • Premium Member

There have been problems shown with variations in LED brightness due to temperature changes. I have seen some designs which used temperature sensors to offset this. In a design using, in effect, auto-exposure, though, I suspect the issue would be masked.

 

P

Link to comment
Share on other sites

@Josh : My father bought the Sankyo projector back in the 70s. It worked fine without problems.

In its stripped form it also works fine : reliable film transfer & windup, good access to film gate & easy to clean.

You should really continue your work, it's very satisfying once you get to see results.

 

@Phil

Correct,

LEDs have a significant negative temperature coefficient. Even worse, the red led temperature coefficient is significantly higher than the blue and green led.

e.g. : from a datasheet of a typical low power rgb led.

post-69665-0-14387500-1455913387_thumb.jpg

 

Since the total led power dissipation in my leds is low, and they are mounted on an aluminium baseplate, the effect is minimal.

Some measurements :

t=0 -> r=g=b=100% brightness ( rgb switched on after being off for long time)

t=5 min -> r=97% , g=b=99%

t=15 min ->r=97% , g=b=99%

So the effects are very small, certainly if you wait a few minutes after switching the leds on.

 

Pol

 

 

Link to comment
Share on other sites

Pol, my hat is off to you. This is real quality work.

 

I got sidetracked last year by my project. I'm inspired to (find the time to) get back to work on mine, and take it to the next level! For a coding "novice" I don't think you're giving yourself nearly enough credit. Thanks so much for sharing all your work!

Link to comment
Share on other sites

@Pol, great piece on your development.

 

I see you use a stepper motor... would you be able to say what type it is and how you drove it? I can see the reed switch etc.

 

I've also been working with the same projector - very easy to crack open. I have three, one I stripped down completely, one I've partially stripped and a 2000 to show film with.

 

2016 is the year to get back into the build... I've tried a different approach that some may find useful. I removed the interlace shutter, used used a different approach, letting the original motor run as slow as I could. Then used a front-mounted lens (like a magnifying glass) and project the image onto that (i.e. using the projector lens as it was designed).

 

If you do that, you get an inverted image that's big enough to capture with a normal camera. Now, if you use your camera in HD video mode, you can capture the film as it runs.

 

The trick is that without the interlace, the video captures the stationary image and the image in transit.... and you can detect the transition between the two by post-processing the video stream.

 

I describe it here.... http://forum.doom9.org/showthread.php?t=168830 and show an example.

 

My next stage is to probably capture it off the gate directly, using a stepper motor to drive the mechanism rather than the original motor..

Link to comment
Share on other sites

Hi Ian,

Sounds like a simple approach that allows you to get near realtime transfers and good quality results.

When I was weighing my options, I came across this idea (problably your post at doom9...).

I didn’t look into it further, because I didn’t understand how the image projection worked. ( I should of asked you back then, it could of made things easier for me...)

Do you have two lenses in the system ( one magnifier, and the camera’s lens) or do you remove the camera’s lens ?

 

In my setup I use a stepper motor because I had one lying around, and wanted to run the projector slower than it was capable of.

 

A brushed DC motor with suitable reduction would also of have been good (and easier to drive electronically)

Because the projector is the master of the system, it can run at any speed it wants. Each time the frame is stable the reed relay sends a signal to the PC to capture an image. The only constraint is that the PC should be able to capture and store the image before a new trigger is received.

 

I use a Sanyo Denki 2-phase stepper motor (103H546-0440), that is driven by a JRC NJM3772 stepper motor driver. This is actually a microstepping driver, but I use it with a fixed voltage on the VR pins.

 

The electronics work like this:

· A sawtooth generator (two opamps) produces a variabele frequency. (using the original projector speed potentiometer). The generator has a softstart function to avoid loosing stepper sync.

· This signal is fed in a 4040 binary counter.

· Using XOR ports two outputs of this 4040 are combined to form two 90° shifted square waves.

· These square waves are fed to the phase inputs of the stepper motor driver IC.

 

 

Using an off the shelf stepper or DC motor driver would make things a lot easier I guess … but not as fun...

 

Have a lot of fun with your project and let us known how it is going.

 

Pol

 

 

Link to comment
Share on other sites

Hi there, I actually combined two different approaches. I struggled getting a good resolution using any sort of Macro lens directly off the gate. I tried (like others) to use USB microscopes but couldn't get them close enough to be useful.

 

So, I went back to basics, used the projector lens to project onto a magnifying glass. then put the camera behind that. With the lens I had it meant I needed lots of space to spread out.

 

Now, it's worth reviewing what the rotor and the gate do on a projector. They do 2 things, they removes flicker by increasing the "flashing" rate of the image and it hides when the film is pulled through the gate. The movement happens behind one of the "fins" of the rotor. Otherwise you'd see a blur.

 

So, removing the rotor from the gate exposes the blur. If we video that image (either using the magnifying glass or directly off the gate) and we film at 2-3 times the gate rate, we can use that blur to indicate when the cine frame is moving, and if there's no difference between video frames, then we're seeing the stationary part of the rotation.

Link to comment
Share on other sites

Hi Ian,

I understand and like the concept where you remove the rotor/gate, video the frames including some blurred fields, and filter out the usefull frames with software.

The thing I was worried about a couple of months ago was the effect on the image quality of having two lenses in the optical path (the projector lens and the camera lens).

But I didn't try so the effect could be neglectable of course.

This does not effect the beauty of the above concept, it works just as well with one or two lenses in the optical path.

Pol

Link to comment
Share on other sites

  • 9 months later...

Hi Everyone,

Thank you all for sharing your projects and knowledge. After browsing the internet for a few hours and considering a few different possibilities, I decided I want to build my own 16mm telecine machine based on the examples I've seen in this discussion. I've also decided I want to go for the frame by frame solution, as I don't mind the machine being slow as long as it's automated, and I think this should give the best results.

Now here's my, rather elaborate, question.

I'm a total beginner. In engineering as well as scripting (ok, I know some HTML, PHP and CSS that I've used for websites but yeah, very limited). So I was wondering if you guys could send me in the right direction as far as learning enough about a few things to set a sort of base level of knowledge before I start buying all sorts of material and tools I may or may not need.

What I understand is, I need:

A functioning projector
A stepper motor
Something to control the stepper motor

A replacement for the projector lamp (a cold light source?)

A camera (preferably some model that has a durable shutter..?)
Something to control the camera (is this where the arduino comes in..?)
A computer/laptop with software/script for capturing the images

So anyway, tinkering with the projector will be different for each model I guess, so it might not be interesting to go deep into that at this point - but in general, replacing a motor, light bulb..where would I start?

And as far as the scripting goes, I've seen you guys mention several different languages, programming options, what would you say is the best choice for a total beginner and where do you recommend I start?

Any help would be greatly appreciated. I might not be able to share a lot with you guys in return in the beginning, but I reckon if I document my process well, it could be very useful as a sort of start from scratch guide for just about anyone.

Baltasar

Link to comment
Share on other sites

Hi Baltasar,

A year ago I set out on a similar quest. It took me about 400 hours before I could start transferring movies. If you are not familiar with electronics, mechanics and programming you should be prepared for an even longer journey.

 

I’ll try to answer (part) of your questions from my own experiences (for what it is worth …)

 

1. for me the core decision is which camera to use, and how to get the images to the PC.

Depending on that choice you will need different skills to complete the project.

Important properties like resolution, image dynamic range, gain control , white balance and who is the master ( who decides when a picture is taken : the camera or the projector ) are fixed with these choices.

The simplest solution I’ve seen so far is to use a standard video camera to capture at near full speed and use software to drop duplicate frames. This way you do not need to replace the motor, capturing is trivial and post processing can (probably) be done with off-the-shelf software.

Or you can use an Arduino board: use the camera, drive motor and store images.

You should read about different possible solutions and decide what is important for you.

After reading a lot and experimenting with webcams, my personal conclusion was that dynamic range of the image capture (number of bits available at the camera) was very important to get the most out of the movies I have.

So I chose a 12bit machine vision camera. As a consequence I had to write my own capture software. This gave me full control of the camera at the expense of a lot of code writing.

 

2. Motor drive: some solutions can keep the existing drive system running near full speed, others use DC or stepper motors to do slow frame movement. I used a stepper motor (and made my own drive hardware) because I had a stepper motor lying around. If you use a DC motor, the speed control is not as precise but driving a DC motor is much easier.

 

3. Lighting system: Unless you run at normal speed and have a good IR filter, the lighting system should be replaced by a cooler light source. This can be rather tricky as three things should match to get best results: spectrum of light source, spectral sensitivity of film grain and camera. Classic options: separate rgb leds or white led.

 

4. Mechanical setup: removing unnecessary projector components, and very important: a stable and precise mounting of camera & lens. Fine positioning and precise alignment (parallel to film) is critical to get the best out of the camera.

 

5. Post-processing of the images, turn them into a movie. This is one of the easier steps , as good free software is available to do this (Eg. Avisynth.)

 

And of course you should be prepared to encounter all sorts of problems, e.g. some of the problems I had:

- Even with a near perfect light source I got very uneven lighting on multiple webcams. Never really understood the problem, it went away when I used the machine vision camera.

- Reduced sharpness near edges, caused by imperfect alignment and too shallow depth of field of lens.

- Green led that emitted too much blue light. Had to select another green led.

- Problems with mechanical transfer of movie through projector ( image jumped to much between frames)

- (my own capture software) : Writing images to disk sometimes took too long, solved by saving images asynchronously .

- Very large quality differences in recorded movies. Sometimes extreme under exposed film, requiring a much longer shutter time.

- Finding a good algorithm to regulate camera exposure. In my case the light output of the leds is constant, and I changed the shutter time. You can also regulate the light output and keep shutter time constant, or go for manual adjustment of the shutter or light level.

 

My advice would be to keep reading and experimenting with simple things (like a webcam) to get a bit more feeling of what is needed.

I wish you a lot of fun with this project,

Pol

Link to comment
Share on other sites

Hi Pol!

Thank you so much for this very comprehensive answer!

I will definitely take your advice to heart and start reading a lot about the different things required, starting with machine vision camera's. The simpler solution you mentioned with near full speed recording sounds ok, but like yourself, I really need to get the most out of the image.

I'll check back in (might be a while) when I'm making progress...!

Cheers,
Baltasar

Link to comment
Share on other sites

  • 4 weeks later...

I had more or less dismantled my scanner a while back (it had been fairly unreliable and I needed the parts for something else) and I've been (slowly) repairing and reworking the whole setup. Including rewriting a some code to work with newer versions of pydc1394 and opencv. I also upgraded the vision camera to a Allied Vision Guppy GF-503c, so I'll be able scan over 2k now. I also got an ISG LW-5-S-1394, which is another 2.5k camera, but I'm unable to get images off of it. So maybe I'll look at that as well (although the Guppy has a slower frame rate, but works fine, so maybe I won't. We'll see). Hopefully I'll be able to make the scanner more reliable with this rewrite. I'll post some stuff when/if I get everything working.

Link to comment
Share on other sites

  • 1 month later...

Hi everyone,

I'm really impressed with all your achievements!

I'm in the process of stripping a Eumig Super 8 from its current AC motor to be able to add a DC stepper motor. I will probably go with Arduino och Raspberry for main logic. My goal was to get more control over the FPS (speed) to be able to get flicker free telecine. But are now looking into frame.by-frame scanning.

 

The hard part for me is the optical (camera and lenses). I have a DSLR (Nikon D5100), a camcorder (Sony HDR-C130) and GoPro (Hero4), Pretty basic consumer stuff I guess. My thoughts are that the GoPro should be a good device for this. Streaming (HDMI) to the software (not decided which) on a computer for grabbing.

 

What are your opinion about using the GoPro? What lenses are there available to shoot the gate?

 

Any input is very much appreciated.

 

Lars

Link to comment
Share on other sites

If you want to use a gopro you have to remove original lens first, and fit a very high resolution macro lens. To open a hero 3-4 cameras is not so difficult, you can find many samples on the net. Other thing is to open a session camera, since it is all glued and sealed one. the only way to remove original lens on a session is to mill the contour in front of the lens first to enlarge the front panel and free the objective then remove with a needle the glue around the lens. Finally, with a specific tool that clamp around the outer objective diameter, unscrew gently the lens. I have just done it, and now i am building a C mount adapter that fits in this camera. As soon as i will upload some stills from S8 and 16 frames

post-39610-0-27658400-1487775376_thumb.jpg

post-39610-0-33706600-1487775401_thumb.jpg

Link to comment
Share on other sites

  • 2 weeks later...

Here the Super 8 SMPTE frame taken with 4K session 5. Well, to me quality is not so good, it suffers from the crazy ( exaggerated) H264 compression, not suitable for telecine/datacine purpose. The lens used comes from a microfilm scanner and it is an ultra-high resolving power lens

post-39610-0-10363100-1488663510_thumb.jpg

post-39610-0-89642400-1488663539_thumb.jpg

Link to comment
Share on other sites

  • 1 year later...

Wondering how everyone who participated in this thread is doing with their projects? I am just getting started and have learned a lot from this thread. I have several projectors I can use to make this, settled on Arduino UNO or MEGA 2560 for the controller, just working on the optical portion of it now. I have a nice Sony HVR-Z7U with removable lens, that streams either HDMI or thru firewire, I have firewire currently working into VirtualDub and the image looks good. I really need to find the right lens and tubes etc to mount on the Sony, or find a machine vision camera which would be WAY easier to use. The Sony is a beast. Projectors include Sekonic 8 model 30C, Sankyo 1000 Dualux and my Dad's Bolex 18-5 which I really don't want to modify. All of my film is regular 8mm.

 

Look forward to hearing from you.

 

Cheers

Link to comment
Share on other sites

It's funny you should ask. I actually never completed mine. But in the last year I moved, and recently unearthed my half-baked projector. In the last few months I've gotten much better at writing python on raspberry pi, and so I've re-added this project to my list.

 

I had purchased a USB macro camera that has a GUI but can be controlled by OpenCV, so I'm hoping I can tap into that on Raspbian. Eager to hear how others have fared.

Link to comment
Share on other sites

Well all this cold weather has given me time to work inside on this project. Today I installed a DC motor installed in place of the AC motor. It's a Faulhaber DC coreless motor made in Germany, with a small diameter shaft which I had to machine a sleeve for so that the 1/4" pulley would fit. It will work down to 2 volts and still has enough torque to turn everything, draws 200mA. At that voltage it turns the projector at about 2 fps. I mounted it on a plexiglas panel I fabricated and mounted it to the original motor/fan housing.

 

My biggest challenge is the optics. I have just found a CMOS sensor machine vision camera, with C lens mount, here are the specs. I think it will work, but would appreciate any input from those wiser than me. It's the Mightex MLE-C030 and is an 8 bit color, 3MP USB 2.0 camera with 2048x1536 pixel, 8fps at that resolution, rolling shutter.

 

https://secure.mightexsystems.com/pdfs/Unbuffered%20USB2.0%20Color%203MP%20CMOS%20Cameras.pdf

 

Cheers

post-76079-0-15317600-1548111828_thumb.jpg

  • Upvote 1
Link to comment
Share on other sites

Why go through all that trouble and then use an 8bit camera? I'd look at something like this instead: $700 and it's a 10 or 12 bit 5.5k camera using a pretty nice Sony sensor: https://www.ptgrey.com/blackfly-s-color-200-mp-usb3-vision-sony-imx183 you can get a 2k version for about $500, but honestly, I'd go for the full 5.5k if you're using the color bayer version, and then downsample to 2k. You'll basically get true RGB color sampling that way, negating the (arguably inconsequential) effects of the bayer filter. If your design uses the intermittent motion of the projector, the rolling shutter shouldn't matter.

 

What are you doing for a light source? You'll want to run something cooler than a traditional bulb, at those slow frame rates, or you'll burn up the film.

  • Upvote 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...