03-29-2009 08:08 AM
I am taking a series of 10bit images, and to increase the effective exposure time of the camera would like to add up to 30 consecutive images together. I am able to add the images using IMAQ Add, but the resulting image acts as if it were also a 10bit image and saturates at 1024 (2^10). I don't understand why as the Image dst in the IMAQ add is wired to a I16 image, and so I was expecting that I would be able to add my 10bit images until I reached the limit of 16bits. I'm new to all of this so it's likely that I'm just making a silly mistake.
Currently I grab N successive frames from the camera using IMAQ Grab, then add each element of the resulting array to form the new image.
I understand that I could add up a subset of the images, then divide them by some power of 2, but I would like to understand why I currently cant use the full 16 bits of the image type.
Solved! Go to Solution.
03-30-2009 12:02 PM
Hey casual,
I'm sorry, but your stacked sequence structure is near impossible to follow, is there any way you could attach your VI for us? If not, I can look at your images some more. Maybe you could also attach a handful of your images in a zip so that we can try some solutions on our end, and to see if we are also saturating at 10 bits even though you are adding 16 bit images.
03-31-2009 05:38 AM
Hi Chris,
Thanks for your reply. Sorry that the pictures that I attached were hard to interpret. The VI in its entirety is quite messy and very much under development so I have isolated the part of the VI that is behaving poorly. Thesub routine is attached. I tested this and it behaves the same as it was when embedded in my code.
What I think I'm doing is, taking N consecutive frames from the camera (a Hitachi KP-F100 (10bit greyscale)) using our NI PCI1422 card. I then add the N images together using IMAQ Add, and then display the image. The resulting addition saturates at 10bits - rather than using the full 16 bits of the image type being fed to the IMAQ Add process.
Thanks for your help
Sam
03-31-2009 01:29 PM
04-01-2009 04:22 AM
Thank you
I suspect that will do the trick - I hadn't spotted that feature.
Thank you
Sam
05-13-2011 09:37 AM
Revisiting this issue:
I have a boatload of U16 images that I have to add together. How do I avoid saturation in this case while using IMAQ Add function?
The IMAQ Image Bit Depth does not have an option for U32 (or SGL) which is what I believe is what is needed.
A workaround is to convert image to array and collect additions in SGL array. But is there a way to do this just using IMAQ functions?
Sincerely,
Don
06-08-2011 12:55 PM
Following up on this. The addition of U16 images can be performed without fear of overflow/saturation by casting the U16 image to SGL type and creating an SGL image type for the sum as per the strategy below: