Skip to content

This project consists of a Rust program and Arduino sketch that helps scan 35mm film negatives using a DSLR camera and a motorized negative feeder

Notifications You must be signed in to change notification settings

FruitieX/negative_scanner

Repository files navigation

negative_scanner

image

This project consists of a Rust program and Arduino sketch that helps scan 35mm film negatives using a DSLR camera and a motorized negative feeder.

Parts list

You will need some basic electronics workshop tools and items. This includes breadboards, jumper wires, resistors, LEDs (optional)

Motorized

Automatic

Setup (Arduino)

Start by wiring up the following schematic:

negative_scanner_bb

Next flash your Arduino with the provided sketch. You can test that everything works by opening up the serial monitor, setting baud rate to 115200 and writing commands like:

  • 100M: should move motor 100 steps clockwise
  • -100M: should move motor 100 steps counter-clockwise
  • F: should act as a "half press" for the camera shutter
  • S: should act as a "full press" for the camera shutter
  • f: cancels half press
  • 400s: sets max speed to 400 (default 4000)

Setup (Rust)

Make sure you're running Rust v1.60 or above. Get started by using rustup

You also need to setup opencv-rust, instructions here: https://github.com/twistedfall/opencv-rust#getting-opencv OpenCV setup on Windows is a bit complicated, more detailed instructions here: twistedfall/opencv-rust#118 (comment)

After that, you can use cargo run --release to run the program.

The program will attempt to use the first serial port and video capture device that is available.

After launching, the program is in manual mode. You should now be able to move the film with a and e keys, and take photos with the s key. (sorry, I'm a Dvorak user :-) Pressing n will advance the film to the next frame. (based on a constant number of steps between frames that you may need to calibrate to match your setup & film)

By pressing spacebar, you enter automatic mode. Pressing spacebar again re-enters manual mode. In automatic mode, the program:

  • Slowly steps the film forward, allowing you to feed in the next strip. Meanwhile, attempts to find areas of the video feed with bright vertical lines. These are hopefully areas between different frames in the film, or areas where there is no film yet/anymore.
  • If these areas are found past a certain "detection point", the distance from the edge of the screen to this area is converted to number of steps the motor should move, and the move is performed rapidly.
  • If no more areas are found, take a photo
  • Wait until the camera has finished taking the photo (currently based on counting the number of #000000 pixels, which may not work for all cameras)
  • Repeat from step one

There's a number of constants you will most likely need to change at the top of the src/main.rs file, with explanations above each one of them. If you've never worked with Rust before and you need to dive deeper into the code, I recommend installing rust-analyzer for autocompletions in your IDE (available for other editors, too).

Re-run with cargo run --release after making changes.

About

This project consists of a Rust program and Arduino sketch that helps scan 35mm film negatives using a DSLR camera and a motorized negative feeder

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published