How to get segmentation ranges?

(Originally posted by Geeda on 5/23/2006)


I am using histogram-based HSI segmentation for my counting macro and need a way to get the thresholds set by the user. Instead of setting the ranges, as in IpSetSetRange(nChannel,FromVal,ToVal), I need a getter. Any suggestions as to how I may do this?

Thank-you in advance for your time.


  • edited June 2013

    (Originally posted by KevinR on 5/24/2006)

    Use Count/Size to find the objects, then:

    ' Requires that Count/Size be run with whatever segmentation ranges have been chosen
    ' If HSI segmentation is used, the values returned will be HSI limits.
    Sub GetSegmentation()
     Dim Range(10) As Single
     Dim i As Integer

     ' Second param unused, 3rd is channel
     ret = IpBlbGet(GETRANGE, 0, 0, Range(0)) ' Red
     Debug.Print Range(0); Range(1)

     ret = IpBlbGet(GETRANGE, 0, 1, Range(0)) ' Green
     Debug.Print Range(0); Range(1)

     ret = IpBlbGet(GETRANGE, 0, 2, Range(0)) ' Blue
     Debug.Print Range(0); Range(1)

    End Sub


Sign In or Register to comment.