フィルターのクリア

Can I threshold this further if so how?

1 回表示 (過去 30 日間)
Oliver Mashari
Oliver Mashari 2018 年 3 月 11 日
回答済み: Prajit T R 2018 年 3 月 14 日
Hi I have this image:
is there anyway I could process this further so that I am only left with an image with only parts like this:
I have used this code to produce this so far:
I = imread('Scan4Loc1.png');
A = rgb2gray(I)
imshow(A)
J = filter2(fspecial('sobel'),A);
min_matrix = min(J(:))
max_matrix = max(J(:))
figure
imshow(J)
K = mat2gray(J);
min_image = min(K(:))
max_image = max(K(:))
figure
imshow(K)

回答 (1 件)

Prajit T R
Prajit T R 2018 年 3 月 14 日
Hi Oliver. I think the im2bw function may be of help to you. I tried the following code with the image you had attached and it seems to be working fine. Of course, depending upon your use-case, you would have to manually try different values for the variable 'level' until you get it right. The value 0.515 seems to be appropriate for this particular image.
I = imread('image.png');
level=0.515
A = rgb2gray(I)
imshow(A)
BW = im2bw(I, level)
figure
imshow(BW)
Cheers

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by