MATLAB Answers

how can i use clarity factor with gaussian kernel in image processing

조회 수: 11(최근 30일)
chang hoon oh
chang hoon oh 2021년 9월 16일
댓글: Image Analyst 2021년 9월 23일 14:46
i apply the gaussian gradient kernel to image for bubble detection
after that i trying to find the clarity of image and remove out of focused bubble. like this article
at the part 3.2.
but i can't find the code for clarity in matlab. so i use the binarize fuction and threshold but it didn't work perfectly so i want to find how i can use
clarity of the image
can anyone help me?
this is my cord
C=imread('30130170023.jpg');
C2=imread('back.jpg');
C1=C2-C;
C3 = imcomplement(C1);
[gx,gy]=gaussgradient(C1,2.0);
[gx1,gy1]=gaussgradient(C3,2.0);
M=abs(gx)+abs(gy);
M1=abs(gx1)+abs(gy1);
MU=M+M1;
Bi=imbinarize(MU,0.3);
BWdfill = imfill(Bi,'holes');
% imshow(MU);
si=imread('sisi.jpg');
si=si(:,:,1:3);
si=im2gray(si);
si=imbinarize(si);
BWdfill=BWdfill-si;
BWdfill=imcrop(BWdfill,[299 0 687 796]);
% imshow(BWdfill);
se = strel('disk',2);
ie = imerode(BWdfill,se);
ie = imerode(ie,se);
ie = imerode(ie,se);
% ie = imerode(ie,se);
% ie = imerode(ie,se);
id =imdilate(ie,se);
id =imdilate(id,se);
id =imdilate(id,se);
% id =imdilate(id,se);
% id =imdilate(id,se);
imshow(id);
[centers,radii] = imfindcircles(id,[3 80],'ObjectPolarity','bright','Sensitivity',0.85);
viscircles(centers, radii,'Color','b');

채택된 답변

Image Analyst
Image Analyst 2021년 9월 18일 16:51
Looks like they define clarity as the max of the gradient in each floc blob:
"The maximum value of Ig associated with each floc i is a
quantitative measure of how close to the plane of focus a given
floc is, and this value is defined here as the ‘‘clarity value’’ a
a(i) = max(Ig(ROI(i))
A threshold......"
  댓글 수: 2
Image Analyst
Image Analyst 2021년 9월 23일 14:46
It's possible expecially if the bubble had a smooth exterior boundary and is smooth inside. I'd try adjusting parameters like the window side and threshold level.

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

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by