저는 AutoFocus, AutoExposure, AutoWhiteBalance 및 LowLightBoost를 사용했지만 네이티브 iPhone 5 카메라를 사용하여 보거나 캡처 한 것만 큼 밝게 표시되도록 카메라 이미지를 얻을 수 있습니다.AVFoundation 카메라 이미지를 네이티브 카메라로 촬영 한 것과 같이 밝게 만드는 방법은 무엇입니까?
내가 잘못하고 있는지 확실하지 않습니다. 다음은 화면을 누를 때 자동 카메라 기능을 설정하는 주요 기능입니다. 자동 초점이 작동합니다. 그러나 자동 노출, 화이트 밸런스 및 LowLightBoost가 정상적으로 작동하는지 여부는 확인해야합니다. 어두운 항목은 원래 카메라와 함께 밝게 빛나지 않기 때문입니다. 아래 코드의 대부분은 iosDev Center Site에 게시 된 AVCam 예제에서 가져온 것입니다.
미리 감사드립니다.
- (IBAction)focusAndExposeTap:(UIGestureRecognizer *)gestureRecognizer
{
CGPoint devicePoint = [(AVCaptureVideoPreviewLayer *)[[self previewView] layer] captureDevicePointOfInterestForPoint:[gestureRecognizer locationInView:[gestureRecognizer view]]];
[self focusWithMode:AVCaptureFocusModeAutoFocus exposeWithMode:AVCaptureExposureModeAutoExpose whiteBalanceWithMode:AVCaptureWhiteBalanceModeContinuousAutoWhiteBalance atDevicePoint:devicePoint monitorSubjectAreaChange:YES];
}
- (void)focusWithMode:(AVCaptureFocusMode)focusMode exposeWithMode:(AVCaptureExposureMode)exposureMode whiteBalanceWithMode:(AVCaptureWhiteBalanceMode)whiteBalanceMode atDevicePoint:(CGPoint)point monitorSubjectAreaChange:(BOOL)monitorSubjectAreaChange{
dispatch_async([self sessionQueue], ^{
AVCaptureDevice *device = [[self videoDeviceInput] device];
NSError *error = nil;
if ([device lockForConfiguration:&error])
{
if ([device isFocusPointOfInterestSupported] && [device isFocusModeSupported:focusMode])
{
[device setFocusMode:focusMode];
[device setFocusPointOfInterest:point];
}
NSLog(@"Pre-Exposure Mode Support?: %hhd", [device isExposurePointOfInterestSupported]);
if ([device isExposurePointOfInterestSupported] && [device isExposureModeSupported:exposureMode])
{
[device setExposureMode:exposureMode];
[device setExposurePointOfInterest:point];
}
NSLog(@"Pre-White Balance mode Support? %hhd", [device isWhiteBalanceModeSupported:whiteBalanceMode]);
if ([device isWhiteBalanceModeSupported:whiteBalanceMode])
{
[device setWhiteBalanceMode:whiteBalanceMode];
}
NSLog(@"Pre Low light mode: %hhd", [device isLowLightBoostSupported]);
if ([device isLowLightBoostSupported]){
[device setAutomaticallyEnablesLowLightBoostWhenAvailable:YES];
}
[device setSubjectAreaChangeMonitoringEnabled:monitorSubjectAreaChange];
[device unlockForConfiguration];
}
else
{
NSLog(@"%@", error);
}
});
}
당신이 해결책을 찾을 수있었습니다을 upvote에 있고,이 문제가 해결되지 않을 경우 알려 주시기 바랍니다? – amone