Home Image-Pro Plus Automation with Macros

Setting a range using LutBinarize instead of allowing BlbCount to automatically threshold

Hi All,

I used code previously where the IpBlbCount code automatically thresholds the image prior to counting objects.  I want to set the range for this and not have that be automatic.  Below is the code I have written, is this correct? Or will the IpBlbCount still be primary and automatically set the range after I have set the range to what I would like to threshold?

ret=IpSCalSelect("Leica_20x")
ret=IpLutBinarize(0,80,1)
ret=IpBlbSetAttr(BLOB_CLEANBORDER,1)
ret=IpBlbCount()
ret=IpBlbUpdate(0)
ret=IpDcUpdate(DC_Fetch)
ret=IpBlbSaveOutline(name_Script)
ret=IpSnap()
ret=IpWsSaveAs(name_Image, "JPG")
ret=IpDocClose()

Thanks,
Jen

Best Answer

  • Answer ✓
    Hi Jen,

    The best way to find our what function to use in Image-Pro Plus macro is to activate macro recording and do the steps you want to execute.
    Here is how the macro looks after recording Count with manual thresholds:

    Sub CountThreshold()
       ret = IpBlbSetAttr(BLOB_AUTORANGE, 0)
       ret = IpBlbSetRange(0, 28)'set intensity range
       ret = IpBlbCount()
       ret = IpBlbUpdate(0)
    End Sub


    Regards,

    Yuri
Sign In or Register to comment.