How to calculate chain code and how to get the boundary as an np-by-2 array (it's required for the chain code)?

1 次查看(过去 30 天)
I am trying to determine chain code for an image. I have tried Freeman chain code ( http://www.mathworks.com/matlabcentral/fileexchange/29518-freeman-chain-code) and also a code from Gonzalez book. I have two problems.
1. For the chain code, how do i get the boundary as np-by-2 array from my image?
2. In the code grom Gonzalez book, i see this error, "the input curve is broken... ... ..."
Any help would be appreciated. Thanx

回答(1 个)

Image Analyst
Image Analyst 2013-4-3
Why not use bwboundaries() to get an ordered list of the boundary coordinates. If you really need the chain code, you could get it from the list of x,y boundary coordinates.

类别

Help CenterFile Exchange 中查找有关 Display and Exploration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by