Can I threshold this further if so how?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi I have this image:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171170/image.png)
is there anyway I could process this further so that I am only left with an image with only parts like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171171/image.png)
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)
0 件のコメント
回答 (1 件)
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!