Hi,
I would like my code to stop at the last value but it is exceeding 1 point more and giving me an error, can anyone help
Code:
I=imread('frame14.png'); %Read the Image
[C,h] = imcontour(I,[-1000 30]); % store the C from the contour
Contours_matrix = C' %transpose the rows into columns
Y_Coordinates = Contours_matrix(:,2) %extract the second column (Y-values)
Current_Rowindex=1
counter=0
while Current_Rowindex < size(Y_Coordinates,1)
counter = counter+1
Rowindices(counter) = Current_Rowindex
Current_Rowindex = Current_Rowindex+Y_Coordinates(Current_Rowindex,1)+1
end
Rowindices_1=Rowindices'
for i= 1:length(Rowindices_1)
co_ordinates(i,1) = Y_Coordinates(Rowindices_1(i,1)+1:Rowindices_1(i+1)-1,1)
end
Error:
Index in position 1 exceeds array bounds
0 Comments
Sign in to comment.