08-14-2013 03:31 PM
Hello,
I have a need to create an HDR image using different exposures from a camera. At the end, I'd like to cast the image to 8 bit, without any bright or dark clipping. based on the image, I'll know a nominal background threshold value say 500 in a float image, but the dark can go as low as 50 and the bright as high as 3000. How do I scale middle to 128, the lower end to 1 to 127 and the upper end to 129 to 255?
Thanks
08-15-2013 03:33 AM
This may not be the neatest way to do it but I think truncating into 8-bit with IMAQ Cast Image first and then linearly remapping using IMAQ MathLookup should achieve what you are looking for. Well, I hope I even understood what you're looking for in the first place. I didn't try it now but maybe you can even create a lookup table for the casting and leave out the IMAQ Histogram and MathLookup altogether.
09-22-2014 07:05 AM
Yes, the post is old, but I do it as can be seen in the attached VI.
Trouble is, usually you loose information due to the fact that the highest/lowest pixel values are broken (or "bad", as they are sometimes called). In order to take only the useful information you'll have to do something like "eliminate outliers", meaning that you make a histogramm of the picture and eliminate the x% of the pixels lying on either margin of the histogram. That way you'll use your precious 256 values only for those pixels that really do contain information.