There are a few things I've found that makes a better scan. First, lens calibration from OpenCV is great at fixing lens deviations. Secondly, since you are already using OpenCV, you can work in the colorspace that your laser/camera works best in. Thirdly, the angle theta is really nasty to calculate accurately. I've found you do not need to measure the angles. I'll explain.
If you assume that your camera is floating in some angle horizontal and some angle vertical, you need 3 pieces to figure out where your camera is. First, you need to locate the center of your platter. Secondly, you need the angle of the laser to vertical as viewed from the camera. These 2 constrain your data to a ray that originates from the center of the platter (origin) outward. Third, you use the checkerboard from calibration to determine your distance from the center, thus constraining the camera in 3space. Here's my equations I've derived:
cam_angle is the angle the line makes. I measured from 270degrees in positive direction. Measure this offset, and the angle is cam_angle. The rest of the variables should be clear.
One place I'd look at changing up is upgrading the laser. You can buy a cheap burning laser for ~$10 on aliexpress. Just add that and a little motor+mirror assembly, and you can generate a clean laser line. I'd recommend green lasers, as green seems to be the most sensitive with the various webcams I've worked with. They also generate lots of IR as well, so the line is really bright.
There are a few things I've found that makes a better scan. First, lens calibration from OpenCV is great at fixing lens deviations. Secondly, since you are already using OpenCV, you can work in the colorspace that your laser/camera works best in. Thirdly, the angle theta is really nasty to calculate accurately. I've found you do not need to measure the angles. I'll explain.
If you assume that your camera is floating in some angle horizontal and some angle vertical, you need 3 pieces to figure out where your camera is. First, you need to locate the center of your platter. Secondly, you need the angle of the laser to vertical as viewed from the camera. These 2 constrain your data to a ray that originates from the center of the platter (origin) outward. Third, you use the checkerboard from calibration to determine your distance from the center, thus constraining the camera in 3space. Here's my equations I've derived:
cam_angle is the angle the line makes. I measured from 270degrees in positive direction. Measure this offset, and the angle is cam_angle. The rest of the variables should be clear.One place I'd look at changing up is upgrading the laser. You can buy a cheap burning laser for ~$10 on aliexpress. Just add that and a little motor+mirror assembly, and you can generate a clean laser line. I'd recommend green lasers, as green seems to be the most sensitive with the various webcams I've worked with. They also generate lots of IR as well, so the line is really bright.