i am capturing an image of pixel size 10*10.using matlab software ,i have written codings to send and store the image data to bram of my fpga kit via RS232 interface.how to write the vhdl coding for finding the image centroid by extracting these image data from the BRAM(fpga contains 8 18kb BRAMs).
Yup, zero chance of finding working HDL code for centroids out in the wild. For some inspiration you can look at the relevant OpenCV code. Remember I said inspiration, not implementation.
You just have to do three summations M00, M01 and M10. Then 2 divisions and Bob's your Uncle. It's not super complicated. Instead of that formula you posted maybe it helps if you take a look at the discrete form.
You have to loop over (x,y) coordinates of your image region and for every (x,y) coordinate you simultaneously do the work (as in multiply-accumulate) for the M00,M01 and M10 sums. And then when all sums are completed you do a division for each axis.