thinhare Posted February 13, 2009 Report Share Posted February 13, 2009 Hello, everyone, Here is my problem: I'd like to implement "connected component labeling" algorithm to analyze particles in a binary bitmap image. each time a pixel is read, if it is black, the original valus is kept; if it is white, and if its 8 neighoring pixels are all black, an unique id is assigned to the pixel; if one or more of 8 neighboring pixels are white too, then find out the ids of those pixels, and pick the lowest one assign to the current/central pixel. therefore, each time 9 values out of the image array will be read and the assigned id will be written back to the array. attached you can find my implementation, strangely enough that it is slow, and the id seems never changes (I set the starting value as 10000). Any idea? Thanks. thinhare Quote Link to comment
thinhare Posted February 14, 2009 Author Report Share Posted February 14, 2009 problem solved. the way I wired array into for loop was not correct. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.