필터 지우기
필터 지우기

Hi, I have a matlab model that works for the given image. It basically finds the circle within the image and calculates the diameter and area.

조회 수: 2 (최근 30일)
Hi, I have a matlab model that works for the given image. It basically finds the circle within the image and calculates the diameter and area. However I want this model to work with another type of image in terms of coloring.
The original image the image type that model works with.
The new image is the image type that I want this model to work with.
Thank you
i
  댓글 수: 1
Image Analyst
Image Analyst 2022년 5월 24일
So the circle can be either brighter or darker than the background? Do you have yet a binarization scheme that will give a rough segmentation of the circle disconnected from its background?

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

답변 (1개)

prabhat kumar sharma
prabhat kumar sharma 2024년 1월 17일
Hi Burcu,
I understand that you're encountering issues with adapting your model to process images that have a different colour scheme. Whenever you adapt our model to work with images of different types, particularly those with varying colour schemes, making adjustments to the preprocessing steps and techniques is often necessary.
I suggest the following steps:
1. Image Conversion:
Both type of images can be converted first to grayscale for thresholding.
grayImage = rgb2gray(newImage);
2. Binarization: Image segmentation to segment out circle from the background would be really helpful. If the circle is brighter than the background, you can use a global thresholding method like Otsu's method, or if the contrast varies, you might need an adaptive thresholding method:
% Global thresholding using Otsu's method
thresholdValue = graythresh(grayImage);
binaryImage = imbinarize(grayImage, thresholdValue);
% Adaptive thresholding
binaryImage = imbinarize(grayImage, 'adaptive', 'ForegroundPolarity', 'bright', 'Sensitivity', 0.5);
3 .Morphological Operations:
se = strel('disk', 2); % You can adjust the size and shape according to your requirements.
binaryImage = imopen(binaryImage, se);
If there are small artifacts or noise in the binarized image, you can use morphological operations like imdilate, imerode, imopen, or imclose to clean up the binary image:
It's important to visually inspect the intermediate results of each processing step to ensure that the circle is being accurately segmented from the background.
I hope it helps!

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by