필터 지우기
필터 지우기

Difference between im2bw and imbinarize?

조회 수: 43 (최근 30일)
HC
HC 2019년 8월 13일
편집: Guillaume 2019년 8월 13일
Hello all,
I know newer versions of MATLAB recommend using imbinarize instead of im2bw. I was wondering if there were any significant differences.
I'm also working on a image processing project and im2bw was used with a sensitivity level of 0.9. Is there an equivalent for imbinarize?
Thanks.

답변 (1개)

Guillaume
Guillaume 2019년 8월 13일
편집: Guillaume 2019년 8월 13일
You can look at the source code of both functions to see the difference in implementation
edit im2bw.m
edit imbinarize.m
In the case of a global threshold for imbinarize, the two are exactly equivalent for images of type 'single', 'double', 'uint8', 'uint16', and 'uint32'. For images of type 'int16' (imbinarize also supports 'int8' and 'int32', im2bw doesn't), the two slightly differ in that im2bw temporarilly offset and convert the image to 'uint16 but the end result is the same.
The meaning of the threshold is the same for both functions, so
im2bw(someimage, 0.9)
can be translated directly into
imbinarize(somimage, 0.9)

Community Treasure Hunt

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

Start Hunting!

Translated by