This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;try this ;) | |
void* cv_createFisherFaceRecognizer(int num_components, double threshold) | |
{ | |
typedef Ptr<FaceRecognizer> ptr_fr; | |
ptr_fr _retval_ = cv::createFisherFaceRecognizer(num_components, threshold); | |
return (void*)(new ptr_fr(_retval_)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>echo -n ../cmake-2.8.12.1/bin/cmake -G \"Unix Makefiles\" -DOPENCV_EXTRA_MODULE | |
S_PATH=../opencv_contrib/modules -DBUILD_TIFF=> cm.in | |
echo -n ON -DWITH_TIFF=ON -DWITH_IPP=ON -DBUILD_PNG=ON -DWITH_PNG=>> cm.in | |
echo -n ON -DBUILD_ZLIB=ON -DWITH_JASPER=OFF -DWITH_OPENEXR=OFF -DBUILD_OPENEXR= | |
OFF -DBUILD_SHARED_LIBS= >> cm.in | |
echo -n OFF -DCMAKE_INSTALL_PREFIX=/app/ocv3 -DBUILD_TESTS=OFF -DBUILD_PERF_TES | |
TS= >> cm.in | |
echo OFF -DBUILD_opencv_apps=OFF -DBUILD_examples=OFF -DANT_EXECUTABLE=../apach | |
e-ant-1.9.4/bin/ant >> cm.in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "opencv2/opencv.hpp" | |
using namespace cv; | |
using namespace std; | |
#ifndef CV_SQR | |
# define CV_SQR(x) ((x)*(x)) | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If no image path was given, then supply some information on how this tool works | |
const char *keys = | |
"{ help h ? | | show this message }" | |
"{ images i | | folder_location }" | |
"{ annotations a |annotations.txt| ouput_file }" | |
; | |
CommandLineParser parser(argc, argv, keys); | |
String image_folder = parser.get<String>("images"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// void initUndistortRectifyMap(Mat K, Mat D, Mat R, Mat P, Size size, int m1type, Mat& map1, Mat& map2) | |
// | |
JNIEXPORT void JNICALL Java_org_opencv_calib3d_Calib3d_initUndistortRectifyMap_10 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jdouble, jdouble, jint, jlong, jlong); | |
JNIEXPORT void JNICALL Java_org_opencv_calib3d_Calib3d_initUndistortRectifyMap_10 | |
(JNIEnv* env, jclass , jlong K_nativeObj, jlong D_nativeObj, jlong R_nativeObj, jlong P_nativeObj, jdouble size_width, jdouble size_height, jint m1type, jlong map1_nativeObj, jlong map2_nativeObj) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "opencv2/opencv.hpp" | |
using namespace cv; | |
using namespace std; | |
int main(int argc, char **argv) | |
{ | |
cv::Mat trainingData, trainingLabels; | |
vector<String> fn; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.opencv.core.*; | |
import org.opencv.imgproc.*; | |
import org.opencv.imgcodecs.Imgcodecs; | |
import org.opencv.videoio.*; | |
class SimpleSample { | |
static{ System.loadLibrary(Core.NATIVE_LIBRARY_NAME); } | |
//~ static int fcc(char a, char b, char c, char d) { | |
//~ return (d<<24 | c<<16 | b<<8 | a); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db = { | |
_get: function(hook,key,who,proc) { | |
hook.datastore.get(key, function(err, result){ | |
if (err) { return hook.res.end(err.message); } | |
proc(hook,result,who); | |
}); | |
}, | |
_setraw: function(hook,key,val,proc) { | |
hook.datastore.set(key, val, function(err, val){ | |
if (err) { return hook.res.end(err.message); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/opencv.hpp> | |
#include "face_x.h" | |
FaceX face_x("model.xml.gz"); | |
// if you have a Rect, e.g. from CascadeDetector: | |
std::vector<cv::Point2d> landmarks = face_x.Alignment(img, cv::Rect(0,0,img.cols,img.rows)); | |
// or track previous landmarks: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/opencv.hpp> | |
#include <opencv2/core/core_c.h> // needed for IplImage ;( | |
#include <dlib/image_processing.h> | |
#include <dlib/opencv/cv_image.h> | |
// IMPORTANT: | |
// do **not** use namespace cv or dlib, | |
// but prefix everything correctly !!! |