Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

move center of ROI to centroid

Hi,

as mentioned in the title, how do I move the center of ROI (rectangle) to the centroid location found within the ROI?

thx again
0 Kudos
Message 1 of 7
(6,295 Views)
I'm still very new to Machine Vision myself, so take this with a grain of salt. I think that if you have found the center of the centroid you can define the rectange that you would like (based on the center point +/- where the edge should be). Then use the IMAQ Convert Rectangle to ROI.vi to create an ROI at the desired location.

Is this what you are asking for?

Thanks,
Bob Young
0 Kudos
Message 2 of 7
(6,287 Views)
Hi Bob Young,

thx for your help.

I have created a ROI initially and I will find the centroid within the rectangle. Then I want to move the center of rectangle to the centroid inside the ROI. I wish to make translation instead of erasing the ROI and create a new one in the next video frame. Do you have any idea?

thx for your consideration again.

jacky
0 Kudos
Message 3 of 7
(6,278 Views)
Jacky,

Unfortunately, there is no way to move the ROI without redrawing it between frames. The previous suggestion involving the use of IMAQ Convert Rectangle to ROI is the best option for you. The top, left, width, and height parameters for the rectangle can be determined based on relative positions with respect to the center of the rectangle.

Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 4 of 7
(6,259 Views)
icic

Actually I'm currently trying to use Imaq TransformROI to move the ROI. I'm doubting if it is working. I will let u know if it works well..Otherwise I will erase and redraw as suggested before.

Really appreciate..

jacky
0 Kudos
Message 5 of 7
(6,256 Views)
hi, im bharath..i have a rectangular image with a black circle in a white background.how to obtain the centroid of the black figure alone..i tried image maskin but it is not workin out..pls pls help..
0 Kudos
Message 6 of 7
(5,914 Views)
Try the attached.  You can change the parameters of the ROI using the ROI property.  This is in LV8.5


Message Edited by rpursley8 on 06-03-2008 09:32 AM
Randall Pursley
Download All
Message 7 of 7
(5,898 Views)