Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Display color image after processing in grayscale

Solved!
Go to solution

Hi there,

I'm trying to write a vi using match geometric pattern which will look for a specific letter (e.g.. A, B, C....  as shown below in Image1) at a time on a live video. My code seems to do the job OK but the only way I was able to make the search work was by using imaq image cast (as shown below in Image2) and converting it to grayscale (U8). My problem is that I require the final image (which is overlayed with a red circle in the centre - see Image1) to be in color but so far my vi only works in grayscale. 

 

Any thoughts anyone?  

 

 

Image1

 

Find A.jpg

 

 

 Image2tip_control.jpg

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

If your analysis is working fine, the solution is fairly simple.  Do your analysis using the grayscale image, then display the results on the color image.  Nobody will ever know...

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 5
(3,793 Views)

Thanks for your prompt reply Bruce. I also thought your solution was the way to go but I didn't manage to make it work that way. I modified my vi so that the color image should not have been converted for display (but overlayed with my red circle and a text message) and then not only the image changes constantly between color and grayscale but also the overlay circle and text message flicker all the time. I'm familiar with Labview but not with image processing, therefore, I am afraid I might be making a very silly mistake somewhere in my code that prevents me from displaying the color image with the overlay properly. The image below shows what I have changed from my previous post.

 

tip_control2.jpg

0 Kudos
Message 3 of 5
(3,785 Views)
Solution
Accepted by topic author Wel

Branching a wire does not make a copy of the image.  You need to create a second image for the grayscale.  IMAQ Cast should have an input for a destination image - wire the grayscale image in there.  If it doesn't, make a copy of the image (IMAQ Copy) then use Cast.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 5
(3,783 Views)

You were absolutely right, If a make a copy before casting than it works fine.

 

Thank you very much for your help.

 

 

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