Now with the application of audio and video more and more, the direct use of the system’s native camera for photo cutting and video shooting can not meet the needs. It is necessary to customize Camera development through Camera API to meet some complex business scenarios. The basic knowledge of Camera will be introduced at the beginning to provide support for later Camera development.
Basic knowledge of
The Android Framework provides a Camera API for taking pictures and recording videos.
- Camera class is an older version of the API used to control the Camera on a device, now deprecated, used on Android5.0 below
- Camera2 this package is used to control the main API device camera, Android5.0 above use
- CameraX is packaged with the Camera 2 API, simplifying the development process and adding life cycle control
Related development classes
- Android.hardware. Camera2 controls the core API of the camera, which can be used to take pictures and record videos.
- Camera class is a deprecated version of the API used to control a device’s Camera.
- The SurfaceView class is used to present a live camera preview to the user.
- TextureView is also used for real-time camera previews, introduced after Android4.0
- MediaRecorder is used to record video
- ACTION_IMAGE_CAPTURE or mediastore.action_video_capture is an Intent action type that can be used to capture images or videos without directly using Camera objects.
The term
- The sensitivity of CMOS (or film) to light. With ISO100 film, the camera can be correctly exposed in 2 seconds, compared with 1 second for ISO200 film and 0.5 second for ISO400 film under the same light conditions. Common standards: ISO100, ISO200, ISO400
- Exposure time Exposure time is the time that the camera shutter must be opened until closed in order to project light onto the camera’s sensor
- A device used to control the amount of light passing through a lens into the photosensitive surface of a camera
- Focal length is the distance between the focal point of parallel light rays passing through the lens. The smaller the value, the wider the Angle, and the larger the value, the smaller the Angle
- In depth-of-field photography, when the lens focuses on a subject, that subject produces a sharp image on the camera. The extent of depth that produces a sharper image of the subject is called depth of field
- Metering metering mode: Central average metering, central local metering, spot metering, multi-point metering and evaluation metering
- The camera automatically adjusts the Exposure time and so on according to the light conditions to determine the amount of Exposure
- Focusing mode: Auto Focus (AE), Manual Focus (MF) Auto Focus is divided into contrast (CONTRAST) and phase (PDAF). Phase Detection Auto Focus (Hybrid)
- Flashlight Uses the Flashlight to illuminate objects to get a clear picture
- ScreenFlash uses the screen to illuminate surrounding objects and take a high-definition picture
- HDR is the full name of high-dynamic Range, that is, High Dynamic Range image technology. Turning on HDR during the photo taking process can make the previously dark scene brighter and more transparent.
- Zero Time lapse photography (ZSD) A technique to reduce the time delay of taking a photo and making the echo complete instantly
- ContinuousShot captures timing by saving data transfer time
- PreviewSize Specifies the size of the image that the camera previews
- PictureSize Specifies the size of the image generated by taking a photo
- Auto White Balance AWB is the default setting of the camera. A complex rectangle in the camera determines the white balance reference point in the picture to achieve white balance adjustment
- The ratio between the lightest and darkest areas of the contrast image. The greater the ratio, the more gradations from black to white, and thus the richer the color presentation
- Saturation refers to the vividness of a color
- Sharpness is an index reflecting the plane sharpness and edge sharpness of an image
Camera function
Android supports a variety of camera features that you can control using the camera app, such as picture format, flash mode, focus Settings, and more. Most of the functions can be set by camera. Parameters. Here are some important functions:
- Area metering and focusing
- Face detection
- Time-lapse video
Area metering and focusing
Starting with Android 4.0 (API level 14), use Camera.Parameters to determine the area of focus or brightness Settings, and then take a photo or video
Face detection
This is not the same as real face recognition, where you just detect faces. Through photo analysis, detect whether the photo contains a face, use face recognition technology to recognize the face and calculate the photo Settings
Time-lapse video
The time-lapse video feature allows users to create video clips by concatenating images taken seconds or minutes apart. Use MediaRecorder to record images of time lapse episodes.
Other important feature apis:
reference
- CameraX
- Camera
- Detecting camera features with Camera2
- Android Camera Development – 1) Basics Overview
- Android Camera1 camera development