Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: problem in contour/contourc
Replies: 1   Last Post: Jan 15, 2012 3:23 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
maniacWaltz

Posts: 16
Registered: 4/10/08
problem in contour/contourc
Posted: Jan 14, 2012 11:08 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi, I want to extract the boundary points of a binary mask using contour/contourc for some application. But there are always some 'odd' points in the output of the function contour/contourc.

Try this codes:

[X,Y]=meshgrid(1:101,1:101);
M=((X-40).^2+(Y-40).^2<400)
a=contourc(M,[0 0])

a =

Columns 1 through 9

0.0000 21.0000 21.0000 21.0000 22.0000 22.0000 22.0000 23.0000 23.0000
157.0000 47.0000 47.0000 48.0000 49.0000 49.0000 50.0000 51.0000 51.0000



You can see the odd point (0, 157) in the first column in this case. The odd point may also appear in other position in other cases. This brings me problem to filter it out. Does anyone here know how to avoid it? Thanks!!



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.