www.photomacrography.net :: View topic - Blue light for high resolution - post processing questions
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 
Blue light for high resolution - post processing questions
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
Beatsy



Joined: 05 Jul 2013
Posts: 1534
Location: Malvern, UK

PostPosted: Tue May 17, 2016 9:32 am    Post subject: Blue light for high resolution - post processing questions Reply with quote

I'm trying to make very high resolution stacks (diatoms) and have kind of 'thunk myself into a corner' regarding post processing of RAW images taken in blue light (455nm). Two main questions...

1. Is there any way to extract just the blue pixels from a batch of RAW files without involving any debayering algorithm? I would expect to end up with tiffs that are half the width and height of the original RAW images. I'd prefer a tool that works on batches of files - but willing to wind through them in turn if needed.

Note: In the absence of said tool in Q1, I used Photoshop CS6 to batch extract blue channels from tiffs, but I'm obviously using debayered input files and believe 'made up' values (derived from the red and green pixels in the bayer matrix) are reducing the quality/accuracy of the blue channel.

2. Related to the above. When determining sharpness, how does Zerene Stacker interpret the different colours? Given that all but Plan Apo lenses will bring different wavelengths to focus at slightly different depths, does ZS use luminance - or does it work with the colour channels separately?

Currently, although I can *see* more detail through the eyepiece, my photographic (stacked) results are only marginally better than I achieve using white light.
Back to top
View user's profile Send private message
Pau
Site Admin


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

PostPosted: Tue May 17, 2016 10:19 am    Post subject: Reply with quote

Not an actual response to your questions, but few points:
- With blue light you only use 1/4 of the Bayer sensor pixels, so you need a very high pixel dense sensor. Resolution on the sensor side will be lower than with white light. The raw image converted with no demosaicing will show separated pixels in place of a continuous image.
- The best alternative will be a monochrome sensor, although this is not present but in some telescope or microscope dedicated cameras apart of the super expensive and maybe not convenient Leica M-Monochrom
_________________
Pau
Back to top
View user's profile Send private message
Beatsy



Joined: 05 Jul 2013
Posts: 1534
Location: Malvern, UK

PostPosted: Tue May 17, 2016 10:35 am    Post subject: Reply with quote

Thanks Pau. I'm using a 5d mkii which has FAR too many pixels really. At high NA the sensor is oversampling by a factor of 8 (thanks to the built-in magnification on my Zeiss's camera port). So the reduced resolution is welcome in this case.
Back to top
View user's profile Send private message
rjlittlefield
Site Admin


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

PostPosted: Tue May 17, 2016 11:01 am    Post subject: Reply with quote

1. You should be able to do this using dcraw with the -d or -h options to convert raw to TIFF without interpolation. See http://www.photomacrography.net/forum/viewtopic.php?p=84987#84987 for example. Then in Photoshop you could certainly do some combination of cropping and resizing with nearest-neighbor resampling to extract just the blue pixel positions. I expect the same thing could be done in imagemagick. There might even be options to do the whole functionality in dcraw. See http://www.cloudynights.com/topic/512342-how-do-you-extract-red-without-interpolation/ for other options.

2. Zerene Stacker works just with luminance in almost all cases. In PMax, there is an option to "Use All Color Channels In Decisions", but that still results in a single decision that then gets applied to all color channels at that pixel position for that source image. There is no facility to process the RGB channels completely separately, as needed to handle different colors focusing at different depths.

I recall exchanging email with two or three people who implemented the separate colors approach by preprocessing their RGB stacks into three monochrome stacks, running each of those through Zerene Stacker separately, then merging the results back to RGB. However, each of them told me that the result was not as good as they had hoped/expected. I have no personal experience with separated colors, and I don't know why it failed to give the expected benefits.

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



Joined: 23 May 2008
Posts: 1434

PostPosted: Tue May 17, 2016 11:06 am    Post subject: Reply with quote

I think Pau is on the right track. What is the point of increasing resolution with blue (you could also use Long Wave UV which has been done, Zeiss had some UV monochromats once upon a time. )light and then throwing it away on the bayer pattern.

To see the improvement afforded by blue light you either need the Leica monochrome sensor Pau mentioned or you could shoot black and white film which is what they used to do with the above mentioned objectives and blue light too "back in the day". Shooting film would be the most economical way. You could also round up a monochrome video camera. Or a three shot camera like the Diagnostic Instruments SPOT cameras which you can probably isolate the channels conveniently without debayering.

I have a vague recollection of someone posting such an experiment here in the past. I will see if I can find it. Maybe I saw it elsewhere.
http://www.photomacrography.net/forum/viewtopic.php?t=10861&postdays=0&postorder=asc&highlight=blue+monochrome&start=15

http://www.photomacrography.net/forum/viewtopic.php?t=7007&highlight=monochrome+resolution


Last edited by g4lab on Tue May 17, 2016 11:27 am; edited 1 time in total
Back to top
View user's profile Send private message
Beatsy



Joined: 05 Jul 2013
Posts: 1534
Location: Malvern, UK

PostPosted: Tue May 17, 2016 11:19 am    Post subject: Reply with quote

I'm not throwing away resolution on the bayer filter.

At the highest numerical apertures, my system is over-sampling by a factor of 10 (using 100/1.3 and oiled condenser and white light). That is, the smallest feature the objective can resolve covers a 10 pixel diameter circle on the sensor. By using blue light, I reduce the size of the smallest resolved feature such that it "only" covers an 8 pixel circle instead (oversampling). I am achieving higher resolution than I would with white light and capturing all the information.

PS. Sorry - forgot to thank you for the link. Also, I have tried using a near-UV interference filter in the past. But all my objectives focus this UV light at a radically different position to 'normal' wavelengths so it's a bit tough to use. Also requires incredibly long exposures on my 5d ii to get a decent signal.
Back to top
View user's profile Send private message
g4lab



Joined: 23 May 2008
Posts: 1434

PostPosted: Tue May 17, 2016 11:30 am    Post subject: Reply with quote

I was also going to ask, are you using a blue interference filter. This would give you much sharper cutoffs than even a pretty good blue glass or blue gelatin filter. It would probably maximize whatever gains you could get.

Maybe you are not throwing away resolution but aren't you throwing away like three quarters of the light??
Back to top
View user's profile Send private message
Beatsy



Joined: 05 Jul 2013
Posts: 1534
Location: Malvern, UK

PostPosted: Tue May 17, 2016 11:47 am    Post subject: Reply with quote

g4lab wrote:


Maybe you are not throwing away resolution but aren't you throwing away like three quarters of the light??


Yes. Well, sort of. But only because I'm discarding (or want to discard) 1 red and 2 green pixels for each blue. It's not a problem - the 100w halogen lamp provides plenty of light. I can blow out the blue histogram with a 1/30th sec exposure and the lamp running at about 80% power.

My main problem is finding a method to extract the blue pixels (without debayering) from each RAW image in the stack and save them as a half-size monochrome tiffs instead (prior to stacking). I've looked at dcraw, raw therapee and even deep sky stacker (super pixels) with no luck so far. The search continues.
Back to top
View user's profile Send private message
rjlittlefield
Site Admin


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

PostPosted: Tue May 17, 2016 11:58 am    Post subject: Reply with quote

Beatsy wrote:
I've looked at dcraw, raw therapee and even deep sky stacker (super pixels) with no luck so far. The search continues.

I'm a little confused here. Do you mean that you haven't found a solution that is as tightly integrated as you'd like, versus the dcraw -d plus Photoshop method that I described above?

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



Joined: 16 Dec 2010
Posts: 551
Location: Barcelona, more or less

PostPosted: Tue May 17, 2016 12:18 pm    Post subject: Reply with quote

Perhaps this is too complicated to explain with my bad English ... In astronomy is very common to use black and white cameras and take a series of images through RGB filters, and then combine them and get a color image.

The cheapest way to have a camera in black and white is taking a DSLR (I did it with a Canon 450D), remove the first lowpass filter, scratch the bayer matrix and the second low-pass filter. Since the focus point is completely lost, I want to repeat the process with a Canon 1200D, for focusing in LiveView mode. The increase in resolution is very important, now every pixel gives information and we donĀ“t have two defocusing filters in the camera. In return, perhaps for non astronomical applications we should add an IR cut filter.



Back to top
View user's profile Send private message
Beatsy



Joined: 05 Jul 2013
Posts: 1534
Location: Malvern, UK

PostPosted: Tue May 17, 2016 12:24 pm    Post subject: Reply with quote

Rik: it was not working as expected. The output tiff just looked like a normal image (no bayer matrix apparent). Had a few goes with different parameters and then set it aside while looking for other options. Just realised I was using the sRAW format - so that may be the issue. Will shoot some full-sized RAWs later and try again.
Back to top
View user's profile Send private message
g4lab



Joined: 23 May 2008
Posts: 1434

PostPosted: Tue May 17, 2016 12:31 pm    Post subject: Reply with quote

http://www.maxmax.com/shopper/category/9274-canon
Back to top
View user's profile Send private message
Beatsy



Joined: 05 Jul 2013
Posts: 1534
Location: Malvern, UK

PostPosted: Tue May 17, 2016 12:59 pm    Post subject: Reply with quote

Update: dcraw doesn't handle sraw or sraw2 files (Canon reduced size RAW). I got it to produce a 16 bit greyscale tiff with with a normal RAW file (as Rik suggested) but cannot find any way to reliably isolate only the blue pixels from that (scaling 50% with nearest neighbour resampling in CS6 doesn't work). So still searching...

soldevilla: Thanks. But that really made my toes curl Smile
Back to top
View user's profile Send private message
Pau
Site Admin


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

PostPosted: Tue May 17, 2016 3:08 pm    Post subject: Reply with quote

Beatsy, you're right, your sensor is largely outresolving the microscope image so at the sensor side resolution will not be an issue.
This leads me to another point: because the use of blue light is only advantageous at the sample/objective side (to diminish diffraction and avoid chromatic aberrations) demosaicing the sensor image will not induce important loses.
Somewhere I read that the green pixels are to some extent sensitive to blue (the channels are not sharply separated from origin), if right it could give some advantage if it applies to the wavelength you're using.

In any case your idea is most interesting and worth to try. Please keep us informed.
_________________
Pau
Back to top
View user's profile Send private message
MaxRockbin



Joined: 08 Nov 2014
Posts: 185
Location: Portland, OR

PostPosted: Tue May 17, 2016 10:53 pm    Post subject: Reply with quote

I haven't tried this, but, to use DCRAW with your sraw/sraw2 files, you might try converting to DNG (Adobe's Digital Negative universal raw format) using their free DNG converter and then using DCRAW on the DNG.

https://helpx.adobe.com/photoshop/digital-negative.html
_________________
If your pictures aren't good enough, you're not close enough. - Robert Capa
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