필터 지우기
필터 지우기

Low contrast image, ablated area extraction

조회 수: 2 (최근 30일)
Hidde Pik
Hidde Pik 2021년 4월 26일
편집: Hidde Pik 2021년 4월 28일
Hi,
With a laser I ablated a certain area from an ink sample. Not the entire layer is ablated. Therefore, the contrast of the hole with the surrounding area is low.
With image processing I would like to determine the area of the ablated hole. This information would be very valuable for my research.
Below you find the script with my attempts to solve this problem. please help.
Kind regards,
Hidde
clear all; close all; clc;
I = imread('400_2_300.jpg');
I = rgb2gray(I);
imh = imadjust(I);
J = medfilt2(imh);
se = strel('disk',25);
thfilter = imtophat(J,se);
adjust = imadjust(thfilter);
bin = im2bw(adjust,0.35);
fill = imfill(bin,'holes')
filt_bin = medfilt2(bin);
fill1 = imfill(filt_bin,'holes');
img_close = imclose(fill1 , strel('disk', 1));
%take complement to adhere to convention
imgbw = imcomplement(fill1) ;
%make bridges across small "leaks"
img_close = imclose(imgbw , strel('disk',5));
%find holes in resulting image
holes = ~img_close & imfill(img_close, 'holes');
%add back holes to original image
img_filled = imfill((imgbw | holes) , 'holes');
%optional additional filling
img_filled_closed = imclose(img_filled, strel('disk', 5)) ;
figure(1), clf(1), hold on
subplot(3,3,1)
imshow(I)
subplot(3,3,2)
imshow(imh)
subplot(3,3,3)
imshow(J)
subplot(3,3,4)
imshow(thfilter)
subplot(3,3,5)
imshow(adjust)
subplot(3,3,6)
imshow(bin)
subplot(3,3,7)
imshow(fill)
subplot(3,3,8)
imshow(fill1)
subplot(3,3,9)
imshow(img_filled_closed)
hold off
  댓글 수: 4
Hidde Pik
Hidde Pik 2021년 4월 26일
Unfortunately the spot is not always in the same place. I am willing to do it manually. It will be some work, since I have 92 images. However cropping takes about 5 seconds to do.
Hidde Pik
Hidde Pik 2021년 4월 28일
편집: Hidde Pik 2021년 4월 28일
@Image AnalystI managed to crop all the images. However I didn't manage to extract the area of the ablated hole. I attached the Binary Image that I end up with. As you can see he still takes a lot of the surrounding as well.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Explore and Edit Images with Image Viewer App에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by