From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Constructing an RGB Image using IMAQ ReplaceColorPlane VI

Solved!
Go to solution

Hi everyone,

 

I'm trying to familiarize myself with the Vision Development Module on LabView 2009 Student Edition because I want to manipulate images in real time. Currently, I'm trying to split up an RGB image into R,G, and B pixel values then recombine them back into the same image. I can do everything up to the recombining back into the same image part. I think this can be done with the IMAQ ReplaceColorPlane VI (I haven't found another VI that seems appropriate) but all I seem to get is black for both my input and output display. I really have no idea with where I went wrong on this and I need some help to figure this out.

 

I attached the VI I'm using for reference.

 

Any insight at all would be a huge help

0 Kudos
Message 1 of 5
(3,998 Views)

 

PS. It seems I can't attach my VI to my post for some reason so I'll try to describe the process as best I can...

 

1.) Create image from file as RGB (U64) and three blank images as Grayscale(I16)

2.) Send into ExtranctColorPlanes VI, blank images as the three plane ins and RGB as source image

3.) send 3 color planes into 3 different ImageToArray VI

4.) send 3 arrays to ArrayToImage VI

5.) create blank image as RGB (U64) and send this and the three converted images into ReplaceColorPlane VI, maintaining appropriate colors as inputs and sending the new RGB as Image destination

0 Kudos
Message 2 of 5
(3,991 Views)

Hi,

 

I don't really know why you couldn't upload your VI, it normally works well, a workaround if you really can't do it it to make a screen shot (print screen) of the block diagram and post the image.

 

For your problem, I think the issue is the size of the image you want to build from the planes, if you want the Replace color plane function to work without error, you have to set the size of the image buffer before your do the replace.

See this example :

 

Example_VI_BD.png

 

Hope this helps


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 3 of 5
(3,984 Views)

So that example immitates the end of my code exactly but I still am getting the same result. I even have the setImageSize VI to make sure I have a properly allocated space for my image. If anyone has any ideas it would help greatly

 

I don't know why I can't upload files but it's not a matter of it being a VI I tried screen shots and they don't work either

 

Thank you for your suggestions 

0 Kudos
Message 4 of 5
(3,963 Views)
Solution
Accepted by topic author Joe_Szalko

I figured out the problem I had the incoming image set as U64 but the image was saved at 24 bit pixel depth so IMAQ couldn't read the image in properly. when I set the incoming image to U32 and the color planes as grayscale U8 everything worked

 

Thank you for the help

0 Kudos
Message 5 of 5
(3,953 Views)