[英]Trouble with Copying Image in Matlab
I have written Matlab code to perform the following steps: 我已经编写了Matlab代码来执行以下步骤:
I have tested and debugged it and it appears that the part of the code that copies the input image is not working. 我已经对其进行了测试和调试,看来复制输入图像的部分代码无法正常工作。 Here is the code:
这是代码:
function (imageName)
inputImage = imread(imageName);
[sizeX,sizeY,~] = size(inputImage);
copyImage = ones(sizeX,sizeY,3);
for i=1:sizeX
for j=1:sizeY
for d=1:3
copyImage(i,j,d)= inputImage(i,j,d);
end
end
end
for r = 1:70
for co = 1:3
var1 = 1:sizeY;
var2 = copyImage(r,:,co);
P = polyfit(var1,var2,2);
Y = polyval(P,var1);
copyImage(r,:,co) = Y;
end
end
imshow(copyImage);
end
Can anyone tell me what is wrong with how I am copying the input image? 谁能告诉我我复制输入图像的方式出了什么问题? Thanks.
谢谢。
这是数字格式的问题,在显示之前将其更改为uint8:
imshow(uint8(copyImage));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.