简体   繁体   English

GPUImage将滤镜应用于小图像,但显示大图像

[英]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 . 我为此使用的算法非常慢,因此我使用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. 但是我无法在设备上显示完整分辨率的图像。

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). 您可以通过在最后一个滤镜上添加两个目标来做到这一点:一个是全分辨率的GPUImageView,另一个是虚拟滤镜(例如默认设置下的亮度滤镜)。 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. 仅在虚拟滤镜上使用forceProcessingAtSize ,而不是在管道的较早位置,您将获得分辨率降低的图像,同时仍在屏幕上显示全分辨率的图像。 Both forks of the pipeline will be updated at the same time 管道的两个分支将同时更新

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM