11-02-2009 08:54 PM
I am working with a 16bit camera (data is native in a U16 format), but to work with LabVIEW functions (e.g. IMAQ add/substract etc. doesn't work on U16 images) I have converted to I16 format by first converting the array data from U16 to I32 and then subtracting 2^15 before converting to I16. While I would prefer to be able to stick with U16 images, this seems like it could work.
However, I now want to subtract one camera image (a dark count image taken with the lens cap on) from another camera image to remove background noise. Since the dark count image is mostly low negative numbers in I16 format (low positive numbers in U16 format), subtracting a dark count image from another image actually adds counts to the original image (i.e. A - (-B) = A + B) and thus is not at all the same as (A - B when both are U16). Can anyone recommend a simple workaround? Can the powers that be at NI add U16 functionality to more of the basic IMAQ routines since 16bit scientific cameras are pretty much the norm now.
Thanks,
Matt
11-03-2009 06:05 PM - edited 11-03-2009 06:06 PM
Hi Canucklehead,
I am a little confused on this issue. If you are concerned with A - (-B) = A+B, can you not simply instead use an IMAQ Add and do A + -B = A-B?
11-05-2009 11:05 AM
Hi Stephen:
Sorry I probably didn't explain that very well. The attached .VI demonstrates the problem for a test 2x2 pixel array/image. It seems a solution would be to convert I16 images to U16 arrays before any addition/subtraction but this gets cumbersome. Also, as I see it, the IMAQ Add/Subtract vi's don't handle I16 operations logically if the image data spans the full 16bits of information and thus extends into negative counts. Of course I chose the moniker "Canucklehead" for a reason!