mmdpotatoes - Grade potato quality by shape and skin spots.
-
Description
- The input image is a gray-scale image of several washed potatoes. The shape of the potatoes is analysed using skeleton feature and the skin spots are detected. These two features can be used to evaluate their visual quality.
Reading
The input image is read.
Thresholding
Convert to binary objects by thresholding
b = mmthreshad(a,90);
Warning: Converting image from scalar to uint8.
mmshow(b);
|
| (b) |
|
|
Skeleton of the potato shapes
The binary image is thinned and the result overlayed on the original image
Closing tophat
To detect the skin spots, a closing tophat can enhance the dark areas of the image
Thresholding and masking
The tophat is thresholded and the result is masked with the binary image of the potatoes as we are interested only on the spots inside them
Final display
Show both results: skeleton and skin spots overlayed on the original image