LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Overlay array of color Box on image

Hi everybody,

im trying to overlay an array of Color box on an image but it does not work.

Here is a short description about the scenario.

I have a camera and a sensor. The sensor has 10 channel and is about 20 cm long and 1cm large. (Pic 1). 

I track the position and orientation of the sensor with the camera. When i move the sensor i get differents position and orientation and per position 10 values (Sensor measures the magnetic field ). After that i convert every value to a specify color and save it as 1D Array. Now i want to overlay it on my live image. You can imagine like someone wipe a board. At the end the results should look like this (Pic 2). i've attached a vi where a do a simulation of my problem.

You need to choose a camera before started the vi.

 

Thank you for you effort

Download All
0 Kudos
Message 1 of 9
(4,337 Views)

I don't have IMAQ or a camera installed, so I can't try running your VI.

 

However, you never actually said exactly what it is that "does not work".

 

Does the VI show the image at all, even with no overlay?  Is there an error in the error out chain?  Is the VI hanging or does it finish running?  Does it seem like everything is working except for the overlay?  Have you probed all of the wires while running to be sure they give the values you expect to see?

 

 

0 Kudos
Message 2 of 9
(4,311 Views)
Thank you for your answer. The Vi works well but i just see one point overlay on the image and Not the Array of Color Box. The Array represent the sensor strip. IT would be better if you can see inside the Vi.

Thx
0 Kudos
Message 3 of 9
(4,305 Views)

 

I'm going to guess that the problem is that the problem is that you're just seeing one point scrolling around, not the whole history of points.  I'm guessing that each time you run the "grab" function it discards the previous overlays.

 

You'll probably want to use a shift register to loop the variable back around to avoid this.  I don't know if you'll need to loop around the image and just keep adding overlays, or if you'll need to loop around an array of the overlays you've added so far and keep re-applying them.

0 Kudos
Message 4 of 9
(4,294 Views)
you can use one of this method
1 use multiple line give the points as end point to this overlay and use high value for width
2 use bitmap pixel
3 use oval overlay several time for each location
0 Kudos
Message 5 of 9
(4,253 Views)

Hello Hatef.fouladi,

 

I've try to implement it with a Imaq "Overlay multiple line 2" but i can not see any point on my image.

However i must choose a fix color for a line, this is not that i want to obtain. I want to see differents color on the image like in this picture (Every value correspond to specific color).

With the "Imaq Overlay Bitmap" i only see small point on the image and dont know how to make it bigger.

Thank you.

 

0 Kudos
Message 6 of 9
(4,235 Views)
for making bigger you have to make algorithm
that for any point colored near neighborhood too
0 Kudos
Message 7 of 9
(4,188 Views)

Hi LearnIT,

 

I think the IMAQ Overlay Bitmap function is the one that will work best for you. However, the bitmap you input to it is normally very small - that's why it doesn't appear to change except for a small point on the image. I would recommend using a For loop to aggregate what lines you want and what colors they need to be to assemble the bitmap (basically the two dimensional array of color box constants). You can wire this straight to the function and it will overlay on the image. Additionally, you could continue to add to this bitmap using the Build Array function if you need to keep adding to the overlay at runtime.

 

Hope this helps!

Austin H.
Applications Engineering
National Instruments
0 Kudos
Message 8 of 9
(4,150 Views)

The below code should get you started with:

Overlay_testing.png

-To the array of color boxes first i removed the Caption and Index display.

-Then i make the entire control as image data .

-The problem is we cannot directly use this image data to overlay hence converting image data to IMAQ image format

-And now the array control can be entirely considered as bitmap and can be used to overlay on image.

Note: Bitmap overlay takes the Top, Left as starting point to start overlay.

- You have to add the rotation logic.

 

I hope it helps to start with.

Thanks
uday
Message 9 of 9
(4,130 Views)