Info

This question is closed. Reopen it to edit or answer.

Composite object builder from locations

1 view (last 30 days)
Jason
Jason on 12 Dec 2016
Closed: MATLAB Answer Bot on 20 Aug 2021
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

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!