0

I see that glReadPixels is a major bottleneck when reading the black image with white dots for Harris corners. FPS drops from 30 to 15. Is it possible to obtain the coordinates of corners without glReadPixels and GPUImageCrosshairGenerator? I know about GPUImageRawDataOutput but don't know exactly how to replace the glReadPixels method with it.

Stephan
  • 4,187
  • 1
  • 21
  • 33
john
  • 1
  • I should mention that I work with the original FilterShowcase example. I managed to download the raw data with GPUImageRawDataOutput, but the FPS is still 15 for the 640x480 resolution. Without downloading the data from the GPU with GPUImageRawDataOutput (that is showing only the result of the HarrisCornerDetectionFilter) the FPS stays at 30. So with GPUImageRawDataOutput it looks like I get the same speed as with glReadPixels() on iPad2. Shouldn't GPUImageRawDataOutput be faster that glReadPixels ? – john Apr 23 '14 at 15:35

1 Answers1

0

The problem with the Harris corner detector as implemented in GPUImage isn't the capture of the frame via glReadPixels(), its the point extraction that happens after that. This is the same with the other corner detectors, and even the Hough transform line detector.

The issue is that extracting sparse points from a field of pixels is tricky when using OpenGL / OpenGL ES. Currently, I read the pixels and then iterate over them on the CPU. This is a very slow process.

In the future, I plan to implement a histogram pyramid point extractor to allow this to be done mostly on the GPU, which I believe should yield a much faster extraction of these points. Haven't yet had the time to do so, though.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • I think a fast way of extracting points coordinates from the GPU is the missing link from using GPUImage in more complex projects. Recently I tried to do Canny with GPUImage in my project, but the cost of getting the RawData was too high. So I am looking forward for the moment when you can find a faster method for this issue. Thank you for your effort ! – john Apr 28 '14 at 15:08
  • Hello Brad, any progress on histogram pyramid point extractor? Thank you and your GPUImage is awesome!!! – willSapgreen Dec 03 '15 at 02:04