Jump to content

First attempt at machine vision capture


Matthew Modget

Recommended Posts

After a few attempts at capturing in real time using a camcorder, I've finally pushed the boat out and bought a machine vision camera. Here's the result, I'd love to know what people think:

 

 

Sadly the focus is off in a few places thanks to the UWL III lens on my Beaulieu. One thing I can't quite decide on is how much neat video noise reduction I ought to be using; it's great for getting rid of the digital noise of the capture but I actually quite like film grain. The other consideration of course is that grainy footage gets mangled by the streaming compression...

 

Here's what I used:

 

Canon 310XL - bride prep, b&w, night

Canon 814 Auto - ceremony

Beaulieu 4008ZM2 - everything else

 

Vision3 200T - everthing indoors + confetti slo-mo

Vision3 50D - outdoors

Argenti APX100 - b&w

Vision3 500T - evening/night

 

Pixelink PL-A782 2208x3000

Schneider Componon-S f4 80mm enlarger lens (facing forwards)

Many, many extension tubes

Fred's script for some dust removal in places

Link to comment
Share on other sites

I think it looks pretty great! I've actually done something similar (see thread here if you're curious), but my converted projector/film transport system just broke. I've got a bolex super 8 projector on the way, so I'll be working on my 2.0 version when that gets here. But I'd love to see some pictures of your projector/triggering setup.

Edited by Josh Gladstone
Link to comment
Share on other sites

Thanks Josh, I'm in Wales for Christmas but I'll post some pics when I'm back in York. It'll be more for comedy value though, it's considerably less pro looking than yours! I've got my camera sitting on a stack of books with my business cards being used as height adjustment shims, my Elmo projector has got one of the blades hacked out of it so the exposure isn't interrupted, the reed switch is gaffer taped onto a bracket to pick up the magnet as it travels past and my light source is a job lot of LEDs soldered onto a piece of bread board with a tin foil reflector!

 

It takes a bit of setting up but I'm happy with the results thus far, I just need to work on speed as one cartridge takes about 70mins which I have to sit through to watch for dust. Fun, fun, fun!

Link to comment
Share on other sites

  • Premium Member

I also look forward to any pics you post about the system you have built, I am hoping to build one myself. Did you use an ordinary projector and substituted a motor with specialised control to advance frames? Did you use a filter on the neg material?

 

The 50D stuff looks really good, I haven't used this stock yet and would love to.

 

BTW. Machine vision camera manufacturers and distributors must be starting to wonder why they are getting one off orders from individuals who obviously don't run production lines.

Link to comment
Share on other sites

Thanks Josh, I'm in Wales for Christmas but I'll post some pics when I'm back in York. It'll be more for comedy value though, it's considerably less pro looking than yours! I've got my camera sitting on a stack of books with my business cards being used as height adjustment shims, my Elmo projector has got one of the blades hacked out of it so the exposure isn't interrupted, the reed switch is gaffer taped onto a bracket to pick up the magnet as it travels past and my light source is a job lot of LEDs soldered onto a piece of bread board with a tin foil reflector!

 

It takes a bit of setting up but I'm happy with the results thus far, I just need to work on speed as one cartridge takes about 70mins which I have to sit through to watch for dust. Fun, fun, fun!

 

My setup was the same way when I was getting things sketched in. Stacks of books, pieces of cardboard and coins holding things up. And mine took three hours to scan 50 feet! Hopefully my 2.0 version will be faster! If you're interested, one thing that helped me is streaming the most recently captured frame to a localhost web server. That way I'm able to check up on the capture and watch for dust and hairs remotely without hovering.

Link to comment
Share on other sites

Thanks Anthony! I've actually backed off on Neat Video all the way to 10% but have been cranking the temporal filter radius higher as I prefer the way it gets rid of noise.

 

The projector is an Elmo GP-F. I've unscrewed the power socket to free up some screw holes onto which I've mounted a 300rpm geared DC motor. I then used this amazing stuff to make my own custom sized rubber belt:

 

http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=231118870679

 

As for filtering for negative, I bought a Lee filters sample pack for a couple of quid and kept trying different ones until I had equal channels on the histogram when displaying a typical scene. I'm finding that the colours are about 90% how I want them just from inverting, not that that stops me spending hours colour grading!

 

How exactly would I go about streaming a frame to a localhost web server?

Link to comment
Share on other sites

Jeremy, I think you're probably right about the machine vision camera orders. I was lucky to get mine on ebay for way less than they cost new, I guess there isn't really a second hand market for them outside super 8 folks and people who attach them to telescopes, any factory is always going to buy them brand new I would think.

Link to comment
Share on other sites

If you're on OSX, you just have to turn Apache on to host a local server (http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/). I'm betting it's just as easy on a pc. I'm not sure what software you're using to capture, but what I do is have my program save a lower resolution copy of each frame as a jpeg (lets call it capture.jpg) into the folder I'm serving. As it captures each new frame, it overwrites capture.jpg. Then I wrote a small HTML page that uses javascript to display and refresh capture.jpg every few seconds. I can load that page up on my phone, and watch my capture remotely!

Link to comment
Share on other sites

That sounds interesting Josh, I'll have to give it a try. If it means an end to spending the day in a darkened room, slowly turning into Gollum, then it's got to be worth it!

 

As it happens, I'm using my MackBook Pro to do the capture but haven't found any OSX software so am running Windows 7 on bootcamp. Do you know of anything on the Mac that will do the job?

Link to comment
Share on other sites

Hahaha, software on a mac? Yes and no. Here's the whole story, or you can skip down a paragraph it if you don't feel like reading.

 

So I, like you, am using a firewire machine vision camera, and no, there is no currently supported software on osx. At least when I looked. But these cameras utilize standards (called DCAM IIDC), so there was no reason the cameras shouldn't work with osx. And if you looked at some of the camera manufacturer's websites (point grey etc) they usually have a small blurb of text about how macos might be supported through third party software. And on top of that, there was some abandoned mac software called Astro IIDC that was meant to control firewire cameras for telescope photography. You can get a demo version, but the full version is completely abandoned by the developer and impossible to register or crack. But this demo version displayed my images off my camera, so I knew at the very least it was possible.

 

So, long story short, there are some software packages that allow firewire camera communication (pydc1394 and libdc1394), and there's some good python software to display and save images (OpenCV), but nobody had really written a program to do it. So, over a long and annoying period of trial and error, I ended up teaching myself enough Python to make it work! My software can change debayer patterns, capture 8 or 10 bit tiffs or jpegs, communicates with the Arduino I use to control the stepper motor (which I also learned how to use because of this project), toggles the aforementioned web viewer, turns the LEDs on and off, inverts the image, adjusts exposure, and lots of other features.

 

I'd be happy to share it with you or anyone who wants it, but it's pretty customized to my hardware setup. The camera capture code should work (in theory) with your camera, but it would take some effort to get rid of the motor control code and make it work with your trigger setup. But probably not impossible.

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...