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
int cv_Mat_set_Type(Mat* self, int val) { | |
self->type() = val; | |
} |
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
CPP file contents: | |
typedef vector<DMatch> vector_DMatch; | |
DMatch* cv_vector_DMatch_at(vector_DMatch* self, int idx) { | |
DMatch & temp = self->at<DMatch>(idx); | |
} | |
HPP file contents: |
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
uchar a[10] = {1,2,3,4,5,6,7,8,9}; | |
Mat b = Mat(3,3,0,a); | |
Mat c = b.diag(0); | |
cout << b.at<uchar>(0); |
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
const int MAX_CORNERS = 500; | |
int main() | |
{ | |
// Load two images and allocate other structures | |
IplImage* imgA = cvLoadImage("/d1", CV_LOAD_IMAGE_GRAYSCALE); | |
IplImage* imgB = cvLoadImage("d1", CV_LOAD_IMAGE_GRAYSCALE); | |
CvSize img_sz = cvGetSize( imgA ); | |
int win_size = 15; |
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
int main( int argc, const char** argv ) | |
{ | |
cv::Point seed(4,4); | |
cv::Mat img = cv::Mat::zeros(100,100,CV_8UC1); | |
cv::circle(img, seed, 20, cv::Scalar(128),3); | |
cv::Mat mask; | |
cv::Canny(img, mask, 100, 200); | |
cv::copyMakeBorder(mask, mask, 1, 1, 1, 1, cv::BORDER_REPLICATE); | |
//Fill mask with value 128 |
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
import numpy as np | |
import cv2 | |
img1 = cv2.imread('/m1') | |
size = 200, 200 | |
e1 = cv2.getTickCount() | |
for x in range(0, 10000): | |
np.zeros((500, 500), np.uint32) | |
e2 = cv2.getTickCount() | |
t = (e2 - e1)/cv2.getTickFrequency() |
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
void cv_KeyPoint_setPT(KeyPoint* self, Point2f* val) { | |
self->pt = (val); | |
} |
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
(let ((previous nil)) | |
(defun %mat-data (rows cols type cffi-type val-list ) | |
(unless (equal data (car previous)) | |
(setf previous (cons data (gced-foreign-alloc cffi-type | |
:initial-contents val-list)))) | |
(mat-data rows cols type (cdr previous))) |
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
(declaim (ftype (function (integer integer integer list ) cv-mat) make-mat-data1)) | |
(let ((previous nil)) | |
;; GET ERROR HERE, defun is underlined "Type assertion too complex to check (VALUES CV-MAT &REST T)" | |
(defun make-mat-data1 (rows cols type data) | |
(let ((cffi-type (case type | |
(#.+8uc1+ ':uchar) | |
(#.+8sc1+ ':char) | |
(#.+16uc1+ ':ushort) |
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
void cv_delete(char* self) { | |
delete self; | |
} |