Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

NI1439 16-bit signed display imagery: Just fix it

Hey Rob,

 

Machine Vision is the correct Board for this issue.

Regards,
Claire Reid
National Instruments
0 Kudos
Message 11 of 22
(2,919 Views)

Hey Rob,

 

I apologize for the frustration here. MAX currently interprets 16-bit images as I16 instead of U16 because this was a design decision that was made a while back. It's my undrestanding that a while back, 16-bit images were preferred in the I16 format for simplicity of algorithms and calculations done on the images.  I'm not going to argue the wrongness of this decision, it's just what we decided to go with. Up until about a year ago, all of our 16-bit grayscale images in LabVIEW and everywhere were considered I16.  We added support for U16 representation and now we are working on adding the U16 image support to all of our vision functions.

 

I agree with you that it is not initially intuitive to use I16 instead of U16.  That being said, MAX does not currently allow you to select what representation to use (as you seem to have found out).  LabVIEW allows you to choose between U16 and I16 for creating image buffers.  Camera File Generator is probably showing you the correct results because it is built in LabVIEW.  MAX is built separate from LabVIEW and doesn't have all of the features yet.  I'll submit your feedback on adding support for U16 to MAX into our product suggestion database.

 

Is there any particular reason you are stuck with MAX and cannot do this from LabVIEW? I think you would have a better experience acquiring from LabVIEW since you can use your U16 datatype from there without error.

 

Take Care,

Evan D.
Installer R&D
National Instruments
Message 12 of 22
(2,920 Views)
Hi, Evan,

Thank you for the explanation.

 

 


BullDozier wrote:

...16-bit images as I16 instead of U16 because this was a design decision that was made a while back. It's my understanding that a while back, 16-bit images were preferred in the I16 format for simplicity of algorithms and calculations done on the images.  I'm not going to argue the wrongness of this decision, ...


I would like to say, that the initial decision was not the best. We working with grayscale XRay images, they are mostly over 8 bit depth. Some devices deliver 12-14 bit images, mostly 16 bits, and everytime black is zero. I haven't seen any XRay detector which deliver I16 images with negative values. Always U16, and everytime 0 is black. So, when using NI Vision algorithms, I should  first convert U16 to I16 for processing, and then convert I16 to U16 for visualization. Line profiles, pixel meters - all things are corrected in my application, otherwise customer frustrated with images, which starts from -32768 with zero intensity exactly in the middle of the image.  Its just additional work for me to adapt UI for bringin images info in range 0...65535 instead of -32768...32767.

Also not understand, which algorithms more simply for I16?

lookup table: NewPixel[i] = LUT[OldPixel[i]], or histogram: Histo[Pixel[i]]++ - try to do this with negative index. So, U16 is more convenient for imageprocessing than I16 from my point of view.

 

 


BullDozier wrote:

I think you would have a better experience acquiring from LabVIEW since you can use your U16 datatype from there without error.

 


Evan, before this recommendation try use U16 yourself. Well, U16 was introduced in Vision 8.x. But this type is unusable, because only few processing algorithms support this type. Technically you can create U16 now, but you can't do much with it:

 

NiceU16Support.png

 

Is this U16 support?!

In additional, I'm not sure, that IMAQ wil acquire directly to U16. (but this not checked, just suggestion). 

 

Andrey.

Message 13 of 22
(2,902 Views)

Hey Andrew,

 

You are correct.  IMAQ will only acquire into U8 or I16.  We do not have full U16 support across the board in Vision yet either.  To be honest with you, I'm not sure why we originally chose to go with I16.  Until I few years ago, I hadn't heard of a camera that actually returns true 16-bit data.  Most, as you know only return 10,12, and some 14-bit. So, it wasn't as big of an issue back then which type to go with.

 

That being said, we are working to add more U16 support into our functions.

 

Take Care,
Evan D.
Installer R&D
National Instruments
0 Kudos
Message 14 of 22
(2,888 Views)

Out of curiousity, are you using a camera with a full 16-bit resolution? As long as your camera is only using 10/12/14 bits, the signed/unsigned difference should not be an issue since the MSB will be clear and will be interpreted as a postive number. There are very few cameras on the market that return a full 16-bits of data, so I think this tends to not be a huge issue for most people.

 

For what it is worth, IMAQdx's latest version will now return 16-bit images as U16 if either the camera explicitly specifies that it is a signed, full, 16-bit format, or the user specifies to force it to return an unsigned image. But, as others have mentioned, many algorithms in Vision still are not yet able to handle U16 image data.

 

Eric 

 

 

 

 

0 Kudos
Message 15 of 22
(2,882 Views)

Yes, it's a 16-bit camera and the customer will not accept a 15-bit output (I wish they would, believe me).

 

Rob

 

0 Kudos
Message 16 of 22
(2,845 Views)
If you are working on U16 image support it would have been great to have support for U32 and I32 grayscale and most important grayscale double precision images also.I usually prefer developing my algorithms in Matlab just from this issue. It is easier to develop the algorithm in grayscale double precision and when you have everything in place to convert the algorithm to the correct bit depth. Thanks - Amit, 

 

 

Amit Shachaf
0 Kudos
Message 17 of 22
(2,833 Views)

Ok, I am joining this discussion.   Yes, I am dealing with this problem at the moment, and it is very, Very frustrating.   I cannot believe the limited support I am getting in LabVIEW with Images.  I have dealt with Image problems for years, and I just told myself that It was because I didn't have the Vision Module. 

SO I bought the Vision Suite for and extra 4 G's and I though it would fix this problem.  Smiley Sad

 

Yes, I have a full, true 16 bit camera.  And the numbers start with 0 being black, and 65535 being white.  When displaying the imagery, at first I always think something is wrong with the camera, until I realized the data format is being displayed in I16. 

 

WHO WANTS AN IMAGE DISPLAYED IN I16?


Not me.

 

So lets get to my current problem.  I have a camera that outputs U16 Data at 640 x 480 x 60 Hz.  When I use the IMAQ configure buffer.vi to set up a continuous grab from a CameraLink NI-PCIe-1427 card, I have to make Images to fill the buffer, so I use IMAQ create.vi with U16 Images.

 

You know what comes out of the IMAQ Extract.vi??   I16 IMAGES!

 

So now what do I do?  convert every image on the fly to U16, then Put back into an Image form using IMAQ ArrayToImage?

 

How Expensive in processing power is that?  More expensive than I want to pay.

 

Any thoughts?

 

 

 

Eric, you say:

 


 

For what it is worth, IMAQdx's latest version will now return 16-bit images as U16 if either the camera explicitly specifies that it is a signed, full, 16-bit format, or the user specifies to force it to return an unsigned image. But, as others have mentioned, many algorithms in Vision still are not yet able to handle U16 image data.


 

Where is this?

 

 

Ben Yeske
Message 18 of 22
(2,668 Views)

Monzue,

 

Sorry to hear your troubles... As others have mentioned, this is really only an issue with a full 16-bit camera, of which there are very few of. Unfortunately that is what you are using, so you are running into it.

 

As Vision Development Module only somewhat recently added support for U16 image types, this is why the support within the drivers themselves (IMAQ and IMAQdx) have been limited to returning I16 images.

 

The new support I mentioned in IMAQdx applies to cameras such as 1394 and GigE Vision. Since you are using our framegrabbers with the IMAQ driver, this option does not apply. However, there is some good news as I believe based on requests like yours we are adding support in IMAQ in the camera files for specifying that the image type is to be unsigned (similar to IMAQdx). This would make the image out of Extract be unsigned if you so desire. You will likely see this in an upcoming driver release.

 

Eric 

0 Kudos
Message 19 of 22
(2,662 Views)
Has the modification to allow U16 bit images in NI-Imaq been completed? I also have 16 bit cameras and it takes a lot of time to recast images. If so what is the command?
John A. Lively
NDE Engineer
Pratt & Whitney
0 Kudos
Message 20 of 22
(2,100 Views)