Home Image-Pro Automation (Macros, Apps, Reports)

Trying to use Aoi.GetFeatureBoundingBox() function. How do I acquire the bounding box object?

I need the LT, RB coordinates.

Best Answers

  • Answer ✓
    Here is the code for accessing the bounds of the first ROI feature.

        Sub PrintBoundingBox
            Dim l,r,t,b As Single
            ThisApplication.ActiveImage.Aoi.GetFeatureBoundingBox(0,l,t,r,b)
            Debug.Print(l)
        End Sub
  • Answer ✓

    rdbunn said:
    The question is, is there a method GetBoundingBox function for use with McMMSubFeature? You can acquire the BB width and height and centroid X/Y. I did not see a BB feature in eMeasures as in GetBounding Box. I have used the centroid tool but this biases the overlay depending on symmetry of the detected area.
    Rod, there is an McMMSubFeature.GetBoundingBox function which does what you want, it shouldn't be difficult to modify Yuri's code to use that.

Answers

  • I had tried this earlier but I am receiving a "Selected index out of range" at run time and I have a count/size detected region on the image and only one.
  • When using an ROI, this will return the ROI coordinates. I need the BoundingBox coordinates of the of the Count/Size detected region. The reason I was seening index out of range was that the ROI was deleted at the time I thought I was grabbing the coordinates of the Count/Size detected region.  I am looking for the latter and not the former.

  • The question is, is there a method GetBoundingBox function for use with McMMSubFeature? You can acquire the BB width and height and centroid X/Y. I did not see a BB feature in eMeasures as in GetBounding Box. I have used the centroid tool but this biases the overlay depending on symmetry of the detected area.
  • What does RgnBoxXY return?
  • For review, I would like to draw a line across the detected area that represents either the BB width or height constrained to the axis of the BB. I may want to position the line at the centroid of the detected area as well.
  • Will take a look. Thanks!
Sign In or Register to comment.