【发布时间】:2016-10-10 11:22:52
【问题描述】:
我的图像数组:C_filled = 256x256x3270
我想做的是计算每个图像的质心,并将与每个“切片”/图像对应的每个质心存储到一个数组中。但是,当我尝试像常规数组一样更新数组时,会出现以下错误:
"Undefined operator '+' for input arguments of type 'struct'."
我有以下代码:
for i=1:3270;
cen(i) = regionprops(C_filled(:,:,i),'centroid');
centroids = cat(1, cen.Centroid);% convert the cen struct into a regular array.
cen(i+1) = cen(i) + 1; <- this is the problem line
end
如何更新数组以存储每个新质心?
提前致谢。
【问题讨论】:
标签: arrays image matlab loops centroid