RealSense cameras are usually well calibrated when they are new out of the box. However, the 400 Series cameras have strong support for custom calibration if you decide that it is required.
The RealSense SDK 2.0 SDK used with the 400 Series cameras has a sample program called Measure that can be used to measure the dimensions of objects.
Intel's documentation says about accuracy that "The depth accuracy of the D400 series cameras is less than one Percent of the distance from the object. So if the camera is 1m from the object, the expected accuracy is between 2.5mm to 5mm."
The 400 Series has a Visual Preset system where you can change which aspects of the scan receive higher or lower quality. There is a pre-made "High Accuracy" preset that gives higher accuracy at the cost of a lower fill rate. In the camera's Advanced Mode, you can define your own Visual Preset if the pre-made ones do not meet your exact needs.
Thanks for your reply. Much appreciated.
If you think the D415 is pretty well calibrated I'll concentrate on achieving the best settings through the settings in Realsense Viewer in the short term. I can return to calibration afterwards.
Ideally I was hoping to use the Realsense viewer to obtain the best settings before I started to get stuck into the code. Is that the correct approach? Can I do everything I need to prove that the D415 will give me the results I require. Can I snap a single frame in here for example?
I took a look at the measure example and while it will be helpful, I believe what I need help with at the moment is what settings I should be changing in order to get the best Z accuracy.
I have seen it mentioned on this forum that it's possible to get sub um accuracy. What I am not sure is what are the optimum settings. Should I use the highest resolution framerate? What other setting effect the accuracy? I tried the higher accuracy profile you mentioned, but it doesn't seem to really help with the Z accuracy. (It improves but not that much)
So really what I am looking for is what is the optimal setup to get the best accuracy. Distance to the object (near / far) + frame rate and resolution + other setting available though the viewer
Any other help would be greatly appreciated?
I think your approach of seeing what the pre-made software settings can provide you with first and then using code if necessary is an efficient approach, and I use it myself.
You can snap a single frame using the SDK's record and playback functions. The RealSense Viewer has built-in save and record. To capture a frame instead of recording a sequence of frames with the Record button, click on the Pause icon to pause the stream, and then click on the Snapshot button next to it to capture that paused frame as a PNG image.
If you want more complex frame capture, you can do that through scripting, as described in the link below.
Intel's data sheet document for the 400 Series recommends using the Depth Quality Tool that comes with the SDK. "This application can be used to test depth quality, including: distance to plane accuracy, Z accuracy, standard deviation of the Z accuracy and fill rate."
Intel also recommend a White Paper document on depth testing methodology, which contains detailed information about Z-accuracy on page 7 and 8.
I made some progress yesterday with understanding what parameters did what with regards in using the intel viewer 2.1.0.
A couple of more questions that you or anyone else might be able to shed some light on
- I'm having real problems picking up resistors, SOICs & caps that are less than 5mm in height of the board. Some of these are fairly large in the X & Y axis (up to 20mm x 20mm). I had some success in changing the Disparity Shift parameter for pulling out the larger components in height but I can't seem to land on any setting that will give me a depth resolution of less than 5mm. Everything is just coming back as the one height. Is this a limit of the D415 do you think or have I just not found the right combination of settings yet?
- From your understanding of what the D415 sensor can do what size features should I be able to pick up on?
- I have a lot of 'noise' in the image that surrounds the PCB I am looking at. What's the best way to remove this in your opinion
Thanks again in advance
1. If you are having trouble picking up the very thin components, it may be because the camera is having trouble seeing their edges. I would recommend trying rotating the camera 90 degrees and see if it can pick up the components' detail better when viewing it from a different direction.
Also, a couple of years ago, a technique called the Canny Edge Detector emerged. You could use SDK 2.0's OpenCV compatibility to create a Canny Edge Detector via OpenCV. Google 'opencv canny edge detector' for details of how to do this.
2. The D415 model's traits are reminiscent of the older SR300 camera model, in that it excels at scanning smaller static objects. Having said that, it may have greater trouble with objects that are less than 1 cm in size, at least when doing 3D model scanning. You may get best results if you ensure that the object (the PCB in this case) fills as much of the camera's view as possible.
3. Is the surface around the PCB that has the noise made of reflective / glossy material? If so, the noise may be caused by the reflection. Better results can be got from reflective surfaces if you apply a fine spray-on powder such as foot powder or baby powder to dampen the reflection. This technique is used to scan shiny surfaces such as jewelry.
I wonder if spraying the whole PCB with foot / baby powder would help the camera to see the components that are less than 5mm by giving it an easily detectable surface to lock on to
Yeah I'm familiar with Canny Edge detector. I used it a lot when using OpenCV in 2D images so maybe I can help you out down the line if you need help in the 2D world! I'm hoping there are ways of using what I know in 2D and bring them into the 3D world but they are very different
I think my understanding on how the 3D algorithm is lacking. Is there a good resource / link you can point me too so that I can better understand on what it is trying to do? For example I didn't realise it was looking for edges in order to 'create' a region of interest of a particular height. What makes a good edge in 3D?
Just looking through other posts that you have helped out on I see it sometime mentioned to load different presets that are not part of the standard options. Would something like that help here? Do these presets contain what is basically just a combination of settings available in the standard intel viewer or can it also add ones that are currently not exposed though the intel viewer interface?
I'll try the baby powder technique and see what it yields. One way or another it might tell me where the problem lies.
Again thanks for the help
A camera may find it easier to scan a complex object with lots of different shapes and edges than a simple object that lacks sharp edges or height features, such as a sphere. The more shapes and edges there are, the more detail there is to identify and lock on to.
At the bottom of the Visual Presets documentation, Intel suggest a link to a discussion on getting best results at close range.
Regarding introductory information about depth, the image below about how the 400 Series cameras handle depth may be helpful.