Closed Reena24 closed 10 years ago
Sorry, all telepaths are in vacation.. Without a context it's hard to say what is wrong. According to this output, there is version conflict of Qt versions (4.8.5 and 4.8.4). You configured OpenCV to use Qt, did you?
Yeah i did configure OpenCV to use Qt. But how to i remove version 4.8.4 since i am new to opencv i dont know how to solve the problem. I configured opencv according yo the instructions in http://docs.opencv.org/2.4.4/doc/tutorials/introduction/windows_install/windows_install.html#installation-by-making-your-own-libraries-from-the-source-files which enables the Qt version. I downloaded qt-everywhere-opensource-src-4.8.5 from http://qt-project.org/downloads and extracted it in a qt folder for which i have configured according to the instruction. I really want some help cause am stuck with trying to execute the code for past three weeks. I tried to execute a simple program to check the problem. This is the sample code i tried.
int _tmain(int argc, _TCHAR* argv[]) { return 0; }
int main() { std::cerr << "Library was built without OpenGL support" << std::endl; return -1; }
#define WIN32_LEAN_AND_MEAN 1
#define NOMINMAX 1
#include <windows.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GL/gl.h>
#include <GL/glu.h>
using namespace cv; using namespace std; void on_opengl(void* userdata);
int main(void) { VideoCapture webcam(CV_CAP_ANY);
namedWindow("window", CV_WINDOW_OPENGL);
Mat frame;
ogl::Texture2D tex;
setOpenGlDrawCallback("window", on_opengl, &tex);
while(waitKey(30) < 0)
{
webcam >> frame;
tex.copyFrom(frame);
updateWindow("window");
}
setOpenGlDrawCallback("window", 0, 0);
destroyAllWindows();
return 0;
}
void on_opengl(void* userdata) { ogl::Texture2D* pTex = static_castogl::Texture2D*(userdata); if (pTex->empty()) return;
glLoadIdentity();
glTranslated(0.0, 0.0, 1.0);
glRotatef( 55, 1, 0, 0 );
glRotatef( 45, 0, 1, 0 );
glRotatef( 0, 0, 0, 1 );
static const int coords[6][4][3] = {
{ { +1, -1, -1 }, { -1, -1, -1 }, { -1, +1, -1 }, { +1, +1, -1 } },
{ { +1, +1, -1 }, { -1, +1, -1 }, { -1, +1, +1 }, { +1, +1, +1 } },
{ { +1, -1, +1 }, { +1, -1, -1 }, { +1, +1, -1 }, { +1, +1, +1 } },
{ { -1, -1, -1 }, { -1, -1, +1 }, { -1, +1, +1 }, { -1, +1, -1 } },
{ { +1, -1, +1 }, { -1, -1, +1 }, { -1, -1, -1 }, { +1, -1, -1 } },
{ { -1, -1, +1 }, { +1, -1, +1 }, { +1, +1, +1 }, { -1, +1, +1 } }
};
glEnable(GL_TEXTURE_2D);
pTex->bind();
for (int i = 0; i < 6; ++i) {
glColor3ub( i*20, 100+i*10, i*42 );
glBegin(GL_QUADS);
for (int j = 0; j < 4; ++j) {
glVertex3d(0.2*coords[i][j][0], 0.2 * coords[i][j][1], 0.2*coords[i][j][2]);
}
glEnd();
}
}
The code displays an error when it reaches the line namedWindow("window", CV_WINDOW_OPENGL); and setOpenGlDrawCallback("window", on_opengl, &tex); . The same error comes when i try for the MarkerlessAR code at the same point. Could you please help solve this error. Please.
Also i have 2 versions of Microsoft sdk C:\Program Files\Microsoft SDKs\Windows\v6.0A (old version) C:\Program Files\Microsoft SDKs\Windows\v6.1 (new version ) am not sure which opengl version is being conisidered
Just remove all Qt versions you have, download the base 4.8.0 and recompile OpenCV with 4.8.0.
On Windows, latest Qt makes problems, unless you switch to Linux
But where can i get 4.8.0 source code version from. I tried to search for 4.8.4 and i couldn't find the link
Also I have a doubt if i install 4.8.0 will it show compatibility problem again. Could i get some link where i can download it from
You just look on Qt website and select "previous versions". On www.pointclouds.org in Download section there is the link to Qt 4.8.0 for MSVC2010 Am 10.02.2014 18:13 schrieb "Reena24" notifications@github.com:
Also I have a doubt if i install 4.8.0 will it show compatibility problem again. Could i get some link where i can download it from
Reply to this email directly or view it on GitHubhttps://github.com/MasteringOpenCV/code/issues/27#issuecomment-34656152 .
Thanks a lot i reconfigured using Qt 4.8.4 and now its executing with no problems.
Glad to hear!
Thanks a lot my Markerless AR code has finally started to execute but i cant understand one thing why does the cube keep on moving when using an image and camera as input
How can i solve this compatibility issue in Windows 7 . Though i have opengl support the next error it shows is this
if i am to downgrade or upgrade it i would like to know where i should download from and the proper steps involved