How to change brightness, contrast, WhiteBalance, exposure, focus and sharpness of AVCaptureSession?

I am making a MAC application quickly, I was able to view the camera in NSView, now I want to change the brightness / contrast / white balance and all the camera related parameters.

I use the AVFoundation structure to preview the camera, and I have a slider to change the values. How can I change all of these settings with custom values.

How does AVFondations communicate with IOKit .. I found that one control is a UVCCamera link for changing manual camera control, can I use this format ???

and on another site I found that

'IOKit is a low-level framework for communicating with the kernel and hardware. Apple advises against using this structure directly and will reject it from the AppStore.

thanks

+5
source share
1 answer

If you want to change the attributes of already captured images, it looks like you need to look into the CIFilter class, which is associated with changing images. See https://developer.apple.com/documentation/coreimage/cifilter/filter_parameter_keys , where it documents filter options such as:

  • kCIInputSharpnessKey Key for a scalar value (NSNumber), which indicates the degree of sharpening to apply.
  • ...
  • kCIInputIntensityKey is the key for a scalar value (NSNumber) that indicates the intensity value.
  • kCIInputEVKey - a key for a scalar value (NSNumber), which indicates how many F-steps should be brighter or darker the image should be.
  • ...
  • kCIInputBrightnessKey - a key for a scalar value (NSNumber), which determines the brightness level.

On the same page there are also some links to related code examples that do some of these things.

Hope this helps you change the settings you want to change. If you are creating a user interface, you might also want to take a look at Core Core Imaging , where they have separate Core Image Views to add to your own applications.

+2
source

Source: https://habr.com/ru/post/1210242/


All Articles