Almost DIY 3d scanner for home

 




A couple of years ago I came across an article on HabrĂ© about a $ 30 3D scanner , and I was very interested in this topic, although I quickly realized that there was no question of any $ 30 for high-quality scanning.

But the main plus that I took away from the article is the David-3D scanning program, to which there really is a good manual in Russian and, importantly, the purchase of a license is the last thing that is required, since the free version is limited only to saving the result scan. Everything else works in full, which means it is quite possible to test the program, settings and your hardware as much as you like. And if you do not need the result with high accuracy, then you can do without buying a license at all.

I needed accuracy, since the main thing I wanted to scan was miniatures from the Warhammer board game (so that later they could be changed as I wanted and printed :)). The height of these "soldiers" is only 3 cm, but this does not prevent them from being very detailed.




If you do not need to shoot such small objects, then you will have lower equipment requirements, which means that it will be much easier to assemble a similar scanner for yourself.

The principle of operation of the program, and, accordingly, scanning is well described in the article to which there was a link above (I think it is not necessary to duplicate this). It is advisable to read that article first, since this one will in some way be its logical continuation.

But let's start in order. What you need to try 3D scanning at home:
1 - projector.
2 - webcam.

That's it, the short list is surprisingly good. Nevertheless, if you want to get very accurate and high-quality scans, then you will have to modify a few things with pens. Of course, you cannot do without additional costs, but in the end it will still cost less than buying any of the 3D scanners available for sale, and the quality of the result can be obtained much better.

Now, in order and in detail.

PROJECTOR.

Like the author of the previous article, I started my first experiments on scanning with a laser pointer, but they immediately showed how inconvenient this method is. There are several disadvantages at once:
- the impossibility of obtaining a beam with a sufficiently thin line. Moreover, when you turn the pointer, the distance from the lens to the object changes, which means that focusing is lost.
- if you need to scan regularly, turning the laser pointer with sufficient accuracy and smoothness manually is very difficult, and tediously simple - the hands are not such a stable instrument when it comes to a long time.
- you have to scan in the dark so that only the laser line is visible and nothing more.

And if the second drawback can still be dealt with by creating a special rotary mechanism (although this is already not such an easy task, in any case, this cannot be done in 5 minutes on the knee), then getting rid of the first drawback is more expensive.

When I realized all this, I decided to try scanning with a projector, for which I borrowed some simple model from a friend.

A little clarification should be made here - in the last article the author mentioned the possibility of scanning with a projector, although the proposal was, in my opinion, very strange -
A projector with a powerful lamp is suitable, the light of which must be directed through a narrow slit to the scanned object.

This may have been the only option in earlier versions of the program, but in version 3 I experimented with, the projector was used much better because there is a feature called Structured Light Scanning (SLS). Unlike laser scanning, the projector immediately projects onto the object a grid of vertical and horizontal lines of different thickness, which significantly reduces the scanning time and allows you to automatically remove the color texture of the object. Well, with good focus, a 1 pixel wide line is much thinner than you can get from an inexpensive laser pointer.

Unfortunately, I didn’t take photographs from those first experiments, and there wasn’t much to photograph - the projector is on the table, next to it is a webcam, all this looks in one direction :) However, even such a simple design showed that this option is much preferable both in scanning speed and quality. Then I decided to buy myself a projector for this purpose.

The criteria for choosing a projector were simple - the resolution is higher, the price and the dimensions are smaller :)
The choice stopped at IconBit Tbright x100 - an ultra-compact DLP LED projector, 1080 resolution - at that time it seemed to me that you couldn't think of anything better, but as it turned out later, I was wrong , although studying with him, I got a lot of interesting experience.

 

The first problem that arises when scanning a small object with a projector is that for best results, the projected mesh should roughly match the size of the object being scanned. This projector made it possible to obtain the smallest screen diagonal at the closest focus - about 22 cm. Agree that against such a background a miniature 3 cm high is far from the concept of "approximately equal dimensions." The answer was found on the official forum - people in such cases install camera lenses on the projector for macro photography. Given the small size of the projector lens, I opted for marumi lenses with a 34mm thread diameter.



Using two such sets, we managed to get a projector screen with a diagonal of only about 3 cm. That turned out to be quite enough to make your first microscan -

This is a single scan, which is why there are "holes" on the model, torn edges, etc. By turning a coin and scanning from different angles, you can get several such scans, which are subsequently combined into one object (the scanning program itself allows you to correctly combine different scans, stitch them together and save them as a single object). In the process of stitching, the shape of the object is also refined. But saving the results of such stitching is possible only after purchasing a license.

And now the moment has come for the first thing, which is not necessary for scanning, but the process is much more convenient with it - this is a stand for a projector with a camera. The calibration process itself is needed not only for the program to find out the parameters of the equipment - the software must also figure out the relative position of the camera and the projector. In the process of work, changing them is not allowed (as well as changing the focus of the camera), which means that all this must be rigidly fixed, because the number of scans can be large even for one object.

On David's main page, a similar system is depicted - it does not represent anything complicated. And after looking through the forum and seeing how different people organize it for myself, I realized that nothing complicated is required here.



For these purposes, a stand was taken from a burned-out LCD monitor, and plexiglass from it was cut out and glued like this structure, as it looked in the first version.

 

To the stand for the projector and fasteners were attached for installing various lenses, which made it possible to change the diagonal of the screen, and scan objects of different sizes.
It should also be noted that scanning with a projector does not require constant presence in the field of view of the calibration panels. Once calibrated, they can be removed. This allows you to calibrate the installation to safely carry it, move it, etc.
That is, you can use a large calibration template to calibrate the walls at home, and then go outside with this stand and a laptop and scan your car, for example. We took a smaller template, put in a pair of lenses - and you can scan jewelry.

Recently, the company released an improved scanning kit, here the rack already looks much more serious and interesting -



As for me, with the cost of a license for the program about $ 500 (they just raised the price recently), giving more than 2000 euros for such a kit is not entirely justified , assembling something like that yourself is not difficult and much cheaper.

Let's go back to the projector. As it turned out, this projector had one significant drawback for use in a scanner, namely its native resolution (854 * 480). And everything would be fine if it produced the same output, but alas - the picture was converted to standard resolutions (like 1024 * 768), and as a result, a line one pixel wide was somewhere brighter in different parts of the screen, where something dimmer, somewhere narrower and somewhere wider ... All this negatively affected the quality of scanning, expressed in the form of ripples and stripes on the resulting model.
By that time, I was already thinking about buying a projector for a stereolithographic 3D printerHaving considered several options, I settled on the Acer P1500 model, because it does not need any modifications for use in a printer (this projector without any lenses is capable of giving a focused image on a screen of about 4 * 7 cm). This means that it will be perfect for a scanner as well. At the same time, the resolution of 1920 * 1080 is real. And so it happened, I still use this projector and I am completely satisfied with the results.

CAMERA.

I had the same criteria for choosing a camera as when choosing a projector. After going shopping, I stopped at Logitech C615. The scan of the coin was taken from it, without any modifications. But when I tried to scan the figurine, I ran into a difficulty called "depth of field." When the object is so small, we actually get a macro shot, and sharpness during such shooting is achieved only on a small segment, literally only a couple of millimeters (which is why the coin was scanned well - the relief fit perfectly into the field of sharpness). It was decided to remake the camera for a different lens. Several different lenses were ordered on Ebay to sample, and a new body was cut out for the camera board. The plan was this



The final result was a little different

 

The main idea, I think, is clear. And now both on Thingiverse and on the program forum you can download stl for printing cases for different types of webcams.

The standard lens had to be removed from the camera board, and as it turned out later, the IR filter was removed along with it, so be careful in this matter. The filter will then come in handy for use with other lenses, although you can buy them separately - the price is cheap.

Thus, I have such a collection of lenses.



While I was waiting for the delivery of lenses, various photography forums were read. Studying the issue with the depth of field, I found out that you can increase it more by closing the lens aperture. This means that the lens was required one in which it was possible to adjust the aperture (alas, among those ordered, not everyone had this opportunity, but luckily I also got a couple of them). In general, a varifocal zoom lens with variable aperture is desirable to enhance the camera. In practice, everything turned out as it was in theory - closing the aperture, one could immediately see an increase in the depth of field, which made it possible to scan volumetric, but small objects.

The main lens I use is on the camera in the photo above. The second, with an adjustable aperture, is the largest, in the center. I use it for very small objects. The rest are without a diaphragm, so I don't use them - it turned out that these two are quite enough.

The plans now are either to find a webcam with a high resolution (the quality and detail of the scans directly depends on the resolution of the camera), or to try to use for these purposes some kind of digital camera with the ability to shoot video - usually they can get much higher resolution, and the lenses are better. ...

Actually, this could have ended - like he told about everything. I also thought that this was the end of the assembly of the scanner, but the further into the forest ... While studying the forum of this program, I often came across various schemes of turntables - since the software allows you to automate the scanning process. After one scan, a command is sent to the com-port, the turntable rotates, turning the object by a specified number of degrees, and gives a command for the next scan. As a result, with one click of the mouse we have circular scans of the object - it would seem, what more could you want? I tried this system with interest, but alas - I absolutely did not like this approach, and there are a couple of reasons for that.

1 - if an object is of a complex shape, then simply rotating it will not be enough - you also need to tilt it in different directions so that the camera with the projector reaches all the depressions and other hard-to-reach places.
2 - even if there are no such places, and given all the scans that were made, there are no parts left on the object that did not fall into the scan, the question of the scan accuracy remains.

Let's say some part of the model on one of the scans came out perfectly. But this does not mean that on all the scans that this part got into, it also looks perfect, and when stitching scans from different angles, the result will be averaged, which can not please. The program allows you to slightly edit the received scans (you can cut out the unnecessary part). If we rotate the model by 20 degrees, it means that after a full rotation we will have 18 scans, the part we need may well be present in half of them, therefore, in order to leave the best result, it will be necessary to remove this piece from 8 scans ... There can be a lot of models, as a result, almost half of each scan will be cut off, which is very laborious and time-consuming.

Instead, it is better to immediately scan the adjacent areas after the first scan and check the result. As soon as one piece is ready, we proceed to scanning the next one, and so on, until the whole model is in perfect shape. This approach gives better results in less time.

But the question of convenience arises. Agree, it is inconvenient to manually try to twist the object, looking not at it, but at the monitor - in order to control hitting the lens, without changing the distance to the camera and the projector at the same time (so as not to lose focus). During the next such balancing act, I accidentally touched the camera, which accordingly knocked down the entire calibration, and the whole process had to be started anew. I categorically did not like this layout, and after some thought I came up with a plan of such a design (which, as you understand, I later put together).



This is not a turntable in the usual sense of the term. Thanks to this design, I can not only rotate the model, but also tilt it as I need. In this case, the center of the model remains in the plane of focus, but even if not, you can move the mount with the model back and forth.




All this was collected on an arduino, a small control program was written, and as a result, now when scanning, I do not have to get up from behind the computer - using the program, I change the position of the scanned object, and at the same time, in the camera window, I choose the optimal one for scanning foreshortening.

Insides


In the program, I incorporated the ability to automatically scan, as well as scanning is not easy in a circle, but with inclinations of 45 degrees to one side and the other, which gives three times more scans. Nevertheless, in the end, I still never use this opportunity - it is too inconvenient to sort out the received heap of scans and clean them of unsuccessful pieces later.

It is also worth mentioning some of the nuances of scanning.
1 - it is impossible to scan shiny and mirror surfaces. Light is reflected from them, or gives such a glare that the program cannot correctly recognize the line. If there is a need to scan such an object, then such parts will have to be masked with something (washable paint, paper tape, etc.).
2 - it is more convenient to scan monotonous objects since when the camera is set to a light color, the brightness of the projector is not set as much, the exposure is low, etc. And a dark object requires a lot of brightness, so if you have a multi-colored object, different parts of it require different settings to get the best result. Here it is also more convenient to use scanning of an object in parts.
3 - if you want to immediately get a color texture, then keep in mind that the settings of the camera and the projector for the scan do not affect the settings for removing the texture (the scan is generally done in black and white), so play with the settings in the texture mode just as you will do in scan mode.

The scanning process for me now looks like this:
- Focusing the projector and camera


The projector light is too bright and the projected grid is not visible in the photo, but here is the view from the camera in the program


- scanner


calibration The calibration angle was made of metal plates, and calibration templates of different sizes were printed on magnetic paper - this way you can very quickly adjust to different sizes of scanned objects.

View in the program


It is recommended that the combined angle between the projector and camera beams is about 20 degrees. Therefore, such a stand is used - when scanning large objects (for example, a person), the camera must be set much further from the projector, but here they are close to me. The position of the camera relative to the projector can be only vertical, or only horizontal - depending on the geometry of the object. In this case, the location is diagonal (13 degrees vertically and 36 horizontally).

Scan results from different angles. These are already cleaned up scans, i.e. removed all unsuccessful and unnecessary (figure stand, mount included in the frame) parts.


Combining scans for subsequent merging into one object


Due to the fact that each scan has its own color, it is convenient to control the correctness of registration.

Well, after combining the scans from different angles, we get such models

Boromir's Miniature from the Lord of the Rings.


When scanning a multi-colored object, the result is slightly worse if you don't bother too much. But you can get an object right away with a texture :)


Originals of models


In the gallery of user works on the developer's website ( http://www.david-3d.com/en/news&community/usergallery ) you can find many more interesting scans, even people scan fingerprints ... And there are even scans of the same miniatures from Warhammer.


In conclusion, I would like to say that no matter what hardware you use, no matter what expensive 3D scanner you buy, but this is not a panacea for printing anything. Theoretically, of course, you can send the resulting object to a slicer and print, but there are several reasons why you should not do this, but in any case you should study 3D graphics packages.

1 - The resulting scans, with a good scan quality (and we want to get the best quality), have a lot of polygons. No, even a LOT . Boromir's scan after merging contained more than 8 million polygons - not every slicer will be able to work with such an object.
2 - Any objects bear traces of assembly and manufacture. And if in reality, files and sandpaper are used to correct this (and sometimes there are still inaccessible places where it is impossible to use tools), then working with a digital copy of an object, we can change it as we like - remove defects, improve detail, etc. ...
3 - As I said at the beginning of the article, when I thought about the scanner, I did not want to print copies of objects, but to change them as I please. I am not a sculptor, I do not have the tools, materials and skills to sculpt such a small model. But knowing how to work in 3D, it is much easier for me, having scanned such Boromir, to make some kind of Prince of Denmark out of him.


By the way, this model already contains almost 100 times fewer polygons than the scan result.
Previous Post Next Post

Contact Form