How to generate a bitmap image without using function...Please help

조회 수: 1 (최근 30일)
Sreeda M A
Sreeda M A 2016년 6월 29일
댓글: Sreeda M A 2016년 8월 10일
How can i generate bitmap representation of an image using thresholding?? below code didn't work....
for i=1:r
for j=1:s
thresh=C(i,j)+Di;
if(imean(i,j)>=thresh)
bm(i,j)=1;
else
bm(i,j)=0;
end
end
end
figure
imshow(bm);
  댓글 수: 8
Image Analyst
Image Analyst 2016년 7월 4일
편집: Image Analyst 2016년 7월 4일
I fixed your formatting for you, but please read this.
Also to do a locally adaptive threshold like you did, you can do it vectorized if you just create an m1 (or n1) image with conv2() or imfilter(), then use >=. Let me know if you can't figure it out.
bm =
Sreeda M A
Sreeda M A 2016년 8월 10일
Sorry sir ,but I can't figure it out .

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

답변 (1개)

Walter Roberson
Walter Roberson 2016년 6월 29일
thresh = C + Di;
bm = imean >= thresh;
No loop required.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by