Very Basic Threshold & Edge Detection
10 views (last 30 days)
Show older comments
Hi all, I have a colour image I need to threshold and edge detect. I know this will be quite a simple piece of code however I'm unable to get it working. I was wondering if you could help. Here's what I have so far.
I = imread('p0071.jpeg');
BW = edge(I,'sobel', thresh)
imshow(BW);
This snippet of code doesn't work, and I assume it's because it's in colour and I need to add some thresholding parameters? How do I add these parameters to get this code to work? Sorry for such a simple question but I've been messing around for over an hour with no success.
Paul
2 Comments
Andreas Goser
on 6 Sep 2011
Maybe it is very basic. Maybe not. Without an error message, it remains guess work. Can you provide code that e.g. works with images from the MATLAB instalation like 'pillsetc.png' that give the same behaviour? and please also clarify if you just like the code to run and then play with the threshold or if you look for methods to auto-calculate a good threshold.
Accepted Answer
More Answers (1)
Walter Roberson
on 6 Sep 2011
"thresh" is not a keyword or a function: it is a numeric value that you have to supply if you want to use a different threshold than would be automatically chosen.
2 Comments
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!