From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adjust ROI to min/max black edges

Solved!
Go to solution

Hello to all.

First of all thanks a lot for reading this post and being able to help.

 

I would like the next:

 

1- I have an image, for example this:

Resultado de imagen de logo

2- User has to draw a ROI to check the logo:Selección_056.png

My program has already done this.

But now I want the program to adjust the User ROI automatically to min/max black edges like this (red bounding rect):

Selección_057.png

 

So how can adjust the User ROI to min/max black adges detected?

 

Thanks a lot.

 

0 Kudos
Message 1 of 7
(2,915 Views)
You didn't provide full information on how the user ROI has been chosen.
-How you get the detected ROI?
-It should simple with converting the Bounding box rectangle using Rectangle to ROI.
-then you can replace the User ROI with the ROI obtained, you can do overlay or replace the ROI value using Property node of the Image Indicator.
Thanks
uday
0 Kudos
Message 2 of 7
(2,867 Views)

Hello, thanks for replying.

 

Sorry for bad explanation.

 

I detect User Roi with property node of the Image Indicator.

So I would liket to do the next:

1-User draws a ROI (I get this ROI with property node of the Image Indicator) 

2-Inside that ROI program has to detect the min/max black edges(vertically and horizontally).

3-Then replace programatically the ROI that user drew (green ROI in post1) for a new ROI (red ROI in post 1).

 

So my problem is how to detect the min/max black edges that there is inside user ROI (green ROI) in image.

 

Do I explain??

Thanks a lot!

0 Kudos
Message 3 of 7
(2,862 Views)
Solution
Accepted by topic author A.Salcedo
IMAQ Horizontal Max Clamp and Vertical Clamp.
-The other way is threshold and get particle measurements(Bounding Box of the Particle should be enough): https://zone.ni.com/reference/en-XX/help/370281AC-01/nivisionconcepts/particle_measurements/
Thanks
uday
Message 4 of 7
(2,858 Views)

Thanks a lot.

It seems really interesting "partycle measurements" and its bounding box particle.

What is the name of the VI which get that bounding box particle (particle inside a ROI that user draws) ?

 

I check this as well: http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_find_edge/

 

Thanks again

0 Kudos
Message 5 of 7
(2,856 Views)
IMAQ Particle Analysis VI is the one which i am referring to and remember that it works on Binary image only.
-You can use IMAQ Rake 3 to get Horizontal and Vertical Scan Direction and First and last Edge Combination.
-I think you might need to use combination if you want get in this method by getting the straight edge detection technique.
Thanks
uday
0 Kudos
Message 6 of 7
(2,854 Views)

Hello!

Finally I have used max hor/ver clamp.vi.

Those VI work really good for what I wanted to do. I have followed the next steps:

1-Select a ROI User.

2-Get max horizontal/vertical black points inside the ROI User

3-Create a rectangle with those points

 

Thanks a lot.

0 Kudos
Message 7 of 7
(2,842 Views)