getExactBounds (get exact boundary)

バージョン 2.0 (5.75 KB) 作成者: Jiexian Ma
Obtain the exact polygonal boundaries of objects and holes in a binary image.
ダウンロード: 96
更新 2020/5/23

ライセンスの表示

getExactBounds returns the coordinates of corners on image boundaries, while Matlab function bwboundaries() is only able to obtain the coordinates of boundary pixel locations.

getExactBounds is used by my other program - im2mesh (2D image to triangular meshes).

You can start with demo.m in the folder.

If you have any questions or suggestions, feel free to send me an email.
mjx0799@gmail.com, May 2020.

Note:
There're huge differences between function bwboundaries and getExactBounds.
The output of bwboundaries and getExactBounds may have different lengths.

1. bwboundaries(BW,connectivity,options)
Return row (y) and column (x) coordinates of boundary pixel locations.
Only inner boundaries are obtained.
Parameter connectivity is very important for function bwboundaries.
According to bwboundaries.m in Matlab,
if connectivity = 4, objects are 4 connected and holes are 8 connected;
if connectivity = 8, objects are 8 connected and holes are 4 connected.
This is to avoid topological errors.

2. getExactBounds( bw )
Return column (x) and row (y) coordinates of the corners on boundaries of objects and holes.
However, function getExactBounds don't have the connectivity parameter.
Both objects and holes are 4 connected, since outputs are exact boundary.

引用

Jiexian Ma (2024). getExactBounds (get exact boundary) (https://www.mathworks.com/matlabcentral/fileexchange/72436-getexactbounds-get-exact-boundary), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2018a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersImage Filtering and Enhancement についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
2.0

rewrite the whole function

1.0.1

revise

1.0.0