CN112995509B - Camera switching method and device based on mobile terminal and computer equipment - Google Patents

Camera switching method and device based on mobile terminal and computer equipment Download PDF

Info

Publication number
CN112995509B
CN112995509B CN202110209267.1A CN202110209267A CN112995509B CN 112995509 B CN112995509 B CN 112995509B CN 202110209267 A CN202110209267 A CN 202110209267A CN 112995509 B CN112995509 B CN 112995509B
Authority
CN
China
Prior art keywords
score
image
weight
camera
weight score
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
CN202110209267.1A
Other languages
Chinese (zh)
Other versions
CN112995509A (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.)
Shenzhen Waterward Information Co Ltd
Original Assignee
Shenzhen Waterward Information 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 Shenzhen Waterward Information Co Ltd filed Critical Shenzhen Waterward Information Co Ltd
Priority to CN202110209267.1A priority Critical patent/CN112995509B/en
Publication of CN112995509A publication Critical patent/CN112995509A/en
Application granted granted Critical
Publication of CN112995509B publication Critical patent/CN112995509B/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
    • 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/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body

Abstract

The application provides a camera switching method and device based on a mobile terminal and computer equipment. The mobile terminal calculates a first weight score of the first image and a second weight score of the second image, determines the image with larger shooting significance by judging the magnitude relation between the first weight score and the second weight score, automatically selects the camera corresponding to the image with higher weight score to collect the image, automatically switches the camera according to the actual requirement of a user, and greatly improves the intelligent degree of the mobile terminal.

Description

Camera switching method and device based on mobile terminal and computer equipment
Technical Field
The present application relates to the field of mobile terminal control technologies, and in particular, to a camera switching method and apparatus based on a mobile terminal, and a computer device.
Background
With the development of science and technology, various types of mobile terminals enter the daily life of people, such as mobile phones, tablet computers and other devices, and bring more convenience to the life of people. Many people now like to record their daily lives, such as the now popular vlog, by taking pictures with mobile terminals. However, the size of the existing mobile terminal is larger (for example, the size of the existing mainstream mobile phone is more than 6.5 inches, and the size of a tablet personal computer is larger), and the mobile terminal is not convenient for one-hand operation of people. Most of mobile terminals have a front camera and a rear camera, and when a user starts the cameras for shooting, the mobile terminals usually start the cameras used last time by default, and may not be the cameras currently required by the user. Therefore, the user is required to manually switch the camera, so that the use is inconvenient, and the intelligent degree is low.
Disclosure of Invention
The application mainly aims to provide a camera switching method and device based on a mobile terminal and computer equipment, and aims to overcome the defects that the existing mobile terminal cannot automatically switch cameras according to actual needs of users and is low in intelligent degree.
In order to achieve the above object, the present application provides a camera switching method based on a mobile terminal, where the mobile terminal is deployed with a front camera and a rear camera, and the method includes:
receiving a shooting instruction input by a user;
opening the front camera according to the shooting instruction to acquire a first image, and simultaneously opening the rear camera to acquire a second image;
calculating a first weight score for the first image and a second weight score for the second image;
and comparing the first weight score with the second weight score, and selecting the camera corresponding to the image with the high weight score to shoot.
Further, the calculation rule of the first weight score is the same as the calculation rule of the second weight score, and the calculating of the first weight score of the first image includes:
identifying a number of object types within a focus range in the first image;
calling a weight score corresponding to each object type;
and calculating to obtain the first weight score according to each weight score.
Further, the step of calculating the first weight score according to each of the weight scores includes:
acquiring an application function corresponding to the shooting instruction;
calling a first weight coefficient corresponding to the application function, and calculating the sum of the values of the weight values;
and calculating to obtain the first weight score according to the score sum and the first weight coefficient.
Further, the step of calculating the first weight score according to the score sum and the first weight coefficient includes:
detecting whether the first image contains a face image;
if the first image contains a face image, identifying the number of the face image, and calling an additional basic score corresponding to the face image;
calculating the product of the additional basic score and the number of the face images to obtain an additional score; calculating the product of the total value of the scores and the first weight coefficient to obtain a weight basis score;
and adding and calculating to obtain the first weight score according to the additional score and the weight basic score.
Further, the step of retrieving the weight scores corresponding to the object types includes:
determining the scene type of a shooting scene according to each article type;
calling a second weight coefficient corresponding to the scene type and a first basic score corresponding to each article type;
and calculating the product of the first basic score and the second weight coefficient to obtain the weight score.
Further, after the step of comparing the first weight score with the second weight score and selecting the camera corresponding to the image with the higher weight score to perform image acquisition, the method includes:
monitoring whether a camera switching instruction input by a user is received;
and if a camera switching instruction input by a user is received, closing the camera corresponding to the image with high weight score, and opening the camera corresponding to the image with low weight score for image acquisition.
Further, after the step of closing the camera corresponding to the image with the high weight score and opening the camera corresponding to the image with the low weight score for image acquisition, the method includes:
reducing the basic score corresponding to the article type contained in the image with the high weight score to obtain a second basic score; improving the basic score corresponding to the article type contained in the image with the low weight score to obtain a third basic score;
and replacing the basic score corresponding to the item type contained in the image with high weight score by using the second basic score, and replacing the basic score corresponding to the item type contained in the image with low weight score by using the third basic score to update the basic score.
The application also provides a camera switching device based on the mobile terminal, the mobile terminal is provided with a front camera and a rear camera, and the method comprises the following steps:
the receiving module is used for receiving a shooting instruction input by a user;
the acquisition module is used for opening the front camera to acquire a first image according to the shooting instruction and simultaneously opening the rear camera to acquire a second image;
a calculation module, configured to calculate a first weight score of the first image and a second weight score of the second image, where a calculation rule of the first weight score is the same as a calculation rule of the second weight score;
and the selecting module is used for comparing the first weight score with the second weight score and selecting the camera corresponding to the image with the high weight score to acquire the image.
Further, wherein the calculation rule of the first weight score is the same as the calculation rule of the second weight score, and the calculation module includes:
the recognition sub-module is used for recognizing a plurality of object types in the focusing range in the first image;
the calling submodule is used for calling the weight scores corresponding to the object types respectively;
and the calculating submodule is used for calculating to obtain the first weight score according to each weight score.
Further, the computation submodule includes:
the acquisition unit is used for acquiring an application function corresponding to the shooting instruction;
the first calculation unit is used for calling a first weight coefficient corresponding to the application function and calculating the sum of the values of the weight values;
and the second calculating unit is used for calculating to obtain the first weight score according to the score sum and the first weight coefficient.
Further, the second calculation unit includes:
the detection subunit is used for detecting whether the first image contains a face image;
the identification subunit is used for identifying the number of the face images and calling the additional basic scores corresponding to the face images if the first images contain the face images;
the first calculating subunit is used for calculating the product of the additional basic score and the number of the face images to obtain an additional score; calculating the product of the total value of the scores and the first weight coefficient to obtain a weight basis score;
and the second calculating subunit is used for calculating the first weight score by adding according to the additional score and the weight basic score.
Further, the calling submodule includes:
the identification unit is used for determining the scene type of the shooting scene according to each article type;
the calling unit is used for calling a second weight coefficient corresponding to the scene type and a first basic score corresponding to each article type;
and the third calculating unit is used for calculating the product of the first basic score and the second weight coefficient to obtain the weight score.
Further, the switching device further includes:
the monitoring module is used for monitoring whether a camera switching instruction input by a user is received;
and the switching module is used for closing the camera corresponding to the image with high weight score and opening the camera corresponding to the image with low weight score for image acquisition if a camera switching instruction input by a user is received.
Further, the switching device further includes:
the correction module is used for reducing the basic score corresponding to the article type contained in the image with the high weight score to obtain a second basic score; improving the basic score corresponding to the article type contained in the image with the low weight score to obtain a third basic score;
and the updating module is used for replacing the basic score corresponding to the article type contained in the image with the high weight score by using the second basic score and replacing the basic score corresponding to the article type contained in the image with the low weight score by using the third basic score so as to realize basic score updating.
The present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any one of the above.
According to the camera switching method and device based on the mobile terminal and the computer equipment, the mobile terminal is provided with the front camera and the rear camera, after a shooting instruction input by a user is received, the mobile terminal opens the front camera according to the shooting instruction to collect a first image, and simultaneously opens the rear camera to collect a second image. And the mobile terminal respectively calculates a first weight score of the first image and a second weight score of the second image, then compares the first weight score with the second weight score, and selects a camera corresponding to the image with high weight score for image acquisition. In the application, when a user starts a camera shooting function, the mobile terminal simultaneously starts the front camera and the rear camera to shoot images, calculates a first weight score of a first image and a second weight score of a second image, determines the image with a larger shooting significance by judging the size relationship between the first weight score and the second weight score (the higher the weight score is, the larger the shooting significance represented by the image is), automatically selects the camera corresponding to the image with the higher weight score to carry out image acquisition, realizes automatic camera switching according to the actual needs of the user, and greatly improves the intelligent degree of the mobile terminal.
Drawings
Fig. 1 is a schematic diagram illustrating steps of a camera switching method based on a mobile terminal in an embodiment of the present application;
fig. 2 is a block diagram of an overall structure of a mobile terminal-based camera switching device according to an embodiment of the present application;
fig. 3 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, an embodiment of the present application provides a camera switching method based on a mobile terminal, where the mobile terminal is deployed with a front camera and a rear camera, and the method includes:
s1, receiving a shooting instruction input by a user;
s2, opening the front camera to acquire a first image according to the shooting instruction, and simultaneously opening the rear camera to acquire a second image;
s3, calculating a first weight score of the first image and a second weight score of the second image;
and S4, comparing the first weight score with the second weight score, and selecting the camera corresponding to the image with the high weight score for image acquisition.
In this embodiment, the mobile terminal is disposed with a front camera and a rear camera, and when receiving a shooting instruction input by a user (for example, the user opens a camera of the mobile terminal), the mobile terminal opens the front camera and the rear camera at the same time to perform image acquisition. The image collected by the front camera is defined as a first image, and the image collected by the rear camera is defined as a second image. The mobile terminal correspondingly calculates a first weight score of the first image and a second weight score of the second image by identifying an object type corresponding to an object image contained in the image. The calculation rule of the first weight score is the same as the calculation rule of the second weight score, and the following description will take the calculation rule of the first weight score as an example. Specifically, the mobile terminal performs focusing detection on an object in a shooting range through the front-facing camera, so as to identify and obtain object types respectively corresponding to a plurality of object images in the acquired first image, for example, if the first image includes a tree image and a shop image, the respectively corresponding object types are a plant and a building; the object types can be further refined through image recognition, for example, the object types are plants which can be subdivided into different types of plants such as trees, flowers, grass and the like; even further subdivision is possible, for example, the object type is that the tree can be subdivided into eucalyptus, banyan and other different varieties of trees, and corresponding division is performed according to matching data entered by developers. The database of the mobile terminal stores an object type and weight score mapping relation table, the object type and weight score mapping relation table comprises multiple groups of object types and weight scores, and each object type corresponds to one weight score. And setting the corresponding weight score of the object type by developers according to the shooting significance of the object type in daily shooting of people. For example, in daily shooting, if the shooting significance of the tree represented in the image composition is greater than the shooting significance of the grass represented in the image composition, the weight score corresponding to the tree is set to be 20, and the weight score corresponding to the grass is set to be 10. The mobile terminal screens out the weight scores corresponding to all object types contained in the first image from the object type and weight score mapping relation table, and adds and calculates all the weight scores to obtain the first weight score corresponding to the first image. And the mobile terminal correspondingly analyzes the second image according to the calculation rule of the first weight score, and calculates to obtain a second weight score. And the mobile terminal compares the first weight score with the second weight score, judges the size relationship between the first weight score and the second weight score, and then selects a camera corresponding to the image with high weight score to shoot. For example, if the first weight score is greater than the second weight score, it indicates that the shooting meaning of the first image is greater than that of the second image, and the user currently wants to start the front camera to shoot. Therefore, the mobile terminal closes the rear camera, keeps the front camera open, and outputs a first image currently shot by the front camera to the preview interface for displaying. And if the first weight score is smaller than the second weight score, the shooting significance of the first image is smaller than that of the second image, the mobile terminal closes the front camera, keeps the rear camera open, and outputs the second image shot by the rear camera to a preview interface for displaying. Before the mobile terminal determines which camera is finally started, the whole process is silent operation, namely the process of non-visualization, and a user cannot see that the first image and the second image appear on the display interface at the same time.
In this embodiment, when a user starts a camera function, the mobile terminal starts the front camera and the rear camera to shoot images simultaneously, calculates a first weight score of the first image and a second weight score of the second image, determines an image with a larger shooting significance by judging a magnitude relationship between the first weight score and the second weight score (the higher the weight score is, the larger the shooting significance represented by the image is), automatically selects the camera corresponding to the image with the higher weight score to shoot, realizes automatic camera switching according to actual needs of the user, and greatly improves the intelligent degree of the mobile terminal.
Further, the calculation rule of the first weight score is the same as the calculation rule of the second weight score, and the calculating of the first weight score of the first image includes:
s301, identifying a plurality of object types in a focusing range in the first image;
s302, the weight scores corresponding to the object types are retrieved;
and S303, calculating to obtain the first weight score according to each weight score.
In this embodiment, in order to further determine the shooting meaning represented by the image, the mobile terminal introduces the first weight coefficient corresponding to the application function to perform weight score calculation, so as to improve the accuracy of identifying the shooting meaning represented by the image. The present embodiment also takes the first image as an example for description, and the processing rule of the second image is the same as that of the first image, and will not be described in detail here. Specifically, the mobile terminal performs focusing detection on an object in a shooting range through the rear camera, so as to identify and obtain object types respectively corresponding to a plurality of object images in the focusing range in the acquired first image. Then, the weight scores corresponding to the object types are screened out from the object type and weight score mapping relation table. Further, the mobile terminal detects the source of the shooting instruction, that is, the shooting instruction input by which application function is by the user, for example, the user starts a camera by opening the american show APP, and then the application function corresponding to the shooting instruction is the american show APP. An application function and first weight coefficient mapping relation table is stored in the mobile terminal, and the application function and first weight coefficient mapping relation table comprises a plurality of groups of application functions and first weight coefficients which correspond to each other, for example, the application function is a scholar APP, and the corresponding first weight coefficient is 0.8; the application function is a camera of the mobile terminal, and the corresponding first weight coefficient is 1. And the mobile terminal screens the first weight coefficient which is changed corresponding to the current application function from the mapping relation table of the application function and the first weight coefficient, and calculates the sum of the scores of all the weight scores. Then, the mobile terminal obtains a first weight score by multiplying the sum of the scores by the first weight coefficient.
Further, the step of calculating the first weight score according to each of the weight scores includes:
s3031, acquiring an application function corresponding to the shooting instruction;
s3032, calling a first weight coefficient corresponding to the application function, and calculating the score sum of each weight score;
s3033, calculating to obtain the first weight score according to the score sum and the first weight coefficient.
In this embodiment, the mobile terminal detects a source of the shooting instruction, so as to obtain an application function corresponding to the shooting instruction. Then, the application function and the application function are compared with the first weight coefficient mapping relation table, so that the first weight coefficient of the application function corresponding to the shooting instruction is obtained through screening. Preferably, the first weighting coefficients corresponding to the same application function are different for different types of cameras. For example, in a first image shot by a front camera, a first weight coefficient corresponding to american show APP is 1.2; in a second image shot by the rear camera, a first weight coefficient corresponding to the american show APP is 0.8. Because most users use the beautiful picture show APP and are used for autodyne, the first weight coefficient corresponding to the first image collected by the front camera is greater than the first weight coefficient corresponding to the second image collected by the rear camera. In this embodiment, the mobile terminal stores an application function and first weight coefficient mapping table a corresponding to the front-facing camera and an application function and first weight coefficient mapping table B corresponding to the rear-facing camera. When the mobile terminal performs the weight score calculation, it is necessary to identify a camera type corresponding to the image (i.e., determine whether the image is captured by a front-facing camera or a rear-facing camera), and then select a corresponding application function and first weight coefficient mapping relationship table according to the camera type (for example, if the first image is captured by a rear-facing camera in this embodiment, the first image corresponds to the application function and first weight coefficient mapping relationship table B, and the first weight coefficient of the application function corresponding to the capturing instruction needs to be screened from the application function and first weight coefficient mapping relationship table B). The mobile terminal calculates the score sum of each weight score, and then performs product calculation on the score sum and the first weight coefficient, so as to obtain a first weight score corresponding to the first image.
Further, the step of calculating the first weight score according to the total score and the first weight coefficient includes:
s30331, detecting whether the first image contains a face image;
s30332, if the first image contains a face image, identifying the number of the face image, and calling an additional basic score corresponding to the face image;
s30333, calculating the product of the additional basic score and the number of the face images to obtain an additional score; calculating the product of the total value of the scores and the first weight coefficient to obtain a weight basis score;
s30334, the first weight score is obtained through addition calculation according to the additional score and the weight basic score.
In the embodiment, in order to further determine the shooting significance represented by the image, the mobile terminal adds the additional score corresponding to the face image to perform weight score calculation, so that the recognition accuracy of the shooting significance represented by the image is improved. Taking the first image as an example, specifically, the mobile terminal detects whether the first image includes a face image, if the first image includes a face image, the number of the face images is further identified, and an additional basic score corresponding to the face image is retrieved. Preferably, a plurality of face images are input into the mobile terminal, the face images are familiar face images of familiar people such as a user, relatives and friends of the user, and the additional basic score corresponding to the familiar face images can be customized by the user (if the user is not customized, the default is factory setting, but the additional basic score of the familiar face images is greater than the additional basic score of the unfamiliar face images). The user can carry out the setting of additional basic score according to the user habit at ordinary times of oneself to make the calculation rule of weight score more laminate the user demand of self, the computational result is more accurate. For example, if the user likes to shoot a landscape, the image of the tree, the flower and the grass can be set with an additional basic score; or, the user often uses the mobile phone to shoot the photos of the user, the friends and the relatives, the additional basic score can be set according to the intimacy between the crowd and the user, for example, the additional basic score of the face image of the user is set to 20, the additional basic score of the face image of the relatives is set to 10, and the additional basic score of the face image of the friends is set to 5; the user may customize the information specifically, which is not limited herein. And if the face image does not belong to the familiar face image, uniformly setting the corresponding additional basic score, for example, setting the additional basic score corresponding to the unfamiliar face image to be 2. The mobile terminal identifies the number of familiar face images and the number of non-familiar face images in the face images contained in the first image. Then, performing product calculation on the additional basic score corresponding to the familiar face image and the number of the familiar face images to obtain a first additional score; and the product of the additional basic scores corresponding to the non-familiar face images and the number of the non-familiar face images is calculated to obtain a second additional score. And adding the first additional score and the first additional score to obtain an additional score corresponding to the face image. Meanwhile, the mobile terminal calculates the product of the total value of the scores and the first weight coefficient to obtain the basic score of the weight. And the mobile terminal adds and calculates to obtain a first weight score according to the additional score and the weight basic score.
Further, the step of retrieving the weight score corresponding to each of the object types includes:
s3021, determining scene types of shooting scenes according to the types of the articles;
s3022, calling a second weight coefficient corresponding to the scene type and a first basic score corresponding to each article type;
s3023, calculating a product of the first basic score and the second weight coefficient to obtain the weight score.
In this embodiment, when determining the weight scores corresponding to the article types, the mobile terminal may further adjust the weight scores corresponding to the article types by identifying the shooting scenes, so that the article types are matched with the shooting scenes, and the relevance between the article types and the shooting scenes is improved, thereby improving the accuracy of identifying the shooting meanings represented by the images including the shooting scenes. Specifically, the mobile terminal identifies the scene type of the shooting scene in the image by combining the types of the respective articles contained in the image. For example, when the type of the object included in the image includes a blackboard, a desk, and a lecture table, the scene type of the shooting scene in the image is determined as a classroom. The mobile terminal is stored with a scene type and second weight coefficient mapping relation table, which comprises a plurality of groups of corresponding scene types and second weight coefficients. The mobile terminal screens out a second weight coefficient corresponding to the current scene type from the mapping relation table of the scene type and the second weight coefficient; and screening out first basic scores respectively corresponding to the article types from the object type and weight score mapping relation table. The mobile terminal multiplies the first basis of the single article type by the second weight coefficient to obtain the weight score of the article type (the other article types are also calculated according to the products to respectively obtain the corresponding weight scores).
Further, after the step of comparing the first weight score with the second weight score and selecting the camera corresponding to the image with the higher weight score to perform image acquisition, the method includes:
s5, monitoring whether a camera switching instruction input by a user is received;
and S6, if a camera switching instruction input by a user is received, closing the camera corresponding to the image with high weight score, and opening the camera corresponding to the image with low weight score for image acquisition.
In this embodiment, after selecting a camera corresponding to an image with a high weight score to perform camera shooting, the mobile terminal monitors whether a camera switching instruction input by a user is received, where the camera switching instruction is used to switch a camera started by the mobile terminal. Preferably, the user can switch the camera by clicking a camera switching button on the screen, and can also quickly switch the camera by slightly shaking the mobile terminal. The camera can be switched again by shaking after the user shakes the mobile terminal to switch the camera at an interval of one second so as to prevent the user from continuously shaking to cause excessive recognition of the mobile terminal (for example, the user only wants to turn over the camera once, but after shaking for many times, the mobile terminal switches the camera back again in the past, and the camera is not finally switched). And if the mobile terminal monitors that the user inputs a camera switching instruction, closing the camera corresponding to the image with high weight score, and opening the camera corresponding to the image with low weight score for shooting. For example, in the current shooting, if the camera corresponding to the image with the high weight score started by the mobile terminal is the front camera, the front camera is closed, and the rear camera is opened for shooting.
Further, after the step of closing the camera corresponding to the image with the high weight score and opening the camera corresponding to the image with the low weight score for image acquisition, the method includes:
s7, reducing the basic score corresponding to the article type contained in the image with the high weight score to obtain a second basic score; improving the basic score corresponding to the article type contained in the image with the low weight score to obtain a third basic score;
and S8, replacing the basic score corresponding to the article type contained in the image with high weight score by using the second basic score, and replacing the basic score corresponding to the article type contained in the image with low weight score by using the third basic score to update the basic score.
In this embodiment, after the mobile terminal determines to use the corresponding camera for shooting according to the weight score, if a camera switching instruction input by the user is subsequently received, it indicates that the weight score representing the shooting significance of the image, which is calculated according to the original score, is not accurate, and cannot express the actual shooting requirement of the user, so that the score calculation needs to be corrected correspondingly through a learning function. Specifically, the mobile terminal reduces the basic score corresponding to the article type contained in the image with the high weight score to obtain a second basic score so as to reduce the shooting significance represented by the article type; and improving the basic score corresponding to the article type contained in the image with low weight score to obtain a third basic score so as to improve the shooting significance represented by the article type. For example, the images with high weight scores include types of articles, i.e., trees, stores, and bicycles, and the corresponding base scores are 10, 8, and 4 in this order, and the reduced second base score of the tree is 9, the second base score of the store is 7, and the second base score of the bicycle is 3. The basic score is reduced and increased by the setting of a developer, and is not limited herein. And the mobile terminal replaces the basic score corresponding to the item type contained in the image with the high weight score by the second basic score and replaces the basic score corresponding to the item type contained in the image with the low weight score by the third basic score, so that the basic score of each item type is updated, the shooting significance represented by each item type is corrected according to the personal requirements of the user, and the accuracy of automatic switching of the camera is improved.
Referring to fig. 2, an embodiment of the present application further provides a camera switching device based on a mobile terminal, where the mobile terminal is deployed with a front camera and a rear camera, and the method includes:
the receiving module 1 is used for receiving a shooting instruction input by a user;
the acquisition module 2 is used for opening the front camera to acquire a first image according to the shooting instruction and simultaneously opening the rear camera to acquire a second image;
a calculating module 3, configured to calculate a first weight score of the first image and a second weight score of the second image;
and the selecting module 4 is used for comparing the first weight score with the second weight score and selecting the camera corresponding to the image with the high weight score to acquire the image.
Further, wherein the calculation rule of the first weight score is the same as the calculation rule of the second weight score, the calculation module 3 includes:
the recognition sub-module is used for recognizing a plurality of object types in the focusing range in the first image;
the calling submodule is used for calling the weight scores corresponding to the object types respectively;
and the calculation submodule is used for calculating the first weight score according to each weight score.
Further, the computation submodule includes:
the acquisition unit is used for acquiring an application function corresponding to the shooting instruction;
the first calculation unit is used for calling a first weight coefficient corresponding to the application function and calculating the sum of the values of the weight values;
and the second calculating unit is used for calculating to obtain the first weight score according to the score sum and the first weight coefficient.
Further, the second calculation unit includes:
the detection subunit is used for detecting whether the first image contains a face image;
the identification subunit is used for identifying the number of the face images and calling the additional basic scores corresponding to the face images if the first images contain the face images;
the first calculating subunit is used for calculating the product of the additional basic score and the number of the face images to obtain an additional score; calculating the product of the total value of the scores and the first weight coefficient to obtain a weight basis score;
and the second calculating subunit is used for adding and calculating to obtain the first weight score according to the additional score and the weight basic score.
Further, the calling submodule includes:
the identification unit is used for determining the scene type of the shooting scene according to each article type;
the calling unit is used for calling a second weight coefficient corresponding to the scene type and a first basic score corresponding to each article type;
and the third calculating unit is used for calculating the product of the first basic score and the second weight coefficient to obtain the weight score.
Further, the switching device further includes:
the monitoring module 5 is used for monitoring whether a camera switching instruction input by a user is received;
and the switching module 6 is used for closing the camera corresponding to the image with high weight score and opening the camera corresponding to the image with low weight score for image acquisition if a camera switching instruction input by a user is received.
Further, the switching device further includes:
the correction module 7 is used for reducing the basic score corresponding to the article type contained in the image with the high weight score to obtain a second basic score; improving the basic score corresponding to the article type contained in the image with the low weight score to obtain a third basic score;
and the updating module 8 is used for replacing the basic score corresponding to the article type contained in the image with the high weight score by using the second basic score, and replacing the basic score corresponding to the article type contained in the image with the low weight score by using the third basic score to update the basic score.
In this embodiment, each module, sub-module, unit and sub-unit of the switching device is used to correspondingly execute each step in the above-mentioned camera switching method based on the mobile terminal, and the specific implementation process thereof is not described in detail herein.
According to the camera switching device based on the mobile terminal, the mobile terminal is provided with the front camera and the rear camera, after a shooting instruction input by a user is received, the mobile terminal opens the front camera according to the shooting instruction to collect a first image, and opens the rear camera to collect a second image. The mobile terminal respectively calculates a first weight score of the first image and a second weight score of the second image, then compares the first weight score with the second weight score, and selects a camera corresponding to the image with the high weight score to shoot. In the application, when a user starts a camera shooting function, the mobile terminal simultaneously starts the front camera and the rear camera to shoot images, calculates a first weight score of a first image and a second weight score of a second image, determines the image with a larger shooting significance by judging the size relationship between the first weight score and the second weight score (the higher the weight score is, the larger the shooting significance represented by the image is), automatically selects the camera corresponding to the image with the higher weight score to carry out image acquisition, realizes automatic camera switching according to the actual needs of the user, and greatly improves the intelligent degree of the mobile terminal.
Referring to fig. 3, an embodiment of the present application further provides a computer device, where the computer device may be a server, and an internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The database of the computer equipment is used for storing data such as object type and weight score mapping relation tables. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a camera switching method based on a mobile terminal, which is deployed with a front camera and a rear camera.
The processor executes the camera switching method based on the mobile terminal, and comprises the following steps:
s1, receiving a shooting instruction input by a user;
s2, opening the front camera to acquire a first image according to the shooting instruction, and simultaneously opening the rear camera to acquire a second image;
s3, calculating a first weight score of the first image and a second weight score of the second image;
and S4, comparing the first weight score with the second weight score, and selecting the camera corresponding to the image with the high weight score for image acquisition.
Further, the calculation rule of the first weight score is the same as the calculation rule of the second weight score, and the calculating of the first weight score of the first image includes:
s301, identifying a plurality of object types in a focusing range in the first image;
s302, the weight scores corresponding to the object types are taken;
and S303, calculating to obtain the first weight score according to each weight score.
Further, the step of calculating the first weight score according to each of the weight scores includes:
s3031, acquiring an application function corresponding to the shooting instruction;
s3032, calling a first weight coefficient corresponding to the application function, and calculating the sum of the values of the weight values;
and S3033, calculating to obtain the first weight score according to the score sum and the first weight coefficient.
Further, the step of calculating the first weight score according to the score sum and the first weight coefficient includes:
s30331, detecting whether the first image contains a face image;
s30332, if the first image contains the face image, identifying the number of the face image, and calling an additional basic score corresponding to the face image;
s30333, calculating the product of the additional basic score and the number of the face images to obtain an additional score; calculating the product of the total value of the scores and the first weight coefficient to obtain a weight basis score;
and S30334, according to the additional scores and the weight basic scores, adding and calculating to obtain the first weight score.
Further, the step of retrieving the weight scores corresponding to the object types includes:
s3021, determining scene types of shooting scenes according to the types of the articles;
s3022, calling a second weight coefficient corresponding to the scene type and first basic scores corresponding to the article types respectively;
s3023, calculating the product of the first basic score and the second weight coefficient to obtain the weight score.
Further, after the step of comparing the first weight score with the second weight score and selecting the camera corresponding to the image with the higher weight score to perform image acquisition, the method includes:
s5, monitoring whether a camera switching instruction input by a user is received;
and S6, if a camera switching instruction input by a user is received, closing the camera corresponding to the image with high weight score, and opening the camera corresponding to the image with low weight score for image acquisition.
Further, after the step of closing the camera corresponding to the image with the high weight score and opening the camera corresponding to the image with the low weight score for image acquisition, the method includes:
s7, reducing the basic score corresponding to the article type contained in the image with the high weight score to obtain a second basic score; improving the basic score corresponding to the article type contained in the image with the low weight score to obtain a third basic score;
and S8, replacing the basic score corresponding to the article type contained in the image with high weight score by using the second basic score, and replacing the basic score corresponding to the article type contained in the image with low weight score by using the third basic score to update the basic score.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored thereon, and when the computer program is executed by a processor, the method for switching a camera based on a mobile terminal is implemented, where the mobile terminal is deployed with a front camera and a rear camera, and the method for switching a camera based on a mobile terminal specifically includes:
s1, receiving a shooting instruction input by a user;
s2, opening the front camera to acquire a first image according to the shooting instruction, and simultaneously opening the rear camera to acquire a second image;
s3, calculating a first weight score of the first image and a second weight score of the second image;
and S4, comparing the first weight score with the second weight score, and selecting a camera corresponding to the image with the high weight score to acquire the image.
Further, wherein the calculation rule of the first weight score is the same as the calculation rule of the second weight score, and the step of calculating the first weight score of the first image includes:
s301, identifying a plurality of object types in a focusing range in the first image;
s302, the weight scores corresponding to the object types are taken;
and S303, calculating to obtain the first weight score according to each weight score.
Further, the step of calculating the first weight score according to each of the weight scores includes:
s3031, acquiring an application function corresponding to the shooting instruction;
s3032, calling a first weight coefficient corresponding to the application function, and calculating the sum of the values of the weight values;
s3033, calculating to obtain the first weight score according to the score sum and the first weight coefficient.
Further, the step of calculating the first weight score according to the score sum and the first weight coefficient includes:
s30331, detecting whether the first image contains a face image;
s30332, if the first image contains a face image, identifying the number of the face image, and calling an additional basic score corresponding to the face image;
s30333, calculating the product of the additional basic score and the number of the face images to obtain an additional score; calculating the product of the total value of the scores and the first weight coefficient to obtain a weight basis score;
s30334, the first weight score is obtained through addition calculation according to the additional score and the weight basic score.
Further, the step of retrieving the weight scores corresponding to the object types includes:
s3021, determining scene types of shooting scenes according to the types of the articles;
s3022, calling a second weight coefficient corresponding to the scene type and first basic scores corresponding to the article types respectively;
s3023, calculating a product of the first basic score and the second weight coefficient to obtain the weight score.
Further, after the step of comparing the first weight score with the second weight score and selecting the camera corresponding to the image with the higher weight score to perform image acquisition, the method includes:
s5, monitoring whether a camera switching instruction input by a user is received;
and S6, if a camera switching instruction input by a user is received, closing the camera corresponding to the image with the high weight score, and opening the camera corresponding to the image with the low weight score for image acquisition.
Further, after the step of closing the camera corresponding to the image with the high weight score and opening the camera corresponding to the image with the low weight score for image acquisition, the method includes:
s7, reducing the basic score corresponding to the article type contained in the image with the high weight score to obtain a second basic score; improving the basic score corresponding to the article type contained in the image with the low weight score to obtain a third basic score;
and S8, replacing the basic score corresponding to the article type contained in the image with high weight score by using the second basic score, and replacing the basic score corresponding to the article type contained in the image with low weight score by using the third basic score to update the basic score.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by hardware associated with instructions of a computer program, which may be stored on a non-volatile computer-readable storage medium, and when executed, may include processes of the above embodiments of the methods. Any reference to memory, storage, database or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (SSRDRAM), enhanced SDRAM (ESDRAM), synchronous Link (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct Rambus Dynamic RAM (DRDRAM), and Rambus Dynamic RAM (RDRAM), among others.
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, apparatus, article, or method 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, apparatus, article, or method. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of another identical element in a process, apparatus, article, or method comprising the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all the equivalent structures or equivalent processes that can be directly or indirectly applied to other related technical fields by using the contents of the specification and the drawings of the present application are also included in the scope of the present application.

Claims (8)

1. A camera switching method based on a mobile terminal, wherein the mobile terminal is provided with a front camera and a rear camera, and the method comprises the following steps:
receiving a shooting instruction input by a user;
opening the front camera according to the shooting instruction to acquire a first image, and simultaneously opening the rear camera to acquire a second image;
calculating a first weight score for the first image and a second weight score for the second image;
the calculation rule of the first weight score is the same as the calculation rule of the second weight score, and the step of calculating the first weight score of the first image includes:
identifying a number of object types within a focus range in the first image;
calling a weight score corresponding to each object type;
acquiring an application function corresponding to the shooting instruction;
calling a first weight coefficient corresponding to the application function, and calculating the sum of the values of the weight values;
calculating to obtain the first weight score according to the score sum and the first weight coefficient;
and comparing the first weight score with the second weight score, and selecting the camera corresponding to the image with the high weight score for image acquisition.
2. The method for switching a camera according to claim 1, wherein the step of calculating the first weighting score according to the total score and the first weighting factor comprises:
detecting whether the first image contains a face image;
if the first image contains a face image, identifying the number of the face image, and calling an additional basic score corresponding to the face image;
calculating the product of the additional basic score and the number of the face images to obtain an additional score; calculating the product of the total value of the scores and the first weight coefficient to obtain a weight basis score;
and adding and calculating to obtain the first weight score according to the additional score and the weight basic score.
3. The method for switching the camera based on the mobile terminal according to claim 1, wherein the step of retrieving the weight score corresponding to each object type comprises:
determining the scene type of a shooting scene according to the object types;
calling a second weight coefficient corresponding to the scene type and a first basic score corresponding to each object type;
and calculating the product of the first basic score and the second weight coefficient to obtain the weight score.
4. The method for switching cameras based on a mobile terminal according to claim 1, wherein after the step of comparing the first weight score with the second weight score and selecting a camera corresponding to an image with a higher weight score for image capturing, the method comprises:
monitoring whether a camera switching instruction input by a user is received;
and if a camera switching instruction input by a user is received, closing the camera corresponding to the image with the high weight score, and opening the camera corresponding to the image with the low weight score for image acquisition.
5. The method for switching cameras based on a mobile terminal according to claim 4, wherein after the step of turning off the camera corresponding to the image with high weight score and turning on the camera corresponding to the image with low weight score for image acquisition, the method comprises:
reducing the basic score corresponding to the article type contained in the image with the high weight score to obtain a second basic score; improving the basic score corresponding to the article type contained in the image with the low weight score to obtain a third basic score;
and replacing the basic score corresponding to the item type contained in the image with high weight score by using the second basic score, and replacing the basic score corresponding to the item type contained in the image with low weight score by using the third basic score to update the basic score.
6. The utility model provides a camera auto-change over device based on mobile terminal which characterized in that, mobile terminal deploys leading camera and rear camera, the device includes:
the receiving module is used for receiving a shooting instruction input by a user;
the acquisition module is used for opening the front camera to acquire a first image according to the shooting instruction and simultaneously opening the rear camera to acquire a second image;
a calculation module to calculate a first weight score of the first image and a second weight score of the second image;
the calculation rule of the first weight score is the same as the calculation rule of the second weight score, and the step of calculating the first weight score of the first image includes:
identifying a number of object types within a focus range in the first image;
calling a weight score corresponding to each object type;
acquiring an application function corresponding to the shooting instruction;
calling a first weight coefficient corresponding to the application function, and calculating the sum of the values of the weight values;
calculating to obtain the first weight score according to the score sum and the first weight coefficient;
and the selecting module is used for comparing the first weight score with the second weight score and selecting the camera corresponding to the image with the high weight score to acquire the image.
7. A computer arrangement comprising a memory and a processor, the memory having a computer program stored therein, characterized in that the processor, when executing the computer program, is adapted to carry out the steps of the method according to any of claims 1 to 5.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
CN202110209267.1A 2021-02-24 2021-02-24 Camera switching method and device based on mobile terminal and computer equipment Active CN112995509B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110209267.1A CN112995509B (en) 2021-02-24 2021-02-24 Camera switching method and device based on mobile terminal and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110209267.1A CN112995509B (en) 2021-02-24 2021-02-24 Camera switching method and device based on mobile terminal and computer equipment

Publications (2)

Publication Number Publication Date
CN112995509A CN112995509A (en) 2021-06-18
CN112995509B true CN112995509B (en) 2022-11-11

Family

ID=76350385

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110209267.1A Active CN112995509B (en) 2021-02-24 2021-02-24 Camera switching method and device based on mobile terminal and computer equipment

Country Status (1)

Country Link
CN (1) CN112995509B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6671405B1 (en) * 1999-12-14 2003-12-30 Eastman Kodak Company Method for automatic assessment of emphasis and appeal in consumer images
CN101299847A (en) * 2008-06-25 2008-11-05 嘉兴闻泰通讯科技有限公司 Method for setting, controlling and switching forward and backward CCD camera of mobile terminal
CN101421730A (en) * 2006-04-13 2009-04-29 伊斯曼柯达公司 Camera user input based image value index
CN102959941A (en) * 2010-07-02 2013-03-06 索尼电脑娱乐公司 Information processing system, information processing device, and information processing method
CN104168418A (en) * 2014-06-30 2014-11-26 宇龙计算机通信科技(深圳)有限公司 Image acquisition device, image acquisition method and terminal
CN108833794A (en) * 2018-08-27 2018-11-16 维沃移动通信有限公司 A kind of image pickup method and mobile terminal
CN109218619A (en) * 2018-10-12 2019-01-15 北京旷视科技有限公司 Image acquiring method, device and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6671405B1 (en) * 1999-12-14 2003-12-30 Eastman Kodak Company Method for automatic assessment of emphasis and appeal in consumer images
CN101421730A (en) * 2006-04-13 2009-04-29 伊斯曼柯达公司 Camera user input based image value index
CN101299847A (en) * 2008-06-25 2008-11-05 嘉兴闻泰通讯科技有限公司 Method for setting, controlling and switching forward and backward CCD camera of mobile terminal
CN102959941A (en) * 2010-07-02 2013-03-06 索尼电脑娱乐公司 Information processing system, information processing device, and information processing method
CN104168418A (en) * 2014-06-30 2014-11-26 宇龙计算机通信科技(深圳)有限公司 Image acquisition device, image acquisition method and terminal
CN108833794A (en) * 2018-08-27 2018-11-16 维沃移动通信有限公司 A kind of image pickup method and mobile terminal
CN109218619A (en) * 2018-10-12 2019-01-15 北京旷视科技有限公司 Image acquiring method, device and system

Also Published As

Publication number Publication date
CN112995509A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN110012210B (en) Photographing method and device, storage medium and electronic equipment
US10264177B2 (en) Methods and systems to obtain desired self-pictures with an image capture device
CN110475069B (en) Image shooting method and device
CN109189986B (en) Information recommendation method and device, electronic equipment and readable storage medium
CN105681675A (en) Mobile terminal, and shooting mode setting method and device
CN113411498B (en) Image shooting method, mobile terminal and storage medium
CN109218609B (en) Image composition method and device
CN109871843A (en) Character identifying method and device, the device for character recognition
CN105338237A (en) Image processing method and device
CN113824883A (en) Information processing method and electronic equipment
CN111770277A (en) Auxiliary shooting method, terminal and storage medium
CN112052784A (en) Article searching method, device, equipment and computer readable storage medium
US10880478B2 (en) Camera, system and method of selecting camera settings
CN112887615B (en) Shooting method and device
CN112685119A (en) Display control method and device and electronic equipment
CN112995509B (en) Camera switching method and device based on mobile terminal and computer equipment
CN110047115B (en) Star image shooting method and device, computer equipment and storage medium
US9888161B2 (en) Generation apparatus and method for evaluation information, electronic device and server
CN105469411B (en) For the method, apparatus and terminal of detection image clarity
CN110297929A (en) Image matching method, device, electronic equipment and storage medium
CN111831615B (en) Method, device and system for generating video file
CN111464734B (en) Method and device for processing image data
CN112019686A (en) Display method and device and electronic equipment
CN112399091B (en) Image processing method and device and electronic equipment
CN113835797A (en) Display method and device of aggregated page information, electronic equipment and storage medium

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