Camera calling method and device, storage medium and electronic equipment

文档序号:1617241 发布日期:2020-01-10 浏览:2次 中文

阅读说明:本技术 摄像头调用方法、装置、存储介质及电子设备 (Camera calling method and device, storage medium and electronic equipment ) 是由 沈伟坤 于 2019-09-03 设计创作,主要内容包括:本申请实施例公开了一种摄像头调用方法、装置、存储介质及电子设备,其中,摄像头调用方法应用于电子设备,电子设备包括多个摄像头。本申请实施例通过当开启预览模式时,启动多个摄像头中的普通彩色摄像头和彩色广角摄像头;在预览模式下确定待拍摄场景中的拍摄主体;根据普通彩色摄像头和彩色广角摄像头确定拍摄主体与电子设备的距离;根据距离确定用于采集预览图像的目标摄像头,并根据确定的目标摄像头采集待拍摄场景的预览图像。本申请实施例通过在预览模式下使用普通彩色摄像头和彩色广角摄像头对拍摄主体进行测距,根据测得的距离需要调用的摄像头,从而自动调用摄像头采集图像,增加拍摄的便利性。(The embodiment of the application discloses a camera calling method, a camera calling device, a storage medium and electronic equipment, wherein the camera calling method is applied to the electronic equipment, and the electronic equipment comprises a plurality of cameras. According to the embodiment of the application, when the preview mode is started, a common color camera and a color wide-angle camera in a plurality of cameras are started; determining a shooting subject in a scene to be shot in a preview mode; determining the distance between a shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera; and determining a target camera for acquiring the preview image according to the distance, and acquiring the preview image of the scene to be shot according to the determined target camera. The embodiment of the application can be used for ranging the shooting main body by using the common color camera and the color wide-angle camera in the preview mode, and the camera needs to be called according to the measured distance, so that the camera is automatically called to collect images, and the shooting convenience is improved.)

1. A camera calling method is applied to electronic equipment, and is characterized in that the electronic equipment comprises a plurality of cameras, and the camera calling method comprises the following steps:

when a preview mode is started, starting a common color camera and a color wide-angle camera in the plurality of cameras;

determining a shooting subject in a scene to be shot in the preview mode;

determining the distance between the shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera;

and determining a target camera for acquiring a preview image according to the distance, and acquiring the preview image of the scene to be shot according to the determined target camera.

2. The camera calling method according to claim 1, wherein the determining a shooting subject in a scene to be shot in the preview mode includes:

when a focusing instruction is received in the preview mode, determining a shooting subject in the scene to be shot according to the focusing instruction; or

Acquiring a current preview picture, and determining a shooting subject in the scene to be shot according to the geometric center of the preview picture; or

Acquiring two adjacent images to be processed through the common color camera, calculating the gray scale difference value of the same object in the two adjacent images to be processed, and determining the object as a shooting subject in a scene to be shot if the gray scale difference value is greater than a preset gray scale threshold value.

3. The camera invocation method according to claim 1, wherein said determining the distance between the photographic subject and the electronic device based on the normal color camera and the color wide-angle camera comprises:

shooting the scene to be shot according to the common camera to obtain a first reference image, and shooting the scene to be shot according to the color wide-angle camera to obtain a second reference image;

determining a first image point of the shooting subject on the first reference image, and determining a second image point of the shooting subject on the second reference image;

calculating to obtain the parallax of the shooting subject on the first reference image and the second reference image according to the first image point and the second image point;

and determining the distance between the shooting subject and the electronic equipment in the scene to be shot according to the parallax.

4. The camera invocation method according to any of claims 1-3, wherein before determining the distance between the photographic subject and the electronic device according to the normal color camera and the color wide-angle camera, the method further comprises:

acquiring the ambient brightness of the scene to be shot;

and when the ambient brightness is greater than the brightness threshold, determining the distance between the shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera.

5. The camera invocation method according to claim 4, wherein the determining, according to the distance, a target camera for acquiring a preview image comprises:

when the distance is smaller than or equal to a first preset distance, determining a color macro camera in the plurality of cameras as the target camera; or

When the distance is greater than the first preset distance and less than a second preset distance, determining a common color camera and a color wide-angle camera in the plurality of cameras as the target camera; or

And when the distance is greater than or equal to the second preset distance, determining a color long-focus camera in the plurality of cameras as the target camera.

6. The camera call method according to claim 4, wherein after determining a normal color camera and a color wide-angle camera of the plurality of cameras as the target camera, further comprising:

when a shooting request is received, shooting the scene to be shot according to the common color camera to obtain a first image to be processed, and shooting the scene to be shot according to the color wide-angle camera to obtain a second image to be processed;

determining depth-of-field information according to the first image to be processed and the second image to be processed;

determining a foreground region and a background region in the first image to be processed according to the depth information;

and carrying out fuzzy processing on the background area in the first image to be processed to obtain an imaging image corresponding to the shooting request.

7. The camera calling method according to claim 4, wherein after the obtaining the ambient brightness of the current scene to be shot, the method further comprises:

and when the ambient brightness is less than or equal to the brightness threshold, determining a common color camera and a common black-and-white camera in the plurality of cameras as the target camera.

8. The utility model provides a camera calling device, is applied to electronic equipment, its characterized in that, electronic equipment includes a plurality of cameras, camera calling device includes:

the starting module is used for starting a common color camera and a color wide-angle camera in the plurality of cameras when a preview mode is started;

the first determining module is used for determining a shooting subject in a scene to be shot in the preview mode;

the second determining module is used for determining the distance between the shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera;

and the acquisition module is used for determining a target camera for acquiring a preview image according to the distance and acquiring the preview image of the scene to be shot according to the determined target camera.

9. A storage medium having stored thereon a computer program which, when run on a computer, causes the computer to execute the camera call method according to any one of claims 1 to 7.

10. An electronic device, comprising a processor, a memory and a plurality of cameras, wherein the processor is electrically connected to the memory and the plurality of cameras, the memory stores a computer program, and the processor executes the camera calling method according to any one of claims 1 to 7 by calling the computer program.

11. An electronic device, comprising:

the cameras are used for acquiring preview images;

a display screen for displaying a preview image;

the treater, respectively with a plurality of cameras reach display screen electric connection, the treater is used for:

when a preview mode is started, starting a common color camera and a color wide-angle camera in the plurality of cameras;

determining a shooting subject in a scene to be shot in the preview mode;

determining the distance between the shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera;

and determining a target camera for acquiring a preview image according to the distance, and acquiring the preview image of the scene to be shot according to the determined target camera.

Technical Field

The application relates to the technical field of electronics, in particular to a camera calling method, a camera calling device, a storage medium and electronic equipment.

Background

At present, users generally take images by using electronic devices with cameras, and things around, scenes and the like can be recorded by the electronic devices anytime and anywhere. With more and more cameras in the electronic equipment, different cameras have different functions and are suitable for different scenes. However, in the related art, a user is required to manually select different cameras to adapt to different scenes to be shot.

Disclosure of Invention

The embodiment of the application provides a camera calling method and device, a storage medium and electronic equipment, which can automatically determine a called camera and increase the convenience of shooting.

In a first aspect, an embodiment of the present application provides a camera calling method, which is applied to an electronic device, where the electronic device includes a plurality of cameras, and the camera calling method includes:

when a preview mode is started, starting a common color camera and a color wide-angle camera in the plurality of cameras;

determining a shooting subject in a scene to be shot in the preview mode;

determining the distance between the shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera;

and determining a target camera for acquiring a preview image according to the distance, and acquiring the preview image of the scene to be shot according to the determined target camera.

In a second aspect, an embodiment of the present application provides a camera calling device, which is applied to an electronic device, where the electronic device includes a plurality of cameras, and the camera calling device includes:

the starting module is used for starting a common color camera and a color wide-angle camera in the plurality of cameras when a preview mode is started;

the second determining module is used for determining a shooting subject in a scene to be shot in the preview mode;

the second determining module is used for determining the distance between the shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera;

and the acquisition module is used for determining a target camera for acquiring a preview image according to the distance and acquiring the preview image of the scene to be shot according to the determined target camera.

In a third aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the camera calling method provided in the embodiment of the present application.

In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and multiple cameras, where the memory stores a computer program, and the processor executes the camera calling method provided in the embodiment of the present application by calling the computer program.

In a fifth aspect, an embodiment of the present application provides an electronic device, including:

the cameras are used for acquiring preview images;

a display screen for displaying a preview image;

the treater, respectively with a plurality of cameras reach display screen electric connection, the treater is used for:

when a preview mode is started, starting a common color camera and a color wide-angle camera in the plurality of cameras;

determining a shooting subject in a scene to be shot in the preview mode;

determining the distance between the shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera;

and determining a target camera for acquiring a preview image according to the distance, and acquiring the preview image of the scene to be shot according to the determined target camera.

In the embodiment of the application, the common color camera and the color wide-angle camera are used for ranging the shooting main body in the preview mode, and the cameras need to be called according to the measured distance, so that the cameras are automatically called to collect images, and the shooting convenience is improved.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a schematic flowchart of a camera calling method provided in an embodiment of the present application.

Fig. 2 is a schematic view of a binocular stereo vision system provided in an embodiment of the present application.

Fig. 3 is a schematic view of a head-up binocular stereoscopic imaging principle provided by an embodiment of the present application.

Fig. 4 is another schematic flow chart of a camera call method provided in the embodiment of the present application.

Fig. 5 is a first structural schematic diagram of a camera call device provided in an embodiment of the present application.

Fig. 6 is a second schematic structural diagram of a camera call device according to an embodiment of the present application.

Fig. 7 is a third structural schematic diagram of a camera call device provided in the embodiment of the present application.

Fig. 8 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.

Fig. 9 is another schematic structural diagram of an electronic device according to an embodiment of the present application.

Detailed Description

Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.

The embodiment of the application firstly provides a camera calling method, and the camera calling method is applied to electronic equipment. The execution main body of the camera calling method can be the camera calling device provided by the embodiment of the application, or electronic equipment integrated with the camera calling device, the camera calling device can be realized in a hardware or software mode, and the electronic equipment can be equipment with processing capability and configured with a processor, such as a smart phone, a tablet computer, a palm computer, a notebook computer or a desktop computer.

For example, the electronic device is exemplified by a smartphone. Wherein the electronic device may include a plurality of cameras. The electronic device may include three cameras, four cameras, five cameras, or more cameras. Such as an electronic device that includes four cameras, respectively: the camera comprises a first camera, a second camera, a third camera and a fourth camera.

It should be noted that the electronic device may include a front camera and/or a rear camera, where the front camera may include a plurality of cameras, and the rear camera may also include a plurality of cameras. The multiple cameras defined by the embodiment of the application can be front-facing cameras or rear-facing cameras.

The first camera can be used as a main camera of the electronic equipment, is a lens with a focal length of 40-55 millimeters, and is mainly used for taking pictures. The picture observed from the first camera is very close to the picture seen by human eyes, and the image shot by the first camera is relatively 'real'. In some embodiments, the first camera may be embodied as a normal color camera.

The second camera, the third camera and the fourth camera can be used as auxiliary cameras. The number of the auxiliary cameras is not limited to this, and the number of the auxiliary cameras is two, four, or the like.

The focal length of the second camera is longer than that of the first camera. The second camera can shoot objects far away compared with the first camera, and can effectively blur the main body with the protruded background. In some embodiments, the second camera may be a color tele camera. The third camera is faster than the first camera in focusing speed. The third camera may be a wide-angle camera, which may increase the shooting angle and content of the first camera. The focal length of the fourth camera is shorter than that of the first camera, and can be a common fourth camera, for example, the focal length is 38-24 mm, and the visual angle is 60-84 degrees. The fourth camera can shoot a picture with a short distance and a large scene, and the shot picture is much larger than that seen by human eyes; the picture of the fourth camera emphasizes the foreground and highlights the far-near contrast, that is, near objects in the picture are larger, far objects are smaller, and a strong perspective effect is achieved. In some embodiments, the fourth camera may be a color macro camera.

Optionally, the electronic device may also include a fifth camera, and the fifth camera is a common black-and-white camera.

Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a camera call method according to an embodiment of the present disclosure. The camera calling method is applied to the electronic equipment provided by the embodiment of the application, the electronic equipment comprises a plurality of cameras, and the flow of the camera calling method provided by the embodiment of the application can be as follows:

101, when the preview mode is turned on, a normal color camera and a color wide-angle camera among the plurality of cameras are activated.

In an embodiment, when a user opens a camera application, the user can enter a preview mode in the camera application. When the preview mode is started, a common color camera and a color wide-angle camera in the multiple cameras are started to serve as a default camera combination in the preview mode, and the current picture is previewed through the default camera combination.

And 102, determining a shooting subject in a scene to be shot in a preview mode.

The shooting subject can be an object to be focused in a scene to be shot, that is, an object that a user wants to shoot in a focused manner. Determining a shooting subject in a scene to be shot in a preview mode may include:

(1) and when the focusing instruction is received in the preview mode, determining a shooting subject in the scene to be shot according to the focusing instruction.

Generally, the in-focus position is a subject. In an embodiment, a shooting subject in a scene to be shot can be determined by a mode actively selected by a user, and before the user operates an electronic device to start a shooting application (such as a system application "camera" of the electronic device) to capture an image, a focusing instruction is input on a preview interface of the shooting application by clicking or frame selection in a preview mode. The electronic equipment receives a focusing instruction input by a user, and determines an object pointed by the focusing instruction as a shooting subject. For example, when the scene to be photographed is a scene in which a cow grazes under the mountain feet, the user wants to mainly photograph the cow, and then the cow can be taken as the subject of photographing by clicking the position of the cow in the preview interface.

(2) And acquiring a current preview picture, and determining a shooting subject in a scene to be shot according to the geometric center of the preview picture.

When the focusing is performed manually, the shooting subject is located at the position of a touch screen; and if the user does not carry out manual focusing, the electronic equipment carries out automatic focusing on the current scene to be shot in a preview mode, and the focusing position is the geometric center of the current preview picture.

In an embodiment, if the focusing instruction is not received in the preview mode, a current preview picture is obtained, the geometric center of the preview picture is focused, and an object corresponding to the geometric center is determined as a shooting subject in a current scene to be shot.

The preview interface may be in various shapes, and preferably, the preview interface may be in a regular geometric figure, such as a rectangle, a triangle, a circle, and the like. When the preview interface is a regular geometric figure, the center of gravity of the regular geometric figure is the geometric center of the preview interface. For a rectangular preview interface, the geometric center of the preview interface is at the intersection point of two diagonal lines of the rectangle; for a triangular preview interface, the geometric center of the preview interface is at the intersection point of three central lines of the triangle; for a circular preview interface, the geometric center of the preview interface is at the center of the circle.

Alternatively, the photographic subject may be a person or an object, may be a stationary photographic subject, or may be a moving photographic subject. For a moving shooting subject, when the shooting subject is determined, two adjacent images to be processed can be obtained through a common color camera, the gray level difference value of the same object in the two adjacent images to be processed is calculated, and if the gray level difference value is larger than a preset threshold value, the object is determined as the shooting subject.

And 103, determining the distance between the shooting subject and the electronic equipment according to the common color camera and the color wide-angle camera.

In one embodiment, the distance between the subject and the electronic device is determined by a three-dimensional measurement method based on a binocular stereo vision system, also called binocular range finding, using a normal color camera and a color wide-angle camera. In the present application, the binocular stereoscopic vision system may be composed of two cameras, a normal color camera and a color wide-angle camera. Just like the left eye and the right eye of human eyes have imaging difference when watching the same object, the positions of the shooting subjects in the images shot by the two cameras by the same shooting subject are different, so that the distance between the shooting subject and the electronic equipment can be determined according to the position difference of image points in the images shot by the shooting subject in the common color camera and the color wide-angle camera respectively.

In one embodiment, determining the distance between the photographic subject and the electronic device according to the common color camera and the color wide-angle camera comprises:

determining a first optical center of a common color camera and a second optical center of a color wide-angle camera;

connecting the first image point and the first optical center to obtain a first projection line, and connecting the second image point and the second optical center to obtain a second projection line;

acquiring an intersection point of the first projection line and the second projection line, and determining the intersection point as the position of the shooting subject;

and acquiring the distance from the intersection point to the electronic equipment, and determining the distance as the distance between the shooting subject and the electronic equipment.

Referring to fig. 2, fig. 2 is a schematic view of a binocular stereo vision system according to an embodiment of the present application. The camera comprises a left camera and a right camera, a common color camera is used as a right camera, and a color wide-angle camera is used as a left camera. In the figure, subscripts l and r are respectively marked on corresponding parameters of the left camera and the right camera. Imaging planes C of photographic subject A (X, Y, Z) in world space on left and right cameraslAnd CrThe image points on are respectively al(ul,vl) And ar(ur,vr). Image point alAnd image point arIs an image of the same object a in world space, called the "conjugate point". From the two conjugate points, the optical centers O of the two conjugate points and the respective cameras are respectively madelAnd OrOf connection lines, i.e. projection lines alOlAnd arOrProjection line alOlAnd arOrThe intersection point of (a) is the photographic subject a (X, Y, Z) in the world space.

In one embodiment, determining the distance between the photographic subject and the electronic device according to the common color camera and the color wide-angle camera comprises:

shooting a scene to be shot according to a common camera to obtain a first reference image, and shooting the scene to be shot according to a color wide-angle camera to obtain a second reference image;

determining a first image point of a shooting subject on a first reference image, and determining a second image point of the shooting subject on a second reference image;

calculating to obtain the parallax of the shooting subject on the first reference image and the second reference image according to the first image point and the second image point;

and determining the distance between the shooting subject and the electronic equipment in the scene to be shot according to the parallax.

Referring to fig. 3, fig. 3 is a schematic view illustrating a principle of head-up binocular stereoscopic imaging according to an embodiment of the present disclosure. Wherein the two cameras photograph the same subject a (X, Y, Z) in a head-up manner. Left image plane ClIs an imaging surface of a color wide-angle camera at an imaging surface ClForming a first reference image of a scene to be shot; right image plane CrIs an imaging surface of a common color camera and is arranged on an imaging surface CrA second reference image of the scene to be photographed is formed. a isl(ul,vl) For capturing a first image point, a, of a subject A (X, Y, Z) on a first reference imager(ur,vr) To capture a second image point of subject a (X, Y, Z) on a second reference image. The base line distance b is the distance of the connecting line of the projection centers of the two cameras. Composition of colour wide-angle camera and ordinary colour cameraThe image plane is in front of the optical center f of the common color camera.

When calculating the parallax of the shooting subject on the first reference image and the second reference image, a virtual image plane coordinate system O is usedlThe u-axis and the v-axis of uv are kept consistent with the directions of the x-axis and the y-axis of the camera coordinate system, so that the calculation process is simplified. O islAnd OrThe system comprises a camera, a camera lens and a camera lens, wherein the camera lens is used for taking the camera lens as a camera lens, the camera lens is used for taking the camera lens.

When the first reference image and the second reference image are on the same plane, the Y coordinates of the photographic subject a (X, Y, Z) in the first reference image and the second reference image are the same, i.e., vl=vr. From the trigonometric relationship:

Figure BSA0000190543980000071

wherein (X, Y, Z) is the coordinate of the main body A in the coordinate system of the left camera, b is the base line distance, f is the focal length of the two cameras, and (u)l,vl) And (u)r,vr) Coordinates of the photographic subject a in the first reference image and the second reference image, respectively.

According to the first image point and the second image point, calculating to obtain the parallax of the shooting subject on the first reference image and the second reference image:

Figure BSA0000190543980000072

thus, the coordinates of the photographic subject a in the left camera coordinate system are calculated as:

Figure BSA0000190543980000073

because the distance between the shooting subject and the electronic equipment is reflected as the coordinate of the Z axis in the coordinate system of the left camera, the distance Z between the shooting subject and the electronic equipment in the scene to be shot can be determined according to the parallax.

In one embodiment, a mark point is determined on the photographic subject, and the coordinates of the mark point in each coordinate system are used as the coordinates of the photographic subject in each coordinate system to represent the photographic subject. The mark point may be a center of gravity of the photographic subject or a highest point of the photographic subject or a lowest point of the highest point of the photographic subject, or the like. Since the photographic subject generally has a certain volume, the photographic subject in the first reference image and the second reference image acquired by the common color camera and the color wide-angle camera also has a certain volume. By determining the mark points on the shooting subject and representing the shooting subject by the mark points, the coordinates of the shooting subject in the first reference image and the second reference image can be more accurately determined, so that the determined shooting subject and the electronic equipment are more accurate.

Here, the directions are set to the left and right for convenience of description, and a color wide-angle camera may be used as the left camera and a normal color camera may be used as the right camera. In addition, the positions of the common color camera and the color wide-angle camera can be left-right, up-down, or obliquely above and obliquely below, and the like, and the positions of the common color camera and the color wide-angle camera are not limited herein.

And 104, determining a target camera for acquiring the preview image according to the distance, and acquiring the preview image of the scene to be shot according to the determined target camera.

The method comprises the steps that a plurality of cameras are arranged in the electronic equipment, and after the distance between a shooting main body in a scene to be shot and the electronic equipment is determined, a target camera needing to be called is determined according to a distance interval where the distance is located. The system comprises at least three distance intervals, and is respectively suitable for a macro shooting scene, a normal distance shooting scene and a long-distance shooting scene according to the distance from near to far.

Determining a target camera for acquiring a preview image according to the distance may include:

(1) and when the distance is smaller than or equal to the first preset distance, determining the color macro camera in the multiple cameras as a target camera.

The first preset distance may be an applicable distance threshold of the color macro camera. When the shooting main body is close to the electronic equipment and the effect of the color macro camera is superior to that of the common color camera, the color wide-angle camera and the common color camera are automatically closed, and the color macro camera is opened to adapt to the current macro shooting scene.

(2) And when the distance is greater than the first preset distance and less than the second preset distance, determining the common color camera and the color wide-angle camera in the plurality of cameras as the target camera.

The second preset distance may be an applicable distance threshold of the color wide-angle camera. When the distance is greater than the first preset distance and less than the second preset distance, the shooting scene does not belong to a macro shooting scene, a long-distance shooting scene or a normal-distance shooting scene.

When the preview mode is started, the cameras are started by default to be a common color camera and a color wide-angle camera in the multiple cameras, so that when the distance between the shooting main body and the electronic equipment is judged to be larger than a first preset distance and smaller than a second preset distance, the two cameras are still determined as target cameras.

Or if a plurality of common color cameras and/or a plurality of color wide-angle cameras are arranged in the electronic equipment, when a preview mode is started, one common color camera and one color wide-angle camera in the plurality of cameras are started, a shooting subject in a scene to be shot is determined in the preview mode, the distance between the shooting subject and the electronic equipment is determined according to the common color camera and the color wide-angle camera, and when the distance is greater than a first preset distance and smaller than a second preset distance, all the common color cameras and all the color wide-angle cameras in the plurality of cameras are determined as target cameras.

(3) And when the distance is greater than or equal to a second preset distance, determining the color long-focus camera in the multiple cameras as a target camera.

The second preset distance may be an applicable distance threshold of the color telephoto camera. When the shooting main body is far away from the electronic equipment and the common color camera is not enough to shoot a far clear picture, the color wide-angle camera and the common color camera are automatically closed, and the color long-focus camera is opened to adapt to the current long-distance shooting scene.

It should be noted that there may be one or multiple cameras of the same type in the determined target cameras, where the number of the cameras of the same type in the determined target cameras is not limited, and when multiple cameras are called, the multiple cameras respectively collect preview images of a scene to be photographed, and perform image synthesis processing on the collected multiple preview images. For example, when a plurality of cameras of the same type are called, the camera parameters of the plurality of cameras of the same type are changed to acquire preview images of the same scene to be shot, and the preview images acquired by the plurality of cameras of the same type and different camera parameters are synthesized to obtain a synthesized image.

In one embodiment, acquiring a preview image of a scene to be photographed according to a determined target camera includes:

when the target camera comprises a plurality of cameras of the same type, setting exposure parameters of different gradients for the plurality of cameras of the same type;

acquiring a plurality of preview images of a scene to be shot based on exposure parameters of different gradients;

and performing image synthesis processing on the plurality of preview images to obtain a synthesized image.

The multiple cameras of the same type refer to the multiple cameras belonging to the same color macro camera or the same color tele camera, and the like. The exposure parameters include exposure time. For example, when the determined target camera includes a plurality of tele cameras, setting exposure times with different gradients for the tele cameras, and acquiring a preview image of a scene to be shot by each tele camera according to the exposure time of the tele camera to obtain a plurality of preview images. When image synthesis processing is performed on a plurality of preview images, dark portion details of a preview image having a long exposure time and bright portion details of a preview image having a short exposure time are synthesized. The bright details refer to the brightest part in the preview image, and the dark details refer to the darkest part in the preview image. Therefore, the bright part details and the dark part details of the synthesized image are clearer.

As can be seen from the above, in the embodiment of the present application, the electronic device includes a plurality of cameras. The electronic equipment starts a common color camera and a color wide-angle camera in the plurality of cameras when a preview mode is started; determining a shooting subject in a scene to be shot in a preview mode; determining the distance between a shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera; and determining a target camera for acquiring the preview image according to the distance, and acquiring the preview image of the scene to be shot according to the determined target camera. The embodiment of the application can be used for ranging the shooting main body by using the common color camera and the color wide-angle camera in the preview mode, and the camera needs to be called according to the measured distance, so that the camera is automatically called to collect images, and the shooting convenience is improved.

Optionally, before determining the distance between the shooting subject and the electronic device according to the common color camera and the color wide-angle camera, obtaining the ambient brightness of the scene to be shot; when the ambient brightness is larger than the brightness threshold, determining the distance between the shooting subject and the electronic equipment according to the common color camera and the color wide-angle camera; and when the ambient brightness is less than or equal to the brightness threshold, determining a common color camera and a common black-and-white camera in the plurality of cameras as the target camera.

Before determining the target camera, besides the distance between the shooting subject and the electronic equipment as a reference condition, the ambient brightness can be used as the reference condition, and the priority of the ambient brightness is better than that of the distance. That is, if the current ambient brightness is dark and the distance between the main shooting body and the electronic device is also close, the camera calling scheme when the ambient brightness is dark is preferentially considered, and a common color camera and a common black-and-white camera are used as target cameras. And only when the current environment brightness is larger than the brightness threshold value and the environment is not dark, considering the reference condition of the distance, and determining the distance between the shooting subject and the electronic equipment according to the common camera and the color wide-angle camera. When the distance is smaller than or equal to a first preset distance, determining a color macro camera in the multiple cameras as a target camera; when the distance is greater than a first preset distance and less than a second preset distance, determining a common color camera and a color wide-angle camera in the plurality of cameras as a target camera; and when the distance is greater than or equal to a second preset distance, determining the color long-focus camera in the multiple cameras as a target camera.

In one embodiment, the sensitivity during shooting automatically changes with the ambient brightness and is inversely proportional to the ambient brightness. When the ambient brightness is brighter, the digital photosensitive element in the electronic equipment senses stronger light, and the sensitivity is correspondingly lower; when the ambient brightness is darker, the light sensed by the digital photosensitive element in the electronic equipment is weaker, and the sensitivity is correspondingly higher. Thus, when the sensitivity varies with the ambient brightness, the sensitivity at the time of shooting can also be acquired. Determining a common color camera and a common black-and-white camera of the plurality of cameras as a target camera when the sensitivity is greater than or equal to the sensitivity threshold; and when the sensitivity is smaller than the sensitivity threshold, determining the distance between the shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera, and determining a target camera for acquiring a preview image according to the distance.

Referring to fig. 4, fig. 4 is another schematic flow chart of a camera invoking method provided in the embodiment of the present application, where the camera invoking method is applied to an electronic device provided in the embodiment of the present application, and if the electronic device includes a normal color camera, a color wide-angle camera, a color macro camera, a color telephoto camera, and a normal black-and-white camera, the flow of the camera invoking method may include:

201. when the preview mode is turned on, a normal color camera and a color wide-angle camera among the plurality of cameras are started.

In the electronic device, a plurality of cameras may be included, for example: common color cameras, color wide-angle cameras, color macro cameras, color tele cameras, common black and white cameras, and the like.

In an embodiment, the preview mode may be entered in the camera class application when the user opens the camera class application. When the preview mode is started, a common color camera and a color wide-angle camera in the multiple cameras are started to serve as a default camera combination in the preview mode, and the current picture is previewed through the default camera combination.

202. A photographic subject in a scene to be photographed is determined in a preview mode.

The shooting subject can be an object to be focused in a scene to be shot, that is, an object that a user wants to shoot in a focused manner. Determining a shooting subject in a scene to be shot in a preview mode may include:

(1) and when the focusing instruction is received in the preview mode, determining a shooting subject in the scene to be shot according to the focusing instruction.

Generally, the in-focus position is a subject. In an embodiment, a shooting subject in a scene to be shot can be determined by a mode actively selected by a user, and before the user operates an electronic device to start a shooting application (such as a system application "camera" of the electronic device) to capture an image, a focusing instruction is input on a preview interface of the shooting application by clicking or frame selection in a preview mode. The electronic equipment receives a focusing instruction input by a user, and determines an object pointed by the focusing instruction as a shooting subject. For example, when the scene to be photographed is a scene in which a cow grazes under the mountain feet, the user wants to mainly photograph the cow, and then the cow can be taken as the subject of photographing by clicking the position of the cow in the preview interface.

(2) And acquiring a current preview picture, and determining a shooting subject in a scene to be shot according to the geometric center of the preview picture.

When the focusing is performed manually, the shooting subject is located at the position of a touch screen; and if the user does not carry out manual focusing, the electronic equipment carries out automatic focusing on the current scene to be shot in a preview mode, and the focusing position is the geometric center of the current preview picture.

In an embodiment, if the focusing instruction is not received in the preview mode, a current preview picture is obtained, the geometric center of the preview picture is focused, and an object corresponding to the geometric center is determined as a shooting subject in a current scene to be shot.

The preview interface may be in various shapes, and preferably, the preview interface may be in a regular geometric figure, such as a rectangle, a triangle, a circle, and the like. When the preview interface is a regular geometric figure, the center of gravity of the regular geometric figure is the geometric center of the preview interface. For a rectangular preview interface, the geometric center of the preview interface is at the intersection point of two diagonal lines of the rectangle; for a triangular preview interface, the geometric center of the preview interface is at the intersection point of three central lines of the triangle; for a circular preview interface, the geometric center of the preview interface is at the center of the circle.

Alternatively, the photographic subject may be a person or an object, may be a stationary photographic subject, or may be a moving photographic subject. For a moving shooting subject, when the shooting subject is determined, two adjacent images to be processed can be obtained through a common color camera, the gray level difference value of the same object in the two adjacent images to be processed is calculated, and if the gray level difference value is larger than a preset threshold value, the object is determined as the shooting subject.

203. And acquiring the ambient brightness of the scene to be shot.

204. And judging whether the ambient brightness is greater than the brightness threshold, if not, turning to step 205, and if so, turning to step 206.

205. And determining a common color camera and a common black-and-white camera in the plurality of cameras as the target camera.

The ambient brightness and the distance between the shooting subject and the electronic equipment are used as two reference conditions for determining the target camera. And, the priority of the ambient brightness is higher than the distance between the photographing subject and the electronic device. That is, if the current ambient brightness is dark and the distance between the main shooting body and the electronic device is also close, the camera calling scheme when the ambient brightness is dark is preferentially considered, and a common color camera and a common black-and-white camera are used as target cameras. Before determining a target camera, obtaining the ambient brightness of a scene to be shot, and determining a common color camera and a common black-and-white camera in a plurality of cameras as the target camera when the ambient brightness is less than or equal to a brightness threshold; and only when the current environment brightness is larger than the brightness threshold value and the environment is not dark, the reference condition of the distance is considered, and the target camera is determined according to the distance.

206. Shooting a scene to be shot according to a common camera to obtain a first reference image, and shooting the scene to be shot according to a wide-angle camera to obtain a second reference image.

207. And determining a first image point of the shooting subject on the first reference image, and determining a second image point of the shooting subject on the second reference image.

Referring to fig. 3, fig. 3 is a schematic view illustrating a principle of head-up binocular stereoscopic imaging according to the present application. Wherein the two cameras photograph the same subject a (X, Y, Z) in a head-up manner. Left image plane ClIs an imaging surface of a color wide-angle camera at an imaging surface ClForming a first reference image of a scene to be shot; right image plane CrIs an imaging surface of a common color camera and is arranged on an imaging surface CrA second reference image of the scene to be photographed is formed. a isl(ul,vl) For capturing a first image point, a, of a subject A (X, Y, Z) on a first reference imager(ur,vr) To capture a second image point of subject a (X, Y, Z) on a second reference image. The base line distance b is the distance of the connecting line of the projection centers of the two cameras. The imaging surfaces of the color wide-angle camera and the ordinary color camera are in front of the optical center f of the ordinary color camera.

208. And calculating the parallax of the shooting subject on the first reference image and the second reference image according to the first image point and the second image point.

When the parallax of the shooting subject on the first reference image and the second reference image is calculated, the virtual image is generatedImage plane coordinate system OlThe u-axis and the v-axis of uv are kept consistent with the directions of the x-axis and the y-axis of the camera coordinate system, so that the calculation process is simplified. O islAnd OrThe system comprises a camera, a camera lens and a camera lens, wherein the camera lens is used for taking the camera lens as a camera lens, the camera lens is used for taking the camera lens.

When the first reference image and the second reference image are on the same plane, the Y coordinates of the photographic subject a (X, Y, Z) in the first reference image and the second reference image are the same, i.e., vl=vr. From the trigonometric relationship:

Figure BSA0000190543980000141

wherein (X, Y, Z) is the coordinate of the main body A in the coordinate system of the left camera, b is the base line distance, f is the focal length of the two cameras, and (u)l,vl) And (u)r,vr) Coordinates of the photographic subject a in the first reference image and the second reference image, respectively.

According to the first image point and the second image point, calculating to obtain the parallax of the shooting subject on the first reference image and the second reference image:

Figure BSA0000190543980000142

209. and determining the distance between the shooting subject and the electronic equipment in the scene to be shot according to the parallax. And determining whether to shift to steps 210, 211 or 213 according to the distance interval to which the distance belongs.

And determining the coordinates of the shooting subject A in the left camera coordinate system according to the parallax as follows:

Figure BSA0000190543980000143

because the distance between the shooting subject and the electronic equipment is reflected as the coordinate of the Z axis in the coordinate system of the left camera, the distance Z between the shooting subject and the electronic equipment in the scene to be shot can be determined according to the parallax.

From the distance interval of the distance Z, it is determined whether to proceed to steps 210, 211 or 213 next. If the distance Z is small and smaller than or equal to the first preset distance, go to step 210; if the distance Z is greater than the first preset distance and less than the second preset distance, go to step 211; if the distance Z is large and greater than or equal to the second predetermined distance, go to step 213.

210. And when the distance is smaller than or equal to the first preset distance, determining the color macro camera in the multiple cameras as a target camera.

The first preset distance may be an applicable distance threshold of the color macro camera. When the shooting main body is close to the electronic equipment and the effect of the color macro camera is superior to that of the common color camera, the color wide-angle camera and the common color camera are automatically closed, and the color macro camera is opened to adapt to the current macro shooting scene.

211. And when the distance is greater than the first preset distance and less than the second preset distance, determining the common color camera and the color wide-angle camera in the plurality of cameras as the target camera.

The second preset distance may be an applicable distance threshold of the color wide-angle camera. When the distance is greater than the first preset distance and less than the second preset distance, the shooting scene does not belong to a macro shooting scene, a long-distance shooting scene or a normal-distance shooting scene.

When the preview mode is started, the cameras are started by default to be a common color camera and a color wide-angle camera in the multiple cameras, so that when the distance between the shooting main body and the electronic equipment is judged to be larger than a first preset distance and smaller than a second preset distance, the two cameras are still determined as target cameras.

Or if a plurality of common color cameras and/or a plurality of color wide-angle cameras are arranged in the electronic equipment, when a preview mode is started, one common color camera and one color wide-angle camera in the plurality of cameras are started, a shooting subject in a scene to be shot is determined in the preview mode, the distance between the shooting subject and the electronic equipment is determined according to the common color camera and the color wide-angle camera, and when the distance is greater than a first preset distance and smaller than a second preset distance, all the common color cameras and all the color wide-angle cameras in the plurality of cameras are determined as target cameras.

212. Shooting a scene to be shot according to the common color camera and the color wide-angle camera, and blurring the shot image.

When the distance between the shooting main body and the electronic equipment is larger than a first preset distance and smaller than a second preset distance, common color cameras and color wide-angle cameras in the multiple cameras are determined as target cameras. Under the condition that the camera is combined into a target camera, the blurring function can be realized by utilizing two paths of data of a common color camera and a color wide-angle camera.

For example, in an embodiment, after a common color camera and a color wide-angle camera in the plurality of cameras are determined as target cameras, a scene to be shot is shot according to the common color camera and the color wide-angle camera, and a shot image is subjected to blurring processing. Wherein, treating according to ordinary color camera and colored wide-angle camera and shoot the scene, the step of carrying out blurring treatment to the image that obtains of shooing can include:

when a shooting request is received, shooting a scene to be shot according to a common color camera to obtain a first image to be processed, and shooting the scene to be shot according to a color wide-angle camera to obtain a second image to be processed;

determining depth-of-field information according to the first image to be processed and the second image to be processed;

determining a foreground region and a background region in the first image to be processed according to the depth information;

and carrying out fuzzy processing on the background area in the first image to be processed to obtain an imaging image corresponding to the shooting request.

Calculating the depth information in the first image to be processed and the second image to be processed, generating a depth table or a depth map according to the depth information, and combining the depth table or the depth map with the first image to be processed, thereby determining a foreground area and a background area in the first image to be processed. The plane of the shooting main body is used as an interface, the foreground area corresponds to one side, close to the electronic equipment, of two side spaces divided by the interface in the actual scene to be shot, and the background area corresponds to one side, far away from the electronic equipment, of two side spaces divided by the interface in the actual scene to be shot.

213. And when the distance is greater than or equal to a second preset distance, determining the color long-focus camera in the multiple cameras as a target camera.

The second preset distance may be an applicable distance threshold of the color telephoto camera. When the shooting main body is far away from the electronic equipment and the common color camera is not enough to shoot a far clear picture, the color wide-angle camera and the common color camera are automatically closed, and the color long-focus camera is opened to adapt to the current long-distance shooting scene.

214. And acquiring a preview image of a scene to be shot according to the determined target camera.

One or more cameras of the same type in the determined target cameras may be provided, and the number of the cameras of the same type in the determined target cameras is not limited herein. When one target camera is used, acquiring a preview image of a scene to be shot through only one camera; when the target cameras are a plurality of cameras, the plurality of cameras are used for respectively collecting preview images of a scene to be shot, and the collected preview images are subjected to image synthesis processing. For example, when a plurality of cameras of the same type are called, the camera parameters of the plurality of cameras of the same type are changed to acquire preview images of the same scene to be shot, and the preview images acquired by the plurality of cameras of the same type and different camera parameters are synthesized to obtain a synthesized image.

In one embodiment, acquiring a preview image of a scene to be photographed according to a determined target camera includes:

when the target camera comprises a plurality of cameras of the same type, setting exposure parameters of different gradients for the plurality of cameras of the same type;

acquiring a plurality of preview images of a scene to be shot based on exposure parameters of different gradients;

and performing image synthesis processing on the plurality of preview images to obtain a synthesized image.

The multiple cameras of the same type refer to the multiple cameras belonging to the same color macro camera or the same color tele camera, and the like. The exposure parameters include exposure time. For example, when the determined target camera includes a plurality of tele cameras, setting exposure times with different gradients for the tele cameras, and acquiring a preview image of a scene to be shot by each tele camera according to the exposure time of the tele camera to obtain a plurality of preview images. When image synthesis processing is performed on a plurality of preview images, dark portion details of a preview image having a long exposure time and bright portion details of a preview image having a short exposure time are synthesized. The bright details refer to the brightest part in the preview image, and the dark details refer to the darkest part in the preview image. Therefore, the bright part details and the dark part details of the synthesized image are clearer.

As can be seen from the above, in the embodiment of the present application, the electronic device includes a plurality of cameras. The electronic equipment starts a common color camera and a color wide-angle camera in the plurality of cameras when a preview mode is started; determining a shooting subject in a scene to be shot in a preview mode; determining the distance between a shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera; and determining a target camera for acquiring the preview image according to the distance, and acquiring the preview image of the scene to be shot according to the determined target camera. The embodiment of the application can be used for ranging the shooting main body by using the common color camera and the color wide-angle camera in the preview mode, and the camera needs to be called according to the measured distance, so that the camera is automatically called to collect images, and the shooting convenience is improved.

The embodiment of the application also provides a camera calling device. Referring to fig. 5, fig. 5 is a first structural schematic diagram of a camera call device according to an embodiment of the present application. The camera calling device 300 is applied to an electronic device, the electronic device includes a plurality of cameras, and the camera calling device includes a starting module 301, a first determining module 302, a second determining module 303, and an acquiring module 304, as follows:

a starting module 301, configured to start a common color camera and a color wide-angle camera in the multiple cameras when the preview mode is started;

a first determining module 302, configured to determine a shooting subject in a scene to be shot in a preview mode;

a second determining module 303, configured to determine a distance between the main shooting object and the electronic device according to the common color camera and the color wide-angle camera;

and the acquisition module 304 is configured to determine a target camera for acquiring a preview image according to the distance, and acquire the preview image of the scene to be shot according to the determined target camera.

Referring to fig. 6, in an embodiment, the first determining module 302 includes a first determining unit 3021 and a second determining unit 3022:

a first determination unit 3021 configured to, when a focus instruction is received in the preview mode, determine a photographic subject in a scene to be photographed according to the focus instruction;

a second determining unit 3022, configured to acquire a current preview screen, and determine a subject in a scene to be photographed according to a geometric center of the preview screen; (ii) a Or

The third determining unit 3023 is configured to obtain two adjacent to-be-processed images through a common color camera, calculate a graying difference value of the same object in the two adjacent to-be-processed images, and determine the object as a shooting subject in a scene to be shot if the graying difference value is greater than a preset grayscale threshold.

In one embodiment, the second determining module 303 includes an acquiring unit 3031, a pixel determining unit 3032, a calculating unit 3033, and a determining unit 3034:

an obtaining unit 3031, configured to shoot a scene to be shot according to a common camera to obtain a first reference image, and shoot the scene to be shot according to a color wide-angle camera to obtain a second reference image;

an image point determining unit 3032, configured to determine a first image point of the photographic subject on the first reference image, and determine a second image point of the photographic subject on the second reference image;

a calculating unit 3033, configured to calculate, according to the first image point and the second image point, a parallax of the shooting subject on the first reference image and the second reference image;

a determining unit 3034, configured to determine, according to the parallax, a distance between the photographic subject and the electronic device in the scene to be photographed.

In an embodiment, the acquisition module 304 includes a third determination unit 3041, a fourth determination unit 3042, and a fifth determination unit 3043:

a fourth determining unit 3041 for determining a color macro camera of the plurality of cameras as a target camera when the distance is less than or equal to the first preset distance; or

A fifth determining unit 3042 configured to determine, as target cameras, a common color camera and a color wide-angle camera of the plurality of cameras when the distance is greater than the first preset distance and smaller than the second preset distance; or

A sixth determining unit 3043 for determining a color tele camera of the plurality of cameras as a target camera when the distance is greater than or equal to a second preset distance.

Referring to fig. 7, in an embodiment, the camera invoking device further includes an obtaining module 305:

the obtaining module 305 is configured to obtain ambient brightness of a scene to be photographed, and when the ambient brightness is greater than a brightness threshold, invoke the second determining module 303 to determine a distance between the photographing subject and the electronic device according to the normal color camera and the color wide-angle camera.

Referring to fig. 7, in an embodiment, the camera call device further includes a third determining module 306:

a third determining module 306, configured to determine, after the obtaining module 301 obtains the ambient brightness of the current scene to be photographed, when the ambient brightness is less than or equal to the brightness threshold, a common color camera and a common black-and-white camera in the multiple cameras as target cameras.

It should be noted that the camera calling device provided in the embodiment of the present application and the camera calling method in the foregoing embodiment belong to the same concept, and any method provided in the camera calling method embodiment may be run on the camera calling device, and a specific implementation process thereof is described in detail in the camera calling method embodiment, and is not described herein again.

The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program stored in the storage medium is executed on a computer, the computer is caused to execute the steps in the camera calling method provided by the embodiment of the present application. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.

An electronic device is further provided in the embodiments of the present application, please refer to fig. 8, and fig. 8 is a schematic structural diagram of the electronic device provided in the embodiments of the present application. The electronic device includes a processor 401, a memory 402, a plurality of cameras 403, and a display 404, wherein the processor 401 is electrically connected to the memory 402, the cameras 403, and the display 404.

The processor 401 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device and processes data by running or loading a computer program stored in the memory 402 and calling data stored in the memory 402.

The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the computer programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.

The plurality of cameras 403 may include a normal color camera, or a normal color camera with a viewing angle of about 45 degrees, or a color telephoto camera with a viewing angle of less than 40 degrees, and so on.

The display 304 may be used to display information entered by or provided to the user as well as various graphical user interfaces that may be composed of graphics, text, icons, video, and any combination thereof. The display 304 includes a display screen for displaying preview images.

In this embodiment, the processor 401 in the electronic device loads instructions corresponding to one or more processes of the computer program into the memory 402 according to the following steps, and the processor 401 runs the computer program stored in the memory 402, so as to implement various functions, as follows:

when a preview mode is started, starting a common color camera and a color wide-angle camera in the plurality of cameras;

determining a shooting subject in a scene to be shot in a preview mode;

determining the distance between a shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera;

and determining a target camera for acquiring the preview image according to the distance, and acquiring the preview image of the scene to be shot according to the determined target camera.

Referring to fig. 9, fig. 9 is another schematic structural diagram of the electronic device according to the embodiment of the present application, and the difference from the electronic device shown in fig. 8 is that the electronic device further includes components such as an input unit 405 and an output unit 406.

The input unit 405 may be used to receive input numbers, character information, or user characteristic information (such as a fingerprint), and generate a keyboard, a mouse, a joystick, an optical or trackball signal input, etc., related to user setting and function control, among others.

The output unit 406 may be used to display information input by the user or information provided to the user, such as a screen.

In this embodiment, the processor 401 in the electronic device loads instructions corresponding to one or more processes of the computer program into the memory 402 according to the following steps, and the processor 401 runs the computer program stored in the memory 402, so as to implement various functions, as follows:

when a preview mode is started, starting a common color camera and a color wide-angle camera in the plurality of cameras;

determining a shooting subject in a scene to be shot in a preview mode;

determining the distance between a shooting main body and the electronic equipment according to the common color camera and the color wide-angle camera;

and determining a target camera for acquiring the preview image according to the distance, and acquiring the preview image of the scene to be shot according to the determined target camera.

In an embodiment, when determining a photographic subject in a scene to be photographed in the preview mode, the processor 401 further performs:

when a focusing instruction is received in a preview mode, determining a shooting subject in a scene to be shot according to the focusing instruction; or

Acquiring a current preview picture, and determining a shooting subject in a scene to be shot according to the geometric center of the preview picture; or

The method comprises the steps of obtaining two adjacent images to be processed through a common color camera, calculating a gray level difference value of the same object in the two adjacent images to be processed, and determining the object as a shooting subject in a scene to be shot if the gray level difference value is larger than a preset gray level threshold value.

In one embodiment, when determining the distance between the subject and the electronic device according to the normal color camera and the color wide-angle camera, the processor 401 further performs:

shooting a scene to be shot according to a common camera to obtain a first reference image, and shooting the scene to be shot according to a color wide-angle camera to obtain a second reference image;

determining a first image point of a shooting subject on a first reference image, and determining a second image point of the shooting subject on a second reference image;

calculating to obtain the parallax of the shooting subject on the first reference image and the second reference image according to the first image point and the second image point;

and determining the distance between the shooting subject and the electronic equipment in the scene to be shot according to the parallax.

In an embodiment, before determining the distance between the subject and the electronic device according to the normal color camera and the color wide-angle camera, the processor 401 further performs:

acquiring the ambient brightness of a scene to be shot;

and when the ambient brightness is greater than the brightness threshold, determining the distance between the shooting subject and the electronic equipment according to the common color camera and the color wide-angle camera.

In an embodiment, when determining the target camera for acquiring the preview image according to the distance, the processor 401 further performs:

when the distance is smaller than or equal to a first preset distance, determining a color macro camera in the multiple cameras as a target camera; or

When the distance is greater than a first preset distance and less than a second preset distance, determining a common color camera and a color wide-angle camera in the plurality of cameras as a target camera; or

And when the distance is greater than or equal to a second preset distance, determining the color long-focus camera in the multiple cameras as a target camera.

In an embodiment, after determining a normal color camera and a color wide-angle camera of the plurality of cameras as the target camera, the processor 401 further performs:

and when the ambient brightness is less than or equal to the brightness threshold, determining a common color camera and a common black-and-white camera in the plurality of cameras as the target camera.

It should be noted that the electronic device provided in the embodiment of the present application and the camera calling method in the above embodiment belong to the same concept, and any method provided in the camera calling method embodiment may be run on the electronic device, and a specific implementation process thereof is described in detail in the feature extraction method embodiment, and is not described herein again.

It should be noted that, for the camera invoking method in the embodiment of the present application, it can be understood by a person skilled in the art that all or part of the process of implementing the camera invoking method in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, the computer program can be stored in a computer readable storage medium, such as a memory of the electronic device, and executed by at least one processor in the electronic device, and the process of executing the computer program can include the process of the embodiment of the camera invoking method. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, etc.

For the camera calling device in the embodiment of the present application, each functional module may be integrated in one processing chip, or each module may exist alone physically, or two or more modules are integrated in one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.

The foregoing describes in detail a camera invoking method, apparatus, storage medium, and electronic device provided in the embodiments of the present application, and a specific example is applied in the present application to explain the principle and implementation manner of the present application, and the description of the foregoing embodiments is only used to help understand the method and core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种摄像头的控制方法和监控设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类