![image1.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/198450/image1.png)
Remove unwanted pixel from an image
조회 수: 3 (최근 30일)
이전 댓글 표시
My image shows here.
![pl.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/198406/pl.png)
![p2.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/198407/p2.png)
The first one is the original image, and the second one is partial. What I want to do is to remove the pixels enclosed by red circle(red line is the mark, not in the original image). I tried to use morphology function but failed. I am new to image processing, and thanks for any replying.
댓글 수: 0
답변 (1개)
Akira Agata
2018년 12월 6일
One simple way to do this type of task is morphological opening. Here is an example.
% Read and binarize your image
I = imread('yourImage.png');
BW = imbinarize(rgb2gray(I));
% Apply morphological opening to remove 1-pixel-width vertical line
se = strel('line',2,0);
BW2 = imopen(BW,se);
The result is as follows (left: original / right: after applying morphological opening)
![image1.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/198450/image1.png)
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!