LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ and RGB24

Dear all,

 

This is my first post. I hope it's in the right section. I could not find a section dedicated to IMAQ nor Vision.

I am facing a problem regarding RGB24 images and IMAQ.

 

I use a frame grabber that stores images in a memory buffer. On the LabView side, I first retrieve the pointer to this buffer and copy the data into a 2D array initialized with the right dimensions. Once done, this array is converted into an IMAQ using IMAQ ArrayToColorImage.

As far as I know, IMAQ image type cannot be set to RGB24 (IMAQ Create). The problem here is that the buffer contains RGB24 data (3 bytes per pixel, no alpha layer). As a result, the image is "broken" and shifted as IMAQ considers the first byte to be the Alpha layer.

I tried modifying the array before conversion by inserting a "dummy" byte each every 3 bytes in order to simulate the Alpha layer but this process is way too slow for my application.

 

Long story short: is there a way for IMAQ to handle RGB24 images? Could I create an IMAQ with RGB24 image type?

 

Thanks in advance.

 

Best regards.

 

0 Kudos
Message 1 of 2
(1,068 Views)

Hi Julien,

 

To the best of my knowledge you're following the correct  procedure for converting this RGB24 data.

 

You could however speed up the operation by splitting up the array and implementing Multithreading in your program, an example for this can be found at the end of the below page.

 

Multithreading Programming Examples

Example 2: G Code Equivalent of C Code in Example 1

http://zone.ni.com/reference/en-XX/help/371361R-01/lvconcepts/multi_programming_ex/

 

I hope this helps!

Jacob

0 Kudos
Message 2 of 2
(1,007 Views)