How to threshold in this.?

clear all;
clc;
I = imread('2.png');
threshold = graythresh(I);
originalImage = im2bw(I, threshold);
i = bwareaopen(originalImage,70);
TI = imfill(i, 'holes');
imshow(TI)
I want to detect only the strip which is on object.?
This code not works.
Is there any other method or modification..?

댓글 수: 2

Image Analyst
Image Analyst 2013년 2월 16일
I wasn't able to download your image. It saves it but it doesn't save it as a real PNG image even though the extension is PNG.
Lalit Patil
Lalit Patil 2013년 2월 16일
i have changed link..

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

 채택된 답변

Image Analyst
Image Analyst 2013년 2월 16일
편집: Image Analyst 2013년 2월 16일

1 개 추천

Don't use graythresh(). Pick your own threshold, perhaps using my interactive thresholding function http://www.mathworks.com/matlabcentral/fileexchange/29372-thresholding-an-image that's in my File Exchange.

댓글 수: 3

Lalit Patil
Lalit Patil 2013년 2월 16일
yes it, works at min=88 and max=233,
but i want code for this..
binaryImage = grayImage >= 88 & grayImage <=233;
Lalit Patil
Lalit Patil 2013년 2월 18일
Very helpful Demo...:) It Solves many problems...

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by