Hi Andre, There are only two places that I change for the resolution inside the code. This first one is capture resolution that openCV uses, the other one is glTexImage2D function. I only modify them for the resolution and I don't see any other functions that can be related to resolution.
cap.set(CV_CAP_PROP_FRAME_WIDTH, 320); cap.set(CV_CAP_PROP_FRAME_HEIGHT, 240); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 320, 240, 0, GL_RGB, GL_UNSIGNED_BYTE, bgr_img.data); The strange thing is; if I set 160x120, 320x240 and even 320x320 resolutions, I don't see any problem. But if I set higher resolutions such as 640x480, 800x600 or 1024x768, etc., I got segmentation fault. Do you have a recommendation for me where and what to check inside the code? Thanks, Fikret On Thu, Dec 19, 2013 at 1:55 PM, Andre Silva <[email protected]>wrote: > Hi Fikret, > > > > I believe that there are another functions in the code using this > resolution, if you change the resolution without modifying these other > parts the segfault will occur. The only limitation using 320x240 is the > performance, since OpenCV runs on cpu, if we use higher resolution the > performance will decrease a lot. > > > > Regards, > > andre > > > > *From:* Fikret Alim [mailto:[email protected]] > *Sent:* Thursday, December 19, 2013 5:40 AM > *To:* Fabio Estevam > *Cc:* [email protected]; Silva Andre-B22958 > *Subject:* Re: [meta-freescale] Using OpenCV and OpenGL together > > > > Dear Marek, > > > > Thank you for your answer, > > > > I will check the file you sent. I have solved the problem in a different > way, I am not sure if this is the correct way or not, but at least it > worked after this change: > > > > I have only moved the following two lines from PlaneCreateTex function to > PlaneSetTex function. > > > > glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); > glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); > > > > Then, PlaneSetTex function will be; > > > > void PlaneSetTex (Mat texture_data) > { > cvtColor (texture_data, _texture_data, CV_BGR2RGB); > //imshow("_texture_data",_texture_data); > glBindTexture(GL_TEXTURE_2D, _texture); > glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, 320, 240, 0, GL_RGB, > GL_UNSIGNED_BYTE, _texture_data.data); > glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); > glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); > } > > > > With this change, now I can run Andre's gesture recognition example, and > also I have tried some GLSL shaders for image processing like sobel > detection. > > > > But, let me ask a different question: Is there a limition for the webcam > resolution? I can only use 320x240 resolution for both Andre's example and > gpu sdk examples. If I set a higher resolution, then I get segmentation > fault error. I am sure that my webcam supports higher resolutions, since I > can get video with openCV at higher resolutions. What can be wrong? Is > there a limitation, or do I need to perform some other operations for > higher resolutions? > > > > Thanks&Best Regards, > > Fikret > > > > On Wed, Dec 18, 2013 at 8:18 PM, Fabio Estevam <[email protected]> wrote: > > On Wed, Dec 11, 2013 at 12:18 PM, Fikret Alim <[email protected]> > wrote: > > Hello, > > > > > > > > I am trying to use OpenCV and OpenGL together for some image processing > > tasks. I have already run OpenCV examples on IMX6, I can also compile and > > run the examples under gpu sdk of Freescale with X11, but when I try to > use > > them together I have some problems. > > > > > > > > Actually, what I am trying to make has already been done by Freescale > > > > http://imxcv.blogspot.com/2012/03/gesture-recognition-on-imx6.html > > Adding Andre. > > Regards, > > Fabio Estevam > > >
_______________________________________________ meta-freescale mailing list [email protected] https://lists.yoctoproject.org/listinfo/meta-freescale
