LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to label items in image display

Hi all,

 

I am stuck with a problem in LabVIEW Vison. I am doing some operation on few items in a single image. Based on the operations some items will be overlaid with red rectangle. I have done upto this. But then I want to give numbers to that overlay and want to show them in Image display. How do I do? For your reference I have attached one print screen of front panel where the items are overlaid with rectangle but not numbered.

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

Use the IMAQ Overlay Text.vi in the Vision>>Vision Utilities>>Overlay palette.  You can configure the font style, size, position, etc.  You can also programmatically control the string input that gets displayed.

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

Hi JKMM,

 

Thank you for your reply. Now I have tried with the block IMAQ Overlay Text.vi, but nothing happened. The image is coming same as before. I want numbering of the items such as one item will be numbered as 1, then the next one as 2 and so on. For your clarification I have attached herewith the front panel screen shot and the vi itself. Kindly help some more.

Download All
0 Kudos
Message 3 of 5
(3,595 Views)

You are setting the origin of the text overlay to (1,2) which will put every text character at pixel location (1, 2) in the image, which is pretty much off screen in the upper left corner. The coordinate system of images is x increases to the right, and y increases downward, and the default origin of the text overlay is the lower left corner of the leftmost character.

 

You need to set the origin seperately for every red bounding box.  Since you are already getting the bounding box info for every shape, it's pretty easy to calculate the centerpoint programmatically to set as the origin for the corresponding text overlay.

 

I have attached a modified version of your VI, with a more detailed explanation on the block diagram.

0 Kudos
Message 4 of 5
(3,583 Views)

Hi,

 

The vi is in LV 2012 version. But I have 2011, so I could not open it. Anyway, you have pointed out where the mistake was done. So, as per that I have corrected my code and it is working fine now. Thank you a lot.

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