필터 지우기
필터 지우기

How to detect contents of a beaker in an image

조회 수: 3 (최근 30일)
MM
MM 2022년 11월 29일
댓글: MM 2023년 2월 9일
I have an image of a beaker in which I want to automatically detect the contents of the beaker. I cannot use the intensity for this because sometimes the intensity of the beaker content is the same as the one in the walls. Also the the length and height of the beaker content is not always the same. Is there a method that I can use to create a mask for just the beaker content without having to do it manually?
  댓글 수: 8
Image Analyst
Image Analyst 2023년 2월 7일
Attach the original image, not a screenshot with tick marks, tick labels, and other stuff. We want just the bare image. Not a figure or .fig file, just the original .tiff, .jpg, or .PNG file.
MM
MM 2023년 2월 9일
Attached you can find three ".mat files" containing the data matrix needed to make the bare figure. Each file has a different situation in which either the volume is different or the content of the beaker has different intensities. I will also try out DGMs suggestion which looks promising.

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

답변 (2개)

DGM
DGM 2023년 2월 7일
Here's an initial attempt. How well this works really depends on how vague the gap between the blobs can be. As Walter mentions, if there are images other than screenshots, that would probably help too.
% read the images
A = imread('bk1.png');
B = imread('bk2.png');
imshow(generatemask(A))
imshow(generatemask(B))
function mk = generatemask(inpict)
% try to make things less sensitive to value
inpict = imadjust(inpict);
% binarize (idk how well this will work across all images)
mk = imbinarize(inpict,'adaptive','sensitivity',0.7);
% clean up the mask
mk = imopen(mk,ones(5)); % try to break any small bridges
mk = imfill(mk,'holes'); % fill any holes
mk = bwareaopen(mk,10E3); % get rid of small blobs
mk = bwpropfilt(mk,'extent',[0.85 1]); % keep blobs which are roughly grid-aligned rectangles
mk = bwareafilt(mk,1); % keep the largest remaining blob
end
As to how to apply watershed segmentation to this problem, I'm not the one to ask, but if it's a particularly good use-case, I'd like to see an example applied to this specific problem.

Mandar
Mandar 2023년 2월 6일
편집: Mandar 2023년 2월 6일
Looking at the image, the watershed-based segmentation approach could be a good starting point to segment out the content in the bicker. Refer the following MATLAB documentation link to know more about watershed segmentation.

카테고리

Help CenterFile Exchange에서 Get Started with Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by