librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Very wavy cloud

Open jjoachim opened this issue 8 years ago • 28 comments

Required Info
Camera Model D415
Firmware Version 05.08.15.00
Operating System & Version Ubuntu 16
Kernel Version (Linux Only)
Platform PC
SDK Version 2.10.2

I took a static scene consisting of a very flat floor and flat scale on top (emphasis on flat) from a static camera. I averaged 10 frames together and used both default and high quality/high res json options. The camera is angled towards the ground at maybe 45 degrees. The result was a bit concerning; both the raw frames and the averaged frames look rather wavy for having a flat scene. I was hoping the averaging would remove the waves (assumed to be noise), but it seems the waves are caused by something more consistent. Any thoughts as to what this might be, or how to mitigate it?

capturecloud capturecolor

Expectation (via Kinectv2, slightly different scene):

jjoachim avatar Mar 15 '18 21:03 jjoachim

What resolution are you using and at what distance are you?

agrunnet avatar Mar 15 '18 22:03 agrunnet

Resolution should be 1280x720 according to this wiki. The distance is about 13ft off the floor (so a bit further to the middle, and further still to the top of the image).

The acceptable distances according to the specs at the intel site should be rated for up to 10m (32ft) so I'm hoping that's not the issue.

jjoachim avatar Mar 15 '18 22:03 jjoachim

The error scales up with distance squared. The error will be much bigger at 4m for sure. As for rate range, that is of course subjective as to the application and the error that is tolerated. The range is actually >60m in terms of seeing depth, but you have specific needs about range error.

Can you tell us what this object size is you are looking at? We can tell you whether this is what you should expect to see or whether there is something wrong.

Also, can you try turning off lights in room? That way we can test whether this is due to SNR and texture issue.

agrunnet avatar Mar 15 '18 23:03 agrunnet

"The error will be much bigger at 4m for sure." Is there any known function of distance to expected error? The magnitude of a squared error depends greatly on what coefficients are involved.

"Can you tell us what this object size is you are looking at?" 5ft x 5ft x 4in

"Also, can you try turning off lights in room?" This is in a remote location, so I'll just have to wait for nightfall. I can post another snapshot in a couple of hours.

jjoachim avatar Mar 15 '18 23:03 jjoachim

Picture with the lights off, cloud points are color white so they can actually be seen: capturecloudbw

jjoachim avatar Mar 16 '18 00:03 jjoachim

Results are improved by using the default settings explicitly (loading the json rather than not loading one at all). Still looks incredibly wavy, but the wave frequency are much higher, so the scene is apporaching something far more recognizable. capturecloudbw2

jjoachim avatar Mar 16 '18 00:03 jjoachim

Compared to Kinect V2, realsense D series is not suitable for volume/dimension measurement applications. There are quite significant fluctuations in depth data. See the following threads: #1280 #1235 #1083

Also see the Kinect v2 vs realsense D415 comparison in following thread: https://communities.intel.com/thread/121880

On the other hand, I believe it is much better for robotic and gesture applications with shrinked size, less power requirements and better outdoor performance.

bellekci avatar Mar 16 '18 06:03 bellekci

Yeah I'm coming to the same conclusion, but we just don't have any other good alternatives since Kinectv2's aren't being made anymore. I'm more confused as why the wavy noise seems to be built in though, because an averaging filter would remove any normal fluctuation. They seem to be consistently wavy in those spots for some reason.

jjoachim avatar Mar 16 '18 08:03 jjoachim

One option to consider is whether you can bring cameras closer to the objects to be measured if accuracy limits are the issue. If FOV then becomes a problem, then use two cameras to increase FOV. The cameras dont interfere with each other, so they are well suited to be used in multiples. The SDK supports it. Also, they can be HW synced if you need that. Also the Intel ASIC does do any post-processing, so using a domain transform edge preserving filter and some temporal averaging can help.

agrunnet avatar Mar 16 '18 14:03 agrunnet

For me, the acceptable distance is 1-1,5m. If it is larger, the point cloud is very wavy. (high accuracy with post processing) wajh

michalstepien avatar Mar 16 '18 17:03 michalstepien

Default settings: wave_default

michalstepien avatar Mar 16 '18 17:03 michalstepien

After couple algorithms :) bez tytulu333

michalstepien avatar Mar 16 '18 18:03 michalstepien

Okay, so what I gather then is that the HQ presets are really just for close range scanning, whereas further ranges are best served with defaults? I wish I knew what all of these parameters did so I could figure out exactly what's happening rather than generally knowing when to use which presets. My next goal will be applying a generous bilateral filter (or a mix of some others) to see if I can't suppress some of those waves without losing the important edges.

jjoachim avatar Mar 16 '18 18:03 jjoachim

Looks good. Yes a bilateral filter should help as well. I found it slightly more computational intensive than the domain transform filter. Also, if you are measuring an object on a floor, and your usage can afford to add a mat underneath, you should try something textured, instead of a white background.

agrunnet avatar Mar 17 '18 16:03 agrunnet

Here is a good pattern to use, as an example. Also in general good to check performance with. ds5_random_image_10_100_0_1920_1080

agrunnet avatar Mar 17 '18 16:03 agrunnet

@michalstepien Ehmm. What are these couple of algorithms?

vladsterz avatar Mar 19 '18 07:03 vladsterz

@michalstepien I'm curious about the algorithms too, but making a wavy plane flat isn't too bad if you know you're looking at a plane. My concern is dealing with more general objects, where smoothing filters will degrade important characteristics.

I've also noticed that increasing exposure time by a factor of 3 improves results (my scenes are mostly static, hence the use of an averaging filter as well).

jjoachim avatar Mar 20 '18 22:03 jjoachim

@agrunnet "If FOV then becomes a problem, then use two cameras to increase FOV." We were experimenting with using 3 cameras (2 sides, one top), but our computer only has 2 USB 3.0 controllers (one on the motherboard, one on an PCI extension slot). We noticed it seemed to run two cameras on the same USB controller pretty well (the Kinectv2's needed dedicated slots without question). Are you all aware of any issues running multiple cameras on the same controller? Is there a limit, or a guideline on how far we can push this?

jjoachim avatar Mar 23 '18 07:03 jjoachim

@jjoachim yes you can use multiple cameras on same USB hub. If you go beyond two cameras we recommend using a powered HUB. We found that we can get stable streaming as long as you stay below about 2200mbps on USB3. Some have connected 8 cameras but this was for depth only at lower resolution. In general do the math and use 16bit for depth calculation and 16bit for RGB (it is using yuy2).

agrunnet avatar Mar 23 '18 14:03 agrunnet

@agrunnet Perhaps I should ask this in a separate question, but how do I ensure that all realsense postprocessing disabled? We're attempting to integrate simultaneous cameras, but the stream has slowed down to a crawl. We have 3 cameras on 2 USB controllers. We were expecting 1 fast stream and 2 slow ones, but we got 3 very slow ones. We also noticed our CPU was being maxed out (400%).

I loaded custom configs that I created with one of the realsense tools, but I specifically disabled all of the postprocessing since we have our own engine that does the filtering we want. In spite of that, we get less than 1 fps on all cameras and maxed out cpu usage. I disabled our filtering altogether and it didn't help very much; the pipe.wait_for_frame() is what's taking so long.

Our configs (hand copied, so some typos may be present):

{
"controls-autoexposure-auto": "False",
"controls-autoexposure-auto": "133660",
"controls-depth-gain": "16", //Why can't this go lower?
"controls laserpower": "180",
"controls laserstate": "on",
"ignoreSAD": 0,
"stream-depth-format": "Z16",
"stream-fps": "15", //this is nowhere close to what we're seeing
"stream-height": "720",
"stream-width": "1280"
}

EDIT: We also noticed that the config creation tool does not save RGB camera information, which we had also set to 15fps at max resolution. Instead, we had to specify these things in the config::enable_stream function for RS2_STREAM_COLOR.

EDIT2: My apologies! It turns out the bottleneck is our pointcloud construction. A size of 921600, or 1280*720, appears to be to big. I'll post multi-camera results when we get performance issues worked out.

jjoachim avatar Mar 27 '18 17:03 jjoachim