Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Bayer Image Array to RGB Image

Solved!
Go to solution
Highlighted

Hello Everyone,

I am currently working with Live Image of a camera. From our hardware I get raw data and convert it to a bayer array (BGBG). Now I am trying to get the RGB Image from this array using "IMAQ Bayer to RGB". I am using "IMAQ ArrayToImage" to convert my BayerArray to Image. Unfortunately that doesn't work and I get the error: "Error -1074396080 occurred at IMAQ BayerToRGB,Possible reason(s):Invalid image type.

Can anyone help me how to fix this error? 

Attached you a screenshot of the BlockDiagram.

 

Thanks a lot in advanced

 

Regards

Sinan Ismael

Certified LabVIEW Developer

Germany

 

0 Kudos
Message 1 of 9
(322 Views)
Highlighted

Actually you have to define your RGB (destination) image properly  when you create it. To do so, set the "image type" input of the IMAQ Create.vi to RGB32.

 

Sami

0 Kudos
Message 2 of 9
(316 Views)
Highlighted

Thanks Sami, I tried that but nothing happened.

 

Attached you my VI. A TestPattern has to be displayed

0 Kudos
Message 3 of 9
(293 Views)
Highlighted

Your raw data being U16, you need to :

  1. select image type for the "bayer image" as Grayscale (U16)
  2. select image type for the "RGB" image as RGB (U64). RGB (U32) might wok but make sure data are properly cast.

SamiF_0-1601900709084.png

Sami

0 Kudos
Message 4 of 9
(274 Views)
Highlighted

Thanks, but it still does not work. There is no error but a complete black image is displayed!

0 Kudos
Message 5 of 9
(267 Views)
Highlighted

Please move your cursor on the image display pixels : the image looks black but you should see that pixel values are not 0s.

 

0 Kudos
Message 6 of 9
(257 Views)
Highlighted

Yes, you are right! I think that is because there is no alpha values (intensity)! Is there a way to display the image without alpha?

0 Kudos
Message 7 of 9
(255 Views)
Highlighted
Solution
Accepted by topic author Sinan_Ismael

The values contained in your image are low if we consider the whole 16bits dynamic range : your highest raw intensity is just above 10bits so it is understandable that on a 16bits scale, they give you "dark" pixels.

I suggest you use "IMAQ Image Bit Depth.vi" to set the real or optimized bit depth for your data. You'll get a much better display.

And my final advice would be : always make the difference between the data and the way you display them !

 

SamiF_0-1601907616597.png

 

 

0 Kudos
Message 8 of 9
(247 Views)
Highlighted

Thanks a lot. I got it!

0 Kudos
Message 9 of 9
(191 Views)