Pulkit Goyal
Pulkit Goyal

Reputation: 5654

GPUImage apply filter on small image but display large image

I am working on an app that computes some points of interests from the live camera feed. The algorithm that I have for this is quite slow and I am therefore applying the processing on a small image using forceProcessingAtSizeRespectingAspectRatio.

[filter forceProcessingAtSizeRespectingAspectRatio:CGSizeMake(100, 80)];

I display the image that I get from the filter as follows:

GPUImageView *filterView = (GPUImageView *)imageView;
[filter addTarget:filterView];

I want to be able to show the full resolution image on the device. I have already normalised the points of interest that I compute within the algorithm so I can map them to the full resolution image. But I cannot get the full resolution images to show on the device.

Upvotes: 1

Views: 1731

Answers (1)

Sapan Diwakar
Sapan Diwakar

Reputation: 10946

My recommendation for this would be to split your processing pipeline, and have one output go to the screen at full resolution and the other at the smaller size. You can do this by adding two targets to your last filter: one being your GPUImageView at the full resolution, and the other being a dummy filter (like a brightness filter at the default setting). Only use -forceProcessingAtSize: on the dummy filter, not earlier in the pipeline, and you'll get reduced-resolution images out of that while still showing the full resolution ones to the screen. Both forks of the pipeline will be updated at the same time

Upvotes: 0

Related Questions