Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Break larger ROI into subsections

I am working on the state machine like you suggested, currently I am trying to just make a boolean cluster of all selected/deselected rois, then I will use a for loop to find the centroid in each roi. I have yet to relate the subarray of rois to the original image to find the 'true' coordinates of the indexed roi.

 

I will post some code soon.

0 Kudos
Message 21 of 23
(953 Views)

I am having trouble with state machines as well as the centroid finding. Using the build_subimages .vi as a template, the value of the centroids are the same in all case since each sub roi is a new image. Is there a way to find the global centroids then send them to the array?

0 Kudos
Message 22 of 23
(942 Views)

Hi dbrittain,

 

I've also used the build_subimages VI as a template. Take a look at the attached VI. If you want to continue with the method started in build_subimages, one way to accomplish your goal would be to create a 2D array that contains the coordinates for each subimage. I did this by creating a cluster containing each array of points (top, left, bottom, right), then letting the for loops in the "generate subs" event create a 2D array of these clusters so each would correspond to the correct subimage. Then, in the mouse down event, the actual coordinates of the sub image can be used with the location of the centroid in each subimage to find the actual centroid location and build an array containing all the chosen centroids. Notice the indicator for the array of selected centroids is located below the two image indicators on the front panel. I hope you can use this as an example and keep moving forward with your project.

 

Best,

 

 

Matt J - NI Tools Network
0 Kudos
Message 23 of 23
(930 Views)