Skip to content

Instantly share code, notes, and snippets.

@deli4iled
Forked from RobertaRavanelli/APIdesign.puml
Last active May 20, 2016 09:16
Show Gist options
  • Save deli4iled/addc398b5d6541fc587ab6454e4df78d to your computer and use it in GitHub Desktop.
Save deli4iled/addc398b5d6541fc587ab6454e4df78d to your computer and use it in GitHub Desktop.
first commit
@startuml
namespace cv::structured_light{
GrayCodePattern <-- GrayCodePattern_Impl : heritance
StructuredLightPattern <-- GrayCodePattern : heritance
cv::algorithm <-- StructuredLightPattern: heritance
class StructuredLightPattern {
'Abstract base class for generating and decoding structured light pattern'
..generate..
+virtual bool generate( OutputArrayOfArrays patternImages )
..decode..
+virtual bool decode(InputArrayOfArray patternImages, InputArrayOfArray blackImages = noArray(), InputArrayOfArray whiteImages = noArray(), OutputArray disparityMap, int flags)
}
class GrayCodePattern{
+static Ptr<GrayCodePattern> create(const GrayCodePattern::Params &parameters = GrayCodePattern::Params());
+struct Params
int width
int height
+virtual void getImagesForShadowMasks(InputOutputArray blackImage, InputOutputArray whiteImage)
+virtual void setBlackThreshold(size_t val)
+virtual void setWhiteThreshold(size_t val)
+virtual void getProjPixel(InputArrayOfArray patternImages, int x, int y, cv::Point &projPix)
+viertual size_t getnumOfPatternImages()
}
class GrayCodePattern_Impl {
+GrayCodePattern_Impl::GrayCodePattern_Impl(const 3DUnderworld::Params &parameters)
+virtual ~GrayCodePattern_Impl()
+void getProjPixel(InputArrayOfArray patternImages, int x, int y, cv::Point &projPix)
'converts a gray code sequence to a decimal number'
-static int grayToDec(const cv::vector<bool> gray)
'computes the required number of pattern images, allocating the pattern vector'
-void computeNumberOfPatternImages()
'the number of images of the pattern'
-size_t numOfPatternImages
'the number of row images of the pattern'
-size_t numberOfHorImages
'the number of column images of the pattern'
-size_t numberOfVerImages
-int blackThreshold
-int whiteThreshold
-void computeShadowMasks(InputArraysOfArray darkImage, InputArraysOfArray lightImage, OutputArraysOfArray shadowsMasks)
-Params params;
+void getImagesForShadowMasks(InputOutputArray blackImage, InputOutputArray whiteImage)
+void setBlackThreshold(size_t val)
+void setWhiteThreshold(size_t val)
+viertual size_t getnumOfPatternImages()
}
class enum{
+enum DECODE_3D_UNDERWORLD = 0
}
note left of (StructuredLightPattern)
Abstract base class for generating and decoding structured light patterns
Its definition is in the structured_light.hpp file
__
generate: generates the gray code pattern as a std::vector<cv::Mat>
__
decode: decodes the gray code pattern returning a disparity map; 0 flag implements a decoding method based on treshold parameters
end note
note left of (GrayCodePattern)
General interface for generating and decoding Gray Codes Pattern
Its definition is in the graycodepattern.hpp file
__
Params: for now it contains the heigth and the width of the projector
__
getImageForShadowsMask: generates the all black and all white images needed for shadowsMask computation
__
setWhiteThreshold: sets the value for white color threshold
__
setBlackThreshold: sets the value for black color threshold
__
getProjPixel: for a (x,y) pixel of the camera returns the corresponding projector pixel
__
getnumOfPatternImages(): returns the number of pattern images needed for that projector
end note
note left of (GrayCodePattern_Impl)
Porting of the structured GrayCodePattern described in 3DUNDERWORLD-SLS
Its definition and implementation is in the graycodepattern.cpp file
--
GrayCodePattern_Impl: constructor
__
~GrayCodePattern: destructor
__
computeNumberOfPatternImages: computes the required number of pattern images, allocating the pattern vector
__
computeShadowsMask: computes the shadows occlusion where the model can't be reconstructed
__
blackThreshold: number between 0-255 that represents the minimum brightness difference
between the fully illuminated (white image) and the non - illuminated images (black image);
used in computeShadowsMask method
__
whiteThreshold: number between 0-255 that represents the minimum brightness difference
between the gray-code pattern and its inverse images; used in getProjPixel method
__
grayToDec: converts a gray code (similar to a binary sequence) to a decimal number
end note
note top of (enum)
DECODE_3D_UNDERWORLD: flag for using the decode algorithm implemented in “3DUNDERWORLD-SLS: An Open-Source
Structured-Light Scanning System for Rapid Geometry Acquisition”. Other algorithms can be implemented.
end note
}
/'
note top of (_t1)
Tutorial for pattern acquisition
--
Handles the pattern generation
Handles the cameras through libgphoto2 APIs (included in OpenCV)
Acquires and savesthe pattern images with libgphoto2 APIs (included in OpenCV)
Performs calibration using OpenCV calibration methods
end note
note top of (_t2)
Tutorial for 3D reconstruction
--
Acquires the pattern images through libgphoto2 APIs (included in OpenCV)
Rectifies the pattern images using the already implemented OpenCV functions
Decodes the images through GrayCodePattern class that returns a disparity map
Computes the point cloud reprojecting the disparity map to 3D (disparity->depth->3D) using the already implemented OpenCV functions
end note
'/
@endunml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment