08-19-2013 04:15 AM
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.
08-19-2013 04:57 AM
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.
08-19-2013 08:15 AM
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.
08-19-2013 02:16 PM
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.
08-20-2013 06:51 AM
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.