hiii....I want to separate the portion from the image(I attached image below). Plz help me in separating that portion

In one image diseased portion is there and other image the boundary is detected. My problem is how to extract only the diseased portion from the boundary image.

Réponses (1)

There is nothing in MATLAB to do that (dental caries segmentation) at a high level. You'll have to build it up from lower level functions. Look to the published image analysis or dental literature for algorithms that you can code up.

4 commentaires

Okay. Now tell me one thing. I have calculated the area by using regionprops instruction. in that I want the portion to be displayed which has maximum area. How can I do that? my code is written here.
clc;
clear all;
close all;
imtool close all;
workspace;
%% Read input image
[I,pathname] = uigetfile('*.jpg','Select an input');
str = strcat(pathname, I);
A = imread(str);
A = rgb2gray(A);
figure, imshow(A); title('Original grayscale Image');
%% Thresholding operation based on given range
A1 = Thresholding(A);
figure, imshow(A1); title('thresholded image');
%% Segmentation using connected component labeling
A1 = uint8(A1);
A2 = immultiply(A,A1);
figure, imshow(A2,[]); title('Multiplied Image');
A3 = A2;
A2 = logical(A2);
cc = bwconncomp(A2, 8);
n = cc.NumObjects;
Area = zeros(n,1);
Perimeter = zeros(n,1);
%% Feature Extraction
k = regionprops(A2,'Area', 'Perimeter', 'MajorAxis', 'MinorAxis');
for i = 1:n
Area(i) = k(i).Area;
Perimeter(i) = k(i).Perimeter;
end
%% Feature Storage
graindata(1,1) = mean(Area);
graindata(2,1) = mean(Perimeter);
%% Boundary Detection using Canny Operator
BW = edge(A3, 'canny',0.3);
figure, imshow(BW); title('Boundary of the multiplied Image');
-----------------------------------------------------------------
%function thresholding used in main program
function im = Thresholding(A)
[r,c] = size(A);
im = zeros(r,c);
for i = 1:r
for j = 1:c;
if A(i,j)>45 & A(i,j)<100
im(i,j) = 1;
end
end
end
im = bwareaopen(im,5);
im = imfill(im, 'holes');
labeledImage = bwlabel(A2);
props = regionsprop(labeledImage, 'Area', 'Perimeter', 'MajorAxis', 'MinorAxis');
allAreas = [k.Area];
[maxArea, indexOfMax] = max(allAreas);
binaryImageMaxOnly = ismember(labeledImage, indexOfMax) > 0;
Or, a lot more simply if you have a recent version of MATLAB:
binaryImageMaxOnly = bwareafilt(A2);
Then can you please "Accept this answer"?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by