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.

0
Best 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
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions