iphone - 使用 'tap-to-focus' 和曝光控制的 GPUImage 视频捕获

标签 iphone ios video-capture gpuimage

我正在使用本教程:https://github.com/BradLarson/GPUImage在 iOS 中创建视频捕获应用程序。

应用程序已启动并正在运行。我有一个问题...

我们使用此代码启动实时视频捕获 session :

 GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc]        
 initWithSessionPreset:AVCaptureSessionPreset640x480    
 cameraPosition:AVCaptureDevicePositionBack];
 videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;

 GPUImageFilter *customFilter = [[GPUImageFilter alloc]     
 initWithFragmentShaderFromFile:@"CustomShader"];
 GPUImageView *filteredVideoView = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0,   
 0.0, viewWidth, viewHeight)];


 [videoCamera addTarget:customFilter];
 [customFilter addTarget:filteredVideoView];

 [videoCamera startCameraCapture];

但是如何在这个框架中启用“图像选择器”风格的“点击聚焦”和点击曝光校正功能。

这可能吗?你能给我指出正确的方向吗?

请帮忙。

提前致谢。

最佳答案

部分了解:

 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {

   UITouch *touch = [touches anyObject];
   CGPoint touchPoint = [touch locationInView:self.view];

    if([videoCamera.inputCamera isFocusPointOfInterestSupported]&&[videoCamera.inputCamera isFocusModeSupported:AVCaptureFocusModeAutoFocus])
   {

   if([videoCamera.inputCamera lockForConfiguration :nil])
   {
    [videoCamera.inputCamera setFocusPointOfInterest :touchPoint];
    [videoCamera.inputCamera setFocusMode :AVCaptureFocusModeLocked];

     if([videoCamera.inputCamera isExposurePointOfInterestSupported])
      {
        [videoCamera.inputCamera setExposurePointOfInterest:touchPoint];
        [videoCamera.inputCamera setExposureMode:AVCaptureExposureModeLocked];
    }
    [videoCamera.inputCamera unlockForConfiguration];
}
}

}

曝光和焦点正在锁定,但过了一段时间就卡住了...

正在努力。

关于iphone - 使用 'tap-to-focus' 和曝光控制的 GPUImage 视频捕获,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17986661/

相关文章:

iphone - 反编译 iOS Objective-C 二进制文件

ios - PrepareForSeque 未调用/触发

python - opencv clahe.apply() 错误

ios - iPhone 5s Touch ID 传感器 API

python - VideoWriter 在 OpenCV Python 中仅输出一个 5.7kB 文件

ios - AVAssetWriter 不录制音频

iphone - 如果我不希望它自动隐藏,如何控制 UIMenuController?

iphone - XCode UIView 在 TableView 第一个 Cell 起源之上

iphone - 关于使用 Slider 观察键值的一些帮助

iphone - 从 NSOperation 重新加载 UITableView