Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Images Not Being Saved as 16-bit

Hello,

 

We are using a Basler acA2000-340km camera.  I am able to capture frames in 10-bit and 12-bit pixel bit depth successfully.  However when I try to save those frames to disk they are only being saved in 8-bit format.  I tried using both .tif and .png images.  I am using the imgSessionSaveBufferEx() function to save the image.

 

I noticed in MAX 10-bit and 12-bit acquired frames are correctly being saved as 16-bit images.  What am I missing here?

 

Thank you.

0 Kudos
Message 1 of 4
(4,284 Views)

I noticed in the camera file used by MAX that the bit depth is being specifically set.  I tried doing the same thing in C++ but when I try setting both the IMG_ATTR_BITSPERPIXEL and IMG_ATTR_PIXDEPTH attributes I am getting an error stating that those attributes can't be set.  Which attribute am I supposed to use for setting the pixel bit depth of acquired frames?

Thanks.

0 Kudos
Message 2 of 4
(4,281 Views)

I am saving 16bit images in Png. 

Is the image you saving from is 16bit?

Do you want to post code?

 

Amit,

Amit Shachaf
0 Kudos
Message 3 of 4
(4,258 Views)

Hello Amit,

 

Yes the image was acquired in 10-bit and stored in a 16-bit buffer.  I tried both TIF and PNG formats.  It looks like the problem is that NI needs to be specifically told that the image is 16-bit.  I am hoping that I don't need to create customized camera files just to set the bit depth.  I was hoping I could do it through one of the attributes.

 

Are you coding in C++?  How are you indicating that you have 16-bit images?

0 Kudos
Message 4 of 4
(4,247 Views)