Matlab image intensity level adjustment
3 ビュー (過去 30 日間)
古いコメントを表示
I have a specific question to ask about the intensity adjustment for image processing. I need high constraint value to find small gaps in the image. I used a manual threshold value 0.99 to convert the grayscale image. However, as the illumination on the surface did not distribute evenly, some parts of the image is lost. I used adaptive method, however, the results is similar to a global threshold. Orignial picture:
Red point as intereted area:

Detail in Binary Image:

I0 = imread('1_2.jpg');
[R,C,K] = size(I0);
if K==1
I1 = I0;
else
I1 = rgb2gray(I0);
end
%Adjsut image to get a standar binary picture
%Adjust image intensity value
I1 = imadjust(I1,[0.1 0.7],[]);
BW0 = im2bw(I1,0.99);
figure;
BW0 = bwareaopen(BW0,10000);
%Fill non_crack hole error
BW0 = bwareaopen(1-BW0,500);
BW0 = 1-BW0;
imshow(BW0);
After this process, only half of the image will be left. I want a whole image with local intensity threshold which can show the same feature as the high-level threshold. What can I do?
Thanks
0 件のコメント
回答 (1 件)
Image Analyst
2017 年 4 月 29 日
You need to do a background correction to get rid of any lens shading. I attach a demo.
6 件のコメント
Image Analyst
2017 年 4 月 30 日
Why not use a template - a reference image. Take a perfect version and get the perfect binary image. Then take your test image, call imregister() to align it, then binarize and subtract. Any defects will be super bright.
参考
カテゴリ
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!


