If you meet this error message "afxcontrolbars.h - No such file or directory...", while complie on the VS C++.
You can solve this problem easily by installing Visual Studio Serviece Pack 1.0.
Download appropriate language version and install.
[vs90 sp1 English]
[vs90 sp1 Korea]
2/23/2012
2/15/2012
(TIP) To get Color Information of specific pixel coordinate in the OpenGL
The method is simple to to get Color Information of specific pixel coordinate in the OpenGL is simple.
glReadPixels function enables these task.
The example source code is as follows.
struct{ GLubyte red, green, blue; } pixelColor;
glReadPixels(int(i), int(j), 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &pixelColor);
But the drawback is too slow and we can get exact color information after view rendering.
Thanks.
glReadPixels function enables these task.
The example source code is as follows.
struct{ GLubyte red, green, blue; } pixelColor;
glReadPixels(int(i), int(j), 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &pixelColor);
But the drawback is too slow and we can get exact color information after view rendering.
Thanks.
2/09/2012
To Save OpenGL ViewPort to Image File (glReadPixels, OpenGL->OpenCV)
You can save the Viewport of OpenGL to Image file using glReadPixels function.
And this code is example for saving image file using openCV.
Thank you.
void CaptureViewPort()
{
GLubyte * bits; //RGB bits
GLint viewport[4]; //current viewport
//get current viewport
glGetIntegerv(GL_VIEWPORT, viewport);
int w = viewport[2];
int h = viewport[3];
bits = new GLubyte[w*3*h];
//read pixel from frame buffer
glFinish(); //finish all commands of OpenGL
glPixelStorei(GL_PACK_ALIGNMENT,1); //or glPixelStorei(GL_PACK_ALIGNMENT,4);
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
glPixelStorei(GL_PACK_SKIP_ROWS, 0);
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
glReadPixels(0, 0, w, h, GL_BGR_EXT, GL_UNSIGNED_BYTE, bits);
IplImage * capImg = cvCreateImage( cvSize(w,h), IPL_DEPTH_8U, 3);
for(int i=0; i < h; ++i)
{
for(int j=0; j < w; ++j)
{
capImg->imageData[i*capImg->widthStep + j*3+0] = (unsigned char)(bits[(h-i-1)*3*w + j*3+0]);
capImg->imageData[i*capImg->widthStep + j*3+1] = (unsigned char)(bits[(h-i-1)*3*w + j*3+1]);
capImg->imageData[i*capImg->widthStep + j*3+2] = (unsigned char)(bits[(h-i-1)*3*w + j*3+2]);
}
}
cvSaveImage("result.jpg",capImg);
cvReleaseImage(&capImg);
delete[] bits;
}
2/07/2012
(TIP) Check the radio button control / MFC or API
[mfc case]
((CButton*)GetDlgItem(IDC_RADIO))->SetCheck(true);
[api case]
HWND hWnd;
hWnd = ::GetDlgItem(GetSafeHwnd(), IDC_RADIO_NOTIFY_ALL);
::CheckRadioButton(hWnd, IDC_RADIO_NOTIFY_ALL, IDC_RADIO_NOTIFY_CONTENTS, IDC_RADIO_NOTIFY_ALL);
::SendMessage(hWnd, BM_SETCHECK, (WPARAM)BST_CHECKED, NULL);
((CButton*)GetDlgItem(IDC_RADIO))->SetCheck(true);
[api case]
HWND hWnd;
hWnd = ::GetDlgItem(GetSafeHwnd(), IDC_RADIO_NOTIFY_ALL);
::CheckRadioButton(hWnd, IDC_RADIO_NOTIFY_ALL, IDC_RADIO_NOTIFY_CONTENTS, IDC_RADIO_NOTIFY_ALL);
::SendMessage(hWnd, BM_SETCHECK, (WPARAM)BST_CHECKED, NULL);
1/31/2012
Distance Tx, Ty according to Heading direction when you know the current point(x,y) - math note
Distance Tx, Ty according to Heading direction when you know the current point(x,y) - math note
Thank you~ ^^.
Thank you~ ^^.
1/26/2012
(TIP) Maple 15 - The method of the Matrix multiply (3by3 Rotation matrix)
(TIP) Maple 15 - The method of the Matrix multiply
Show the below example~
or
We can use LinearAlgebra command. Using 'with(LinearAlgebra)' keyword
Show next example~
Thank you~ ^^
Show the below example~
or
We can use LinearAlgebra command. Using 'with(LinearAlgebra)' keyword
Show next example~
Thank you~ ^^
1/24/2012
(TIP) Maple 15 - the method of the matrix differential
(TIP) The method of the matrix differential in the Maple 15 math tool.
You should use "map" function. Show the below example.
Thanks you. ^^
You should use "map" function. Show the below example.
Thanks you. ^^
Subscribe to:
Posts (Atom)
-
Logistic Classifier The logistic classifier is similar to equation of the plane. W is weight vector, X is input vector and y is output...
-
This is data acquisition source code of LMS511(SICK co.) Source code is made by MFC(vs 2008). The sensor is communicated by TCP/IP. ...
-
Image size of origin is 320*240. Processing time is 30.96 second took. The result of stitching The resul...
-
RTSP(Real Time Streaming Protocol) is video streaming, it usually sent from network camera. VideoCapture function in opencv also can get r...
-
Background subtractor example souce code. OpenCV support about 3 types subtraction algorithm. Those are MOG, MOG2, GMG algorithms. Det...
-
Created Date : 2011.2 Language : C/C++ Tool : Microsoft Visual C++ 2010 Library & Utilized : OpenCV 2.2 Reference : Interent Refer...
-
After training SVM, we should test the trained XML data is reliable or not.. The method to extract HOG feature is refer to -> http://fe...
-
This example source code is to extract HOG feature from images. And save descriptors to XML file. The source code explain how to use HOGD...
-
EMD(earth mover distance) method is very good method to compare image similarity. But processing time is slow. For using the EMD compare, ...
-
AMD GPU Programming Primer Threads · Waves · Memory · Tile Distribution · Vector Loads · MFMA ...