[英]What's the concise expression for the following Matlab code
img is an image of a single color channel. img是单色通道的图像。 img_temp is defined as follows:
img_temp定义如下:
img_temp = zeros(size(img,1), size(img,2), N);
where N is an integer. 其中N是整数。 Therefore, each entry of img_temp contains N values.
因此,img_temp的每个条目都包含N个值。
What's the concise way of expressing the following operation in Matlab? 在Matlab中表达以下操作的简洁方法是什么?
for x=1:size(img,1)
for y=1:size(img,2)
img(x,y,1) = find(img_temp(x,y,:)==max(img_temp(x,y,:)));
end
end
I want to find the index of the largest value in the array img_temp(x,y,:) and store it in the corresponding place in img, namely, img(x,y,1) 我想找到数组img_temp(x,y,:)中最大值的索引,并将其存储在img中的相应位置,即img(x,y,1)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.