RobinoScan RT 16/35 Scanner

OpenCV has debayering built in and is likely as fast as you will find. It’s worth figuring out where your slowdown is though. I would be surprised if it’s in the debayer itself, and not in something else like I/O, especially if it’s high resolution. The actual act of debayering is not especially intensive, so it should be fast. If you can, build timers into your code at the beginning and before/after each individual operation. Then you can display the duration for each task and see where things are getting bogged down.

This would also be doable in OpenCV. One method is to create some template B/W images of just the perforations for each type of film you’re scanning, then have OpenCV use its pattern matching tools to locate the perfs in your image. Then you can determine where that perf is in the frame and simply move the whole image on the X,Y axes to align it to a predefined position. It should be very fast. We did some tests on 14k images a while back and the time it took to do the pattern match was measured in microseconds. One thing with OpenCV - you generally want to work on a copy of your full color image, that’s monochrome, so that processing is faster. then apply whatever transform you want to the full color image before outputting.

OpenCV has really good python integration, and most of the documentation and example videos you’ll find will include both C++ and Python code.

3 Likes

That’s great to know - I’m really new to Python and OpenCV and I can’t find much examples out there. OpenCV doesn’t read raw files natively, have to use Numpy or something. I got a snippet of code that read and saves an image but the image comes out all garbled. Will continue hammering at it. As far as IO i have a 24TB Pegasus 3 raid - it’s pretty fast.

When testing other solutions, I tried debayering with FFMPEG which was working but it was SUPER slow even on my MacPro NVME SSD, I think openCV will solve that.

Nice photos! I see you’ve mounted a fan - someone else with one of those cameras I think is attaching an actual heatsink to it - so if you have any noise issues don’t be afraid to experiment with more cooling. You should be able to get captures that are completely free from digital noise with that camera.

The video you posted looks pretty good.

@robinojones What lens are you using in the setup? And what RGB chip is that?
It looks just like the 100W version of a 10W RGB LED module I found somewhere,
something like this? Epileds chips led 100 W RGB led module

I don’t use python much for OpenCV, but the way OpenCV works in general is that images aren’t really images, they’re a kind of array (a MAT in OpenCV speak). You would need to get the image into a Mat, and then you can manipulate the pixel data directly. This makes things like debayering very fast. And you’re correct that for raw images, numpy is needed along with a few extra lines of code… https://newbedev.com/opencv-python-display-raw-image – this would probably need to be modified to avoid hitting the disk, if you can, which will speed things up. If you can get the data from the camera’s frame buffer somehow, you would pass that to numpy instead of sending it to the disk to read a file. Should speed things up a lot.

You can quickly copy mats to make duplicate images (so you’d read in your main image, then maybe copy that to a new mat that’s B/W to make it even faster for things like perf detection, then take the information you learned from that perf detection pass and apply it to main image. It takes a little practice to get the idea, but it’s incredibly powerful.

numpy is separate from OpenCV, but it allows you to do all kinds of math on the open cv mats, so it’s good to know if you’re going to work in python in general.

I had a heatsink on it with 2 fans mounted but removed it as it was not really improving things and it was vibrating camera, I found the external fan, pointing at camera keeps it at a constant 34c. The camera is mounted on an aluminum plate which is secured to the temp 3d printed Y stage dovetail.

Temporarily using Tokina 100mm 2.8 set to f5.6, final version will be using one of my printing Nikkor 105mm but might research something else so the camera doesn’t have to be so far from gate.

Exactly that

Robin, have you posted your files for the lighting sphere and other bits and bobs that are part of your lighting unit? I’d like to try to re-create it and compare it to what i’m using.

I was planning on making a dedicated post for my light solution with schematics, parts, 3D Model and Arduino Code - so if anyone would like to participate in improving it would be great.

I should have everything posted this week.

In the meantime you can download the prototype model in .STEP below:

ROBINOSCAN RT_BACKLIGHT v1.step.zip (46.8 KB)

Edit: wanted to add, I printed it at 15% infill and coated the inside with Golden flat titanium white mixed with 10% barium sulfate powder.

I’m really interested in the RGB cob, and the potential for a driver made for it with the ability to strobe from a trigger input

@Andyw and anyone else interested - I just made a dedicated thread for the light system here:

Mini update.

I was out of a camera for the last 3 weeks, had to do a RMA for an issue I was seeing - it’s not there anymore.

Designed a PCB to clear up the mess of hand-made boards and cables.

I went from this…

…to this!

Here it is fully assembled.

I added header pins around both microcontrollers so I can continue developing, and change things if needed - it’s very much an in-progress development board but I learned a lot doing this. The next version will be a lot cleaner and include the light system on the board. Drive and Camera are both powered with a single 24V PSU. Light is on its own PSU.

Next steps is refining the speed regulation code, it works well as is but I know it can be better. Then it’s calibrating the sensor and hopefully if everything clears out I will order the final frame and put the machine to good use.

3 Likes

This is so cool! Just found this place, and am deeply inspired by what you are doing. I have a 35mm cartoon that I want to scan so badly. How did you get into building this? Does it do sound too?

Welcome to the community - the film is “over-scanned” so the optical soundtrack image is captured with every frame. Audio can then be extracted with a software called AEOlight.

Here’s the link: AEO-Light

Started with optical printer conversions and now aiming for real-time with this machine. The community has been extremely helpful and supportive. There are people here that are truly remarkable at what they do.

It’s been a long time without any updates. Very happy to report that a working version 1 is now completed! I can scan 16/35 at 12fps / approx. 4.8~5K resolution for the moment. Aiming for real time in very near future.

Here’s a quick update video showing the machine.

I said it before but I’ll say it again. Making scanners is hard. I had to face insane issues like ESD (electro static discharges) and many other insanities but a lot was learned.

I hired someone to help me with the code, It really helped me keep sane even though it’s been a lot of $$$. The UI is super basic at the moment but has all the things I needed to operate the machine. Feet & Frame count, format change (16mm, 35mm 4p, 3p, 2p), RGB brightness values and everything is saved in EEPROM so you don’t lose anything when rebooting. The next firmware will add a paginated menu system.

The light has been improved a lot. I now use 4x 50W RGB chips in one housing. Perfect for the densest negatives.

I’m now at my 3rd PCB revision and about to send a 4th one for manufacturing. The upcoming version will host one teensy only. The entire system is now running on a single Teensy 4.1

Added a Capstan, I really tried everything to avoid using one but in the end, I fought the capstan and the capstan won.

Taking a much needed break from software and electronics for about a month - I will be working on mechanical stuff, designing the final frame, adding custom 2000’ reels and getting metal gates machined. Once I’m done with these items I’ll be back to working on the next firmware version.

I will also calibrate the sensor and continue researching the color science during this time. One good thing is that I have “Scanity” scans of many of my films so I will be able to compare. So far it’s looking really good. I’ll upload scans soon.

So now I can go back to shooting some film and using the machine, see what I need to improve as I use it.

Another big and future task will be the capture software with real time stabilization. Once the Kinograph is up and running we will all join forces and make this happen. In the meantime, software stabilization it is, I’m using Davinci Resolve and it’s… slow. (4fps @ 4K)

Thanks a million to @matthewepler for listening, helping me debug some of the most crazy stuff and bouncing ideas back and forth.

8 Likes

This is fantastic!! Congratulations!

Resolve stabilization likes lots of memory and very fast graphics cards, especially at 4k.

Thanks very much !

Yes it’s really disheartening that I get 3-4 fps when stabilizing using a new Mac Pro 16Core Xeon, 96GB ram and 2x AMD GPUs (Pro Vega II 32GB and Pro W5700X 16GB).

It could be that AMD GPUs are not optimized as good as Nvidia in Resolve…

EDIT: I might have to build a PC and add a good Nvidia card (if they can be found) to prepare for the capture software with OpenCV.

I’m running a similar (although much older) workstation PC but with dual CPU and a new Nvidia A4000. The couple of times I tested with 4k it was around 7fps if I remember correctly.

I got my GPU from shopblt.com
I found them after A LOT of googling and had reasonable prices (MSRP?) even in the middle of the GPU craziness.

Great progress @robinojones, excellent work.

I’m curious what is the total light (lumens) you are getting out of the 4xRGB LEDs. Typically Green has a higher light output than Red/Blue, so probably you have to back the green channel to balance it all.

For example, these in Amazon have 1000 lm for Green. 4000 lm is a lot of light!

Thanks @PM490

It must be a lot of lumens if you have them continuously turned on. I would not want to look directly at that light.

In my case the light is pulsed. The pulses are extremely short and so the light output is reduced considerably, hence the need of more light / going quad.

I never have my backlight turned on continuously.

1 Like