Question

I am working on an image stitching app, which takes input from camera, estimates image transformation and warped input image by the estimated transformation. As shown in the following figure, image from camera are input into 2 branch of chains. However, the processing of image warping is dependent on the result of transformation estimation. My question is how I can make branch 1 wait for the results of branch 2?

enter image description here

Was it helpful?

Solution

If you make your image warping filter a subclass of GPUImageTwoInputFilter, this synchronization is taken care of for you.

Target the GPUImageVideoCamera instance to your feature matching / transformation estimation filter and the image warping filter, then target your feature matching / transformation estimation filter to the image warping filter. This will cause your video input to come in via the first input image and the results of your feature matching and transformation estimation filter to be in the second image. GPUImageTwoInputFilter subclasses only process and output a frame once input frames have been provided to both their inputs.

This should give you the synchronization you want, and be pretty straightforward to set up.

OTHER TIPS

I think, you can try to use, something like dispatch_semaphore_t Look here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top