How to Enter Rational Threshold Value
1 view (last 30 days)
Show older comments
Hello,
I would like to add rational thresholding value on my code. The related line is as below:
strel('disk',8);
is it possible to make 8 rational value 7.8 or 7.85-7.982 etc.
0 Comments
Answers (2)
Image Analyst
on 25 Feb 2018
No. Why do you even think it would make sense? It essentially says what pixels to consider when doing a morphological operation. How can you consider the pixel a fractional amount? Like in dilation, you look at some pixels and take the max in a window. Let's say the window is a 3x3 window. You look at all 9 pixels and take the max of the 9 pixels. What would you take for the max if your structuring element was 0.7 in the corners instead of 1? If you just want to multiply your window by the image, then you should be using the conv2() function, not a morphological operation that uses a structuring element.
I'm not even sure why you consider that thresholding.
Perhaps you want fspecial() and/or conv2, or imfilter().
0 Comments
Murat Kocaman
on 26 Feb 2018
Edited: Murat Kocaman
on 26 Feb 2018
2 Comments
Image Analyst
on 26 Feb 2018
Since everything looks like it should be in predefined positions, like you're using a jig to position your sample, why don't you just use a template with predefined regions? Just create a binary mask with white where you want the blobs to be and black elsewhere. Or, if you want each number to be in a known location, you can label it by creating a gray scale image where each blob has an integer with its label as the gray level.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!