LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1st: ROI, 2nd: Other ROI, 3rd calibrate?

Greetings folks,

 

I am trying to find for a solution to the following problem that I encountered when making a crop of one image, and then making a second crop to the same image in the front panel using ROI from a property node of the image to be cropped.

 

The problem is after I make this first crop, the second crop i make is wrongly placed and not where i made the crop. I think this is because after making the first crop, the cropped image has a new 0,0 pixel coordinate of reference, and when making a second crop it will take this new 0,0 reference value rather than the original image. If this were to be like this, what solutions can be done to account for the second crop to be in place as it is done in the actual image?

 

Here I attach the Problem in a .png picture (reference to the wrong ROIs) and 2nd the .vi program for which the crops are being made.

 

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

Am I clear in my explanation? Or do I need to express myself differently to be understood?

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

First, you are seriously abusing local variables in that VI.  For some, you are using local variables when the terminal sits outside the loop unused.  For others, you are reading a local variable of an indicator which is set inside another part of the loop.  You definitely have a race condition there where you have no idea if a new value or old value of the indicator is being used.

 

As such, it is impossible to figure out what you are doing.

 

But to solve your problem, it seems like you might need to use the coordinates of the corner of the ROI for your first crop, and either add or subtract them from the coordinates of your ROI of your second crop so it compensates for the coordinate system shifting as a result of the first crop.

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

Solved...

This is how I did solve the problem I had:

Display an image in the front panel. From this image displayed obtain property node: ROI > Input this in the vision assisant. The processed image, obtain a display of this image. And create a second property node ROI from this processed image. Solution: Calibration of consecutive ROIs of the same image.

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