Enhancing an RGB image to identify a feature
古いコメントを表示
I have an image which has a faint line that is NOT continuous. I want to find the pixel intensities along the line so that if there is a drop in intensity i can identify it as a break in the line. For example, in the green apparently "uniform" line below, there are supposed to breaks in between. I need to find the pixel intensities along that line to find the break. I tried using the image tool to see the pixel intensities, however, the breaks are too faint to be noticed.
I tried enhancing the image by using imadjust (both in rgb and converting to grayscale then trying imadjust) but it didnt help. Any other methods to enhance the line so that the breaks are visible, or atleast the pixel intensity variations along the line are significant?

Any help is appreciated, thank you!
1 件のコメント
You might be able to work something along these lines
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/843265/image.jpeg';
img = imread(filename);
imshow(img)
imshow(img(:,:,1)); title('r');
imshow(img(:,:,2)); title('g');
imshow(img(:,:,3)); title('b');
lab = rgb2lab(img);
min(lab(:)),max(lab(:))
whos
imshow(lab(:,:,1), []); title('L');
imshow(lab(:,:,2), []); title('a');
imshow(lab(:,:,3), []); title('b');
Notice that 'a' appears to distinguish the line we want in a way that hints we might be able to binarize. But at what values?
imagesc(lab(:,:,2)); colormap(parula); colorbar(); title('a colorizeed');
abin = lab(:,:,2) > 0 & lab(:,:,2) < 14;
imshow(abin); title('a bin')
If you change to < 15 instead of < 14 then a lot more shows up in white, and you can see the line doesn't show up long enough, so somehow the hints from the imshow(, []) do not carry over well to the imagesc(); colormap('parula'). Perhaps using the data cursor on the imshow(lab(:,:,2),[]) would help find a range of values that is more usable.
採用された回答
その他の回答 (1 件)
Image Analyst
2021 年 12 月 24 日
1 投票
Did you try calling improfile(). Have the user draw a line, extract the colors along the line in each color channel, and then plot them.
4 件のコメント
Manas Pratap
2021 年 12 月 25 日
Image Analyst
2021 年 12 月 25 日
編集済み: Image Analyst
2021 年 12 月 25 日
Yes. See and adapt my freehand drawing demo.
Also, is the faint line the mostly vertical one, or the mostly horizontal one, or do you want both? Is the panel always going to be situated at that angle, like it's held in a jig or something? Or is it some lousy handheld cell phone snapshot?
Can you do anything to improve your image capture situation? Usually making a simple change on the image capture situation will make lots of complicated algorithm development for analysis unnecessary.
Have you tried looking at the thing in non-visible light, like infrared or ultraviolet?
Have you tried stdfilt() or imtophat()? How about anisotropic diffusion?
Basically your image is virtually useless because you have horrible JPEG artifacts. Never use JPG when you're planning on doing image analysis. Can you supply a non-corrupted image in PNG format?
Manas Pratap
2021 年 12 月 26 日
Image Analyst
2021 年 12 月 26 日
Then if your image capture person can't (or is unwilling to) do anything to help you solve their problem, I suggest you give them a human-assisted solution like I originally suggested. Have them hand draw the line and then you can do whatever you want with those coordinates.
カテゴリ
ヘルプ センター および File Exchange で Orange についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!










