EasyAR control over the camera
This article describes how to control the camera in EasyAR.
Before you begin
- Learn about the camera model, parameters, and other usage notes for physical cameras through camera and input extension.
Camera type and camera flipping
When using the front camera, EasyAR horizontally flips the camera image by default. Depending on application requirements, horizontal flipping of the camera image can also be turned on or off manually.
For example, when developing an image recognition application for a tablet with an external reflective mirror, you need to set camera image flipping.
Note
If the camera is mounted as a front camera but is not recognized by the system as a front camera, horizontal camera image flipping will not be performed by default and must be enabled manually.
Focus
Mobile phones usually use fixed-focus cameras, which means the focal length cannot be adjusted. Some phones use multiple fixed-focus cameras, each with a different focal length, and can switch between cameras.
When an object is at infinity, its image is exactly on the focal plane. When the object gets closer, its image moves away from the optical center. If the camera sensor is fixed on the focal plane, a clear image can be obtained only when the object is at infinity. When the object is nearby, because the image of the object is behind the sensor, the sensor receives a blurred image with a circle of confusion.
Phone cameras usually have a focusing function, which can adjust the focal distance and move the sensor or optical center so that the circle of confusion of most points on the object is minimized on the sensor. Note that real objects are always 3D, and the image obtained through the camera is also 3D, while the sensor is a plane. Therefore, some areas in a photo are always clear and some areas are blurred.
It can be seen that at a specific focal distance, the focal length only affects the size of the circle of confusion, so camera parameters are related to focal distance, or in other words, field of view. In general, trackers prefer not to have camera parameters change dynamically, because this affects tracking accuracy. However, fixing focus at a specific distance may make the camera image very blurry, so in most cases AR applications still enable autofocus.
Resolution and frame rate
Mobile phone cameras usually provide multiple resolution and frame rate formats to choose from, but higher resolution and frame rate require higher processor performance and produce different heat levels, so they should be selected according to the actual situation.
Flash
In some low-light situations, the flash needs to stay on continuously. In this case, the tracker may perform worse or fail to work properly.