Add tutorial on how to use Orbbec Astra 3D cameras#18854
Add tutorial on how to use Orbbec Astra 3D cameras#18854opencv-pushbot merged 1 commit intoopencv:masterfrom
Conversation
alalek
left a comment
There was a problem hiding this comment.
Documentation looks good (except webp images).
Sample requires improvements.
maxFrames = 64
I believe it should be 1 without other options.
For example, color stream has 30 FPS, depth - 31 FPS (or 30.001 doesn't matter).
So you have 1 extra frame in 30 seconds
64 buffered frames would just grow the lag between streams of data.
After ~1800 seconds (~30 minutes) you will get full 2 seconds lag between frames.
| on a wall, but the depth data makes it easy. | ||
|
|
||
|  | ||
|  |
There was a problem hiding this comment.
.webp
Please stay conservative and use JPEG / PNG formats instead at least in "docs" area.
+430 KB
Hi-res images are usually not needed for tutorial pages.
- use lower resolution
- use lower quality for JPEG encoder (80 is usually good enough)
BTW, General rule is stay up to 150 Kb per image.
There was a problem hiding this comment.
Is there any particular reason to avoid using webp? It is supported in all browsers except KalOS browser. I picked webp because it's much smaller than png in lossless mode.
There was a problem hiding this comment.
WebP still has low adoption in tools.
At least, GitHub PR review tool doesn't support that format.
|
|
||
| { std::lock_guard<std::mutex> lk(depthFramesMtx); |
| while (depthFrames.empty() && colorFrames.empty()) | ||
| dataReady.wait(lk); | ||
|
|
||
| depthFramesMtx.lock(); | ||
| if (depthFrames.empty()) | ||
| { | ||
| depthFramesMtx.unlock(); |
There was a problem hiding this comment.
How this can happen after a while() pre-check above?
Half-answer: why do we need 3 different mutexes?
There was a problem hiding this comment.
The condition in the while() loop is true only when both lists are empty, so one of the lists can be empty here.
| colorFramesMtx.unlock(); | ||
|
|
||
| // Show color frame | ||
| imshow("Color", colorFrame); |
There was a problem hiding this comment.
This sample processes color/depth streams independently.
It is not a common flow for such applications.
They usually has some function like process(colorFrame, depthMap) which takes data from both streams.
There is no way to call processing with just one data frame.
Current "if"s logic above doesn't care about that and processes streams independently and optionally.
There was a problem hiding this comment.
Indeed some post-processing is required to sync two streams. It will be implemented later, I guess. This topic is out of scope for now.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.