60
CHAPTER 8. COIN COUNTER
clean image free of extraneous features, and the morphological operations “re-
move small objects” and “fill holes” available under the
Advanced Morphology
step work well for this purpose. The
Threshold
step offers a wide variety of
auto-thresholding operations to separate the foreground coin objects from the
background, and the auto-thresholding feature allows the thresholding step to
work reliably under changing lighting conditions.
You will find it convenient to set up your coin class diameter thresholds
as constants in the
(qsm) initialize
state based on real-world units such as
millimeters instead of pixels. Calibrate the image using the general technique
that you developed for the
Coin Caliper II
application (Chapter 7 on page 45),
e.g., image a coin of known diameter to recalculate the calibration scale factor
with an action button. As of this writing the
Circle Detector
step only provides
measurements in pixels, therefore you may omit the
Image Calibration
step and
simply use
Clamp Rake
to measure the diameter in pixels for a single selected
coin; for this reason remember to select the “ROI Descriptor” control and the
“Distance” indicator when you import the script into LabVIEW. Once you have
filled the FOV with coins you need to be able to draw an ROI around a single
coin instead of physically removing all but one coin.
Study these short video tutorials to learn how to use each of the recom-
mended NI Vision Assistant steps for this project:
•
Circle Detector
–
– learn how to configure the
range of acceptable radii and how to export measurements to an Excel file
for further analysis,
•
Advanced Morphology
– learn how configure the various operations such
as “remove small objects” (
•
Threshold
– learn how to manually thresh-
old an image or select from a variety of auto-thresholding routines.
•
Measure Width with “Clamp (Rake)”
– learn how to measure the diam-
eter of a single coin within the ROI.
(1:47)
(1:09)
(1:35)
(3:08)
(2:18)
Summary of Contents for NI myRIO
Page 1: ...Ed Doering NI myRIO Vision Essentials Guide...
Page 2: ......
Page 11: ...Part I Machine Vision Fundamentals...
Page 12: ......
Page 31: ...Part II Introductory Machine Vision Projects...
Page 32: ......
Page 38: ...32 CHAPTER 4 CAMERA SETUP...
Page 44: ...38 CHAPTER 5 STEREO VISION...
Page 61: ...Part III Machine Vision Application Projects...
Page 62: ......
Page 72: ...66 CHAPTER 8 COIN COUNTER...
Page 86: ...80 CHAPTER 10 KEYED OPTICAL LOCK...
Page 92: ...86 CHAPTER 11 DMM TEST STAND...
Page 134: ...128 CHAPTER 17 MARBLE SORTER...
Page 135: ...Part IV Appendices...
Page 136: ......
Page 143: ...B MXPandMSPConnectorDiagrams Figure B 1 MXP myRIO eXpansion Port connector diagram...
Page 144: ...138 APPENDIX B MXP AND MSP CONNECTOR DIAGRAMS Figure B 2 MSP miniSystem Port connector diagram...
Page 148: ...142 APPENDIX D BUILD A STAND ALONE APPLICATION...
Page 149: ...E MarbleSorterConstructionDetails To be continued...
Page 150: ...144 APPENDIX E MARBLE SORTER CONSTRUCTION DETAILS...