LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

protecting of ROI region in image control.

Solved!
Go to solution

I am using ROI rectangle on an image.

As you may know well, the ROI can be moved or change the size by clicking and moving the mouse.

But when the user click a point outside ROI, the current ROI will be reset and disappeared from the image control.

 

Is there an idea on how to get the information about the event or property of protecting ROI?

(ROI region itself detects the event of mouse handling.)

I just wanted to keep, move, or translate the current ROI with mouse handling.

 

My application is required to have an input a constant ROI in realtime.

 

labmaster.

0 Kudos
Message 1 of 4
(2,632 Views)

That's a good question and I've had similar issue.

What I ended up doing to prevent clumsy user to modify ROI when they're not supposed to is to lock the him to the pan tool on the image and have a button called "edit ROI" that give him the ROI tool on the image, lock all other UI controls, checks that the ROIs plausible and unlocks "validate new ROI" when the ROI is plausible, when user clicks on "valide new ROI", impose pan tool on the image again.

 

I'm not sure if "protected ROI" is a good idea or not... you can suggest it on the idea exchange (i'd vote for it), there is another thing that would help it's the ability to capture (and discard) ROI change events on image controls, that would help, no?

 


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 4
(2,624 Views)

I expected some solutions for keeping ROI when a user clicks a point unintentionally except around vertex or centeroid of ROI rectangle.

Is there any other idea for holding ROI in any cases including uncareful mouse clicking?

For example, the clicking around vertex +- 10 pixels are currently allowed. Can I extend the width of pixel? 

No default ROI like whole area of image even in invalid ROI?

 

*)The error of "invalid ROI" was happened once due to above and then the image was disposed in stopping.

 In this case, I couldn't redraw ROI with the tool even in programming mode.

 I think this is very serious limitation of using ROI in image control.

 

0 Kudos
Message 3 of 4
(2,619 Views)
Solution
Accepted by topic author labmaster

I just put the extra code for checking whether current ROI is valid or not by counting the array size of global rectangle.

 

Invalid ROI means no size of array or the same position of x1 and x2 (for y, the same.) of rectangle.

I know this is not perfect way to keeping ROI but it's okay to me practically.

 

labmaster

0 Kudos
Message 4 of 4
(2,598 Views)