This invention discloses a method for distinguishing and marking multiple foreground objects in image data streams. The steps include: 1) connecting a camera to an FPGA, whereby the camera transmits the acquired
fiber optic unit array image to the FPGA line-by-line in real-time in a streaming manner; 2) the FPGA detects the received image pixels, identifies and marks the
light spot pixels; 3) the FPGA calculates the optical
centroid coordinates of the corresponding
light spot pixels based on the marked
light spot pixels. This invention can process the image
data stream in real-time at the
image acquisition end, distinguishing and marking each
fiber optic light spot pixel. This allows for real-time calculation of the light spot
centroid at the
image acquisition end while maintaining accuracy, thereby greatly reducing
data transmission volume and enabling the host computer to obtain the optical
centroid coordinates of the
fiber optic unit in real-time. This provides an accurate and real-time labeled image
data stream for subsequent optical centroid calculation, thus improving overall positioning efficiency.