How to remove the extra unwanted white pixels from an image.
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
kanika bhalla
le 26 Juin 2021
Réponse apportée : kanika bhalla
le 26 Juin 2021
I want to automatically remove the marked white pixels in attached Figure named as Picture 2. I have also attached an original image with name Picture1. Can anyone please help me in this. I will be very Thank Full to you.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/666050/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/666055/image.png)
0 commentaires
Réponse acceptée
Image Analyst
le 26 Juin 2021
What is it that defines those pixels? How about if you just picked some column, and erased from there to the center of the image, like
[rows, columns, numberOfColorChannels] = size(binaryImage)
binaryImage(:, 50 : round(columns/2), :) = 0;
I don't know if you just want to pick 50 or some other value, basically manually by turning the axis tick marks on and looking at them, or if you can explain somehow how that column could be automatically chosen.
2 commentaires
Image Analyst
le 26 Juin 2021
You went from column 50 to column 28, which means no columns were chosen. You really need to take this 2 hour course to learn how indexing is done:
What you should have done is
[rows, columns, numberOfColorChannels] = size(binaryImage)
% Erase from column 28 to middle of the image.
binaryImage(:, 28 : round(columns/2), :) = 0;
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Image Data Workflows dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!