Giter VIP home page Giter VIP logo

Comments (10)

BloodAxe avatar BloodAxe commented on June 10, 2024

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?

from code.

Reena24 avatar Reena24 commented on June 10, 2024

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.

#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2/core/opengl_interop.hpp>
#include
#include "E:\OpenCV\Build\cvconfig.h"
#ifndef HAVE_OPENGL
int main()
{
std::cerr << "Library was built without OpenGL support" << std::endl;
return -1;
}
#else

#ifdef WIN32
#define WIN32_LEAN_AND_MEAN 1
#define NOMINMAX 1
#include <windows.h>
#endif

#if defined(APPLE)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif

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();
}

}
#endif

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.

from code.

Reena24 avatar Reena24 commented on June 10, 2024

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

from code.

madduci avatar madduci commented on June 10, 2024

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

from code.

Reena24 avatar Reena24 commented on June 10, 2024

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

from code.

Reena24 avatar Reena24 commented on June 10, 2024

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

from code.

madduci avatar madduci commented on June 10, 2024

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" [email protected]:

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//issues/27#issuecomment-34656152
.

from code.

Reena24 avatar Reena24 commented on June 10, 2024

Thanks a lot i reconfigured using Qt 4.8.4 and now its executing with no problems.

from code.

BloodAxe avatar BloodAxe commented on June 10, 2024

Glad to hear!

from code.

Reena24 avatar Reena24 commented on June 10, 2024

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

from code.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.