How to Improve Image binarization and segmentation?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jenifer NG
am 14 Mai 2022
Kommentiert: Jenifer NG
am 14 Mai 2022
Dear all,
I am doing image segmentation. But my reseult include some unwated areas.
Could anyone help me to improve it ? or any ideal to remove it
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/997830/image.png)
Thanks
Han
This is my code.
Original_image = rgb2gray(imread('original.jpg'));
[rows, columns] = size(Original_image);
leftHalf = Original_image(:, 1:floor(columns/1.3));
rightHalf = Original_image(:, floor(columns/1.3)+1 : end);
imwrite(leftHalf,'2_.png')
%Pre thresholding
warning off;
x=leftHalf
imshow(x);
title('Original Grayscale Image');
figure;
x=im2double(x);
d=im2bw(x);
imshow(d);
imwrite(d,'2_mask1.png');
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 14 Mai 2022
Use bwareaopen() to throw out blobs less than a certain number of pixels, for example
d = bwareaopen(d, 25); % Keep blobs only 25 pixels or larger.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!