2016-09-23 02:04:42 -0600 | received badge | ● Enthusiast |
2016-09-19 00:43:43 -0600 | received badge | ● Editor (source) |
2016-09-19 00:43:04 -0600 | asked a question | OpenCV + OpenGL: How to use SolvePnP Rotation and translation vector in OpenGL I'm working on an AR program. please heip me dealing's almost done. I found marker and rvec,tvec by SolvePnP. I can not draw object in OpenGL. I am beginer OpenGL,OpenCV. I want to render 3D cube over that marker using OpenGL. use support opengl mode by build opencv. According to "http://answers.opencv.org/question/23089/opencv-opengl-proper-camera-pose-using-solvepnp/" I'm doing it like this: opengl callback i cannot find cube. if I delete "glLoadMatrixd(&glViewMatrix2.at<double>(0, 0));" this line. I can find cube on center. Q2-How to use glut.where can I do"glutInit(&argc2, argv2);" |
2016-07-12 09:11:06 -0600 | asked a question | find trapezoid's 4 points for warping (rectangle-A4paper ) find biggest rectangle. I need to find trapezoid's 4 points I try use "Rect" but only 2points just 1point is good point help me int main(int argc, char** argv) { } |
2016-07-09 11:31:27 -0600 | asked a question | find largest Square and location I used sample code pragma package <opencv>endifinclude <opencv2\opencv.hpp>include <opencv2\highgui.hpp>include <stdio.h>include <math.h>include <string.h>int thresh = 50; IplImage* img = 0; IplImage* img0 = 0; CvMemStorage* storage = 0; const char* wndname = "Square Detection Demo"; // helper function: // finds a cosine of angle between vectors // from pt0->pt1 and from pt0->pt2 double angle(CvPoint* pt1, CvPoint* pt2, CvPoint* pt0) { double dx1 = pt1->x - pt0->x; double dy1 = pt1->y - pt0->y; double dx2 = pt2->x - pt0->x; double dy2 = pt2->y - pt0->y; return (dx1dx2 + dy1dy2) / sqrt((dx1dx1 + dy1dy1)(dx2dx2 + dy2*dy2) + 1e-10); } // returns sequence of squares detected on the image. // the sequence is stored in the specified memory storage CvSeq* findSquares4(IplImage* img, CvMemStorage* storage) { CvSeq* contours; int i, c, l, N = 11; CvSize sz = cvSize(img->width & -2, img->height & -2); IplImage* timg = cvCloneImage(img); // make a copy of input image IplImage* gray = cvCreateImage(sz, 8, 1); IplImage* pyr = cvCreateImage(cvSize(sz.width / 2, sz.height / 2), 8, 3); IplImage* tgray; CvSeq* result; double s, t; // create empty sequence that will contain points - // 4 points per square (the square's vertices) CvSeq* squares = cvCreateSeq(0, sizeof(CvSeq), sizeof(CvPoint), storage); (more) |