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

Switching Auto_threshold for bright to dark objects

I recorded a macro where i clicked on the auto threshold for bright objects.I also recorded a macro where I manually changed threshold level setting. When i looked at the code for both macros they looked identical?. I want to change a lengthy macro where rather than identifying bright obejcts automatically I extract the dark object automatically. How can I do this without having to re-record the process. Code (partly)  and design attached.

Best Answer

  • Options
    edited January 2015 Answer ✓
    From your macro I see that you used manual threshold, not Auto. If you want to change it you just need to change numbers in the Threshold classes line:

    .Classes.Add(New SegmentationClass("Class 1",System.Drawing.Color.Blue,New Double(){237R,255R}))

    These numbers can be also changed in the Designer view, using the properties dialog.


    If you want to use "Auto Bright" threshold, then you should change the AutoFindPhase of the Segmentation of Measurement Options command. The screenshot below shows how to do it in the Designer view.

    Regards,

    Yuri


Sign In or Register to comment.