繁体   English   中英

在Matlab中,我需要一个函数/脚本来读取两个不同图像中的元素ij并输出一个新图像,该图像是函数的输出

[英]In Matlab, I need a function/script that reads the element ij in two different images and outputs a new image which is the output of a function

很简单:

我需要一个脚本来读取两个图像(相同大小)的元素ij。 这两个元素将是我具有的功能(实际上是模糊逻辑系统)的输入。 我希望此函数的输出形成一个新图像,这是通过我函数的输出为之前打开的两个图像中的每个 ij元素生成的。

非常感谢!

罗德里戈

天真的方法:

sz = size(img1);
out = zeros(sz,class(img1));
for i=1:sz(1)
     for j=1:sz(2)
         out(i,j) = myFunc(img1(i,j), img2(i,j));
     end
end

如果您的函数已正确向量化,则可以执行以下操作:

out = myFunc(img1,img2);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM