As part of a course, we had to design a 3D scanner using a video projector and a webcam. The principle is to send different frames to the object and capture an image with the webcam. Using mathematics models, we can then obtain a 3D model of the object.
For the device to work, it must first be calibrated. To do this, we place a physical grid in front of the device and mark the coordinates of certain points, which are then used in the calculations. We do the same with a projected grid.
My role in the team was to set up a Python program to automatically detect the coordinates of the grid boxes.
To do this, I used the OpenCV library. I detected the edges present in the image, then detected the lines using the HoughLines function.
I adapted the parameters to obtain straight lines that were relevant to the framing, so that none of them were totally out of place. The result is shown opposite:
I then sorted the lines to keep only those closest to reality.
Having the coordinates of each line, I was able to deduce the various points of intersection.
I was finally able to deduce the remarkable points that were useful for calibration.
The other members of my team took care of what happened next. We place the object to be studied in front of the camera, and project various band images onto it.
The webcam captures the various images, and a 3D model of the object can be created.