CN110830717A - Parameter value acquisition method and electronic equipment - Google Patents
Parameter value acquisition method and electronic equipment Download PDFInfo
- Publication number
- CN110830717A CN110830717A CN201911101566.2A CN201911101566A CN110830717A CN 110830717 A CN110830717 A CN 110830717A CN 201911101566 A CN201911101566 A CN 201911101566A CN 110830717 A CN110830717 A CN 110830717A
- Authority
- CN
- China
- Prior art keywords
- preset
- parameter
- camera
- image
- obtaining
- 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.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/64—Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/71—Circuitry for evaluating the brightness variation
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
The invention provides a parameter value acquisition method and electronic equipment, wherein the parameter value acquisition method comprises the following steps: obtaining parameter values of preset image parameters according to image data shot by a camera; obtaining a parameter value of a preset induction parameter according to the parameter value of a preset image parameter and a preset corresponding relation; the preset corresponding relation comprises a first corresponding relation between a parameter value of a preset image parameter and a parameter value of a preset induction parameter. The scheme can achieve the purpose of acquiring the environmental brightness value of the current environment and the parameter values such as the distance value between the shooting main body and the camera by utilizing the camera of the electronic equipment, reduces the implementation cost and the difficulty of the scheme, and well solves the problems that in the prior art, the electronic equipment achieves the sensing functions such as photoinduction and distance sensing, and the cost is high and the difficulty is high.
Description
Technical Field
The present invention relates to the field of electronic devices, and in particular, to a parameter value obtaining method and an electronic device.
Background
At present, electronic equipment such as mobile phones and the like mostly adopt a special sensor scheme for detecting the ambient light brightness, the human body approaching distance and the like: ambient light sensing sensor, distance sensing sensor or a combination of both. Fig. 1 is a layout diagram of a sensor dedicated for an electronic device such as a current terminal, wherein:
a represents an electronic device such as a terminal having functions of detecting ambient light intensity and approaching a human body.
b represents a distance sensing sensor, which is arranged on the top of the terminal or close to the edge of the top, and the sensor can realize the distance sensing function by using infrared light reflected by a human body, and simultaneously, the receiving part of the sensor can also realize the ambient light intensity detection function.
c represents an ambient light sensing sensor, which is arranged under the display screen and requires openings in the light-shielding material at corresponding positions of the screen so that ambient light can penetrate into the sensor.
However, the current solution using the above-mentioned dedicated sensor has the following problems:
1. one or more sensor chips and peripheral electronic devices are needed to realize the ambient light and distance sensing functions, and meanwhile, the whole machine assembly requirement is realized by adding the structural stacking form of a Flexible Printed Circuit (FPC) and a raising plate, so that the material cost is high;
2. in order to meet the requirement of light transmittance, a display screen cover plate is usually required to be provided with hidden optical holes, printing ink or holes made of shading materials at positions corresponding to light sensation under the screen, so that the appearance is influenced, and meanwhile, the manufacturing procedure is increased;
3. the special sensor scheme has strict requirements on assembly tolerance, and the detection performance is greatly reduced due to slight deviation caused by assembly or material introduction, so that the process difficulty is increased.
Therefore, the existing electronic equipment has the problems of high cost, high difficulty and the like when the existing electronic equipment realizes induction functions such as light induction and distance induction.
Disclosure of Invention
The invention aims to provide a parameter value acquisition method and electronic equipment, and aims to solve the problems of high cost and great difficulty in realizing sensing functions such as light sensing, distance sensing and the like of the electronic equipment in the prior art.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for obtaining a parameter value, which is applied to an electronic device, where the electronic device includes a camera, and the method includes:
obtaining parameter values of preset image parameters according to the image data shot by the camera;
obtaining a parameter value of a preset induction parameter according to the parameter value of the preset image parameter and a preset corresponding relation;
the preset corresponding relation comprises a first corresponding relation between the parameter value of the preset image parameter and the parameter value of the preset induction parameter.
In a second aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes a camera, and the electronic device further includes:
the first processing module is used for obtaining parameter values of preset image parameters according to the image data shot by the camera;
the second processing module is used for obtaining the parameter value of the preset induction parameter according to the parameter value of the preset image parameter and the preset corresponding relation;
the preset corresponding relation comprises a first corresponding relation between the parameter value of the preset image parameter and the parameter value of the preset induction parameter.
In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the above-mentioned parameter value obtaining method.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned parameter value obtaining method are implemented.
In the embodiment of the invention, the parameter value of the preset image parameter is obtained according to the image data shot by the camera; obtaining a parameter value of a preset induction parameter according to the parameter value of the preset image parameter and a preset corresponding relation; the preset corresponding relation comprises a first corresponding relation between a parameter value of the preset image parameter and a parameter value of the preset induction parameter; the camera that can realize utilizing electronic equipment obtains the ambient brightness value of current environment, the purpose of the parameter values such as distance value between shooting main part and the camera, do not need additionally to increase special sensor, peripheral device and other FPC relevant material, and the display screen apron need not open extra optical hole, only use the camera trompil, the realization of this scheme requires lowly to structure assembly tolerance, the consumption of function realization process is far less than the consumption that the camera was shot or was recorded a video, the realization cost and the degree of difficulty of scheme have been reduced, fine solution electronic equipment among the prior art realizes the photoinduction, response functions such as distance response exist with high costs, the big problem of the degree of difficulty.
Drawings
FIG. 1 is a schematic diagram of a sensor layout of a conventional electronic device;
FIG. 2 is a flowchart illustrating a method for obtaining parameter values according to an embodiment of the present invention;
FIG. 3 is a schematic view of a camera structure according to an embodiment of the invention;
FIG. 4 is a schematic diagram of an image data acquisition process according to an embodiment of the present invention;
fig. 5 is a diagram illustrating YUV420 format data according to an embodiment of the present invention;
fig. 6 is a diagram illustrating YUV420 format data according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating a correspondence relationship between image brightness and ambient brightness according to an embodiment of the present invention;
fig. 8 is a schematic view of a process of acquiring a distance between a camera and a subject according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a correspondence between a distance between a camera and a subject and a sharpness of an image according to an embodiment of the present invention;
FIG. 10 is a first schematic structural diagram of an electronic device according to an embodiment of the invention;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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 invention.
The invention provides a parameter value obtaining method for an electronic device, aiming at the problems of high cost and high difficulty in implementation of schemes for realizing light induction, distance induction and other induction functions of the electronic device in the prior art, the parameter value obtaining method is applied to the electronic device, the electronic device comprises a camera, and as shown in figure 2, the obtaining method comprises the following steps:
step 21: and obtaining the parameter value of a preset image parameter according to the image data shot by the camera.
The image data may be image data of all pixels of one frame, or may be partial image data of all pixels of one frame, which is not limited herein.
The preset image parameter may be image brightness, image sharpness, or the like, and is not limited herein.
Step 22: obtaining a parameter value of a preset induction parameter according to the parameter value of the preset image parameter and a preset corresponding relation; the preset corresponding relation comprises a first corresponding relation between the parameter value of the preset image parameter and the parameter value of the preset induction parameter.
Under the condition that the preset image parameter is the image brightness, the preset induction parameter can be the current environment brightness of the camera; when the preset image parameter is the image definition, the preset sensing parameter may be a distance between a subject (shooting subject) shot by the camera and the camera; that is:
the preset image parameters comprise image brightness, and the preset induction parameters comprise the current environment brightness of the camera; and/or the presence of a gas in the gas,
the preset image parameters comprise image definition, and the preset induction parameters comprise the distance between a main body shot by the camera and the camera; but not limited thereto.
According to the method for acquiring the parameter value, the parameter value of the preset image parameter is acquired according to the image data shot by the camera; obtaining a parameter value of a preset induction parameter according to the parameter value of the preset image parameter and a preset corresponding relation; the preset corresponding relation comprises a first corresponding relation between a parameter value of the preset image parameter and a parameter value of the preset induction parameter; the camera that can realize utilizing electronic equipment obtains the ambient brightness value of current environment, the purpose of the parameter values such as distance value between shooting main part and the camera, do not need additionally to increase special sensor, peripheral device and other FPC relevant material, and the display screen apron need not open extra optical hole, only use the camera trompil, the realization of this scheme requires lowly to structure assembly tolerance, the consumption of function realization process is far less than the consumption that the camera was shot or was recorded a video, the realization cost and the degree of difficulty of scheme have been reduced, fine solution electronic equipment among the prior art realizes the photoinduction, response functions such as distance response exist with high costs, the big problem of the degree of difficulty.
Further, before obtaining the parameter value of the preset sensing parameter according to the parameter value of the preset image parameter and the preset corresponding relationship, the method further includes: acquiring each group of image data shot by the camera under the condition that the preset induction parameters take different values; obtaining values of preset image parameters corresponding to the values of the preset induction parameters according to the groups of image data; and obtaining the first corresponding relation according to each value taken by the preset induction parameters and the corresponding value of the preset image parameter.
That is, multiple sets of relevant experimental data are obtained in advance to obtain the corresponding relationship between relevant parameters for subsequent use.
Specifically, here are: aiming at a training scheme of preset induction parameters, the preset induction parameters take different numerical values to obtain corresponding relations with corresponding image parameters; the preset sensing parameter refers to a parameter, such as image brightness; in the embodiment of the present invention, the scheme may be adopted to train for different preset sensing parameters, which is not limited herein.
In an embodiment of the present invention, the obtaining a parameter value of a preset image parameter according to image data captured by the camera includes: obtaining parameter values of preset image parameters according to image data sensed by a preset sensing area in the camera; wherein the center of the preset sensing area is aligned with the center of a lens of the camera.
Therefore, the method and the device are favorable for more accurately detecting the light vertically incident to the screen, more accurately obtaining parameter values according to the image data, and reducing the data processing amount and the power consumption.
In the embodiment of the present invention, for a specific implementation of "obtaining a parameter value of a preset image parameter according to image data sensed by a preset sensing area in the camera", the following two ways are provided:
in a first mode, obtaining parameter values of preset image parameters according to image data sensed by a preset sensing area in the camera includes: under the condition that the camera is in a preset opening state, acquiring image data sensed by a preset sensing area in the camera from a data code stream of a preview interface; and obtaining the parameter value of a preset image parameter according to the image data.
That is, only partial data of a frame of full pixels of the camera is captured when the camera is turned on, so that the subsequent data processing amount and power consumption are reduced.
The preset starting state may be a manual starting state, or an automatic starting state of the electronic device.
In a second mode, obtaining parameter values of preset image parameters according to image data sensed by a preset sensing area in the camera includes: starting a preset sensing area in the camera under the condition that the camera is in a closed state; acquiring image data sensed by the preset sensing area; and obtaining the parameter value of a preset image parameter according to the image data.
That is, when the camera is turned off, only the preset sensing area is enabled to sense image data to reduce the subsequent data processing amount and power consumption. Specifically, the preset sensing area can be started only in the background, and the screen cannot be lightened to enter a preview interface, so that the power consumption is further reduced.
In the embodiment of the present invention, when there is one sensor for sensing data, activating the preset sensing area may be activating a part of the sensor;
when the number of the sensors for sensing data is at least two, activating the preset sensing area may be activating a sensor corresponding to the preset sensing area, which corresponds to:
the obtaining of the parameter value of the preset image parameter according to the image data sensed by the preset sensing area in the camera may specifically include: under the condition that the camera is in a closed state, a sensor corresponding to a preset sensing area in the camera is started; acquiring image data sensed by the preset sensing area based on the sensor; and obtaining the parameter value of a preset image parameter according to the image data.
The method for obtaining the parameter value provided by the embodiment of the present invention is further described below.
In view of the above technical problems, an embodiment of the present invention provides a method for obtaining parameter values, which can achieve the purpose of obtaining parameter values, such as an environment brightness value of a current environment where a camera is located and a distance value between a shooting subject and the camera, by using the camera of an electronic device (including a terminal such as a mobile phone); namely, the camera can be used for simultaneously realizing the functions of ambient light intensity sensing and human body approaching distance sensing.
The scheme provided by the embodiment of the invention is as follows: when terminals such as a mobile phone with a camera have the requirements of ambient light intensity sensing and human body approaching distance sensing functions, a special sensor, peripheral devices and other related materials such as an FPC (flexible printed circuit) do not need to be additionally added; the display screen cover plate does not need to be provided with an additional optical hole, and only a camera is used for forming a hole; when the scheme is implemented (the hardware structure of the implementation scheme), the requirement on the assembly tolerance of the structure is low; the power consumption of the function implementation process is far lower than that of shooting or recording by a camera.
The structure of the camera in the embodiment of the present invention may be specifically as shown in fig. 3, and includes a camera body 31, a lens 32, and a Sensor area 33; the Sensor area 33 includes a partial Sensor area 34 (i.e., the preset sensing area), where the partial Sensor area 34 is an area (which may be a rectangular area) directly facing the lens center of the lens 32, and a connection line between the area center of the area and the lens center of the lens is perpendicular to the light-sensing surface of the Sensor area 33 (i.e., the center of the preset sensing area is aligned with the lens center of the camera), and the number of pixels in the area is much smaller than the maximum pixel supported by the Sensor, while the function detection is satisfied (i.e., the image data sensed by the area can obtain the image data required by the present scheme).
In the embodiment of the present invention, whether the camera is manually turned on (i.e. in a certain preset on state) or not, the system may periodically (e.g. every 1 second) store the picture data code stream sensed by the partial Sensor area 34 into the memory, where the code stream format is one of formats supported by the camera Sensor, such as YUV format.
Specifically, the process of acquiring image data (taking the image data sensed by the preset sensing area as an example) according to the embodiment of the present invention is shown in fig. 4, and includes:
step 41: starting up the electronic equipment;
step 42: detecting whether the screen (of the electronic device) is lighted, if so, entering step 43 (namely, if the screen is not lighted, the screen does not act, and the screen waits for 1 second for detection again), and if not, entering step 49;
step 43: detecting whether a camera (of the electronic device) is manually opened; if yes, go to step 44, if no, go to step 46;
step 44: acquiring a data code stream of a preview interface (electronic equipment);
specifically, the method comprises the following steps: acquiring a data code stream (data of a frame of full pixels) of a frame of data under the condition that a camera is manually opened on a preview or video interface;
step 45: intercepting the data code stream sensed in a part of Sensor area 34 (electronic equipment); entering a step 48;
step 46: supplying power to a camera (of the electronic device);
step 47: the (electronic equipment) controls the partial Sensor area 34 to work, and acquires the data code stream sensed by the partial Sensor area 34;
and 48: the (electronic equipment) stores the data code stream sensed by the partial Sensor area 34 to a system memory, so that the subsequent data operation is convenient;
step 49: wait for 1 second and return to step 42.
From the above, the scheme provided by the embodiment of the invention is as follows: capturing partial data of a frame of full pixels of the camera when the camera is started; when the camera is turned off, only a partial Sensor area 34 can be enabled in the background to sense data, and the screen is not lighted up to enter a preview interface; compared with the method for processing the whole image of the Sensor, the method has the advantages of smaller data processing amount, shorter processing time and more complete machine power consumption saving.
The following illustrates the acquisition of parameter values in the embodiment of the present invention.
Example one: the parameter value is exemplified by an environment brightness value;
after the data code stream sensed by the partial Sensor area 34 is acquired and stored in the memory, the data code stream can be converted into a specific format, such as YUV (Y represents brightness, and UV represents chroma) data format (YUV occupies a smaller bandwidth than RGB (R represents red, G represents green, and B represents blue), and Y represents brightness of a picture, namely a gray level value), and the data with a fixed size is calculated to extract brightness data of each pixel point, so that the brightness data of all the pixel points can be averaged to acquire an average brightness value L representing the picture corresponding to the data code stream;
in the embodiment of the present invention, the average brightness values L1 and L2 … … Ln of the pictures corresponding to the different luminances EL1 and EL2 … … ELn of the photographing environment (the environment where the camera is located) from dark to bright (which can also be understood as obtaining the average brightness values of the pictures obtained under different ambient luminances) are obtained, and data fitting is performed to obtain the corresponding relationship between the average brightness value L of the pictures and the ambient brightness value EL, where the corresponding relationship may be as follows:
EL=a×L2+ b × L + c; wherein a, b and c are shown inShowing a constant coefficient obtained after fitting; specifically, as shown in fig. 7, the average luminance value L of the picture and the ambient luminance value EL have a monotonic non-linear relationship.
According to the scheme provided by the embodiment of the invention, after the data sensed by part of the Sensor area 34 acquired each time is calculated, a unique value EL representing the current environment brightness (the environment brightness where the camera is currently located) can be obtained.
As for the data sensed by the partial Sensor region 34, specifically, as shown in fig. 5 and fig. 6, data in YUV420 format of one frame is represented, in which the Y value representing the luminance is in the first 24 positions in the byte stream (byte stream) array; the first 24 data are extracted and converted into unsigned values, and then the unsigned values are added and averaged to obtain the average brightness value of the picture. In the figure, U represents hue and V represents saturation.
By the scheme provided by the example, the electronic device can acquire the current ambient brightness through the camera at regular time intervals.
Example two: the parameter value takes the distance value between the shooting subject and the camera as an example;
under the condition that parameters such as focal length, exposure, contrast and the like of the camera are fixed and unchanged, an object approaches the camera from far to near, and when the distance exceeds the nearest focusing distance, an imaging picture can be changed from clear to fuzzy, and the distance is generally within a range of 10cm (determined by the focal length of the camera); a definition evaluation function based on the image gray gradient can obtain a definition evaluation value (namely an image definition value) of the image, and further describe the definition of the image; within a certain distance range, the distance between the image definition evaluation value and a shot object (the shot main body) is in a monotone single-value nonlinear relation, and the electronic equipment can judge the distance between the object and the electronic equipment according to the relation through the definition (image definition) of pictures shot by a camera; specifically, as shown in fig. 8, the method includes:
step 81: the electronic equipment acquires the image data sensed by the partial Sensor region 34;
step 82: the electronic device converts the image data (color data) acquired through step 81 into grayscale data, for example, acquired through an algorithm of grayscale value grey ═ R + G + B)/3;
step 83: based on the gray data, the electronic device obtains the definition of the image through a definition evaluation function based on the gray gradient of the image, specifically, the definition evaluation function is, for example, the following formula:
S(f)=∑y∑x|g(x+2,y)-g(x,y)|2
wherein g (x, y) represents the gray value of the pixel point (x, y) corresponding to the image, and S (f) represents the image definition value, which is the image definition calculation result.
Step 84: and fitting the distance between the camera and the object by the electronic equipment according to the definition evaluation value.
In the production test stage, the electronic device may calibrate the distance of the object to be photographed and the sharpness evaluation value according to the above steps, that is, find a function (corresponding relationship) between the photographing distance D (i.e., the above distance) of each camera and the sharpness evaluation value S, and the corresponding relationship may be specifically as shown in fig. 9.
Specifically, in the production test stage, the distance D between the camera and the object to be shot (the shooting subject) can be fixed by using the test fixture, and at this time, the electronic device can obtain the definition of the image (the value of the image definition) through the definition evaluation function; setting different distances D to obtain different definitions; fitting a curve formula of the distance and the definition through the acquired distance D and the definition data; thus, the definition of any image is obtained, and the corresponding distance D (the distance between the camera and the shooting subject) can be calculated through the curve formula.
By the scheme provided by the example, the electronic equipment can acquire the distance condition of the shot object from the camera through the camera at regular time intervals.
In addition, by the aid of the scheme, the electronic equipment with the camera can acquire the current ambient brightness by the camera, the electronic equipment can adjust the display brightness of the display screen based on the ambient brightness value, and prompts a user to turn on a flash lamp and other actions in a dark environment;
meanwhile, the electronic equipment with the camera can detect the distance between the electronic equipment and the shot object by using the camera, and the electronic equipment can detect the screen-off action when the distance between the electronic equipment and the human body is less than a certain distance;
however, the present solution is not limited to the above-listed application scenarios, and may be applied to any scenario in which the electronic device with a camera acquires the sensing parameter value.
An embodiment of the present invention further provides an electronic device, where the electronic device includes a camera, and as shown in fig. 10, the electronic device further includes:
the first processing module 101 is configured to obtain a parameter value of a preset image parameter according to image data captured by the camera;
the second processing module 102 is configured to obtain a parameter value of a preset sensing parameter according to the parameter value of the preset image parameter and a preset corresponding relationship;
the preset corresponding relation comprises a first corresponding relation between the parameter value of the preset image parameter and the parameter value of the preset induction parameter.
According to the electronic equipment provided by the embodiment of the invention, the parameter value of the preset image parameter is obtained according to the image data shot by the camera; obtaining a parameter value of a preset induction parameter according to the parameter value of the preset image parameter and a preset corresponding relation; the preset corresponding relation comprises a first corresponding relation between a parameter value of the preset image parameter and a parameter value of the preset induction parameter; the camera that can realize utilizing electronic equipment obtains the ambient brightness value of current environment, the purpose of the parameter values such as distance value between shooting main part and the camera, do not need additionally to increase special sensor, peripheral device and other FPC relevant material, and the display screen apron need not open extra optical hole, only use the camera trompil, the realization of this scheme requires lowly to structure assembly tolerance, the consumption of function realization process is far less than the consumption that the camera was shot or was recorded a video, the realization cost and the degree of difficulty of scheme have been reduced, fine solution electronic equipment among the prior art realizes the photoinduction, response functions such as distance response exist with high costs, the big problem of the degree of difficulty.
The preset image parameters comprise image brightness, and the preset induction parameters comprise the current ambient brightness of the camera; and/or the preset image parameters comprise image definition, and the preset induction parameters comprise the distance between the main body shot by the camera and the camera.
Further, the electronic device further includes: the first acquisition module is used for acquiring each group of image data shot by the camera under the condition that the preset induction parameters take different values before the parameter values of the preset induction parameters are obtained according to the parameter values of the preset image parameters and the preset corresponding relation; the third processing module is used for obtaining values of the preset image parameters corresponding to the values of the preset induction parameters according to the groups of image data; and the fourth processing module is used for obtaining the first corresponding relation according to each value taken by the preset induction parameters and the corresponding value of the preset image parameter.
In an embodiment of the present invention, the first processing module includes: the first processing submodule is used for obtaining parameter values of preset image parameters according to image data sensed by a preset sensing area in the camera, wherein the center of the preset sensing area is aligned with the center of a lens of the camera.
In the embodiment of the present invention, for specific implementation of the "first processing sub-module", the following two ways are provided:
in a first mode, the first processing sub-module includes: the first acquisition unit is used for acquiring image data sensed by a preset sensing area in the camera from a data code stream of a preview interface under the condition that the camera is in a preset opening state; and the first processing unit is used for obtaining the parameter value of the preset image parameter according to the image data.
In a second mode, the first processing sub-module includes: the first enabling unit is used for enabling a preset sensing area in the camera under the condition that the camera is in a closed state; the second acquisition unit is used for acquiring the image data sensed by the preset sensing area; and the second processing unit is used for obtaining the parameter value of the preset image parameter according to the image data.
The electronic device provided in the embodiment of the present invention can implement each process implemented by the electronic device in the method embodiments of fig. 1 to 9, and is not described herein again to avoid repetition.
Fig. 11 is a schematic diagram of a hardware structure of an electronic device for implementing various embodiments of the present invention, where the electronic device 110 includes, but is not limited to: radio frequency unit 111, network module 112, audio output unit 113, input unit 114, sensor 115, display unit 116, user input unit 117, interface unit 118, memory 119, processor 1110, and power supply 1111. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 11 does not constitute a limitation of electronic devices, which may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
The electronic device 110 includes a camera, and the processor 1110 is configured to obtain a parameter value of a preset image parameter according to image data captured by the camera; obtaining a parameter value of a preset induction parameter according to the parameter value of the preset image parameter and a preset corresponding relation; the preset corresponding relation comprises a first corresponding relation between the parameter value of the preset image parameter and the parameter value of the preset induction parameter.
In the embodiment of the invention, the parameter value of the preset image parameter is obtained according to the image data shot by the camera; obtaining a parameter value of a preset induction parameter according to the parameter value of the preset image parameter and a preset corresponding relation; the preset corresponding relation comprises a first corresponding relation between a parameter value of the preset image parameter and a parameter value of the preset induction parameter; the camera that can realize utilizing electronic equipment obtains the ambient brightness value of current environment, the purpose of the parameter values such as distance value between shooting main part and the camera, do not need additionally to increase special sensor, peripheral device and other FPC relevant material, and the display screen apron need not open extra optical hole, only use the camera trompil, the realization of this scheme requires lowly to structure assembly tolerance, the consumption of function realization process is far less than the consumption that the camera was shot or was recorded a video, the realization cost and the degree of difficulty of scheme have been reduced, fine solution electronic equipment among the prior art realizes the photoinduction, response functions such as distance response exist with high costs, the big problem of the degree of difficulty.
Optionally, the preset image parameter includes image brightness, and the preset sensing parameter includes current ambient brightness of the camera; and/or the preset image parameters comprise image definition, and the preset induction parameters comprise the distance between the main body shot by the camera and the camera.
Optionally, the processor 1110 is further configured to obtain each group of image data captured by the camera under the condition that the preset sensing parameter takes different values before obtaining the parameter value of the preset sensing parameter according to the parameter value of the preset image parameter and the preset corresponding relationship; obtaining values of preset image parameters corresponding to the values of the preset induction parameters according to the groups of image data; and obtaining the first corresponding relation according to each value taken by the preset induction parameters and the corresponding value of the preset image parameter.
Optionally, the processor 1110 is specifically configured to obtain a parameter value of a preset image parameter according to image data sensed by a preset sensing area in the camera; wherein the center of the preset sensing area is aligned with the center of a lens of the camera.
Optionally, the processor 1110 is specifically configured to, under the condition that the camera is in a preset on state, obtain image data sensed by a preset sensing area in the camera from a data code stream of a preview interface; and obtaining the parameter value of a preset image parameter according to the image data.
Optionally, the processor 1110 is specifically configured to enable a preset sensing area in the camera when the camera is in a closed state; acquiring image data sensed by the preset sensing area; and obtaining the parameter value of a preset image parameter according to the image data.
It should be understood that, in the embodiment of the present invention, the rf unit 111 may be used for receiving and sending signals during a message transmission or call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 1110; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 111 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 111 may also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 112, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 113 may convert audio data received by the radio frequency unit 111 or the network module 112 or stored in the memory 119 into an audio signal and output as sound. Also, the audio output unit 113 may also provide audio output related to a specific function performed by the electronic device 110 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 113 includes a speaker, a buzzer, a receiver, and the like.
The input unit 114 is used to receive an audio or video signal. The input Unit 114 may include a Graphics Processing Unit (GPU) 1141 and a microphone 1142, and the Graphics Processing Unit 1141 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 116. The image frames processed by the graphic processor 1141 may be stored in the memory 119 (or other storage medium) or transmitted via the radio frequency unit 111 or the network module 112. The microphone 1142 may receive sound and may be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 111 in case of the phone call mode.
The electronic device 110 also includes at least one sensor 115, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 1161 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 1161 and/or the backlight when the electronic device 110 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 115 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 116 is used to display information input by the user or information provided to the user. The Display unit 116 may include a Display panel 1161, and the Display panel 1161 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 117 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 117 includes a touch panel 1171 and other input devices 1172. Touch panel 1171, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., user operations on or near touch panel 1171 using a finger, stylus, or any suitable object or accessory). Touch panel 1171 can include two portions, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 1110, and receives and executes commands sent from the processor 1110. In addition, the touch panel 1171 can be implemented by various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1171, the user input unit 117 may also include other input devices 1172. Specifically, the other input devices 1172 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a track ball, a mouse, and a joystick, which are not described herein.
Further, touch panel 1171 can be overlaid on display panel 1161, and when touch panel 1171 detects a touch operation thereon or nearby, the touch operation can be transmitted to processor 1110 to determine the type of touch event, and then processor 1110 can provide a corresponding visual output on display panel 1161 according to the type of touch event. Although in fig. 11, the touch panel 1171 and the display panel 1161 are two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 1171 and the display panel 1161 may be integrated to implement the input and output functions of the electronic device, and is not limited herein.
The interface unit 118 is an interface for connecting an external device to the electronic apparatus 110. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 118 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic apparatus 110 or may be used to transmit data between the electronic apparatus 110 and the external device.
The memory 119 may be used to store software programs as well as various data. The memory 119 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 119 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 1110 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 119 and calling data stored in the memory 119, thereby performing overall monitoring of the electronic device. Processor 1110 may include one or more processing units; preferably, the processor 1110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 1110.
The electronic device 110 may further include a power supply 1111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 1111 may be logically connected to the processor 1110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
In addition, the electronic device 110 includes some functional modules that are not shown, and are not described in detail herein.
Preferably, an embodiment of the present invention further provides an electronic device, which includes a processor 1110, a memory 119, and a computer program stored in the memory 119 and capable of running on the processor 1110, where the computer program, when executed by the processor 1110, implements each process of the above-mentioned parameter value obtaining method embodiment, and can achieve the same technical effect, and details are not repeated here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned parameter value obtaining method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention 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 an electronic device (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 invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (13)
1. The method for acquiring the parameter value is applied to electronic equipment, the electronic equipment comprises a camera, and the method for acquiring the parameter value comprises the following steps:
obtaining parameter values of preset image parameters according to the image data shot by the camera;
obtaining a parameter value of a preset induction parameter according to the parameter value of the preset image parameter and a preset corresponding relation;
the preset corresponding relation comprises a first corresponding relation between the parameter value of the preset image parameter and the parameter value of the preset induction parameter.
2. The acquisition method according to claim 1,
the preset image parameters comprise image brightness, and the preset induction parameters comprise the current environment brightness of the camera; and/or the presence of a gas in the gas,
the preset image parameters comprise image definition, and the preset induction parameters comprise the distance between a main body shot by the camera and the camera.
3. The obtaining method according to claim 1 or 2, wherein before obtaining the parameter value of the preset sensing parameter according to the parameter value of the preset image parameter and the preset corresponding relationship, the obtaining method further comprises:
acquiring each group of image data shot by the camera under the condition that the preset induction parameters take different values;
obtaining values of preset image parameters corresponding to the values of the preset induction parameters according to the groups of image data;
and obtaining the first corresponding relation according to each value taken by the preset induction parameters and the corresponding value of the preset image parameter.
4. The method according to claim 1, wherein obtaining the parameter value of the preset image parameter according to the image data captured by the camera comprises:
obtaining parameter values of preset image parameters according to image data sensed by a preset sensing area in the camera;
wherein the center of the preset sensing area is aligned with the center of a lens of the camera.
5. The method according to claim 4, wherein obtaining the parameter value of the preset image parameter according to the image data sensed by the preset sensing area in the camera comprises:
under the condition that the camera is in a preset opening state, acquiring image data sensed by a preset sensing area in the camera from a data code stream of a preview interface;
and obtaining the parameter value of a preset image parameter according to the image data.
6. The method according to claim 4 or 5, wherein obtaining the parameter value of the preset image parameter according to the image data sensed by the preset sensing area in the camera comprises:
starting a preset sensing area in the camera under the condition that the camera is in a closed state;
acquiring image data sensed by the preset sensing area;
and obtaining the parameter value of a preset image parameter according to the image data.
7. An electronic device, the electronic device comprising a camera, the electronic device further comprising:
the first processing module is used for obtaining parameter values of preset image parameters according to the image data shot by the camera;
the second processing module is used for obtaining the parameter value of the preset induction parameter according to the parameter value of the preset image parameter and the preset corresponding relation;
the preset corresponding relation comprises a first corresponding relation between the parameter value of the preset image parameter and the parameter value of the preset induction parameter.
8. The electronic device of claim 7,
the preset image parameters comprise image brightness, and the preset induction parameters comprise the current environment brightness of the camera; and/or the presence of a gas in the gas,
the preset image parameters comprise image definition, and the preset induction parameters comprise the distance between a main body shot by the camera and the camera.
9. The electronic device of claim 7 or 8, further comprising:
the first acquisition module is used for acquiring each group of image data shot by the camera under the condition that the preset induction parameters take different values before the parameter values of the preset induction parameters are obtained according to the parameter values of the preset image parameters and the preset corresponding relation;
the third processing module is used for obtaining values of the preset image parameters corresponding to the values of the preset induction parameters according to the groups of image data;
and the fourth processing module is used for obtaining the first corresponding relation according to each value taken by the preset induction parameters and the corresponding value of the preset image parameter.
10. The electronic device of claim 7, wherein the first processing module comprises:
the first processing submodule is used for obtaining a parameter value of a preset image parameter according to image data sensed by a preset sensing area in the camera;
wherein the center of the preset sensing area is aligned with the center of a lens of the camera.
11. The electronic device of claim 10, wherein the first processing submodule comprises:
the first acquisition unit is used for acquiring image data sensed by a preset sensing area in the camera from a data code stream of a preview interface under the condition that the camera is in a preset opening state;
and the first processing unit is used for obtaining the parameter value of the preset image parameter according to the image data.
12. The electronic device of claim 10 or 11, wherein the first processing submodule comprises:
the first enabling unit is used for enabling a preset sensing area in the camera under the condition that the camera is in a closed state;
the second acquisition unit is used for acquiring the image data sensed by the preset sensing area;
and the second processing unit is used for obtaining the parameter value of the preset image parameter according to the image data.
13. An electronic device, comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method for obtaining a parameter value according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911101566.2A CN110830717B (en) | 2019-11-12 | 2019-11-12 | Parameter value acquisition method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911101566.2A CN110830717B (en) | 2019-11-12 | 2019-11-12 | Parameter value acquisition method and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110830717A true CN110830717A (en) | 2020-02-21 |
CN110830717B CN110830717B (en) | 2021-06-25 |
Family
ID=69554338
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911101566.2A Active CN110830717B (en) | 2019-11-12 | 2019-11-12 | Parameter value acquisition method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110830717B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111918047A (en) * | 2020-07-27 | 2020-11-10 | Oppo广东移动通信有限公司 | Photographing control method and device, storage medium and electronic equipment |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104883509A (en) * | 2015-04-30 | 2015-09-02 | 广东欧珀移动通信有限公司 | Method of shooting through flash lamp, and terminal |
CN107071272A (en) * | 2017-02-17 | 2017-08-18 | 奇酷互联网络科技(深圳)有限公司 | Control method, device and the terminal of camera light compensating lamp brightness |
CN108270966A (en) * | 2017-12-27 | 2018-07-10 | 努比亚技术有限公司 | A kind of method, mobile terminal and storage medium for adjusting light filling brightness |
CN108924414A (en) * | 2018-06-27 | 2018-11-30 | 维沃移动通信有限公司 | A kind of image pickup method and terminal device |
CN109034265A (en) * | 2018-08-16 | 2018-12-18 | 湖北亿咖通科技有限公司 | Wiper self-starting device and method |
CN109495689A (en) * | 2018-12-29 | 2019-03-19 | 北京旷视科技有限公司 | A kind of image pickup method, device, electronic equipment and storage medium |
CN110113528A (en) * | 2019-04-26 | 2019-08-09 | 维沃移动通信有限公司 | A kind of parameter acquiring method and terminal device |
CN110176039A (en) * | 2019-04-23 | 2019-08-27 | 苏宁易购集团股份有限公司 | A kind of video camera adjusting process and system for recognition of face |
CN110365911A (en) * | 2019-08-14 | 2019-10-22 | 珠海格力电器股份有限公司 | Method for shooting photo by mobile terminal, mobile terminal and server |
-
2019
- 2019-11-12 CN CN201911101566.2A patent/CN110830717B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104883509A (en) * | 2015-04-30 | 2015-09-02 | 广东欧珀移动通信有限公司 | Method of shooting through flash lamp, and terminal |
CN107071272A (en) * | 2017-02-17 | 2017-08-18 | 奇酷互联网络科技(深圳)有限公司 | Control method, device and the terminal of camera light compensating lamp brightness |
CN108270966A (en) * | 2017-12-27 | 2018-07-10 | 努比亚技术有限公司 | A kind of method, mobile terminal and storage medium for adjusting light filling brightness |
CN108924414A (en) * | 2018-06-27 | 2018-11-30 | 维沃移动通信有限公司 | A kind of image pickup method and terminal device |
CN109034265A (en) * | 2018-08-16 | 2018-12-18 | 湖北亿咖通科技有限公司 | Wiper self-starting device and method |
CN109495689A (en) * | 2018-12-29 | 2019-03-19 | 北京旷视科技有限公司 | A kind of image pickup method, device, electronic equipment and storage medium |
CN110176039A (en) * | 2019-04-23 | 2019-08-27 | 苏宁易购集团股份有限公司 | A kind of video camera adjusting process and system for recognition of face |
CN110113528A (en) * | 2019-04-26 | 2019-08-09 | 维沃移动通信有限公司 | A kind of parameter acquiring method and terminal device |
CN110365911A (en) * | 2019-08-14 | 2019-10-22 | 珠海格力电器股份有限公司 | Method for shooting photo by mobile terminal, mobile terminal and server |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111918047A (en) * | 2020-07-27 | 2020-11-10 | Oppo广东移动通信有限公司 | Photographing control method and device, storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN110830717B (en) | 2021-06-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107093418B (en) | Screen display method, computer equipment and storage medium | |
CN110969981B (en) | Screen display parameter adjusting method and electronic equipment | |
CN108833753B (en) | Image acquisition and application method, terminal and computer readable storage medium | |
CN110769151B (en) | Image processing method, image processing apparatus, electronic device, and medium | |
CN108111754B (en) | Method for determining image acquisition mode and mobile terminal | |
CN110557575B (en) | Method for eliminating glare and electronic equipment | |
CN109688322B (en) | Method and device for generating high dynamic range image and mobile terminal | |
CN111045279B (en) | Flash lamp light supplementing method and electronic equipment | |
CN111246121B (en) | Shooting light supplement method, electronic equipment and medium | |
CN110445984B (en) | Shooting prompting method and electronic equipment | |
CN108924414B (en) | Shooting method and terminal equipment | |
CN111491072B (en) | Pixel clock frequency adjusting method and device and electronic equipment | |
CN107995437B (en) | Photo shooting and lighting method and mobile terminal | |
CN108040209B (en) | Shooting method and mobile terminal | |
CN108040240B (en) | White balance adjustment method and device and mobile terminal | |
CN110290331B (en) | Screen control method and terminal | |
CN112507256A (en) | Background adjusting method, terminal and computer readable storage medium | |
CN111443765A (en) | Electronic equipment and screen display method | |
CN110636225B (en) | Photographing method and electronic equipment | |
CN111246111A (en) | Photographing method, electronic device, and medium | |
CN109639981B (en) | Image shooting method and mobile terminal | |
CN110830717B (en) | Parameter value acquisition method and electronic equipment | |
CN111475238B (en) | Page processing method and device, electronic equipment and storage medium | |
CN111402157B (en) | Image processing method and electronic equipment | |
CN110661972B (en) | Image processing method, image processing apparatus, electronic device, and 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 |