top of page

Update on the upcoming OpenScan firmware release (IMX519 + other changes)

For almost two years, I have been working on the first version of the firmware for the OpenScan Mini + Classic. And so far, I have been able to release updates, that could be easily installed through the user interface.

But due to two major external factors, I decided to rewrite the whole code and create a 'new' firmware (with many of the old features + some exciting new functionality). It will be necessary to flash the micro SD-card with the new image, but this should be easily doable :)


Support for many more camera models

The first factor is, that the Raspberry Pi foundation dropped the used camera python library in favor of the libcamera framework. Generally speaking, this is a great step, as it will allow many more camera sensors to be supported. This coincided with the release of the new Arducam IMX519 camera, which I have been testing for a few weeks now. This camera needs the libcamera functionality too, and thus I have to move forward.


For now, this means that the following camera will be supported:

  • IMX219 (pi camera v2) with 8mp

  • IMX477 (pi camera HQ) with 12mp

  • OV5647 (pi camera 1.3) with 5mp

  • IMX378 with 11mp

  • OV9271 with 1mp and global shutter

  • IMX290 with 2mp and global shutter

Furthermore, using the libcamera framework will allow third parties (like Arducam) to add support for their cameras too. For now, the following Arducam cameras should work too:

  • IMX519 with 16mp and autofocus (definitely working, see below :)

  • AR0234 with 2.3mp and global shutter

  • IMX230 with 21mp (!!!)

  • IMX298 with 16mp and autofocus (and microphone)

  • IMX462 with 2mp (and low-light functionality)

  • OV9281 with 1mp, monochrom

  • OV2311 with 2mp global shutter

So can you see, that the overall usability is widely improved. The only shortcoming of the new libcamera framework is, that the preview is very slow at a framerate of below 1fps (which should be improved as soon as the Raspberry Pi Foundation releases their new python camera library, which is expected somewhat soonish)


Autofocus + Focus Stacking

With the adjustable focus of the Arducam IMX519 it will be possible to create stacks of photos. The position of the camera remains the same and only the focal plane is shifted. In theory, this should improve the photogrammetry output for models, where depth of field is an issue and some areas are blurry in one photo. Those areas will be crisp in the next photo, and the photogrammetry software -should- be able to only use the crisp areas for reconstruction. But there is a lot of testing needed ;)


For the coming update, I implemented three different modes (autofocus, MF - manual focus and ST - stacking) for the adjustable-focus IMX519 sensor:

- autofocus (default), where you do not need to worry about setting the focus. The focus will be calculated in every position and the algorithm seems really robust. I only had some issues, when the object only covered a small part of the photo and the camera tried to focus the background instead.

- for this reason, there is the Manual Focus mode, where you can set the focus distance manually. This value will be kept for all photos during the routine.

- And finally, Stacking, where you can set a lower and upper limit for the focus distance and a number of x photos. During the routine, the camera will stop in each position and take x instead of 1 photos with varying focus (in the given range). Note, that the overall size of the image sets will be increased accordingly by a factor of x.


Re-adding DSLR support (with gphoto2)

This feature has already been tested a long time ago, but I did not get around to fully implement it into the firmware. So it rested in developer mode for ages... I will try my best to implement this functionality too, so that many, many DSLR cameras can be used with the official main firmware.


Improvements in stability + usability

This is seems like a tiny step, but this is a thing, that gives me at least some satisfaction ^^: The user interface + backend are now accessible directly via openscan and openscan/editor respectively. (and not through openscan:1880/ui as before)



A much more important improvement is the introduction of 'advanced settings' - mode, where you can access many more settings. This should make it much easier to modify and create your own hardware version:


Cleaning the Code + Backend

For a long time, I have just kept adding and adding new features and code-snippets. And over the time, the backend (node-red) and the underlying file-structure became a huge mess. I decided to re-organize and re-write a lot of code and clean up the overall file- and code-structure. I hope, that this will help future contributions!

There will be a dedicated update + documentation on how to use and modify the existing code at some point.


Conclusion

I started this blog post with the words 'short update', but had to realize, that there have been quite a few changes already and there is even more to talk about in future posts. Please let me know if you wish any particular functionality or usability improvement!


If you made it that far in the text, feel free to support my work through a coffee or two ;)

2,057 views14 comments

Recent Posts

See All

Is OpenScan an Open Source project?

The short answer is absolutely yes, the longer answer gets a bit more nuanced and we will have to dig into some details. So if you are concerned or just interested, stick around and feel free to share

14 Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

Hi Thomas. I have just taken delivery of the new 16mp ArduCam. I am woundering how you are mounting it to the Openscan mini are you just drilling out the led board. Thanks Matt

Like
Replying to

Thanks for the reply. I hadn't thought of the filter. So great advise cheers.

Like

Hi Thomas,

Any luck with the Pi3 image? Appreciate you are probably really busy. Sorry to be a pain.

Like
Replying to

That's fantastic, thank you!

I understand the potential problems, thank you for warning me about them. I don't know what you should do about releasing future versions, I know nothing about software development, I make jewellery!

Like

Got my Arducam today too, for some reason I thought you'd already added support. My mistake! Looking forward to testing it, I've got some projects waiting, so really hope it's soon. I see the Raspian image below, will I have to get a Pi4 for my OpenScan Mini? Or will it work on the Pi 3?

Like
Replying to

You, my good sir, are quickly becoming my favourite person in the world!

Like

I really want DSLR support for the main firmware release! that would be great!

Like
Thomas_OpenScan
Thomas_OpenScan
Feb 09, 2022
Replying to

You can download and test the beta image below. Dslr support should work just fine :) (but note that it is still in beta)

Like

Nice... I have an arducam ready to test 😎

Like
Thomas_OpenScan
Thomas_OpenScan
Feb 07, 2022
Replying to

Lucky you :) i am still waiting for my batch… Feel free to download the raspbian image here: https://drive.google.com/file/d/1x87Hif_Y6ee1Li3cWa05_GQBp0o41qWm/view?usp=drivesdk (Currently only works on pi 4 2gb and has some bugs, but i am working on it :)

Like
bottom of page