but the input for it is "b" since the b is a np by 2 matrix that represent the boundary of the object ... so i need first to extract the outer boundry and make it an input to chain code .... how can i ?
Ok i have an image that contains a hand gun, i enhanced this image to get just the outer boundary of the gun then i get the coordinates by for loop and check the pixel value if it is a white or not if it is a white i store the coordinates in matrix... Sure the matrix values will not be in 8-connected. But how can i make it in 8-connected with keeping the arrangement of x and y coordinates?