rociodandolo / ehci

Automatically exported from code.google.com/p/ehci
0 stars 0 forks source link

Trouble working samples in Windows Vista #13

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Windows Vista
2. Using the following software

MINGW 5.1.6
gcc-g++3.4.5
gcc-core-3.4.5
binutils-2.20.51-1-mingw32
gcc-build-3.4.5
mingw-runtime-3.14
w32api-3.14-mingw32-dev
glut-3.7.6
ehci-0.6

3. Eclipse with no include or library problems to my knowledge, at least there 
is nothing in the problems list.

What is the expected output? What do you see instead?

Whatever the simple2d is supposed to do.

This is what I get from the console report

**** Build of configuration Debug for project GetBounds ****

**** Internal Builder is used for build               ****
g++ -LC:\OpenCV2.1\lib -LC:\MinGW\ehci -oGetBounds.exe Headbounds.o -lcv210 
-lml210 -lcvaux210 -lcxcore210 -lhighgui210
Headbounds.o:在函数‘main’中:
C:/Users/Bluefrared/workspace/GetBounds/Debug/../Headbounds.cpp:23:对â
€˜ehciLoop(int, int)’未定义的引用
C:/Users/Bluefrared/workspace/GetBounds/Debug/../Headbounds.cpp:24:对â
€˜getHeadBounds(int*, int*, int*, 
int*)’未定义的引用
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 536  ms.  

What version of the product are you using? On what operating system?

Windows Vista, EHCI 0.6

Please provide any additional information below.

I originally was working in Mac OS X snow leopard but was running into 
significant OpenGL and GLUT issues so I tried in Windows Vista--the issues from 
before cleared, but this new one appeared and I am at a loss as to what the 
cause is because I am not an experienced programmer.

I did not follow the INSTALL file that came with ehci because I did not know 
how to perform the instructions in the windows terminal.  I simply extracted 
the files into my MinGW folder in the folder ehci and included them, and did 
not include any ehci library or direction path because I did not see any ehci 
lib files.

OpenCV worked with some sample code such as a contour identification program.  
I assume, because it is a rather large and complex OpenCV program, that OpenCV 
is being correctly referenced and was properly installed.

Original issue reported on code.google.com by itachi.r...@gmail.com on 14 Jun 2010 at 10:31

GoogleCodeExporter commented 8 years ago
Thanks for the feedback.
Please, could you change the compilers language?
We cannot understand the error from the output, because only weird characters 
are appearing 
(g++ -LC:\OpenCV2.1\lib -LC:\MinGW\ehci -oGetBounds.exe Headbounds.o -lcv210 
-lml210 -lcvaux210 -lcxcore210 -lhighgui210
Headbounds.o:在函数‘main’中:
C:/Users/Bluefrared/workspace/GetBounds/Debug/../Headbounds.cpp:23:对â
€˜ehciLoop(int, int)’未定义的引用
C:/Users/Bluefrared/workspace/GetBounds/Debug/../Headbounds.cpp:24:对â
€˜getHeadBounds(int*, int*, int*, 
int*)’未定义的引用)

But either way, it seems to be a linker error. It seems you are not including 
.lib files.
We are creating a simpler CMake based build and windows binaries. We'll have 
that uploaded this week, could you please check it out?
Thanks for your feedback,
Daniel

Original comment by danielba...@gmail.com on 15 Jun 2010 at 2:32

GoogleCodeExporter commented 8 years ago
Maybe you could copy and paste the compiler output to some Google Language 
Tools and translate it to English.
Kind regards,
Daniel

Original comment by danielba...@gmail.com on 15 Jun 2010 at 2:33

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I saw the windows binaries and tried to run them but got the following error 
with the .exe files

The application has failed to start because it's side-by-side configuration is 
incorrect.

That error was present with all three .exe files.  All I did was try to run the 
files directly from the folder after unzipping.

Original comment by itachi.r...@gmail.com on 15 Jun 2010 at 9:15

GoogleCodeExporter commented 8 years ago
In case I simply made an error in initializing and linking everything,

This is how I set it up:

#include "ehci.h"
#include <stdio.h>
#include <vector>
#include <cv.h>
#include <cxcore.h>
#include <cvaux.h>
#include <highgui.h>

// This demonstration shows how to use the simple getHeadBounds function

int main(){

    int upperX,upperY,headWidth,headHeight;

    //this function creates a window to see debug information
    //about capturing image and face detection
    while(1){
        //this is the main ehciLoop
        //every application should call this function in a realtime loop
        //so that the frame could be grabbed and processed
        //the EHCI2DFACEDETECT parameter tells ehci that only 2d detection will be
        //made
        ehciLoop(EHCI2DFACEDETECT,0);
        getHeadBounds(&upperX,&upperY,&headWidth,&headHeight);
        printf("Head Coordinates %3d %3d head width %3d height %3d (Press Ctrl+C to finish)\n",
                upperX,upperY,headWidth,headHeight);
    }
}

with the libraries cv, cvaux, cxcore and highgui, and include paths pointing to 
opencv includes and the ehci/lib folder containing the ehci.cpp and ehci.h 
files.  

I attached images showing my project properties

Original comment by itachi.r...@gmail.com on 15 Jun 2010 at 9:30

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Actually, I think my issue is that I don't have and .lib files for the ehci 
project.  How do I make them in Windows Vista?  I've been trying to use the 
command prompt with mingw32-make but I am having some trouble with that.   

BTW, my compiler is set to English.  That garbage from the console is not a 
human language issue.  It just gives me that for some unknown reason.

Original comment by itachi.r...@gmail.com on 16 Jun 2010 at 10:18

GoogleCodeExporter commented 8 years ago
Hi Mr. Ricky,
I'm very glad for your effort trying to make everything work.
Seeing that the current build system isn't very good, I'm trying to updated it 
to CMake. I'm almost finishing and I hope everything will work so it will be 
nice to have some feedback from you. 
Well, firstly I'd like to reply to your comment #4.
I think that embedding visual studio runtimes wasn't a good idea, so please, 
delete the msvc*.dll (3 files) and try to run again. Can you tell me if the 
error is gone?
Now, about the other comments, I see that's no compiler output language 
problem, hehe. And I also made a mistake telling you about the .lib files, 
because this version of ehci doesn't generate any .lib. What I really think 
about your error is that it's related to not including ehci.cpp in your build 
tree. Try to add this file to your project, because it shows errors to the only 
2 functions implemented in ehci.cpp (ehciLoop and getHeadBounds).
And by the way, I'm almost finishing CMake project. It should work out of the 
box with Eclipse. I intend to upload it until the end of the day.
Kind regards and thanks a lot for your nice feedback,
Daniel

Original comment by danielba...@gmail.com on 16 Jun 2010 at 11:38

GoogleCodeExporter commented 8 years ago
Removing the msvc files did the trick, but now simple 2d and 3d cut abruptly a 
few seconds in and boxView3d is working but has no escape feature that I 
noticed and was a little buggy.

Now that I included the .cpp and .h ehci files into my project root, I get some 
errors, which is better than before with no problems and still not working.  I 
am getting errors with multiple definitions for

chosencamera
ehcifocus
ehcimodelscale
gltexture
moviefile
ransac_distance_threshold
ransac_iterations
ransan_samples
texturecreated
use_ransac

the issue is that the multiple definitions point to locale_facets.tcc and that 
file does not even mention those constants.  I went through and slowly 
commented out the instantiations of ehcimodelscale, ehci, and the others listed 
above and in the ehci.c file and it seemed to be reducing the problems.

The problem is that when I have all of these uncommented, it states multiple 
definition errors.  When I comment them all out, it gives me not declare in 
this scope errors. Partial commenting out ends up with one of these two errors.

When I move the declarations of those 10 constants from the header file to the 
.cpp file, the code compiles and gives binaries but the .exe crashes when I try 
to run.

I'll play with the CMake when you manage to get it out and see how well it 
works.

Thanks for the help!

-Ricardo

Original comment by itachi.r...@gmail.com on 17 Jun 2010 at 7:14

GoogleCodeExporter commented 8 years ago
The debugger indicated the exit occurs here

    if( !(*cascade) ){
        printf( "ERROR: Could not load classifier cascade. The required file '%s' should be in a 'data' subdirectory under the directory in which the application is being run.\n"
                , fileName);
        exit(1);
    }

in the ehci.cpp file.  

Original comment by itachi.r...@gmail.com on 17 Jun 2010 at 10:00

GoogleCodeExporter commented 8 years ago
I got it fixed for the simple2d.  Apparently, the issue was that the 
haarcascade and aGest .xml files included with OpenCV were not being found or 
simply weren't already in OpenCV so I just tossed those into the project.

I'll test out the rest of the code

simple3d works but crashes if one moves too quickly and also is not able to 
re-find the head if it loses track.

6dofhead is having trouble with the constants I had listed previously, but I'll 
play with it to find out why.

Original comment by itachi.r...@gmail.com on 17 Jun 2010 at 11:15

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I have not been able to get 6dofhead and 6dofhand working yet.  There are many 
different errors that, I think, are masking one underlying error.  

**** Build of configuration Debug for project 6dofhead ****

**** Internal Builder is used for build               ****
g++ -LC:\OpenCV2.1\lib -o6dofhead.exe main.o ehci.o -lcv -lcxcore -lcvaux 
-lhighgui
ehci.o:在函数‘ZSt24__uninitialized_copy_auxIN9__gnu_cxx
17__normal_iteratorIP12CvPoint2D32fSt6vectorIS2_SaIS2_EEEES7_ET0_T_S9_S8_12__fal
se_type’中:
C:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_alg
obase.h:(.data+0x0): multiple definition of `EHCIMODELSCALE'
main.o:C:/Users/Bluefrared/workspace/6dofhead/Debug/../main.cpp:(.data+0x0)�
�第一次在此定义
main.o:在函数‘glutInit_ATEXIT_HACK’中:
C:/MinGW/include/GL/freeglut/GL/include/GL/freeglut_std.h:611:对‘
_imp____glutInitWithExit@12’未定义的引用
main.o:在函数‘glutCreateWindow_ATEXIT_HACK’�
�:
C:/MinGW/include/GL/freeglut/GL/include/GL/freeglut_std.h:613:对‘
_imp____glutCreateWindowWithExit@8’未定义的引ç”
¨
main.o:在函数‘glutCreateMenu_ATEXIT_HACK’中�
�¼š
C:/MinGW/include/GL/freeglut/GL/include/GL/freeglut_std.h:615:对‘
_imp____glutCreateMenuWithExit@8’未定义的引用
main.o:在函数‘Z12drawHelpTextv’中:

(more garbage)

collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 2689  ms.  

Any idea?

Original comment by itachi.r...@gmail.com on 24 Jun 2010 at 9:25

GoogleCodeExporter commented 8 years ago
Never mind.  The issue was solved so far.  Apparently, as the EHCI files come 
with the constants included and defined in the header file, there is a problem 
with definition conflict with the EHCI.cpp file and anything else that uses it. 
 This is solved by using the extern initialization in the header file without 
defining a value, and then defining the value in the .cpp file only.

Now my issue lies with the .exe crashing everytime the GLUT library is referred 
to for glutinit or anything related.  I assume it incorrectly installed though 
I've followed steps very thoroughly to ensure it was done correct, so hopefully 
that is resolved soon.

Original comment by itachi.r...@gmail.com on 30 Jun 2010 at 7:45

GoogleCodeExporter commented 8 years ago
The other problem was that freeglut.h was being used at the same time as 
glut.h, glu.h and gl.h, and, since freeglut is larger and encompasses the GLUT 
project, it was conflicting. After I commented out that and removed those 
libraries and used only freeglut, the whole thing worked.

Original comment by itachi.r...@gmail.com on 2 Jul 2010 at 5:47

GoogleCodeExporter commented 8 years ago
Itachi Ricky, thanks for your feedback, couldn't be more valuable.
Making the software compile in every platform is very hard since each library 
may have different dependencies... I'm glad you've been able to make it work 
with only freeglut. I intend to upload a new version with CMake pretty soon, as 
you might find some execution error in the current release.
Best regards, and really thanks for making all your error reports and solutions 
available for the whole community.
Daniel

Original comment by danielba...@gmail.com on 2 Jul 2010 at 8:33

GoogleCodeExporter commented 8 years ago
I have a question about getting the face direction.  Which values create the 
direction vector on the screen?  This is what I am trying to make use of, and I 
wanted to make sure I was referencing the correct variables with my code.

Original comment by itachi.r...@gmail.com on 9 Jul 2010 at 6:24

GoogleCodeExporter commented 8 years ago
Hi Ricky,
please, check the drawCentralAxis() function on 6dofhead. The red value goes in 
the x negative direction, so, it's pretty much a vector from 
(CenterX,CenterY,CenterZ) to (CenterX -1000, CenterY, CenterZ). There's a 
snippet below:

void drawCentralAxis(){

        float deltaX,deltaY,deltaZ;
        getReferenceCoordinate(&deltaX,&deltaY,&deltaZ);

        float cx,cy,cz;
        cx = .5 - deltaX;
        cy = -.25 - deltaY;
        cz = 1.0 - deltaZ;

        glLineWidth(4.0);
        glBegin(GL_LINES);
        glColor3f(1.0f,0.0f,0.0);
        glVertex3f( cx,cy,cz);
        glVertex3f( cx+1000,cy,cz);
        glEnd();

        glBegin(GL_LINES);
        glColor3f(0.9f,0.3f,0.0);
        glVertex3f( cx,cy,cz);
        glVertex3f( cx -1000,cy,cz);
        glEnd();
....

King regards

Original comment by danielba...@gmail.com on 9 Jul 2010 at 11:15

GoogleCodeExporter commented 8 years ago
I've got a feel for that part of the code now, but how would I know the pixel 
position on the screen of where the axis is centered at and the pixel points of 
along the way of each of the axis.  I am trying to draw a dot on the screen 
that estimates where I am facing using the direction vector and 3-D position.  
What variables would I use to accomplish that?

Thanks!

Original comment by itachi.r...@gmail.com on 12 Jul 2010 at 10:05

GoogleCodeExporter commented 8 years ago
Well, you should use glPositMatrix and project point 0,0,0:
double glPositMatrix[16];
//returns translation and rotation matrix in openGl format
getGlPositMatrix(glPositMatrix);

In order to project point 0,0,0 in glPositMatrix, just multiply them:
glPositMatrix (4x4) * point (0;0;0;1) (4x1) = projectedCenterPoint(4x1)
Now you'll need to project the projectedCenterPoint to your perspective, which 
will require the projection matrix... check this:
http://www.songho.ca/opengl/gl_projectionmatrix.html#perspective
The easiest way is to let OpenGL handle it for you through projection matrix, 
but you can also make it as the link says.

Kind regards,
Daniel

Original comment by danielba...@gmail.com on 13 Jul 2010 at 1:25

GoogleCodeExporter commented 8 years ago
Just as a side note, I've just committed the CMake version to the head trunk.

Original comment by danielba...@gmail.com on 16 Jul 2010 at 8:22

GoogleCodeExporter commented 8 years ago
Hi Ricky,

Firs of all, thank you for your contribution.

I tried to compile 6dofhead by copying and pasting it in my root file 
HeadTracking.cpp. And I copied 2 dependency files ehci.h, ehci.cpp to my 
project. Though I did not follow your installation instruction, I think it 
should work. 

but i got this kind of errors - -"

error LNK2005: "int USE_RANSAC" (?USE_RANSAC@@3HA) already defined in 
ehci.obj    HeadTracking.obj    HeadTracking

error LNK2005: "int RANSAC_SAMPLES" (?RANSAC_SAMPLES@@3HA) already defined in 
ehci.obj    HeadTracking.obj    HeadTracking

..
I have no idea why, these variables are not defined in my HeadTracking.cpp.

I think my problem is similar with comment 13. But I do not understand your 
reply on comment 14. Could you help me?

Regards
Nirin

Original comment by tos...@gmail.com on 23 Aug 2010 at 6:38

GoogleCodeExporter commented 8 years ago
Hi Tosent,
can you show your HeadTracking.cpp?
It seems it's somehow including the headers twice. Are you using the latest SVN 
source codes? These errors should be gone.
Although this could work, I highly recommend using CMake, it's easier and more 
flexible.
Best regards,
Daniel

Original comment by danielba...@gmail.com on 23 Aug 2010 at 9:59

GoogleCodeExporter commented 8 years ago
Hi Daniel, thank for your reply.

Finally it works well. The problem is that i forgot to use the lastest svn 
source code. - -" Sorry.

many thanks

Original comment by tos...@gmail.com on 28 Aug 2010 at 8:48