romainbrette / holypipette

Holy Pipette
GNU General Public License v3.0
4 stars 0 forks source link

Camera-independent calibration #97

Open romainbrette opened 2 years ago

romainbrette commented 2 years ago

We have several issues with calibration. One is precision (#86). Another is that calibration depends on the objective (#75 #76 #61) and the camera resolution (#74 #6). Finally, calibration requires the program to run the camera, and so it is dependent on the possibility of acquiring camera images.

I propose a different way to do it, which does not necessarily require to acquire images. It can only work with a properly adjusted professional system, that is, it assumes that movements specified in µm actually move by the expected distance, that right angles are really right angles, that the vertical axes of manipulators and focus are the same.

If all of this holds, then the system is specified by:

  1. For the stage, we put a visual guide on the stage, for example something with a straight edge (a slide for example), and we move the stage in a direction that leaves the edge visually unchanged. This gives the angle of the stage relative to the guide, which acts as a reference system.

  2. For each manipulator, we make a move in the x direction and compensate with a move in the z direction so as to keep the tip in focus. We then get one angle. The stage may be moved to make larger movements. Reliability problems with the stage will have no effect on this measurement. Here we get the angle between the x axis and the z axis of the manipulator, which should be independent of the rest. Then we use the visual guide to get the other angle: we move the manipulator so as to follow the visual guide. This will give us the angle of the y axis relative to the visual guide. This can be combined in a single calibration move.

  3. All of this is camera independent. Then we need to know the camera angle and the magnification. This could be done with a single shot of the visual guide: we get the angle if the visual guide is an edge, and we get the magnification if the visual guide has some recognizable pattern of known dimensions, or by moving the stage in the orthogonal direction. In fact, printing/engraving a pattern at known place on the stage could allow automatic measurement of camera magnification and aspect parameters (eg horizontal flip).

romainbrette commented 2 years ago

All angles can actually be given directly, except for the camera. Manipulator vertical angle can be read, although it is approximate (with a few degrees). The horizontal angle is specified by the placement; there are holes every 15 degrees. Currently the main manipulators are placed at +-90 degrees on the stage. In other words, once we only need to calibrate more precisely the vertical angle, which is easy to do. This would be sufficient for all compensatory movements. Only for clicking would it be necessary to have camera calibration. A single camera snapshot with a grid would do (although the grid has to be well placed on the stage). Otherwise, movements of the stage (the current stage calibration).

romainbrette commented 2 years ago

It turns out the horizontal angle is not precise because there is only one screw... So we need a way to measure it. One way independent of the camera is to move in Y and make a compensatory move with the XY stage. The underlying assumption is then that the manipulator is perfectly parallel to the XY stage. And of course that the manipulator is placed on a motorized XY stage.

romainbrette commented 2 years ago

Ok apparently the vertical axis of the manipulators is not exactly parallel to the microscope axis... Something like a 0.5% error, which is quite significant. This means that it's virtually to do the calibration without the camera. The only way I see is to do the camera-dependent calibration, then factor out the camera transformation, when we have a calibrated stage.