Faydiamond / lkb-kinect-bundle

Automatically exported from code.google.com/p/lkb-kinect-bundle
0 stars 0 forks source link

Final blob issue on 2d camera #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. go into 2d camera settings
2. white screen on blob
3.

What is the expected output? What do you see instead?
2d image

What version of the product are you using? On what operating system?
windows 7  lkb .1 win

Please provide any additional information below.
Hardware is intel GMA 950,  it seems the opengl does not support the texture 
format being used by this program,  my guess is that it has to deal with a non 
power of two texture being used.  I have tried other programs and the camera 
works correctly,  I have also tried this program on another computer and it 
worked correctly

Original issue reported on code.google.com by knight0f...@gmail.com on 30 Oct 2012 at 2:41

GoogleCodeExporter commented 8 years ago
I just went through the code and it looks like the texture sizes are 640x480,  
any easy way to pad the texture to make it 1024x512 and use the range of 0 to 
.625, 0 to .9375?  I would do it myself but I do not want to go through 
downloading all this stuff and setting it up to make one little fix.  plus I do 
not know what Mat* actually is to see if it could be expanded on.
The code that would be fixed is located at common\glwidget2d in function painGL

    if(color)
        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data);
    else
        glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, image.cols, image.rows, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, image.data);

would end up being

paddedimage = image with padding to make it 1024x512
    if(color)
        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, paddedimage.cols, paddedimage.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, paddedimage.data);
    else
        glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, paddedimage.cols, paddedimage.rows, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, paddedimage.data);

Original comment by knight0f...@gmail.com on 5 Nov 2012 at 11:18

GoogleCodeExporter commented 8 years ago
                glBegin(GL_QUADS);

                // upper left
                glTexCoord2f(0, 0);
                glVertex2f(-1.0, 1.0);
                // upper right
                glTexCoord2f(0.625f, 0);
                glVertex2f(1.0, 1.0);
                // bottom right
                glTexCoord2f(0.625f, 0,9375f);
                glVertex2f(1.0, -1.0);
                // bottom left
                glTexCoord2f(0, 0,9375f);
                glVertex2f(-1.0, -1.0);

                glEnd();
}

Original comment by knight0f...@gmail.com on 5 Nov 2012 at 11:20

GoogleCodeExporter commented 8 years ago
The new version has a fix to work with opengl versions less than 2.0. It also 
has the posibility to save the calibration and autostart. We havent had the 
time to finalize this version but soon we will. The fix for opengl is on the 
same direction as yours. We also had a couple of issues with the whole screen 
point calibration widget so we made it  regular qwidget (non opengl). As soon 
as we get a little time we will upload the project. Thanks for your comments. 
Cheers!

Original comment by nzalaqu...@gmail.com on 7 Nov 2012 at 11:42

GoogleCodeExporter commented 8 years ago
Fixed on version 0.1.1

Original comment by nzalaqu...@gmail.com on 22 Nov 2012 at 9:08