Extract contour of an image and plot it

3 次查看(过去 30 天)
Hi,
I want to extract the contour from an image and plot the contours assuming the center of the image as the (0,0) coordinate system.
I have attached my image too.
Thanks for your help.
Picture4.png

采纳的回答

Walter Roberson
Walter Roberson 2019-4-26
im = rgb2gray( imread('Picture4.png') );
contour(im,4)
There is an obvious difference between specifying 2 (contour levels) or 3. However, you have to be looking fairly closely to tell the difference between 3 vs 4. You probably will not be able to tell the difference between 4 and 5.
The image appears to be consistent with the possibility that someone converted an image to black and white, and then write the image as jpeg, and then read in the jpeg and wrote it as png. That is, the values that are not 0 (black) or 255 (white) occur only in boundary positions as-if they only existed due to the way DCT handles sharp edges (it blurs them, like anti-aliasing.)
  11 个评论
Image Analyst
Image Analyst 2023-7-29
@Jean-Parfait My demo does not reverse/invert the image intensities. I think you must have changed something. Nonetheless, I've updated a few lines in the demo and the updated code is attached.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by