Reputation: 406
There are 2 coins with a 24,26mm diameter as shown in the picture. Diameters in pixels are a bit diverse: 292px and 302px. One of the potential reasons for different diameters is different distances from coins to the camera (e.g. one is closer to the center). What is good practice for dealing with such differences?
Of course, there are other sources of different diameters like lens distortion and camera direction, but it would be great to get approaches specifically for errors caused by different distances.
Upvotes: 0
Views: 900
Reputation: 15354
typically, you calibrate your camera intrinsically (basic properties and lens distortion to remove), and then you calibrate it "extrinsically", i.e. calculate its position relative to the world.
both steps involve a checkerboard pattern. OpenCV's docs have tutorials on that.
your world is a flat surface. you can warp the image to be a top-down view using a "homography". in that view, everything on the plane has the same proportions.
(edit to address some points that came up)
object thickness: move the camera further away, which comes closer to an orthogonal projection and reduces the effect of a flat object having some thickness. more distance also improves depth of focus and reduces the effect of lens distortion (because narrower field of view means you use the middle of the lens primarily vs. a larger area of it).
shadows are best addressed by distributing light all around. I would suggest a "softbox" (photography term) that throws diffuse light at the object from all around
Upvotes: 1
Reputation:
IMO, the main cause of the discrepancies are the thickness of the coins and possibly shadows. No calibration in the world will correct that.
Upvotes: 2