Face3d
|
#include <Detection.hpp>
Classes | |
struct | ContourInfo |
struct | DetectFaceResult |
Public Member Functions | |
Detection (const cv::Mat &front, const cv::Mat &side) | |
create a Detection object More... | |
DetectFaceResult | detectFace () |
calculate the face geometry and the textures More... | |
Private Types | |
enum | RegionType { RegionTypeInside, RegionTypeOutside } |
Private Member Functions | |
cv::Mat | getCopyOfOriginal (int imgNr) |
void | doPreprocessing () |
void | doFaceExtraction () |
void | doFacialComponentsExtraction () |
void | doFacialComponentsExtractionFront (FaceGeometry &faceGeometry, const std::vector< ContourInfo > &componentContourInfo, const std::vector< ContourInfo > &faceContourInfo) |
void | doFacialComponentsExtractionSide (FaceGeometry &faceGeometry, const std::vector< ContourInfo > &componentContourInfo, const std::vector< ContourInfo > &faceContourInfo) |
std::vector< size_t > | findRegions (const std::vector< std::vector< cv::Point > > &contours, const std::vector< cv::Vec4i > &hierarchy, RegionType regionType) |
std::vector< ContourInfo > | extractContourInfo (const std::vector< std::vector< cv::Point > > &contours, const std::vector< size_t > indices) |
void | doMatchCoordinates () |
void | createTextures () |
cv::Rect | getBoundingBox (const cv::Mat &color) |
void | doFaceExtractionGUI () |
void | createTexturesAndShowResultsGUI () |
cv::Mat | combineVertically (const cv::Mat &a, const cv::Mat &b) const |
Private Attributes | |
int | m_ColorThresValue = 10 |
int | m_OffsetCB =0 |
int | m_OffsetCR =0 |
double | m_AddTextureBottom = 0 |
double | m_AddTextureTop = 0 |
const size_t | frontImgNr = 0 |
index of the front image when both images are stored in an array More... | |
const size_t | sideImgNr = 1 |
index of the side image when both images are stored in an array More... | |
const size_t | imgSize = 320 |
size of the images we are working with. 320x320 seems good as its fast but has still enough details More... | |
std::vector< cv::Mat > | m_Originals |
original images (scaled down) More... | |
std::vector< cv::Mat > | m_Preprocessed |
preprocessed images (smooth) More... | |
std::vector< cv::Mat > | m_FaceExtracted |
binary image with skin as foreground More... | |
std::vector< cv::Mat > | m_FaceMask |
mask of the face regions. foreground regions which are not the face are already removed More... | |
FaceGeometry | m_FaceGeometry |
FaceGeometry | m_FaceGeometryBackup |
the geometry of the face, i.e. the coordinates of the facial components More... | |
std::vector< cv::Mat > | m_Textures |
the textures, already in a format that can be used in OpenGL More... | |
cv::Mat | m_FacialPointsGUI |
cv::Mat | m_TexturesGUI |
Friends | |
void | onColorThresholdsTrackbar (int, void *) |
void | onTextureAdjustmentTrackbarBottom (int, void *) |
void | onTextureAdjustmentTrackbarTop (int, void *) |
class which detects the facial components and calculates the face geometry
|
private |
Face3D::Detection::Detection | ( | const cv::Mat & | front, |
const cv::Mat & | side | ||
) |
create a Detection object
front | image of the face from the front |
side | image of the face from the side |
|
private |
|
private |
create the textures from the two images and align them
|
private |
Detection::DetectFaceResult Face3D::Detection::detectFace | ( | ) |
calculate the face geometry and the textures
|
private |
extracts face (skin) region
|
private |
|
private |
extract facial components (eyes, nose, ...)
|
private |
extract facial components in front image
|
private |
extract facial components in side image
|
private |
match the 2d coordinates of the facial components in the two images to get the 3d information
|
private |
preprocessing: smooth image
|
private |
calculate informations about the contours, e.g. the area
|
private |
fget list of regions with specified type
|
private |
get the bounding box of the color image. background must be black, everything else will be regared as foreground.
|
inlineprivate |
helper function to get original image to draw on for debug output
|
friend |
|
friend |
|
friend |
|
private |
index of the front image when both images are stored in an array
images (originals and processed)
|
private |
size of the images we are working with. 320x320 seems good as its fast but has still enough details
|
private |
|
private |
|
private |
gui interaction
|
private |
binary image with skin as foreground
|
private |
|
private |
the geometry of the face, i.e. the coordinates of the facial components
|
private |
mask of the face regions. foreground regions which are not the face are already removed
|
private |
resulting images to show in the gui
|
private |
|
private |
|
private |
original images (scaled down)
|
private |
preprocessed images (smooth)
|
private |
the textures, already in a format that can be used in OpenGL
|
private |
|
private |
index of the side image when both images are stored in an array