how can convert image to binary image without threshold matlab ?

how can convert image to binary image without threshold matlab ?

1 件のコメント

Walter Roberson
Walter Roberson 2013 年 11 月 12 日
Under what conditions do you want 0 to be generated, and what conditions for 1 ?

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2013 年 11 月 12 日

0 投票

binaryImage = logical(yourImage);
yourImage must be an integer (of any type), single, or double array of only 0's and 1's. Any other values (other than 0 or 1) will involve thresholding to make them true or false.

5 件のコメント

engineer 01
engineer 01 2013 年 11 月 13 日
it didn't work.. how can i use binaryImage = logical(yourImage) ? Please, Can you write exact code ?
Image Analyst
Image Analyst 2013 年 11 月 13 日
That IS my exact code...and it works. Yours is the code that doesn't work according to your own statement, so doesn't it make sense that it should be you that posts the code that doesn't work?
engineer 01
engineer 01 2013 年 11 月 13 日
thank you so much, but when i write
I = imread('d:\\photo.jpg'); binaryImage = logical(I); imshow(binaryimage);
then give an error
Image Analyst
Image Analyst 2013 年 11 月 13 日
Well, what is the error?
Anyway, if you read my answer you'd see that it is valid only for images comprised of only 1's and 0's. You probably don't have that. You cannot convert your image into a binary image without thresholding.
Sean de Wolski
Sean de Wolski 2013 年 11 月 13 日
Well it's basically an "anything but 0" threshold :)

サインインしてコメントする。

タグ

質問済み:

2013 年 11 月 12 日

コメント済み:

2013 年 11 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by