MATLAB: How to remove the extra unwanted white pixels from an image.

image processingImage Processing Toolboximage segmentationMATLAB

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.

Best Answer

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.