www.photomacrography.net :: View topic - Camera independent pixel-shift possible?
www.photomacrography.net Forum Index
An online community dedicated to the practices of photomacrography, close-up and macro photography, and photomicrography.
Photomacrography Front Page Amateurmicrography Front Page
Old Forums/Galleries
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Camera independent pixel-shift possible?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    www.photomacrography.net Forum Index -> Macro and Micro Technique and Technical Discussions
View previous topic :: View next topic  
Author Message
JohnyM



Joined: 24 Dec 2013
Posts: 451

PostPosted: Tue Nov 06, 2018 6:17 am    Post subject: Camera independent pixel-shift possible? Reply with quote

Hello!
Right now, im in the process of building my ultimate (I hope!) horizontal rig. Should wrap up initial phase in about a month, so i can move on to dia-illumination part.

It have the option to stack and stich by camera movement with 1um resolution, expandable to 0,25um if needed (currently only Z axis for NA of 0.5 and higher). Can move just the camera with lens fixed or whole camera-optics block, with subject and light remaining stationary.

XY axes will have 30mm travel, which is good for ~1x 2x2 panoramas and higher magnifications (APS-C), but it just occured to me, that with 1um axis resolution i could make 4x4 samples per pixel for ~4um Sony A6300 sensor for under 1x magnifications (rig is made for up to 700mm working distance with DIA-illumination block removed).

Is there any software that could manage those files for super-resolution technique like found in some m4/3 bodies?

Best thing i can think of is batch split each image into RGB channels, stack them and then merge back in PS. I would expect this process to increase color acutance (like in A7RIII or Pentax K) but not necesary resolution?

Other thing, is stack the images with average weight, which should result in better detail and resolution, but would be a nightmare to process. (camera raw -> ImageJ -> Zerene -> Photoshop)

If there is, i'll have to learn arduino for controlling stepper motors, which i try to grasp for years but still fail to do so Confused
Back to top
View user's profile Send private message
mawyatt



Joined: 22 Aug 2013
Posts: 1802
Location: Clearwater

PostPosted: Tue Nov 06, 2018 9:10 am    Post subject: Reply with quote

John,

I haven't done any programming in over 40 years, so this is all new to me also!!

If you decide to do this stepper motor control look into the Raspberry Pi as the commanding computer, these are amazingly complete little computers with lots of useful features and cost only $35 for the 3B or 3B+ versions. The 3B+ has four 64 bit Arm cores at 1.4GHz, 4 USB ports, HDMI and WiFi & Bluetooth. They us a micro SD card to load the OS and programs. Sure it's way overkill, but for $35 hard to argue!!

For the stepper controllers the TI devices (DRV8825 for example) evidently have some highly non-linear behavior when micro-stepping, I'm using a MPS6500 for this reason. I had already purchased 5 of the TI boards before I found this out Confused The MPS6500 also has a PWM mode which returns some of the motor inductive coil current to the supply rather than dumping it all to ground and thus wasting power. The actual supply current is much smaller than the actual motor current set limit.

Putting together a Precision S&S system based upon 2 THK KR15s to move the subject (X & Y axis), and a THK KR20 or KR26 to move the camera/lens (Z axis) when a vertical setup is used. The same setup with a precision Thor Labs proper optical 95mm mounting system, or a modified WeMacro Vertical Stand that can be used vertically or horizontally in either case.

Everything is playing nicely together and just putting some parameter storage/recall capability in the code (Python) now.

Good luck with your setup and keep us posted,

Best,
_________________
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike
Back to top
View user's profile Send private message
rjlittlefield
Site Admin


Joined: 01 Aug 2006
Posts: 19549
Location: Richland, Washington State, USA

PostPosted: Tue Nov 06, 2018 10:39 am    Post subject: Reply with quote

mawyatt wrote:
For the stepper controllers the TI devices (DRV8825 for example) evidently have some highly non-linear behavior when micro-stepping, I'm using a MPS6500 for this reason.

I expect the linearity varies depending on which motor you use it with.

In any case, if the nonlinearity is repeatable then you might consider calibrating it out, with a lookup table to translate between the physical position you want and the nominal microstep needed to get there.

--Rik
Back to top
View user's profile Send private message Visit poster's website
ray_parkhurst



Joined: 20 Nov 2010
Posts: 1896
Location: Santa Clara, CA, USA

PostPosted: Tue Nov 06, 2018 10:55 am    Post subject: Reply with quote

rjlittlefield wrote:
mawyatt wrote:
For the stepper controllers the TI devices (DRV8825 for example) evidently have some highly non-linear behavior when micro-stepping, I'm using a MPS6500 for this reason.

I expect the linearity varies depending on which motor you use it with.

In any case, if the nonlinearity is repeatable then you might consider calibrating it out, with a lookup table to translate between the physical position you want and the nominal microstep needed to get there.

--Rik


Linearity also depends on load, friction, and maybe a few other things that would make lookup table-based calibration difficult or even impossible. There of course might be some tricky "local" methods that would optimize the system for the subpixel steps.
Back to top
View user's profile Send private message Visit poster's website
mawyatt



Joined: 22 Aug 2013
Posts: 1802
Location: Clearwater

PostPosted: Tue Nov 06, 2018 12:03 pm    Post subject: Reply with quote

Rik, Ray,

Here's an example of the Ti DRV8825 I mentioned, note how bad it misbehaves even without a load!! I doubt you could reliably correct this kind of misbehavior, and why I moved on the the MPS6500.

https://hackaday.com/2016/08/29/how-accurate-is-microstepping-really/

Best,
_________________
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike
Back to top
View user's profile Send private message
rjlittlefield
Site Admin


Joined: 01 Aug 2006
Posts: 19549
Location: Richland, Washington State, USA

PostPosted: Tue Nov 06, 2018 5:17 pm    Post subject: Reply with quote

mawyatt wrote:
Here's an example of the Ti DRV8825 I mentioned, note how bad it misbehaves even without a load!!

Heh! That looks pretty much like a StackShot in low precision mode. There, the nonlinearity appeared when the drive current was set too low, for "holding torque". The solution was to increase the minimum drive current, which is why high precision mode also makes noise and the motor gets warm. I have no idea what driver was involved.

--Rik
Back to top
View user's profile Send private message Visit poster's website
Pau
Site Admin


Joined: 20 Jan 2010
Posts: 4679
Location: Valencia, Spain

PostPosted: Wed Nov 07, 2018 2:28 am    Post subject: Reply with quote

I guess that to have enough precision and no backlash for pixel shifting you would be better served with piezo actuators.
_________________
Pau
Back to top
View user's profile Send private message
enricosavazzi



Joined: 21 Nov 2009
Posts: 1128
Location: Stockholm, Sweden

PostPosted: Wed Nov 07, 2018 5:14 am    Post subject: Reply with quote

Pau wrote:
I guess that to have enough precision and no backlash for pixel shifting you would be better served with piezo actuators.

I agree, for fractional pixel shifts the total amount of travel is less than about 5 microns (if shifting is done at the camera - the alternative being shifting the subject stage), which makes stepper motors overkill in terms of total travel capabilities and not precise enough.

A camera support or subject stage with flexures would also work better than rails and sliders.
_________________
--ES
Back to top
View user's profile Send private message Visit poster's website
ray_parkhurst



Joined: 20 Nov 2010
Posts: 1896
Location: Santa Clara, CA, USA

PostPosted: Wed Nov 07, 2018 7:13 am    Post subject: Reply with quote

Pau wrote:
I guess that to have enough precision and no backlash for pixel shifting you would be better served with piezo actuators.


Or voice coils.
Back to top
View user's profile Send private message Visit poster's website
JohnyM



Joined: 24 Dec 2013
Posts: 451

PostPosted: Wed Nov 07, 2018 7:55 am    Post subject: Reply with quote

@mawyatt
I've decided to stick to wemacro controller for controlling the motor for now. They've said 3-axis controller is WIP, and there also will be software doing that with 3x ordinary controller. Signle controller will have the advantage of using single USB vs 3x USB ports.

My reasons for that is pricing and uniformity (got 3 wemacro rails and some home brew "micromates" on few devices already).

I'll update the topic when i put it all together. Over 800 individual parts to put together! I feel like kid playing with bricks again Laughing !

Setup for now is:
-Wemacro rail as mm / um Z stepper with idler rail above it.
-Sub um Z stepper still in design stage (got one for vertical, now need to think how to make it horizontal).
-Thk KR1501A mounted horizontally for X axis - spring loaded idler rail above.
-Thk KR1501A mounted vertically for Y axis - idler rail in form of 4 spring loaded columns supporting the stage.

@Pau & enricosavazzi
Every rail is (will be) mounted to idler rail and spring loaded. Shouldnt that take care of backlash?

As an alternative, subject is mounted ( is! that's already done ) on 6 axis manual micrometric stage, so i could do it manually. But lights are fixed on independent rails and will not move when subject will. So that's a thing to reconsider.

@everyone - returning to original question:
https://www.dpreview.com/articles/0727694641/here-s-how-to-pixel-shift-with-any-camera
This method looks interesting. When comparing 4 image to "oversharpened" i can see much less noice, but not really any more details.

Processed image was both: first blown up to 200% then resized back to original size, and image was shifted without any controll. I wonder how well would it work with precise shift and no downsizing. After all it's just simple 25% opacity that could be eazily automated in PS.
Back to top
View user's profile Send private message
ray_parkhurst



Joined: 20 Nov 2010
Posts: 1896
Location: Santa Clara, CA, USA

PostPosted: Wed Nov 07, 2018 8:41 am    Post subject: Reply with quote

JohnyM wrote:

@everyone - returning to original question:
https://www.dpreview.com/articles/0727694641/here-s-how-to-pixel-shift-with-any-camera
This method looks interesting. When comparing 4 image to "oversharpened" i can see much less noice, but not really any more details.

Processed image was both: first blown up to 200% then resized back to original size, and image was shifted without any controll. I wonder how well would it work with precise shift and no downsizing. After all it's just simple 25% opacity that could be eazily automated in PS.


JohnyM...the "Super Resolution" method does indeed work, but one thing you may not realize is that sub-pixel shifts are not required. The SR algos only require that the images are offset from each other by non-integer numbers of pixels. I was successful in making the technique work with manual steps on order of ~10um, with no regard to sub-pixel alignments. This means for SR you don't need to worry about accuracy of sub-pixel movement, only that the movement is non-integer vs pixel pitch.
Back to top
View user's profile Send private message Visit poster's website
mawyatt



Joined: 22 Aug 2013
Posts: 1802
Location: Clearwater

PostPosted: Wed Nov 07, 2018 9:05 am    Post subject: Reply with quote

JohnyM wrote:
@mawyatt
I've decided to stick to wemacro controller for controlling the motor for now. They've said 3-axis controller is WIP, and there also will be software doing that with 3x ordinary controller. Signle controller will have the advantage of using single USB vs 3x USB ports.

My reasons for that is pricing and uniformity (got 3 wemacro rails and some home brew "micromates" on few devices already).

I'll update the topic when i put it all together. Over 800 individual parts to put together! I feel like kid playing with bricks again Laughing !

Setup for now is:
-Wemacro rail as mm / um Z stepper with idler rail above it.
-Sub um Z stepper still in design stage (got one for vertical, now need to think how to make it horizontal).
-Thk KR1501A mounted horizontally for X axis - spring loaded idler rail above.
-Thk KR1501A mounted vertically for Y axis - idler rail in form of 4 spring loaded columns supporting the stage.



The USB ports use for the 3 axis controller isn't a problem since I now use (not shown though) a 4X USB expander which takes up only one USB port on the Raspberry Pi but expands it to 4 ports. Stacking and Stitching isn't very fast so no issues with speed and the stepper driver micro controllers take care of motor interfaces.

The Wemacro rail and controller are certainly good enough, probably the best value overall focus stacking rail setup available, I know I have and use them a lot!!

I've been able to use the Stack & Stitch setup I'm developing on the Wemacro Vertical Stand, in either the normal vertical or horizontal mode. This creates a very compact and portable Stack & Stitch system. Just some slight modifications and additional parts are required. Your two KR15s will fit nicely on the Vertical Stand stage base to move the subject in X and Y axis and the Wemacro focus rail obviously fits on the vertical bar Z axis since that's what the stand was designed for!!

The two KR15 are bolted together with low head profile very short M3 bolts. The mount spacing is 14mm which is what the USA KR15 stage plate spacing is and it's tapped for M3, convenient!! The bottom KR15 has a long ARCA clamp attached by drilling and tapping 4 M3 holes in the ARCA clamp using low profile M3 bolts. A long ARCA plate is attached to the Wemacro Vertical Stand bottom base directly or indirectly via a large adapter plate. I've used 4 M5 bolts to hold the ARCA plate to the base by drilling and tapping the base for M5 bolts. The two KR15s now slide onto the ARCA plate on the Wemacro base for coarse Y positioning which is needed because of the different lens assemblies I use (PN105, various extension tubes & mounts, Mittys with various tube lenses, Nikon & Canon Bellows, and standard Macro lens.

For Weamcro Stand horizontal use, get a longer 40mm bar (600~700mm) from Misumi. Wemacro has a horizontal option with the Vertical Stand and get an additional M8 adapter. Use the additional M8 adapter as shown under the horizontal bar to the base. I'll be drilling a hole in the vertical ARCA plate to allow it to also bolt directly to the Misumi 40mm bar (haven't done this yet thought). Slide the two KR15s onto the vertical ARCA plate for coarse Z positioning, and the Wemacro rail mounts to the Misumi 40mm bar as usual (you'll need to drill a few attachment holes like in the standard supplied Wemacro 40mm bar).

Anyway, hope this helps describe a possible method for a small, portable Stack & Stitch setup based upon the Weamcro Vertical Stand and a couple THK KR15s.

Best,




_________________
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike


Last edited by mawyatt on Wed Nov 07, 2018 9:43 am; edited 1 time in total
Back to top
View user's profile Send private message
Lou Jost



Joined: 04 Sep 2015
Posts: 3190
Location: Ecuador

PostPosted: Wed Nov 07, 2018 9:18 am    Post subject: Reply with quote

Precision sub-pixel shifts buy you fewer shots per gain in resolution. Eight shots more than doubles the resolution in megapixels. I don't know how many random shots would be required to do that, but it ought to be more than eight.
_________________
Lou Jost
www.ecomingafoundation.wordpress.com
www.loujost.com
Back to top
View user's profile Send private message Visit poster's website
ray_parkhurst



Joined: 20 Nov 2010
Posts: 1896
Location: Santa Clara, CA, USA

PostPosted: Wed Nov 07, 2018 9:33 am    Post subject: Reply with quote

Lou Jost wrote:
Precision sub-pixel shifts buy you fewer shots per gain in resolution. Eight shots more than doubles the resolution in megapixels. I don't know how many random shots would be required to do that, but it ought to be more than eight.


From what I found in my testing, resolution improvment with the SR method (at least using one program to do it) topped-out around 6-8 images. Above that I saw no improvement, the final images were basically unchanged.

Another point that may not be obvious is that the optics used for SR method (or any pixel-shift method) must be able to support the higher resolution. You won't get much improvement in resolution if you are already diffraction-limited. That said, the technique does help with noise, so that may be a benefit even with diffraction-limited optics.

In my testing, I was not looking for an increased image size, only for improvement in sharpness/color fidelity/noise for the same image size. I did not like the look of the 2x images at all, but when downsized to the original size, there was clear improvement.
Back to top
View user's profile Send private message Visit poster's website
Adalbert



Joined: 30 Nov 2015
Posts: 618

PostPosted: Wed Nov 07, 2018 9:39 am    Post subject: Reply with quote

Hi Johny,
Please take a look at ( arduino c++):
https://www.photomacrography.net/forum/viewtopic.php?t=30220&highlight=
BR, ADi
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.photomacrography.net Forum Index -> Macro and Micro Technique and Technical Discussions All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group