I am trying to find the function of the contour line of a grayscale image, but I can't seem to get it to work, anybody know what im doing wrong?

1 visualizzazione (ultimi 30 giorni)
So basically I have a grayscale image, which has been blurred to smooth out the intensities in the image. What I need to do is get the function of the contour line for the grayscale image for an intensity of 60. I think contourc is supposed to help me get the points, however I either don't understand it properly, or am doing something wrong. My grayscale image is "gray".
My code is essentially this:
d=contourc(gray,[60 60]);
I thought this would return a two row matrix of all the points/pixels of the contour line. However i get an error "Error using contourc Input arguments for contourc must be of type 'double'."
Anybody know what I am doing wrong? Have I completely misunderstood the use of this function?

Risposta accettata

Star Strider
Star Strider il 19 Mag 2017
Try this:
d=contourc(double(gray),[60 60]);

Più risposte (0)

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by