Skip to content

Commit 8a4e1c2

Browse files
committed
structured_light: GreyCodePattern 16-bit support and performance improvements
- Vastly improve performance of the GreyCodePattern structured light algorithm by leveraging built-in OpenCV functions and parallel code instead of raw loops, at the cost of a bit more memory (decoding a set of 96 5320x4600 images acquired using stereo cameras goes from taking ~100 seconds to taking ~2.5 seconds, in release mode) - Automatically gain the ability to decode 16-bit images (switching from raw loops and uchar-indexing to OpenCV functions gives this for free) - Remove the getProjPixel function from the GreyCodePattern API surface (this gives us the ability to optimize the retrieval and hide some implementation details) Manual testing was done to ensure that the calculated results are correct, both for generation of the patterns and for decoding, in both Debug and Release mode, using real world data.
1 parent ea9f108 commit 8a4e1c2

File tree

2 files changed

+193
-256
lines changed

2 files changed

+193
-256
lines changed

modules/structured_light/include/opencv2/structured_light/graycodepattern.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,6 @@ class CV_EXPORTS_W GrayCodePattern : public StructuredLightPattern
128128
*/
129129
CV_WRAP
130130
virtual void getImagesForShadowMasks( InputOutputArray blackImage, InputOutputArray whiteImage ) const = 0;
131-
132-
/** @brief For a (x,y) pixel of a camera returns the corresponding projector pixel.
133-
*
134-
* The function decodes each pixel in the pattern images acquired by a camera into their corresponding decimal numbers representing the projector's column and row,
135-
* providing a mapping between camera's and projector's pixel.
136-
*
137-
* @param patternImages The pattern images acquired by the camera, stored in a grayscale vector < Mat >.
138-
* @param x x coordinate of the image pixel.
139-
* @param y y coordinate of the image pixel.
140-
* @param projPix Projector's pixel corresponding to the camera's pixel: projPix.x and projPix.y are the image coordinates of the projector's pixel corresponding to the pixel being decoded in a camera.
141-
*/
142-
CV_WRAP
143-
virtual bool getProjPixel( InputArrayOfArrays patternImages, int x, int y, CV_OUT Point &projPix ) const = 0;
144131
};
145132

146133
//! @}

0 commit comments

Comments
 (0)