Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
Sreeda M A
Sreeda M A am 29 Jun. 2016
Kommentiert: Sreeda M A am 10 Aug. 2016
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 Kommentare
Image Analyst
Image Analyst am 4 Jul. 2016
Bearbeitet: Image Analyst am 4 Jul. 2016
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 am 10 Aug. 2016
Sorry sir ,but I can't figure it out .

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 29 Jun. 2016
thresh = C + Di;
bm = imean >= thresh;
No loop required.

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by