Fast image processing to locate the centroid of an object using MMX or SSE

Started by z23, January 03, 2008, 03:27:03 AM

Previous topic - Next topic

z23

HI, I'm learning asm language to add some inline _asm instruction of MMX or SSE to accelerate image processing.After some segment on the original image, I can get the raster data like the pic below. the "1" stands for the object area.


my object is to determine the center (called centroid of the object on image) like


some times the image is very large , and I should use the algorithms like:
for example : the image size is Xsize * Ysize

I'd to define some Array like x[Xsize] ,y[Ysize]

then I could walk though all the pixel line by line. If I found a "1" I should add x and y[j], i,j is the corresponding coordinates of the pixel. than I could get the distribution like. on each x,y axis.


Then, I can locate the center of the object.

But these algorithms is very slow if I use the C or C++ language ,which in my project, the image processing is very time critical. that means ,I should processing a 1000*1000 image in less than 10ms.

so, I think The MMX or SSE instruction may help me.
can some one give me suggestion on this. Thanks.

by the way, This image size is too large to fit the post, is there some html scrips to make it smaller?




u

Please use a smaller graphic in your signature.

z23