필터 지우기
필터 지우기

im2bw finding an alternative

조회 수: 4 (최근 30일)
Lisa Kaatz
Lisa Kaatz 2017년 9월 26일
답변: Image Analyst 2017년 9월 29일
Hey everybody, I try to find an alternative to im2bw(x,y).
Here's the code excerpt:
A1 = imread('filename.png'); A2 = im2bw(A1,0.5); %Make BW matrix (0=black, 1=white)
thanks for helping
  댓글 수: 1
Geoff Hayes
Geoff Hayes 2017년 9월 26일
Lisa - are you looking for an alternative because you don't have access to this function? I don't think it would be that difficult to come up with your own implementation of this function.

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

답변 (2개)

Eeshan Mitra
Eeshan Mitra 2017년 9월 29일
If you do not have access to the Image Processing Toolbox as Geoff commented, you can manually threshold, as described in the following post:

Image Analyst
Image Analyst 2017년 9월 29일
To threshold at a level of one half, try this:
level = intmax(class(A1)) / 2;
BW = A1 > level; % Or can use < instead to get dark things.

카테고리

Help CenterFile Exchange에서 Get Started with Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by