Info

此问题已关闭。 请重新打开它进行编辑或回答。

Composite object builder from locations

2 次查看(过去 30 天)
Jason
Jason 2016-12-12
关闭: MATLAB Answer Bot 2021-8-20
Hi.
I have an image in which I have detected the spots and have the coordinates, some of them are listed below.
Coord =
6 5
7 8
7 23
9 10
10 13
10 32
10 36
13 5
I want to take each location and then add the pixels representing the object and just add them all together. Then I can divide by how many they are to get a sort of average single object representation of all the objects. Im looking to just take a 4x4 square around each location.
Im not sure where to start - is there a way to do this without using a for loop?
This was my approach:
cmpT=false(5)
cx=Coords(:,1)
cy=Coords(:,2)
for i=1:length(cx)
xx=cx(i)
yy=cy(i)
cmp=Raw(yy-2:yy+2,xx-2:xx+2)
cmpT=cmpT+cmp;
end

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by