Open jdev7 opened 9 years ago
If you need the image from the second blend filter, you need to capture from blendFilter2. You're only grabbing blendFilter in the above.
Also, are you updating lineGenerator and lineGenerator2 in your setLinesDetectedBlock? That will need to be done as well.
Thanks Brad, that is true. But I'm not sure how I should do it. Should it be something like?:
[blendFilter useNextFrameForImageCapture];
[blendFilter2 useNextFrameForImageCapture];
[picture processImage];
UIImage *result = [blendFilter2 imageFromCurrentFramebuffer];
Regarding to the lineGenerator, inside the block I have this two lines:
[lineGenerator renderLinesFromArray:lineArray count:linesDetected frameTime:frameTime];
[lineGenerator2 renderLinesFromArray:filteredLinesArray count:filteredLines frameTime:frameTime];
Is that what you meant? Btw, when I use the 2 lineGenerators, the first is set to paint red the unfiltered Lines, and the second to paint blue the filteredLines, but when it draws the lines, all are blue.
I'm using
GPUImageHoughTransformLineDetector
to detect edges of a document in an image. And aGPUImageLineGenerator
to draw them over the image.This works fine and returns the image with the red lines overlayed.
Now I want to filter out those lines within the block call, and create a second array of
filteredLines
, and overlay them over the image with red lines, to visually see which lines are being discarded, but I don't seem to be able to do it.I've tried creating a second
GPUImageLineGenerator
with the color lines set to blue, and rendering thefilteredLines
array and a secondGPUImageAlphaBlendFilter
to blend the output of the firstblendFilter
with the result of the secondlineGenerator2
like this:But the best result I get is all the lines drawn in blue, so I can't compare them. How should I chain these filters??
Besides, I'm not sure if I'm properly understanding the way
addTarget
works to chain filters, so if there is any tutorial which would help me understand how GPUImage works, I would really appreciate it.Thanks