Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

User defined ROI coordinates

Hello, 

 

I'm performing some initial testing ahead of a larger OCR project and am looking into how to allow the user to insert coordinates for a ROI, assuming that the user already knows the coordinates ahead of time. These coordinates will then define the ROI on the displayed image and following this, OCR will be carried out and the output string shown. 

 

I have a working model however due to my low level of experience with LV, I have perhaps missed some key function and have been struggling to recreate something already built in. 

 

Desired behaviour is to have the vi create an OCR session and an IMAQ image read, then depending on whether the user (Currently using a switch to control the 2 states) wants to manually enter the coordinates for the ROI or use the image viewer to draw the shape, selects an ROI and then allows OCR to be applied. 

I've tried a number of ways using variables and grouping those into an array (you can see this in block_1.png) , then into a cluster, but I'm getting compatibility issues where IMAQ is expecting a specific type "rectangle" which is what I'm trying to replicate so I can get full control of top, bottom, left, right and rotation control. 

The second way where the user simply draws the shape on works fine as far as I can see.

 

This is all being done in LV2013 with NI Vision13 and IMAQ4.8

 

So, in summary;

- Apart from my novice mistakes (I know there are many) what am I missing?

- Is there a cleaner way to allow both coordinates and drawn ROIs to be used?

-The method I've used to gray out the coordinate section, is there a cleaner way of implementing this?

 

Many thanks to you all

0 Kudos
Message 1 of 4
(1,923 Views)

I only had time to look at correctly building the rectangle cluster- no array operations needed.

Hope this helps, I did not test run it. Saved it for previous to 2013.

Cheers

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 2 of 4
(1,888 Views)

Fantastic, that's been bugging me for hours. 

Thank you!

 

Would you also happen to know of how to clear the ROI from the image? Currently I have it setup using the IMAQ Clear Overlay, but it only works to clear the ROI that has been setup by specifying the coordinates, not the one that the user is able to draw themselves directly on the screen. 

Otherwise there could be some confusion if both of them are visible on the image at the same time. 

Effectively I'm hoping to achieve the same effect you can get by right clicking on the image and selecting "Clear ROI", but I'm hoping to have it happen automatically as soon as you flip the switch from manual to drawing mode and the same in reverse. 

 

Cheers

0 Kudos
Message 3 of 4
(1,862 Views)

Fantastic, that's been bugging me for hours. 

Thank you!

 

Would you also happen to know of how to clear the ROI from the image? Currently I have it setup using the IMAQ Clear Overlay, but it only works to clear the ROI that has been setup by specifying the coordinates, not the one that the user is able to draw themselves directly on the screen. 

Otherwise there could be some confusion if both of them are visible on the image at the same time. 

Effectively I'm hoping to achieve the same effect you can get by right clicking on the image and selecting "Clear ROI", but I'm hoping to have it happen automatically as soon as you flip the switch from manual to drawing mode and the same in reverse. 

 

Cheers

0 Kudos
Message 4 of 4
(1,867 Views)