CN112887615B - Shooting method and device - Google Patents

Shooting method and device Download PDF

Info

Publication number
CN112887615B
CN112887615B CN202110114225.XA CN202110114225A CN112887615B CN 112887615 B CN112887615 B CN 112887615B CN 202110114225 A CN202110114225 A CN 202110114225A CN 112887615 B CN112887615 B CN 112887615B
Authority
CN
China
Prior art keywords
camera
preview image
shooting
preset
target object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110114225.XA
Other languages
Chinese (zh)
Other versions
CN112887615A (en
Inventor
韦燕宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202110114225.XA priority Critical patent/CN112887615B/en
Publication of CN112887615A publication Critical patent/CN112887615A/en
Application granted granted Critical
Publication of CN112887615B publication Critical patent/CN112887615B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters

Abstract

The application discloses a shooting method and device, and belongs to the technical field of electronic equipment. The method comprises the following steps: acquiring a first preview image based on a first camera and acquiring a second preview image based on a second camera, wherein the shooting range of the second camera is larger than that of the first camera; detecting whether a target object exists in the second preview image; the target object is a preset designated object which is not acquired by the first camera; and when the target object exists, shooting based on the second camera to obtain a target image. Therefore, the second camera is selectively used for shooting under specific conditions, so that the target object in the nearby environment can be captured during shooting, the phenomenon that a user easily misses nearby nice objects in the shooting process is avoided, the image collected by the user can be more complete, and the shooting effect of the image is optimized.

Description

Shooting method and device
Technical Field
The invention belongs to the technical field of electronic equipment, and particularly relates to a shooting method and device.
Background
With the continuous development of the shooting function of the electronic device, manufacturers of large electronic devices gradually start to produce electronic devices including more than one camera, for example, electronic devices including both a wide-angle lens and a normal camera.
However, in the prior art, the default main camera in the plurality of cameras is often directly used for shooting, and the image shooting effect is poor.
Disclosure of Invention
The embodiment of the application aims to provide a shooting method and a shooting device, and the technical problems that in the prior art, a user directly uses a default main camera to shoot and the image shooting effect is poor can be solved.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides a shooting method, which is applied to an electronic device, where the electronic device includes a first camera and a second camera; the shooting range of the second camera is larger than that of the first camera; the method comprises the following steps:
acquiring a first preview image based on the first camera and acquiring a second preview image based on the second camera;
detecting whether a target object exists in the second preview image; the target object is a preset designated object which is not acquired by the first camera;
and under the condition that the target object exists, shooting based on the second camera to obtain a target image.
In a second aspect, an embodiment of the present application provides a shooting device, which is applied to an electronic device, where the electronic device includes a first camera and a second camera; the shooting range of the second camera is larger than that of the first camera; the photographing apparatus includes:
the acquisition module is used for acquiring a first preview image based on the first camera and acquiring a second preview image based on the second camera;
the detection module is used for detecting whether a target object exists in the second preview image; the target object is a preset designated object which is not acquired by the first camera;
and the shooting module is used for shooting based on the second camera under the condition that the target object exists to obtain a target image.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method for shooting according to the first aspect.
In a fourth aspect, the present application provides a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method for shooting according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method for shooting according to the first aspect.
In the embodiment of the application, a first preview image is acquired based on a first camera, a second preview image is acquired based on a second camera, and the shooting range of the second camera is larger than that of the first camera; detecting whether a target object exists in the second preview image; the target object is a preset designated object which is not acquired by the first camera; and when the target object exists, shooting based on the second camera to obtain a target image. Therefore, the second camera is selectively used for shooting under specific conditions, so that the target object in the nearby environment can be captured during shooting, the phenomenon that a user easily misses nearby nice objects in the shooting process is avoided, the image collected by the user can be more complete, and the shooting effect of the image is optimized.
Drawings
FIG. 1 is a flow chart illustrating steps of a method of photography in accordance with an embodiment of the present application;
FIG. 2 is a schematic diagram illustrating a display of a first preview image according to an embodiment of the present application;
FIG. 3 is a diagram illustrating image detection of a second preview image according to an embodiment of the present application;
FIG. 4 shows a schematic diagram of a preview interface based on second camera shooting in an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a display of a target object in a preview interface according to an embodiment of the present application;
FIG. 6 is a schematic diagram illustrating a display of a hint animation in accordance with an embodiment of the present application;
FIG. 7 is a diagram illustrating a display of a text prompt in an embodiment of the application;
FIG. 8 is a schematic diagram illustrating a display of a text prompt with target scores added according to an embodiment of the present application;
FIG. 9 is a flow chart illustrating self-learning of a predictive scoring algorithm according to an embodiment of the present application;
fig. 10 is a block diagram showing a configuration of a photographing apparatus according to an embodiment of the present application;
fig. 11 is a block diagram showing a structure of an electronic device according to an embodiment of the present application;
fig. 12 is a schematic diagram illustrating a hardware structure of an electronic device implementing various embodiments of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
A shooting method and a shooting device provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Referring to fig. 1, a flowchart illustrating steps of a shooting method according to an embodiment of the present application is shown, where the method may be applied to an electronic device, and the electronic device may specifically be a smartphone, a notebook, a tablet computer, an in-vehicle computer, and the like. The electronic equipment comprises a first camera and a second camera, and the shooting range of the second camera is larger than that of the first camera.
In this application embodiment, the first camera may be a standard camera, and the standard camera is the most basic camera lens, and the shooting angle of view of the standard camera is smaller. The second camera may be a camera with a large shooting range, for example, a wide-angle lens or an ultra-wide-angle lens with a view angle larger than that of a standard camera.
The shooting method specifically includes:
step 101, acquiring a first preview image based on the first camera, and acquiring a second preview image based on the second camera.
In the embodiment of the application, after the user opens the photographing application of the electronic device, the camera can be started to shoot, after the user aligns the camera to a certain scene, the electronic device can acquire a first preview image based on the first camera, and meanwhile can acquire a second preview image based on the second camera.
Step 102, detecting whether a target object exists in the second preview image; the target object is a preset designated object which is not acquired by the first camera.
In this embodiment of the present application, the preset designated object may refer to a category or a name of a shooting object preset in the electronic device, for example, the preset designated object may be a pedestrian, various animals, or the like, and the preset designated object may be specifically set according to an actual preference of a user, which is not limited in this embodiment of the present application. The target object may be a preset designated object that cannot be acquired by the first camera due to the shooting range limitation in the second preview image.
In this step, since the range of the first camera is small, the range of the subject photographed in the first preview image is smaller than the range of the subject photographed in the second preview image. In this way, the second preview image may include more objects, and when the object captured in the second preview image includes a preset designated object that does not exist in the first preview image, it may be determined that the target object exists in the second preview image.
And 103, under the condition that the target object exists, shooting based on the second camera to obtain a target image.
In the embodiment of the present application, the target object may refer to an image obtained by performing final shooting. When the target object is detected, the second camera can shoot the target object which cannot be shot by the first camera, and shooting can be performed based on the second camera, so that more beautiful objects can be contained in the image.
In summary, in the shooting method provided by the embodiment of the present application, a first preview image is collected based on a first camera, and a second preview image is collected based on a second camera, where a shooting range of the second camera is larger than that of the first camera; detecting whether a target object exists in the second preview image; the target object is a preset designated object which is not acquired by the first camera; and when the target object exists, shooting based on the second camera to obtain a target image. Therefore, the second camera is selectively used for shooting under specific conditions, so that the target object in the nearby environment can be captured during shooting, the phenomenon that a user easily misses nearby nice things in the shooting process is avoided, the image collected by the user can be more complete, and the shooting effect of the image is optimized.
Optionally, in this embodiment of the present application, step 101 may include the following sub-steps 1011 to 1012:
substep 1011, taking the first camera as a main camera, and acquiring a first preview image based on the main camera; and a first preview image acquired by the main camera is displayed in a preview interface.
In this embodiment of the application, the main camera may be a camera that operates in the foreground of the electronic device and is capable of displaying a preview image. The preview interface may refer to a display interface of an application having a photographing function in the electronic device, such as a preview interface of a camera.
Exemplarily, fig. 2 shows a display diagram of a first preview image according to an embodiment of the present application. As shown in fig. 2, after the application program with the shooting function is started, the electronic device enters a preview interface, in which a first preview image 201 captured by a first camera as a main camera is displayed.
Substep 1012, starting the second camera in the background, and acquiring the second preview image through the second camera in the background.
In the embodiment of the application, when the first camera is used as the main camera and the first preview image is displayed on the preview interface, the electronic device may start and operate the second camera in the background, and acquire the second preview image based on the second camera, where the second preview image is not directly displayed on the preview interface but is cached in a preset storage location in the electronic device for subsequent image detection to determine whether the target object exists in the second preview image. The preset storage location may refer to a cache of the electronic device, and the like, which is not limited in this embodiment of the application.
In the embodiment of the application, the electronic equipment takes the first camera as a main camera and acquires a first preview image based on the main camera; a first preview image acquired by the main camera is displayed in a preview interface; and starting the second camera at the background, and acquiring a second preview image through the second camera at the background. Like this, the second camera is started and is operated at the background in this application embodiment, compare in the mode that starts first camera and second camera in the proscenium simultaneously, can reduce the consumption, reduces electronic equipment's power consumption, and flashlight electronic equipment overheated problem when also can avoid long-time shooting simultaneously.
Optionally, in this embodiment of the present application, step 102 may include the following sub-steps 1021 to 1023:
substep 1021 determines an image region of the second preview image that is not coincident with the first preview image.
In the embodiment of the present application, since the shooting range of the second camera is larger than that of the first camera, the image area included in the second preview image is larger than that included in the first preview image. That is, the second preview image includes both an image area overlapping with the first preview image and an image area not overlapping with the first preview image.
In this step, the non-coincident image regions are determined based on the second preview image and the first preview image, so that the data processing amount of a subsequent preset detection algorithm can be reduced, and the calculation speed is increased.
Sub-step 1022, based on a preset detection algorithm, extracts at least one candidate object included in the image region.
In this embodiment of the present application, the candidate may refer to various photographic subjects in an image area in the second preview image that is not coincident with the image area in the first preview image, and this candidate may specifically be a plant, an animal, a pedestrian, or another object, and this embodiment of the present application does not limit a specific type of the candidate. The preset detection algorithm may be used to detect each candidate object in the non-coincident image region, and specifically may be a fast Regions with CNN features extraction, an SSD algorithm (Single Shot multi box Detector), and the like.
In this step, after determining an image region in the second preview image that is not coincident with the image region in the first preview image, at least one candidate object in the non-coincident image region may be identified based on a preset detection algorithm, and a specific type or name of the candidate object may be determined.
Sub-step 1023, in case the candidate object matches a preset designated object, determining that a target object is present in the second preview image.
In the embodiment of the application, at least one preset designated object and a type or name corresponding to the preset designated object are stored in the electronic device in advance, after at least one candidate object in a non-coincident region is determined, for each candidate object, matching can be searched in the at least one preset designated object respectively, if the preset designated object with the same type or name as the candidate object can be found, the electronic device determines that the second preview image includes a target object, and meanwhile, the candidate object can be determined as the target object, and then the target object can be shot based on the second camera.
In another implementation manner, at least one preset specified object and a corresponding preset image feature thereof may be stored in the electronic device in advance, and may be, for example, a Scale Invariant Feature Transform (SIFT) feature or a Histogram of Oriented Gradients (HOG) feature. After determining the image areas in the second preview image that are not coincident with the image areas in the first preview image, the electronic device may extract at least one candidate object in the image areas that are not coincident with each other and image features corresponding to the candidate objects. And then, matching the image characteristics of each candidate object with the preset image characteristics of the preset specified object, and when the matching degree of the image characteristics of each candidate object and the preset image characteristics of the preset specified object reaches a preset matching degree threshold (for example, 90%), determining that the candidate object is matched with the preset specified object, wherein the candidate object is a target object, and further determining that the target object exists in the second preview image.
In the embodiment of the application, the electronic equipment determines an image area which is not overlapped with the first preview image in the second preview image; extracting at least one candidate object included in the image area based on a preset detection algorithm; and determining that the target object exists in the second preview image under the condition that the candidate object is matched with the preset specified object. Therefore, the candidate object in the non-coincident image area is extracted and matched with the preset specified object, the accuracy of target object detection is improved, the interference of false detection on the user shooting process is avoided, and the user experience is improved.
Exemplarily, fig. 3 shows an image detection schematic diagram of a second preview image according to an embodiment of the present application. As shown in fig. 3, the second camera has a larger field angle, has a larger shooting range than the first camera, and acquires a second preview image 302 (a dashed box in fig. 3) including not only all image contents in the first preview image 301 displayed in the preview interface but also an image area that does not overlap with the first preview image. After the misaligned image regions are determined, the electronic device extracts the candidate object 303 in the misaligned image regions based on a preset detection algorithm to determine that the candidate object is a "pedestrian", then matches the candidate object 303 with a preset specified object, and if the preset specified object includes the "pedestrian", it may be determined that the candidate object 303 is a target object, and then it may be determined that the second preview image includes the target object.
Optionally, in this embodiment of the application, before step 103, the shooting method may further include the following steps (1) to (2):
and (1) displaying prompt information, wherein the prompt information is used for prompting a user to switch the second camera to the main camera and shooting based on the second camera.
In this embodiment of the application, the prompt information may refer to information that can prompt a user, and specifically may refer to text prompt information, animation prompt information, voice prompt information, and the like, which is not limited in this embodiment of the application.
In this step, after determining that the second preview image includes the target object, the prompt information can be displayed to prompt the user that the target object capable of being shot exists besides the main camera, so that the user can know the situation of the nearby environment when shooting, and can prompt the user to shoot before good things such as pedestrians and animals leave the range where the camera can shoot, and further the user can shoot a picture with higher quality.
And (2) switching the second camera to a main camera and executing the step of shooting based on the second camera under the condition that a confirmation instruction of the user is received.
In this embodiment of the application, the confirmation instruction may be an instruction for confirming that the user uses the second camera to shoot, and specifically may be a confirmation option in the user touch text prompt information or a user touch prompt animation, and the like.
In this step, after the electronic device displays the prompt information, if a confirmation instruction of the user is received, it is determined that the user needs to switch the first camera to the second camera, and a shooting range is expanded to shoot the target object, at this time, the second camera may be used as a main camera, and a second preview image shot by the second camera is displayed in a preview interface, and then the target image may be shot based on an operation of the user.
In the embodiment of the application, prompt information is displayed, and the prompt information is used for prompting a user to switch the second camera to the main camera and carry out shooting based on the second camera; and under the condition that a confirmation instruction of the user is received, switching the second camera to the main camera, and executing the step of shooting based on the second camera. Therefore, in the embodiment of the application, under the condition that the target object exists in the second preview image, the user can be prompted in time, so that the user can know whether the target object worthy of shooting exists in the nearby environment in time, the user can conveniently switch the cameras, and the shooting experience of the user is improved.
Illustratively, fig. 4 shows a preview interface schematic diagram based on shooting by a second camera in an embodiment of the present application. As shown in fig. 4, after the second camera is used as the main camera, a second preview image 401 is displayed in the preview interface of the electronic device, and the second preview image includes the target object 303 "pedestrian" in fig. 3, so that the finally-captured target image can include the target object, the range of the image captured by the user is larger, and the capturing effect is better.
Optionally, in this embodiment of the application, the prompt information includes at least one of a prompt animation and text prompt information.
In this embodiment of the application, the prompt animation may be preset animation that prompts a user to switch shooting by a camera, and may be, for example, animation clicked by a finger or animation that an aperture for prompting is highlighted and flickers. The text prompt information may be preset text information for prompting the user to switch the camera to shoot, for example, the text prompt information may be "whether to switch to a second camera to shoot" or not.
Accordingly, step (1) can be achieved by the following step (3):
and (3) displaying the target object in a preset area of the preview interface, displaying the prompt animation in the preset area, and/or displaying the text prompt information in the preview interface.
In this embodiment of the application, the preset area may be a preset area in the preview interface, for example, the preset area may be an upper right corner or a lower right corner of the preview interface, the preset area may be displayed in a form of a pop-up frame, and a subsequent touch input of the user for the pop-up frame may be used as a confirmation instruction for the user to switch the first camera to the second camera.
In this step, after it is determined that the target object exists in the second preview image, the target object may be displayed in a bullet frame in a preset area in the preview interface, so that a user can intuitively determine whether to switch the camera according to the target object. The user can click the popup box in the preset area to send a confirmation instruction, and switching of the camera is achieved.
Illustratively, fig. 5 shows a display diagram of a target object in a preview interface according to an embodiment of the present application. As shown in fig. 5, the first camera serves as a main camera, the preview interface displays a first preview image 501 captured by the first camera, and when the electronic device detects that a target object 503 exists in the second preview image, an image of the target object 503 is displayed in a bullet box 502 in the upper right corner of the preview interface, which is a preset area of the preview interface.
In this step, after it is determined that the target object exists in the second preview image, the target object may be displayed in the preset area, and a prompt animation may be displayed in the preset area to prompt the user whether to adopt the second camera for shooting. Of course, in the embodiment of the present application, the prompt animation may also be displayed in other areas, which is not limited in the embodiment of the present application. At this time, the user may touch the bullet box displaying the target object in the preset area to send a confirmation instruction.
Illustratively, fig. 6 shows a display diagram of a prompt animation according to an embodiment of the present application. As shown in fig. 6, the first camera serves as a main camera, the preview interface displays a first preview image 601 captured by the first camera, and when detecting that a target object 603 exists in the second preview image, the electronic device displays an image of the target object 603 in a bullet box 602 at the upper right corner of the preview interface, which is a preset area of the preview interface, and simultaneously displays a prompt animation 604 clicked by a finger.
In this step, after determining that the target object exists in the second preview image, the electronic device may display the image of the target object in a preset area of the preview interface, and may display text prompt information in the preview interface to prompt the user whether to switch to the second camera for shooting. At this time, the user may touch the confirmation option in the text prompt message to send the confirmation instruction, or may touch the pop-up box of the display target object in the preset area to send the confirmation instruction.
Exemplarily, fig. 7 shows a display diagram of a text prompt message according to an embodiment of the present application. As shown in fig. 7, the first camera serves as a main camera, the preview interface displays a first preview image 701 acquired by the first camera, and when detecting that the target object 703 exists in the second preview image, the electronic device displays the image of the target object 703 in a bullet box 702 in the upper right corner of the preview interface, which is a preset area of the preview interface, and simultaneously displays text prompt information 704 "whether to switch to the second camera for shooting" and touch options of "yes" and "no".
It should be noted that, three ways of displaying the prompt information are defined in step (3), and the three display ways are and/or relationships, that is, only one way may be adopted when displaying the prompt information, or a combination of two or three ways may be adopted, which may be specifically determined according to the actual needs of the user, and this is not limited in the embodiment of the present application. For example, the user thinks that the image of the target object popped up in the preset area of the preview interface is more obtrusive, and at this time, the user can only set the preview interface to display the text prompt information, so that the personalized requirements of the user are met.
In the embodiment of the application, the electronic device may display the prompt information by displaying the target object in a preset area of a preview interface, displaying the prompt animation in the preset area, and/or displaying the text prompt information in the preview interface. Like this, electronic equipment can show the prompt message with multiple form, has improved the variety that the prompt message shows, can satisfy user's diversified demand, more can laminate user's actual hobby.
Optionally, in this embodiment of the application, before step (3), the shooting method may further include the following steps (4) to (5):
and (4) determining a target score corresponding to the second preview image based on a preset scoring algorithm.
In this embodiment of the application, the target score may refer to a score corresponding to the second preview image, and the target score may be a 10-point score, that is, the target score ranges from 0 to 10 points. The preset scoring algorithm may be a preset algorithm capable of calculating an Image target score, and specifically may be a BRISQUE algorithm (No-Reference Image Quality Assessment algorithm in the Spatial Domain, no-Reference Spatial Domain Image Quality Assessment algorithm), a NIMA algorithm (Neural Image Assessment algorithm), and the like, and the embodiment of the present application does not limit the type of the preset scoring algorithm.
Specifically, in this step, the second preview image includes the first preview image and the target object, and the electronic device may determine a target score of the second preview image based on a combination of the target object and the first preview image, where the target score can indicate a composition quality effect of the entire image after the target object is added to the first preview image.
And (5) generating the prompt information according to the target score.
In the embodiment of the application, before the prompt message for prompting the user whether to switch the camera is displayed, the prompt message can be generated according to the target score, and the prompt message can be a text prompt message. In this way, the user can be made to know the image quality of the second preview image more accurately.
In one implementation, after the prompt information is generated based on the target score, the electronic device may only display the prompt information added with the target score to prompt the user, and no longer display the image of the target object in the preset area of the preview interface, so that the sense of incongruity of popping up a pop-up box in the preset area in the shooting process can be avoided, and the shooting process is more natural.
Exemplarily, fig. 8 shows a display diagram of a text prompt message added with a target score according to an embodiment of the present application. As shown in fig. 8, a preview interface of the electronic device displays a first preview image 801 acquired by a first camera, and then detects whether a target object exists in a second preview image based on the electronic device, and if the target object exists, calculates a target score of the second preview image by using a preset scoring algorithm, and generates text prompt information 802 according to the target score, and then displays the text prompt information 802 in the preview interface to prompt a user whether to switch the second camera for taking a picture.
In the embodiment of the application, a target score corresponding to the second preview image is determined based on a preset scoring algorithm; and generating prompt information according to the target score. Therefore, the electronic equipment scores the second preview image and generates the prompt information with the target score, so that the follow-up prompt for the user is more concise, the user can visually determine the image quality of the target object added to the first preview image, and the image detection process is more intelligent.
Optionally, in this embodiment of the present application, the shooting method may further include the following steps (6) to (9):
and (6) identifying the scene type of the first preview image.
In this embodiment of the application, the scene type may refer to a main scene in the first preview image, such as a waterfall, a park, a tree, and the like, and this embodiment of the application does not limit a specific kind of the scene type.
Specifically, in this step, an image scene type recognition algorithm may be used to determine the scene type of the first preview image, for example, a PlaceCNN (image location scene type recognition) algorithm, and the like.
And (7) recording the target object and the scene type as a user preference combination under the condition of receiving the confirmation instruction.
In the embodiment of the application, the user preference combination may refer to a combination with higher user interest and better user preference. After the prompt information is displayed, if the user confirms to switch to the second camera for shooting, it is determined that the user has a high interest level in the combination of the target object and the scene type, and the electronic device may record the combination as a user preference combination.
And (8) recording the target object and the scene type as a non-user preference combination under the condition that the confirmation instruction is not received.
In the embodiment of the application, the non-user preference combination may be a combination which is low in user interest and does not accord with user preferences. After the prompt information is displayed, if the user does not confirm to switch to the second camera and still adopt the first camera for shooting, it is determined that the interest degree of the user in the combination of the target object and the scene type is low, and the electronic device can record the combination as a non-user preference combination.
And (9) updating the preset scoring algorithm by taking the user preference combination as a positive sample or taking the non-user preference combination as a negative sample.
In the embodiment of the present application, the preset scoring algorithm may be a self-learning specific algorithm. When the user uses the preset scoring algorithm for the first time, the scoring standard and the internal parameters of the preset scoring algorithm are determined based on the aesthetic sense of the public. In the process of using by the user, the user preference combination and the non-user preference combination can be recorded based on whether a switching confirmation instruction of the user is received or not, and then the algorithm is updated according to the user preference combination and the non-user preference combination. Thus, with the use of users, the preset scoring algorithm meets the aesthetic standard of the users.
Specifically, in this step, when the preset algorithm is updated, for the positive sample of the user preference combination, the internal parameters of the preset scoring algorithm may be adjusted in the forward direction, for example, the scoring coefficient of the positive sample may be increased, so that the target score of the positive sample is improved; for the negative sample of the non-user preference combination, negative adjustment may be performed on internal parameters of the preset scoring algorithm, for example, a scoring coefficient of the negative sample may be reduced, so that the target score of the negative sample is reduced in adaptability.
Exemplarily, the electronic device uses a first camera as a main camera, displays a first preview image acquired by the first camera in a preview interface, detects that a scene type of the first preview image is 'waterfall', and then calculates a target score of 'waterfall + pedestrian' to be 8 points by using an initial preset scoring algorithm if the electronic device detects a target object 'pedestrian' in a second preview image; if the electronic device detects a target object, namely a rabbit, in the second preview image, an initial preset scoring algorithm calculates a target score of 'waterfall + rabbit' to be 7.
Further, if the user does not send a confirmation instruction for switching the cameras when detecting the target object pedestrian and still shoots with the first camera, the electronic device may record the combination of waterfall and pedestrian as a non-user preference combination, subsequently update the preset scoring algorithm, reduce the scoring coefficient of the non-user preference combination, and reduce the target score when the electronic device detects the combination of waterfall and pedestrian next time; if the user sends a confirmation instruction for switching the cameras when detecting the target object 'rabbit' and shoots with the second camera, the electronic device can record the combination of 'waterfall + rabbit' as a user preference combination, a preset scoring algorithm can be updated subsequently, the scoring coefficient of the user preference combination is improved, and the target score can be improved when the electronic device detects the combination of 'waterfall + rabbit' again next time.
It should be noted that, in the embodiment of the present application, in order to improve the accuracy of the algorithm and avoid contingency, for a combination of the same target object and a scene type, the combination may be determined as a user preference combination under the condition that the number of times of receiving the confirmation instruction is greater than a preset number threshold; correspondingly, for the combination of the same target object and the scene type, the combination can be determined as a non-user-preference combination under the condition that the number of times that the confirmation instruction is not received is greater than the preset number threshold. The preset number threshold may be set based on an actual requirement of the user, and may be, for example, 3 times, 5 times, and the like, which is not limited in this embodiment of the application.
Illustratively, fig. 9 shows a schematic flow chart of self-learning of a preset scoring algorithm according to an embodiment of the present application. As shown in fig. 9, when the user takes a photograph with the first camera, the electronic device determines a score of the second preview image based on a preset scoring algorithm and outputs a target score. And if a confirmation instruction of switching the camera by the user is received, recording the combination of the target object and the scene type of the first preview image as a user preference combination. If the confirmation instruction of the user is not received, judging whether the number of times that the confirmation instruction is not received by the combination is larger than a preset number threshold value or not, and recording the combination of the target object and the scene type of the first preview image as a non-user preference combination under the condition that the number of times that the confirmation instruction is not received is larger than the preset number threshold value; and recording the times that the combination does not receive the confirmation instruction under the condition that the times that the confirmation instruction is not received is not more than a preset time threshold. And then, updating the preset scoring algorithm according to the user preference combination and the non-user preference combination, so that the preset scoring algorithm is more in line with the personal habits of the user.
In the embodiment of the application, the scene type of a first preview image is identified; recording the target object and the scene type as a user preference combination under the condition of receiving a confirmation instruction; recording the target object and the scene type as a non-user preference combination under the condition that a confirmation instruction is not received; and updating the preset scoring algorithm by taking the user preference combination as a positive sample or taking the non-user preference combination as a negative sample. Therefore, according to the embodiment of the application, through the self-learning characteristic of the preset scoring algorithm, the preset scoring algorithm can better conform to the aesthetic standard of the user along with continuous use of the user, the preset scoring algorithm can better conform to the personal habits and hobbies of the user, the goodness of fit between the target score and the personality of the user is improved, and the calculation process of the target score is more accurate.
It should be noted that, in the method for shooting provided in the embodiment of the present application, the execution subject may be a device for shooting, or a control module in the device for shooting for executing the method for loading shooting. The embodiment of the present application takes a method for a shooting device to perform shooting as an example, and describes a shooting device provided in the embodiment of the present application.
Referring to fig. 10, a block diagram of a shooting device according to an embodiment of the present application is shown, where the shooting device 100 is applied to an electronic apparatus, and the electronic apparatus includes a first camera and a second camera; the shooting range of the second camera is larger than that of the first camera; the photographing apparatus 100 may include the following modules:
an acquisition module 1001 configured to acquire a first preview image based on the first camera and acquire a second preview image based on the second camera.
A detecting module 1002, configured to detect whether a target object exists in the second preview image; the target object is a preset designated object which is not acquired by the first camera.
And the shooting module 1003 is configured to, in a case that the target object exists, shoot based on the second camera to obtain a target image.
Optionally, the acquisition module 1001 is specifically configured to:
taking the first camera as a main camera, and acquiring a first preview image based on the main camera; a first preview image acquired by the main camera is displayed in a preview interface; and starting the second camera at the background, and acquiring the second preview image through the second camera at the background.
Optionally, the detecting module 1002 is specifically configured to:
determining an image area in the second preview image that is not coincident with the first preview image; extracting at least one candidate object included in the image area based on a preset detection algorithm; and determining that a target object exists in the second preview image under the condition that the candidate object is matched with a preset specified object.
Optionally, the apparatus 100 further includes:
the display module is used for displaying prompt information, and the prompt information is used for prompting a user to switch the second camera to the main camera and carry out shooting based on the second camera;
and the switching module is used for switching the second camera to a main camera under the condition of receiving the confirmation instruction of the user and executing the step of shooting based on the second camera.
Optionally, the prompt information includes at least one of a prompt animation and text prompt information;
the display module is specifically configured to:
and displaying the target object in a preset area of the preview interface, displaying the prompt animation in the preset area, and/or displaying the text prompt information in the preview interface.
Optionally, the apparatus 100 is further configured to:
determining a target score corresponding to the second preview image based on a preset scoring algorithm;
and generating the prompt information according to the target score.
Optionally, the apparatus 100 is further configured to:
identifying a scene type of the first preview image;
recording the target object and the scene type as a user preference combination if the confirmation instruction is received;
recording the target object and the scene type as a non-user preference combination if the confirmation instruction is not received;
and updating the preset scoring algorithm by taking the user preference combination as a positive sample or taking the non-user preference combination as a negative sample.
In summary, the device for shooting provided in the embodiment of the present application collects a first preview image based on a first camera, and collects a second preview image based on a second camera, where a shooting range of the second camera is larger than that of the first camera; detecting whether a target object exists in the second preview image; the target object is a preset designated object which is not acquired by the first camera; and when the target object exists, shooting based on the second camera to obtain a target image. Therefore, the second camera is selectively used for shooting under specific conditions, so that the target object in the nearby environment can be captured during shooting, the phenomenon that a user easily misses nearby nice objects in the shooting process is avoided, the image collected by the user can be more complete, and the shooting effect of the image is optimized.
The device for shooting in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The device for shooting in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The shooting device provided in the embodiment of the present application can implement each process implemented by the method embodiments of fig. 1 to 9, and is not described here again to avoid repetition.
Optionally, as shown in fig. 11, an electronic device 110 is further provided in an embodiment of the present application, and includes a processor 1101, a memory 1102, and a program or an instruction that is stored in the memory 1102 and is executable on the processor 1101, where the program or the instruction is executed by the processor 1101 to implement each process of the foregoing shooting method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices described above.
Referring to fig. 12, a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present application is shown.
The electronic device 120 includes, but is not limited to: radio frequency unit 1201, network module 1202, audio output unit 1203, input unit 1204, sensors 1205, display unit 1206, user input unit 1207, interface unit 1208, memory 1209, and processor 1210.
Those skilled in the art will appreciate that the electronic device 120 may further include a power supply (e.g., a battery) for supplying power to various components, and the power supply may be logically connected to the processor 1210 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in fig. 12 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is not repeated here.
The input unit 1210 is configured to acquire a first preview image based on the first camera, and acquire a second preview image based on the second camera.
A processor 1210 for detecting whether a target object exists in the second preview image; the target object is a preset designated object which is not acquired by the first camera.
And a processor 1210, configured to perform shooting based on the second camera in the presence of the target object, so as to obtain a target image.
In the embodiment of the application, the electronic device can acquire a first preview image based on a first camera and acquire a second preview image based on a second camera, wherein the shooting range of the second camera is larger than that of the first camera; detecting whether a target object exists in the second preview image; the target object is a preset designated object which is not acquired by the first camera; and when the target object exists, shooting based on the second camera to obtain a target image. Therefore, the second camera is selectively used for shooting under specific conditions, so that the target object in the nearby environment can be captured during shooting, the phenomenon that a user easily misses nearby nice objects in the shooting process is avoided, the image collected by the user can be more complete, and the shooting effect of the image is optimized.
It should be understood that, in the embodiment of the present application, the input Unit 1204 may include a Graphics Processing Unit (GPU) 12041 and a microphone 12042, and the Graphics processor 12041 processes image data of a still picture or a video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 1206 may include a display panel 12061, and the display panel 12061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1207 includes a touch panel 12071 and other input devices 12072. A touch panel 12071, also referred to as a touch screen. The touch panel 12071 may include two parts of a touch detection device and a touch controller. Other input devices 12072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. The memory 1209 may be used to store software programs as well as various data, including but not limited to application programs and an operating system. The processor 1210 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communication. It is to be appreciated that the modem processor described above may not be integrated into processor 1210.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored, and when the program or the instruction is executed by a processor, the program or the instruction implements the processes of the foregoing shooting method embodiment, and can achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the above shooting method embodiment, and can achieve the same technical effect, and the details are not repeated here to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as a system-on-chip, or a system-on-chip.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (8)

1. The shooting method is applied to electronic equipment, and the electronic equipment comprises a first camera and a second camera; the shooting range of the second camera is larger than that of the first camera; the method comprises the following steps:
acquiring a first preview image based on the first camera, and acquiring a second preview image based on the second camera;
detecting whether a target object exists in the second preview image; the target object is a preset designated object which is not acquired by the first camera; the preset appointed object is a shooting object which accords with a preset category or name; the preset designated object is set by a user;
under the condition that the target object exists, shooting based on the second camera to obtain a target image;
the electronic equipment is stored with at least one preset specified object and a corresponding type or name in advance;
the detecting whether a target object exists in the second preview image includes:
determining an image area in the second preview image that is not coincident with the first preview image;
extracting at least one candidate object included in the image area based on a preset detection algorithm; the candidate objects comprise various shot objects in image areas which are not overlapped with the first preview image in the second preview image;
determining that a target object exists in the second preview image under the condition that the candidate object is matched with a preset specified object;
the determining that a target object exists in the second preview image when the candidate object is matched with a preset specified object includes:
searching for a match in at least one preset specified object respectively aiming at each alternative object;
if the preset specified object with the same type or name as the alternative object is found, determining that the second preview image comprises the target object;
and determining the candidate object as the target object.
2. The method of claim 1, wherein acquiring a first preview image based on the first camera and acquiring a second preview image based on the second camera comprises:
taking the first camera as a main camera, and acquiring a first preview image based on the main camera; a first preview image acquired by the main camera is displayed in a preview interface;
and starting the second camera at the background, and acquiring the second preview image through the second camera at the background.
3. The method of claim 2, wherein prior to the taking based on the second camera, the method further comprises:
displaying prompt information, wherein the prompt information is used for prompting a user to switch the second camera to the main camera and shooting based on the second camera;
and under the condition that a confirmation instruction of the user is received, switching the second camera to be a main camera, and executing the step of shooting based on the second camera.
4. The method of claim 3, wherein prior to said displaying a prompt message, the method further comprises:
determining a target score corresponding to the second preview image based on a preset scoring algorithm;
generating the prompt information according to the target score;
the method further comprises the following steps:
identifying a scene type of the first preview image;
recording the target object and the scene type as a user preference combination if the confirmation instruction is received;
recording the target object and the scene type as a non-user preference combination if the confirmation instruction is not received;
and updating the preset scoring algorithm by taking the user preference combination as a positive sample or taking the non-user preference combination as a negative sample.
5. The shooting device is applied to electronic equipment, and the electronic equipment comprises a first camera and a second camera; the shooting range of the second camera is larger than that of the first camera; the device comprises:
the acquisition module is used for acquiring a first preview image based on the first camera and acquiring a second preview image based on the second camera;
the detection module is used for detecting whether a target object exists in the second preview image; the target object is a preset specified object which is not acquired by the first camera; the preset appointed object is a shooting object which accords with a preset category or name; the preset specified object is set by a user;
the shooting module is used for shooting based on the second camera under the condition that the target object exists to obtain a target image;
the electronic equipment is stored with at least one preset specified object and a corresponding type or name in advance;
the detection module is specifically configured to:
determining an image area in the second preview image that is not coincident with the first preview image;
extracting at least one candidate object included in the image area based on a preset detection algorithm; the candidate objects comprise various shot objects in image areas which are not overlapped with the first preview image in the second preview image;
determining that a target object exists in the second preview image under the condition that the candidate object is matched with a preset specified object;
the determining that a target object exists in the second preview image when the candidate object is matched with a preset specified object includes: searching for a match in at least one preset specified object respectively aiming at each candidate object; if the preset specified object with the same type or name as the alternative object is found, determining that the second preview image comprises the target object; and determining the candidate object as the target object.
6. The device according to claim 5, wherein the acquisition module is specifically configured to:
taking the first camera as a main camera, and acquiring a first preview image based on the main camera; a first preview image acquired by the main camera is displayed in a preview interface;
and starting the second camera at the background, and acquiring the second preview image through the second camera at the background.
7. The apparatus of claim 6, wherein the apparatus is further configured to:
displaying prompt information, wherein the prompt information is used for prompting a user to switch the second camera to the main camera and shooting based on the second camera;
and under the condition that a confirmation instruction of the user is received, switching the second camera to a main camera, and executing the step of shooting based on the second camera.
8. The apparatus of claim 7, wherein the apparatus is further configured to:
determining a target score corresponding to the second preview image based on a preset scoring algorithm;
generating the prompt information according to the target score;
the apparatus is further configured to:
identifying a scene type of the first preview image;
recording the target object and the scene type as a user preference combination if the confirmation instruction is received;
recording the target object and the scene type as a non-user-preferred combination if the confirmation instruction is not received;
and updating the preset scoring algorithm by taking the user preference combination as a positive sample or taking the non-user preference combination as a negative sample.
CN202110114225.XA 2021-01-27 2021-01-27 Shooting method and device Active CN112887615B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110114225.XA CN112887615B (en) 2021-01-27 2021-01-27 Shooting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110114225.XA CN112887615B (en) 2021-01-27 2021-01-27 Shooting method and device

Publications (2)

Publication Number Publication Date
CN112887615A CN112887615A (en) 2021-06-01
CN112887615B true CN112887615B (en) 2022-11-11

Family

ID=76052870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110114225.XA Active CN112887615B (en) 2021-01-27 2021-01-27 Shooting method and device

Country Status (1)

Country Link
CN (1) CN112887615B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114845052B (en) * 2022-04-22 2024-03-12 杭州海康威视数字技术股份有限公司 Shooting parameter adjustment method and device, camera and target equipment
CN117425071A (en) * 2023-12-15 2024-01-19 荣耀终端有限公司 Image acquisition method, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107613203A (en) * 2017-09-22 2018-01-19 维沃移动通信有限公司 A kind of image processing method and mobile terminal

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4568009B2 (en) * 2003-04-22 2010-10-27 パナソニック株式会社 Monitoring device with camera cooperation
WO2016068057A1 (en) * 2014-10-31 2016-05-06 富士フイルム株式会社 Imaging device and method for recognizing target object
KR20170006559A (en) * 2015-07-08 2017-01-18 엘지전자 주식회사 Mobile terminal and method for controlling the same
US9749543B2 (en) * 2015-07-21 2017-08-29 Lg Electronics Inc. Mobile terminal having two cameras and method for storing images taken by two cameras
JP2018110385A (en) * 2016-12-28 2018-07-12 株式会社リコー Communication terminal, imaging system, method for image processing, and program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107613203A (en) * 2017-09-22 2018-01-19 维沃移动通信有限公司 A kind of image processing method and mobile terminal

Also Published As

Publication number Publication date
CN112887615A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
US11875467B2 (en) Processing method for combining a real-world environment with virtual information according to a video frame difference value to provide an augmented reality scene, terminal device, system, and computer storage medium
CN107818180B (en) Video association method, video display device and storage medium
CN112887615B (en) Shooting method and device
CN108551552B (en) Image processing method, device, storage medium and mobile terminal
CN111835982B (en) Image acquisition method, image acquisition device, electronic device, and storage medium
CN112492201B (en) Photographing method and device and electronic equipment
CN112532885B (en) Anti-shake method and device and electronic equipment
CN113873166A (en) Video shooting method and device, electronic equipment and readable storage medium
CN113596344A (en) Shooting processing method and device, electronic equipment and readable storage medium
CN114267041B (en) Method and device for identifying object in scene
CN114025092A (en) Shooting control display method and device, electronic equipment and medium
CN112291480B (en) Tracking focusing method, tracking focusing device, electronic device and readable storage medium
US20180336243A1 (en) Image Search Method, Apparatus and Storage Medium
CN112381091A (en) Video content identification method and device, electronic equipment and storage medium
CN108495038B (en) Image processing method, image processing device, storage medium and electronic equipment
CN108052506B (en) Natural language processing method, device, storage medium and electronic equipment
CN112532904B (en) Video processing method and device and electronic equipment
CN115278084A (en) Image processing method, image processing device, electronic equipment and storage medium
CN114758054A (en) Light spot adding method, device, equipment and storage medium
CN113989387A (en) Camera shooting parameter adjusting method and device and electronic equipment
CN110012208B (en) Photographing focusing method and device, storage medium and electronic equipment
CN111582258A (en) Image processing method and device, electronic equipment and readable storage medium
CN113489901B (en) Shooting method and device thereof
US20240054691A1 (en) Image processing method and device, and storage medium
CN117097982B (en) Target detection method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant