how to get starting position of every connected component of an image in matlab -
i using "bwconncomp" method connected component of image.
there 4 connected components bounded red boxes , every starting point of every connected component marked yellow point.the co-ordinate of yellow point (x , y) which first component left. @ first connected component(which separate image) left side , see blue point gravity center of particular connected component. can calculate blue point co-ordinate (x1 , y1). if want calculate position of gravity center respect whole image co-ordinate (x+x1 , y+y1). question how can (x , y) co-ordinate in matlab?**fully functional code more helpful not expert in matlab.
main image here 
one of best things matlab regionprops function. allows hand image (black , white, connected component, or labelled image) , return stats object contains loads of information each connected component in image.
you can limit information returned (and therefore calculated, can save time) telling property want. bounding box (which sounds want) say
stats = regionprops(image,'boundingbox'); then, stats.boundingbox contains array [x_position y_position width height].
hope points in right direction, , experiment regionprops(image,'all') see of information can image.
Comments
Post a Comment