From: Srimal J. <sr...@gm...> - 2009-07-31 00:52:16
|
Hi all I'm working on a Image recognition project where I need to do calculations on different views (more than 100 frames) of a 3d model within an order of less than 1 sec, in order to calculate a particular optimization function. I am hoping to use OpenGL to obtain 2D pixel values from different 3D view points, in the hope that the 3d h/w processing will do things a lot faster for me. I need to render 100frames of 20,000 triangles in less than 1sec. At the moment I am using glReadPixels() to read transformed pixel values into memory. This is a bit slow and it takes around 10sec to grab 100 frames . Is there a faster way? Or would you recommend a better approach? I've heard of buffer object ? but am not quite sure how they can be used to grab pixel data into memory. Rendering the pixels into some virtual buffer is fine with my application as long as reading the pixel values happens in less than 1 sec. Any pointers would be much appreciated. Thanks in advance Srimal. |
From: Brian P. <br...@vm...> - 2009-07-31 14:49:04
|
Srimal Jayawardena wrote: > Hi all > > > I'm working on a Image recognition project where I need to do > calculations on different views (more than 100 frames) > of a 3d model within an order of less than 1 sec, in order to > calculate a particular optimization function. > > I am hoping to use OpenGL to obtain 2D pixel values from different 3D > view points, in the hope that the 3d h/w processing will do things a > lot faster for me. > > I need to render 100frames of 20,000 triangles > in less than 1sec. > > At the moment I am using glReadPixels() to read transformed pixel > values into memory. > > This is a bit slow and it takes around 10sec to grab 100 frames . > > Is there a faster way? Or would you recommend a > better approach? > > I've heard of buffer object ? but am not quite sure how they can > be used to grab pixel data into memory. > > Rendering the pixels into some virtual buffer is fine with my application > as long as reading the pixel values happens in less than 1 sec. > > > Any pointers would be much appreciated. > > Thanks in advance Which hardware/driver are you using? The only thing I can suggest is trying different format/type parameters to glReadPixels(). A combo such as GL_BGRA/GL_UNSIGNED_INT_8_8_8_8 might be a better match for the hardware layout and allow the driver to avoid swizzling. But this can vary from one gpu/driver to another. -Brian |
From: tom f. <tf...@al...> - 2009-08-01 23:03:25
|
Brian Paul <br...@vm...> writes: > Srimal Jayawardena wrote: > > I'm working on a Image recognition project . . . > > > > I am hoping to use OpenGL to obtain 2D pixel values from different 3D > > view points, in the hope that the 3d h/w processing will do things a > > lot faster for me. [snip] > > At the moment I am using glReadPixels() to read transformed pixel > > values into memory. > > > > Is there a faster way? Or would you recommend a > > better approach? How complex is the image recognition algorithm? You might consider implementing your algorithm in GLSL. Then you'd do one readback at the end just to get the result. If your bottleneck is the readback, you'd get much better performance. Plus a modern GPU will greatly accelerate the GLSL operations. Cheers, -tom |
From: Srimal J. <sr...@gm...> - 2009-08-02 10:19:36
|
Hi > How complex is the image recognition algorithm? Well the function involves a matrix operations, calculating expected values, covariances etc and obtaining the minimum of the function values from the 100 frames. Can GLSL calculate an arbitrary function like that? Any good pointers for me to get started? Many thanks Srimal. > > You might consider implementing your algorithm in GLSL. Then you'd do > one readback at the end just to get the result. If your bottleneck is > the readback, you'd get much better performance. Plus a modern GPU > will greatly accelerate the GLSL operations. > > Cheers, > > -tom > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Mesa3d-users mailing list > Mes...@li... > https://lists.sourceforge.net/lists/listinfo/mesa3d-users > -- ~ Srimal Jayawardena BSc (Engineering), BIT, MIET PhD Student, Australian National University. Phone(Mobile): +61 422 684 854 Phone(Office): +61 2 6125 1771 Phone(Home): +61 2 6125 1413 ANU Contact Info : http://arp.anu.edu.au/user/3788 http://srimal.sri-lankan.net/ http://srimal-techdiary.blogspot.com/ |
From: tom f. <tf...@al...> - 2009-08-02 19:16:56
|
Srimal Jayawardena <sr...@gm...> writes: > Hi > > > How complex is the image recognition algorithm? > > Well the function involves a matrix operations, calculating > expected values, covariances etc and obtaining the minimum > of the function values from the 100 frames. > > Can GLSL calculate an arbitrary function like that? In general, it's hard to get a GPU to perform an arbitrary algorithm. That said, matrix operations are what a GPU was designed to do, and I recommended GLSL because GPUs are exceptionally good at doing the types of per-fragment operations that come up frequently in image processing. > Any good pointers for me to get started? http://www.opengl.org/documentation/glsl/ the wikipedia page is a good meta starting point: http://en.wikipedia.org/wiki/GLSL note the 'References'. Some quick google searches turn up: http://gamma.cs.unc.edu/GPGP/lectures/imgproc.pdf http://www.cs.berkeley.edu/~kubitron/courses/cs252-F03/projects/reports/project12_report_ver2.pdf -tom > > You might consider implementing your algorithm in GLSL. [snip] |