This file contains 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
// images from | |
// https://drive.google.com/drive/folders/19tcwtgXRqyRxcNcfmyqUoBPM78mvfD9n?usp=sharing | |
int main(int argc, char **argv) { | |
Ptr<MACE> mace = MACE::create(); | |
vector<string> fn; | |
glob("face",fn); | |
for (int i=0; i<fn.size(); i++) { | |
vector<Mat> train_img; |
This file contains 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
static PyObject* pyopencv_cv_solvePnPGeneric(PyObject* , PyObject* args, PyObject* kw) | |
{ | |
using namespace cv; | |
{ | |
PyObject* pyobj_objectPoints = NULL; | |
Mat objectPoints; | |
PyObject* pyobj_imagePoints = NULL; | |
Mat imagePoints; | |
PyObject* pyobj_cameraMatrix = NULL; |
This file contains 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
Mat m1(3,3,CV_32FC3,Scalar(3,2,1)); | |
Mat m2; | |
cout << m1 << endl << m2 << endl; | |
Mat n = m1/m2; | |
cout << n << endl; | |
divide(1,m1,n); | |
cout << n << endl; | |
This file contains 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 <fstream> | |
#include <iostream> | |
#include <sstream> | |
#include <opencv2/dnn.hpp> | |
#include <opencv2/imgproc.hpp> | |
#include <opencv2/highgui.hpp> | |
using namespace cv; |
This file contains 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
# colab - install latest | |
# !pip install opencv-python==4.1.0.25 | |
import torch | |
import torch.nn as nn | |
import torchvision | |
import numpy as np | |
import cv2 |
This file contains 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
# this is a travis related oddity, ignore ... | |
import sys | |
sys.path.append('/home/travis/build/berak/tt/ocv/lib/python2.7/dist-packages/') | |
import cv2, numpy as np | |
img = cv2.imread("david2.jpg",0) | |
cas = cv2.CascadeClassifier("haarcascade_frontalface_alt2.xml") | |
faces = cas.detectMultiScale(img, 1.5, 5) | |
print("faces",faces) |
This file contains 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/dnn.hpp> | |
#include <opencv2/opencv.hpp> | |
using namespace cv; | |
using namespace cv::dnn; | |
using namespace std; | |
int main(int argc, char **argv) | |
{ | |
String modelTxt = "c:/data/mdl/faceboxes/deploy.prototxt"; |
This file contains 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
node { | |
name: "conv2d_input" | |
op: "Placeholder" | |
attr { | |
key: "dtype" | |
value { | |
type: DT_FLOAT | |
} | |
} | |
attr { |
This file contains 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/dnn.hpp> | |
#include <opencv2/dnn/layer.details.hpp> | |
class CropLayer : public cv::dnn::Layer | |
{ | |
public: | |
CropLayer(const cv::dnn::LayerParams ¶ms) : Layer(params) | |
{ |
This file contains 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
class CV_EXPORTS_W LDA | |
{ | |
public: | |
/** @brief constructor | |
Initializes a LDA with num_components (default 0). | |
*/ | |
explicit LDA(int num_components = 0); | |
/** Initializes and performs a Discriminant Analysis with Fisher's | |
Optimization Criterion on given data in src and corresponding labels |