how can I get a 16 bit TIFF?
Answeredusing a grasshopper or a blackfly of some kind. Shouldn't actually matter since it's all GenICam, right?
I set the camera to 12 bit packed and then try to convert to a bitmapsource. 8 bit works fine, but I don't want that.
Here's a code snippet and an error:
protected override void OnImageEvent(ManagedImage image)
{
ListenerEventCount++;
try
{
if (image.IsIncomplete)
{
Trace.WriteLine("Image incomplete with image status {0}...\n" + image.ImageStatus);
}
else
{
CompleteImageCount++;
Trace.WriteLine("new complete image");
//temporary container for processed image
using (ManagedImage tempImage = new ManagedImage())
{
//convert to bitmapsource
image.ConvertToBitmapSource(PixelFormatEnums.Mono12Packed, tempImage);
...
Exception thrown: 'SpinnakerNET.SpinnakerException' in SpinnakerNET_v140.dll
Spinnaker: Error converting source image from pixel format Mono12p to destination image pixel format Mono12Packed. [-1003]
-
Official comment
Hello Greg,
I am afraid that our sdk only support Mono8 or BGR8 for retrieving bitmap image. If this is a blocker to your project, please open a support ticket via https://flir.custhelp.com/app/ask Our sales representative would get back to you, and probably open sdk feature request ticket to be prioritize via our PM.
Mono12p is packed pixel format, and saving as .tiff file will unpack it to 8-bit format. So, It would require saving as .raw format to keep the original Mono12p.
Regards,
Ifeanyi
-
Hello Greg,
That's correct for our USB3 and GigE cameras. However, different camera models and interfaces may have unique features (such as supported pixel format, maximum exposure time, etc) which must be considered during software implementation.
With that said, Mono12Packed pixel format is for GigE cameras, and Mono12p is for USB3 cameras. Besides, it does not make sense converting from Mono12p to Mono12Packed, since both are 12 bit pixel format.
Have you tried with any of below implementation for retrieving bitmap image?
image.ConvertToBitmapSource(PixelFormatEnums.Mono8, tempImage); // for monochrome camera
image.ConvertToBitmapSource(PixelFormatEnums.BGR8, tempImage); // for color camera
Regards,
Ifeanyi
0 -
Mono8 works, as I said. How can I get a 16-bit BitmapSource and/or a tiff file? If I save the Mono12p ManagedImage as a tiff it is only 8-bit.
0 -
Ok. I assumed it would unpack it to save it in 16 bit mode. If I set it to Mono16 mode and then save as a tiff, it works.
But I would still like to access the image data without having to save it as a tiff and then load the tiff.
How do you recommend accessing the image buffer? Would I use image.DataPtr?
0 -
Hi Greg,
That's correct, rawImage.DataPtr allow access to ImanagedImage object data.
I hope the provided information thus far helps to proceed with the implementation.
Regards,
Ifeanyi0
Please sign in to leave a comment.
Comments
5 comments