Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions modules/face/include/opencv2/face.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class CV_EXPORTS_W FaceRecognizer : public Algorithm
@param src The training images, that means the faces you want to learn. The data has to be
given as a vector\<Mat\>.
@param labels The labels corresponding to the images have to be given either as a vector\<int\>
or a
or a Mat of type CV_32SC1.

The following source code snippet shows you how to learn a Fisherfaces model on a given set of
images. The images are read with imread and pushed into a std::vector\<Mat\>. The labels of each
Expand All @@ -175,6 +175,8 @@ class CV_EXPORTS_W FaceRecognizer : public Algorithm
// holds images and labels
vector<Mat> images;
vector<int> labels;
// using Mat of type CV_32SC1
// Mat labels(number_of_samples, 1, CV_32SC1);
// images for first person
images.push_back(imread("person0/0.jpg", IMREAD_GRAYSCALE)); labels.push_back(0);
images.push_back(imread("person0/1.jpg", IMREAD_GRAYSCALE)); labels.push_back(0);
Expand Down Expand Up @@ -211,7 +213,7 @@ class CV_EXPORTS_W FaceRecognizer : public Algorithm
@param src The training images, that means the faces you want to learn. The data has to be given
as a vector\<Mat\>.
@param labels The labels corresponding to the images have to be given either as a vector\<int\> or
a
a Mat of type CV_32SC1.

This method updates a (probably trained) FaceRecognizer, but only if the algorithm supports it. The
Local Binary Patterns Histograms (LBPH) recognizer (see createLBPHFaceRecognizer) can be updated.
Expand Down
9 changes: 0 additions & 9 deletions modules/sfm/src/libmv_light/libmv/base/CMakeLists.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ FILE(GLOB CORRESPONDENCE_HDRS *.h)

ADD_LIBRARY(correspondence STATIC ${CORRESPONDENCE_SRC} ${CORRESPONDENCE_HDRS})

TARGET_LINK_LIBRARIES(correspondence multiview)
TARGET_LINK_LIBRARIES(correspondence LINK_PRIVATE multiview)
IF(TARGET Eigen3::Eigen)
TARGET_LINK_LIBRARIES(correspondence LINK_PUBLIC Eigen3::Eigen)
ENDIF()

LIBMV_INSTALL_LIB(correspondence)

LIBMV_INSTALL_LIB(correspondence)
5 changes: 4 additions & 1 deletion modules/sfm/src/libmv_light/libmv/multiview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ SET(MULTIVIEW_SRC conditioning.cc
FILE(GLOB MULTIVIEW_HDRS *.h)

ADD_LIBRARY(multiview STATIC ${MULTIVIEW_SRC} ${MULTIVIEW_HDRS})
TARGET_LINK_LIBRARIES(multiview ${GLOG_LIBRARY} numeric)
TARGET_LINK_LIBRARIES(multiview LINK_PRIVATE ${GLOG_LIBRARY} numeric)
IF(TARGET Eigen3::Eigen)
TARGET_LINK_LIBRARIES(multiview LINK_PUBLIC Eigen3::Eigen)
ENDIF()

LIBMV_INSTALL_LIB(multiview)
6 changes: 4 additions & 2 deletions modules/sfm/src/libmv_light/libmv/numeric/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ FILE(GLOB NUMERIC_HDRS *.h)

ADD_LIBRARY(numeric STATIC ${NUMERIC_SRC} ${NUMERIC_HDRS})

TARGET_LINK_LIBRARIES(numeric)
IF(TARGET Eigen3::Eigen)
TARGET_LINK_LIBRARIES(numeric LINK_PUBLIC Eigen3::Eigen)
ENDIF()

LIBMV_INSTALL_LIB(numeric)
LIBMV_INSTALL_LIB(numeric)
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ FILE(GLOB SIMPLE_PIPELINE_HDRS *.h)

ADD_LIBRARY(simple_pipeline STATIC ${SIMPLE_PIPELINE_SRC} ${SIMPLE_PIPELINE_HDRS})

TARGET_LINK_LIBRARIES(simple_pipeline multiview ${CERES_LIBRARIES})
TARGET_LINK_LIBRARIES(simple_pipeline LINK_PRIVATE multiview ${CERES_LIBRARIES})

LIBMV_INSTALL_LIB(simple_pipeline)
LIBMV_INSTALL_LIB(simple_pipeline)
21 changes: 3 additions & 18 deletions modules/ximgproc/samples/fld_lines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ int main(int argc, char** argv)
return -1;
}

// Create LSD detector
Ptr<LineSegmentDetector> lsd = createLineSegmentDetector();
vector<Vec4f> lines_lsd;

// Create FLD detector
// Param Default value Description
// length_threshold 10 - Segments shorter than this will be discarded
Expand All @@ -57,29 +53,18 @@ int main(int argc, char** argv)
vector<Vec4f> lines_fld;

// Because of some CPU's power strategy, it seems that the first running of
// an algorithm takes much longer. So here we run both of the algorithmes 10
// times to see each algorithm's processing time with sufficiently warmed-up
// an algorithm takes much longer. So here we run the algorithm 10 times
// to see the algorithm's processing time with sufficiently warmed-up
// CPU performance.
for(int run_count = 0; run_count < 10; run_count++) {
lines_lsd.clear();
int64 start_lsd = getTickCount();
lsd->detect(image, lines_lsd);
// Detect the lines with LSD
double freq = getTickFrequency();
double duration_ms_lsd = double(getTickCount() - start_lsd) * 1000 / freq;
std::cout << "Elapsed time for LSD: " << duration_ms_lsd << " ms." << std::endl;

lines_fld.clear();
int64 start = getTickCount();
// Detect the lines with FLD
fld->detect(image, lines_fld);
double duration_ms = double(getTickCount() - start) * 1000 / freq;
std::cout << "Ealpsed time for FLD " << duration_ms << " ms." << std::endl;
std::cout << "Elapsed time for FLD " << duration_ms << " ms." << std::endl;
}
// Show found lines with LSD
Mat line_image_lsd(image);
lsd->drawSegments(line_image_lsd, lines_lsd);
imshow("LSD result", line_image_lsd);

// Show found lines with FLD
Mat line_image_fld(image);
Expand Down