why the output image lines are doubled?
2 次查看(过去 30 天)
显示 更早的评论
Dear all
I have the following image1 as an input for my code,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/141648/image1.png)
The code is:
load('matlab')
mdl = 'TwoVoltsTanhtestmodel2';
rgbImage = imread('/home/salibensuleiman/Documents/MATLAB/Escher/Escher/image1.png');
[rows, columns, numberOfColorChannels] = size(rgbImage);
if numberOfColorChannels > 1
grayImage = rgbImage(:, :, 1); % Take red channel.
else
grayImage = rgbImage; % It's already gray scale.
end
binaryImage = grayImage < 128;
subplot(2, 2, 2);
imshow(binaryImage, []);
.
.
.
The rest of the code is a parallel processing for this image which I did not include it here for simplicity.
The output image is attached.
![image1-testscript23DifferentImgBinarize.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/141651/image1-testscript23DifferentImgBinarize.jpg)
I noticed the lines are doubled although my code is just checking the pixels one by one if the neighbours are for example 1 they keep it one otherwise change it to zero.
4 个评论
Image Analyst
2018-11-22
I did NOT notice that there were doubled. Like I said, all I see is the input image.
I can't even run your code now without the MATLAB.MAT file. Please attach it.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!