The invention discloses a multi-light-spot
centroid extraction method and device based on an FPGA, a medium and a product, and relates to the field of
digital image processing, and the method comprises the steps: firstly, caching image line data through a first-stage FIFO and a second-stage FIFO, forming three continuous groups of image line data streams, effectively solving the problems of
data synchronization and
processing rate matching, and improving the
data processing efficiency; then, effective pixels of the light spots are accurately determined by means of a pixel threshold value, and different
light spot areas are accurately divided by means of line continuity judgment and boundary marking, so that repeated recognition and error recognition of the light spots are avoided, and the accuracy of
light spot recognition is greatly improved. And finally, according to the weighted average positions of the gray values of the effective pixels of all the light spots, the target
centroid coordinates of the target light spots are calculated, the internal gray difference of the light spots is fully considered, and compared with a conventional method, the
light spot energy distribution center is more accurately reflected, so that the calculation precision of the light spot
centroid is remarkably improved.