Laser pointer and visual marker aruco

Is the camera moving or stationary? If it’s moving you might have to do some additional work to handle the perspective change, but here are some things I’d be thinking about for a task like this:

  1. How accurately are the Aruco corners being detected? I’ve had some less-than-ideal results for the corners in the past, so depending on your accuracy requirements you might consider adding some additional features to your target (I’m thinking chessboard corners in known positions outside of the aruco white zone).

  2. I’m not a big fan of using color directly for tracking, but in this case it might be appropriate. Extract the R channel, apply a threshold and blob detection?

  3. Look into background modeling. Depending on how significantly / quickly the luminosity is varying, you can probably get a pretty good background model which, with image differencing, would probably work quite well at distinguishing the laser pointer.

  4. As the laser pointer crosses into the black portion of the aruco, the image will have a step function in the intensity for the laser. To some extent the background modeling and image differencing might account for this, but I would still expect a non-uniform response and would probably affect the resulting shape / intensity distribution of the blob. The typical approaches (center of mass of the blob, fitting a circle / ellipse to the blob) would tend to have bias in the position.

  5. Does the line you are using for where the laser crosses have to be tangent to the Aruco, or can you position the Aruco offset (either vertically or horizontally) so the detection area of the laser pointer is a uniform material/color (all white)?