필터 지우기
필터 지우기

How can I grab the contour lines into a new figure ?

조회 수: 1 (최근 30일)
Uni
Uni 2013년 6월 7일
I am using contour function to get the contour lines from an image. Now I'd pretend to get only the contour lines created before to make a new image.
I am using [C,h]=contour(a,[0 0]); I have C - ContourMatrix and h - handler.
How can I create a new image (only contour lines) with this C and h ??
Thanks in Advance Mike

채택된 답변

Kelly Kearney
Kelly Kearney 2013년 6월 7일
Easiest way: download contourcs, which will parse the C matrix for you.
a = peaks;
C = contourcs(a, [0 0]);
xy = {C.X; C.Y};
plot(xy{:});
  댓글 수: 9
Kelly Kearney
Kelly Kearney 2013년 6월 11일
Oops, forgot that one... imshow also flips the axis. Add 'ydir' to the list of properties to copy.
Uni
Uni 2013년 6월 12일
Many many thanks :D

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Angus
Angus 2013년 6월 7일
Try checking out ContourMatrix.
"ContourMatrix is also a read-only contourgroup property that you can obtain from the returned handle." -- matlab docs
  댓글 수: 1
Uni
Uni 2013년 6월 8일
you mean I should rearrange my C variable from contour function to get the new image ?
thanks

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by