CN110248110B - Shooting parameter setting method, setting device, terminal equipment and readable storage medium - Google Patents

Shooting parameter setting method, setting device, terminal equipment and readable storage medium Download PDF

Info

Publication number
CN110248110B
CN110248110B CN201910573334.0A CN201910573334A CN110248110B CN 110248110 B CN110248110 B CN 110248110B CN 201910573334 A CN201910573334 A CN 201910573334A CN 110248110 B CN110248110 B CN 110248110B
Authority
CN
China
Prior art keywords
light source
flicker
frequency
camera
exposure time
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
CN201910573334.0A
Other languages
Chinese (zh)
Other versions
CN110248110A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910573334.0A priority Critical patent/CN110248110B/en
Publication of CN110248110A publication Critical patent/CN110248110A/en
Application granted granted Critical
Publication of CN110248110B publication Critical patent/CN110248110B/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/70Circuitry for compensating brightness variation in the scene
    • H04N23/745Detection of flicker frequency or suppression of flicker wherein the flicker is caused by illumination, e.g. due to fluorescent tube illumination or pulsed LED illumination

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

The application provides a shooting parameter setting method, a shooting parameter setting device, terminal equipment and a readable storage medium. The method comprises the following steps: when the flicker of a preview picture of the camera is detected, calculating the flicker frequency of the preview picture; calculating the flicker frequency of the light source based on the flicker frequency of the preview picture and the charging signal frequency of the location of the camera; if the exposure time of the camera is not the integral multiple of the flicker period of the light source, setting the exposure time to be the integral multiple of the flicker period of the light source, wherein the flicker period is the reciprocal of the flicker frequency of the light source. The technical problem that flicker phenomenon can not be eliminated for special light sources in the prior art can be solved.

Description

Shooting parameter setting method, setting device, terminal equipment and readable storage medium
Technical Field
The present application belongs to the field of computer technologies, and in particular, to a shooting parameter setting method, a shooting parameter setting apparatus, a terminal device, and a computer-readable storage medium.
Background
In order to avoid the phenomenon of flicker in the preview picture of the camera, the exposure time of the camera needs to be set to be integral multiple of the flicker period of the light source.
Currently, common methods for setting the exposure time are: the method comprises the steps of obtaining the location of a camera through geographical position positioning, determining 2 times of the charging signal frequency of the location of the camera as the flicker frequency of a light source according to the location of the camera, and adjusting the exposure time of the camera to be integral multiple of the determined flicker period of the light source (the reciprocal of the determined flicker frequency of the light source). For example, since the frequency of the chinese charging signal is 50Hz, and the flashing frequency of the light source is usually 2 times of the frequency of the charging signal, the flashing frequency of the light source located in china is considered to be 100Hz, and the flashing period of the light source is 10ms, the exposure time of the camera can be adjusted to N × 10ms, so as to eliminate the flicker phenomenon in the preview screen.
However, the blinking frequency of different types of light sources is not necessarily 2 times the charging signal frequency, and some types of light sources have the blinking frequency 3 times or 4 times the charging signal frequency, so that in this case, the exposure time is adjusted by the conventional method according to the geographical location, which may result in that the flicker phenomenon in the preview screen cannot be eliminated.
Disclosure of Invention
In view of this, the present application provides a shooting parameter setting method, a shooting parameter setting apparatus, a terminal device, and a computer-readable storage medium, which can solve the technical problem that the flicker phenomenon cannot be eliminated for a special type of light source in the existing technical solution to a certain extent.
The first aspect of the present application provides a shooting parameter setting method, including:
when the flicker of a preview picture of the camera is detected, calculating the flicker frequency of the preview picture;
acquiring the frequency of a charging signal at the location of the camera;
calculating the flicker frequency of the light source based on the flicker frequency of the preview picture, the charging signal frequency and a light source flicker frequency calculation formula, wherein the light source flicker frequency calculation formula is as follows:
Figure BDA0002111426700000021
wherein f islightIs the flicker frequency of the light source, fchargeFor the above charging signal frequency, fpreviewRound (x) is the rounding operation for x, which is the flicker frequency of the camera preview picture;
if the exposure time of the camera is not an integral multiple of the flicker period of the light source, the exposure time of the camera is set to be an integral multiple of the flicker period of the light source, wherein the flicker period of the light source is the reciprocal of the flicker frequency of the light source.
A second aspect of the embodiments of the present application provides a shooting parameter setting apparatus, including:
the preview image flicker calculation module is used for calculating the flicker frequency of the preview image when the flicker of the preview image of the camera is detected;
a charging frequency acquisition module for acquiring the charging signal frequency of the location of the camera;
a light source flicker frequency calculation module, configured to calculate a flicker frequency of the light source based on the flicker frequency of the preview picture, the charging signal frequency, and a light source flicker frequency calculation formula, where the light source flicker frequency calculation formula is:
Figure BDA0002111426700000022
wherein f islightIs the flicker frequency of the light source, fchargeIs that the above-mentionedFrequency of charging signal, fpreviewRound (x) is the rounding operation for x, which is the flicker frequency of the camera preview picture;
and an exposure time setting module configured to set the exposure time of the camera to be an integer multiple of a flicker period of the light source if the exposure time of the camera is not an integer multiple of the flicker period of the light source, where the flicker period of the light source is a reciprocal of a flicker frequency of the light source.
A third aspect of the present application provides a terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to the first aspect when executing the computer program.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect as described above.
A fifth aspect of the present application provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the method of the first aspect as described above.
From the above, the application provides a shooting parameter setting method, which comprises the following steps: first, when it is detected that a preview screen of a camera flickers, a flicker frequency of the preview screen is calculated (normally, the flicker frequency of the preview screen is approximately coincident with the flicker frequency of a light source); secondly, acquiring the charging signal frequency of the location of the camera, and calculating the flicker frequency of the light source based on the flicker frequency of the preview picture, the charging signal frequency and a light source flicker frequency calculation formula, wherein the light source flicker frequency calculation formula is as follows:
Figure BDA0002111426700000031
wherein f islightIs the flicker frequency of the light source, fchargeFor the above charging signal frequency, fpreviewIs the above-mentioned phaseThe flicker frequency of the preview image, round (x), is obtained by rounding x, that is, the accurate flicker frequency of the light source is determined for the preview image flicker frequency similar to the light source flicker frequency, and in general, the flicker frequency of the light source is an integer multiple of the charging signal frequency, so the accurate flicker frequency of the light source can be determined based on the light source flicker frequency calculation formula; finally, if the exposure time of the camera is not an integer multiple of the flicker period of the light source, setting the exposure time of the camera to be an integer multiple of the flicker period of the light source, wherein the flicker period of the light source is the inverse of the flicker frequency of the light source, that is, if the current exposure time is not an integer multiple of the flicker period of the light source, setting the exposure time to be an integer multiple of the estimated flicker period of the light source (that is, the inverse of the flicker frequency estimated according to the light source flicker calculation formula).
Therefore, the estimation of the flicker frequency of the light source can be suitable for more types of light sources, not only is the flicker frequency 2 times that of the charging signal frequency, but also the flicker frequency 3 times, 4 times and other integral multiples of the charging signal frequency are suitable for the light source, and therefore the technical problem that the flicker phenomenon cannot be eliminated for the light source of a special type in the existing technical scheme can be solved to a certain extent.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed for the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flow chart illustrating an implementation of a shooting parameter setting method according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation of another shooting parameter setting method provided in the second embodiment of the present application;
fig. 3 is a schematic structural diagram of a shooting parameter setting apparatus according to a third embodiment of the present application;
fig. 4 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
The shooting parameter setting method provided by the embodiment of the application can be applied to terminal equipment, and the terminal equipment includes but is not limited to: computing devices such as smart phones, tablet computers, desktop computers, intelligent wearable devices, and the like.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
In addition, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not intended to indicate or imply relative importance.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Example one
Referring to fig. 1, a method for setting shooting parameters according to a first embodiment of the present application is described below, where the method includes:
in step S101, when it is detected that a preview screen of a camera flickers, a flicker frequency of the preview screen is calculated;
if the steps of the embodiment of the present application are applied to a terminal device (for example, a mobile phone), in step S101, the terminal device may continuously detect whether a preview screen of the camera flickers (for example, whether the preview screen flickers may be determined by detecting whether the brightness difference between two adjacent frames of preview screens is large), and once the flickers are detected, the terminal device calculates the flickering frequency of the preview screen. At present, there are many methods for calculating the flicker frequency of the preview image in the prior art, and therefore, the method for calculating the flicker frequency of the preview image is not described in detail in the present application.
In general, since the flicker frequency of the camera preview screen is approximately equal to the flicker frequency of the light source, the present application estimates the accurate flicker frequency of the light source by using this characteristic of the flicker frequency of the preview screen.
In step S102, a charging signal frequency at a location of the camera is obtained;
in the embodiment of the present application, the location of the camera may be located by using a geographic location positioning method, for example, if the camera is located in china, the frequency of the charging signal at the location of the camera may be determined to be 50Hz, and if the camera is located in the united states, the frequency of the charging signal at the location of the camera may be determined to be 60 Hz.
In addition, if the steps of the embodiment of the present application are applied to a terminal device and the camera is built in the terminal device, the charging signal frequency at the location of the camera may be obtained in the following manner:
mode A: and reading the charging signal frequency of the location of the camera from a preset storage device, wherein the charging signal frequency of the location of the camera is the charging signal frequency which is acquired by the terminal device and is stored in the preset storage device in advance when the terminal device is connected with a charger.
The mode a may specifically be: when the terminal device is connected to the charger, the terminal device may calculate a charging signal frequency at a location of the terminal device according to the pulse dc signal output by the rectifying circuit in the charger, and store the calculated charging signal frequency in the preset storage device, so as to directly read the charging signal frequency from the preset storage device when the step S102 is executed.
Alternatively, the mode a may specifically be: when the terminal device is connected to the charger, the terminal device may receive a local charging signal frequency sent by the charger (at this time, a charging signal frequency determining module and a charging signal frequency sending module need to be built in the charger), and after receiving the charging signal frequency sent by the charger, the terminal device stores the charging signal frequency into the preset storage device, so that when the step S102 is executed, the terminal device directly reads the charging signal frequency from the preset storage device.
It should be understood by those skilled in the art that the present application does not specifically limit the "charging signal frequency acquisition mode at the location of the camera". All the specific ways of acquiring the charging signal frequency of the location of the camera are within the protection scope of the present application.
In step S103, a blinking frequency of the light source is calculated based on the blinking frequency of the preview screen, the charging signal frequency, and a light source blinking frequency calculation formula:
Figure BDA0002111426700000061
wherein f islightIs the flicker frequency of the light source, fchargeFor the above charging signal frequency, fpreviewRound (x) is the rounding operation for x, which is the flicker frequency of the camera preview picture;
in general, the flicker frequency of the light source is N times of the charging signal frequency, and therefore, the flicker frequency of the light source can be estimated based on the above light source flicker frequency calculation formula proposed in the present application. For example, if the current charging signal frequency is 50Hz and the blinking frequency of the preview screen calculated in step S101 is 205Hz, the blinking frequency of the light source is normally an integer multiple of the charging signal frequency, and therefore, it can be considered that the blinking frequency of the light source should be 200Hz at this time.
In step S104, if the exposure time of the camera is not an integer multiple of the flicker period of the light source, setting the exposure time of the camera to be an integer multiple of the flicker period of the light source, the flicker period of the light source being the reciprocal of the flicker frequency of the light source;
in step S104, the exposure time is set to be an integral multiple of the light source flickering period, so as to eliminate the flicker phenomenon of the preview screen.
Furthermore, those skilled in the art will appreciate that in some cases, even if the camera exposure time is an integral multiple of the light source flickering period estimated in step S103, the preview image may still have flicker phenomenon. This may occur for several reasons: reason one, some types of light sources, whose flicker frequency is a fixed value, are not integer multiples of the charging signal frequency; the second reason is that the flicker frequency of the preview screen calculated in step S101 is greatly different from the actual flicker frequency of the light source. If the above two reasons are met, flickers still exist even if the exposure time is an integral multiple of the flicker frequency of the light source estimated in step S102.
Therefore, when the exposure time of the camera is already an integer multiple of the estimated flicker period of the light source, but the flicker phenomenon still exists, the description of the second embodiment may be specifically referred to how to further eliminate the flicker phenomenon of the preview image.
Therefore, the estimation of the flicker frequency of the light source in the embodiment of the application can be suitable for more types of light sources, not only for the light source with the flicker frequency 2 times of the charging signal frequency, but also for the light sources with the flicker frequency 3 times, 4 times or other integral multiples of the charging signal frequency, so that the application can solve the technical problem that the flicker phenomenon cannot be eliminated for the light source with a special type in the existing technical scheme to a certain extent. Those skilled in the art can understand that the technical solution provided in the first embodiment of the present application can adapt to more types of light sources and has a greater probability of eliminating flicker compared with the conventional solution of eliminating flicker.
Example two
Another shooting parameter setting method provided in the second embodiment of the present application is described below with reference to fig. 2, where the shooting parameter setting method includes:
in step S201, when it is detected that a preview screen of a camera flickers, a flicker frequency of the preview screen is calculated;
in step S202, a charging signal frequency at the location of the camera is obtained;
in step S203, a blinking frequency of the light source is calculated based on the blinking frequency of the preview screen, the charging signal frequency, and a light source blinking frequency calculation formula:
Figure BDA0002111426700000081
wherein f islightIs the flicker frequency of the light source, fchargeFor the above charging signal frequency, fpreviewRound (x) is the rounding operation for x, which is the flicker frequency of the camera preview picture;
in step S204, if the exposure time of the camera is not an integer multiple of the flicker period of the light source, setting the exposure time of the camera to be an integer multiple of the flicker period of the light source, where the flicker period of the light source is the reciprocal of the flicker frequency of the light source;
the above-mentioned specific implementation of steps S201 to S204 is completely the same as the specific implementation of steps S101 to S104 in the first embodiment, and can be referred to the description of the first embodiment, which is not repeated herein.
In step S205, it is detected whether or not a flicker occurs in a preview screen of the camera;
in step S206, if the preview image of the camera flickers, selecting a flicker frequency from a preset table, and adjusting the exposure time to be an integral multiple of the selected flicker frequency of the light source, wherein the preset table stores commonly used flicker frequencies of each light source in advance;
in the first embodiment of the present application, it has been described that even if the camera exposure time is an integer multiple of the light source flickering period estimated in the above step S203, the preview image may still have flicker phenomenon. Therefore, after the step S204, whether the flicker phenomenon exists in the preview screen may be continuously detected, and if so, the flicker phenomenon is eliminated based on the preset table.
In the second embodiment of the present application, the preset table stores commonly used light source flicker frequencies, and if it is detected that the preview picture still has flicker phenomenon in the step S205, a light source flicker frequency may be selected from the preset table, and the exposure time is adjusted to be an integral multiple of the reciprocal of the light source flicker frequency.
Furthermore, it is easily understood by those skilled in the art that after the above step S203, it is first detected whether the exposure time of the camera is an integral multiple of the flicker frequency of the light source estimated in the step S203, if not, step S204 is executed, and if so, step S206 and the following steps may be executed.
Since the preview screen flicker frequency calculated in step S201 is approximately equal to the actual flicker frequency of the light source, in step S206, the light source flicker frequency in the selected preset table may be the light source flicker frequency closest to (i.e. the absolute value of the difference between) the preview screen flicker frequency calculated in step S201.
In step S207, detecting whether the preview screen of the camera flickers again, if so, determining whether all light source flicking frequencies in the preset table have been traversed, if not, executing step S208, and if so, executing step S209;
in step S208, removing the selected light source flicker frequency, selecting a light source flicker frequency again from the preset table, adjusting the exposure time to be an integer multiple of the selected light source flicker frequency, and returning to step S207;
in the second embodiment of the present invention, after the step S206, whether the preview screen of the camera flickers is detected again, and if there still flickers, a light source flicking frequency that has not been selected before is selected again from the preset table, and the step S207 is executed again.
In addition, it should be understood by those skilled in the art that in the process of executing the above steps, if it is detected that the preview screen of the camera no longer flickers, the execution of the steps in the embodiment of the present application may be stopped.
In step S209, a prompt message for prompting the user to input the identification information of the light source is output;
in step S210, searching for a flicker frequency of the light source according to the identification information;
in step S211, setting an exposure time of the camera to be an integral multiple of the searched reciprocal of the flicker frequency;
if the flicker phenomenon still exists in the preview picture of the camera after traversing each light source flicker frequency of the preset table, the user may be prompted to input identification information (for example, brand, model, manufacturer, and/or date of delivery, etc.) of the current light source, then, the flicker frequency of the light source may be searched (for example, searched on the internet) according to the identification information of the light source, and the exposure time is set to be an integral multiple of the reciprocal of the searched flicker frequency, so as to eliminate the flicker phenomenon in the preview picture.
Compared with the first embodiment, the technical scheme provided by the second embodiment of the application has
Those skilled in the art should understand that the technical solution provided in the second embodiment of the present application has a wider light source adaptation range than that in the first embodiment, and the probability of eliminating the flicker phenomenon in the preview picture is greater than that in the first embodiment.
It should be understood that, the size of the serial number of each step in the foregoing method embodiments does not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
EXAMPLE III
A third embodiment of the present application provides a shooting parameter setting apparatus, which, for convenience of description, only shows the relevant parts of the present application, and as shown in fig. 3, the shooting parameter setting apparatus 300 includes,
a preview screen flicker calculation module 301, configured to calculate a flicker frequency of a preview screen of a camera when it is detected that the preview screen flickers;
a charging frequency obtaining module 302, configured to obtain a charging signal frequency at a location where the camera is located;
a light source flicker frequency calculating module 303, configured to calculate a flicker frequency of the light source based on the flicker frequency of the preview image, the charging signal frequency, and a light source flicker frequency calculation formula, where the light source flicker frequency calculation formula is:
Figure BDA0002111426700000101
wherein f islightIs the flicker frequency of the light source, fchargeFor the above charging signal frequency, fpreviewRound (x) is the rounding operation for x, which is the flicker frequency of the camera preview picture;
an exposure time setting module 304, configured to set the exposure time of the camera to be an integer multiple of a flicker period of the light source if the exposure time of the camera is not an integer multiple of the flicker period of the light source, where the flicker period of the light source is an inverse number of a flicker frequency of the light source.
Optionally, the shooting parameter setting apparatus 300 further includes:
a flicker detection module for detecting whether a preview screen of the camera flickers after the step of setting the exposure time of the camera to be an integral multiple of the flicker period of the light source;
a preset table selection module, configured to select a light source flicker frequency from a preset table if the flicker detection module detects that a preview image of the camera flickers, and adjust an exposure time to be an integral multiple of a reciprocal of the selected light source flicker frequency, where the preset table stores commonly used light source flicker frequencies in advance;
and the preset table re-selection module is used for detecting whether the preview picture of the camera flickers again, judging whether all the light source flickering frequencies in the preset table are traversed or not if the preview picture of the camera flickers again, removing the selected light source flickering frequencies if the preset table is not traversed, re-selecting one light source flickering frequency in the preset table, and adjusting the exposure time to be integral multiple of the reciprocal of the selected light source flickering frequency.
Optionally, the preset table selecting module is specifically configured to:
if the flicker detection module detects that the preview picture of the camera flickers, selecting a light source flicker frequency with the minimum absolute value of the flicker frequency difference value of the preview picture in the preset table, and adjusting the exposure time to be the integral multiple of the reciprocal of the selected light source flicker frequency
Optionally, the shooting parameter setting apparatus 300 further includes:
the prompt information output module is used for outputting prompt information after judging that all the light source flicker frequencies in the preset table are traversed, wherein the prompt information is used for prompting a user to input identification information of the light sources;
the searching module is used for searching the flicker frequency of the light source according to the identification information of the light source;
and the searching and setting module is used for setting the exposure time of the camera to be integral multiple of the searched reciprocal of the flicker frequency.
Optionally, the shooting parameter setting apparatus 300 is applied to a terminal device, and the camera is built in the terminal device;
accordingly, the charging frequency obtaining module 302 is specifically configured to:
and reading the charging signal frequency of the location of the camera from a preset storage device, wherein the charging signal frequency of the location of the camera is the charging signal frequency which is obtained by the terminal device and stored in the preset storage device in advance when the terminal device is connected with a charger.
It should be noted that, because the content of information interaction, execution process, and the like between the units of the apparatus is based on the same concept as that of the method embodiment of the present invention, specific functions and technical effects thereof may be referred to specifically in the method embodiment section, and are not described herein again.
Example four
Fig. 4 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present application. As shown in fig. 4, the terminal device 400 of this embodiment includes: a processor 401, a memory 402 and a computer program 403 stored in said memory 402 and executable on said processor 401. The processor 401, when executing the computer program 403, implements the steps in the various method embodiments described above, such as the steps S101 to S104 shown in fig. 1. Alternatively, the processor 401, when executing the computer program 403, implements the functions of each module/unit in the above-mentioned device embodiments, for example, the functions of the modules 301 to 304 shown in fig. 3.
Illustratively, the computer program 403 may be divided into one or more modules/units, which are stored in the memory 402 and executed by the processor 401 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 403 in the terminal device 400. For example, the computer program 403 may be divided into a preview screen flicker calculation module, a charging frequency acquisition module, a light source flicker frequency calculation module, and an exposure time setting module, and the functions of the modules are as follows:
when the flicker of a preview picture of the camera is detected, calculating the flicker frequency of the preview picture;
acquiring the frequency of a charging signal at the location of the camera;
calculating the flicker frequency of the light source based on the flicker frequency of the preview picture, the charging signal frequency and a light source flicker frequency calculation formula, wherein the light source flicker frequency calculation formula is as follows:
Figure BDA0002111426700000121
wherein f islightIs the flicker frequency of the light source, fchargeFor the above charging signal frequency, fpreviewRound (x) is the rounding operation for x, which is the flicker frequency of the camera preview picture;
if the exposure time of the camera is not an integral multiple of the flicker period of the light source, the exposure time of the camera is set to be an integral multiple of the flicker period of the light source, wherein the flicker period of the light source is the reciprocal of the flicker frequency of the light source.
The terminal device may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that fig. 4 is merely an example of a terminal device 400 and does not constitute a limitation of terminal device 400 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input output devices, network access devices, buses, etc.
The Processor 401 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 402 may be an internal storage unit of the terminal device 400, such as a hard disk or a memory of the terminal device 400. The memory 402 may also be an external storage device of the terminal device 400, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 400. Further, the memory 402 may include both an internal storage unit and an external storage device of the terminal device 400. The memory 402 is used to store the computer programs and other programs and data required by the terminal device. The memory 402 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the above modules or units is only one logical function division, and there may be other division manners in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units described above, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above method embodiments may be implemented by a computer program, which may be stored in a computer readable storage medium and executed by a processor, so as to implement the steps of the above method embodiments. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium described above may include content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media that does not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (9)

1. A shooting parameter setting method is applied to a terminal device, a camera is built in the terminal device, and the shooting parameter setting method comprises the following steps:
when the fact that a preview picture of a camera flickers is detected, calculating the flickering frequency of the preview picture;
acquiring the frequency of a charging signal at the location of the camera, comprising: reading the charging signal frequency of the location of the camera from a preset storage device, wherein the charging signal frequency of the location of the camera is a pulse direct current signal output by a rectifying circuit in a charger when the terminal device is connected with the charger, and the terminal device calculates and acquires the charging signal frequency of the location of the terminal device according to the pulse direct current signal output by the rectifying circuit in the charger and stores the charging signal frequency into the preset storage device in advance;
calculating the flicker frequency of the light source based on the flicker frequency of the preview picture, the charging signal frequency and a light source flicker frequency calculation formula, wherein the light source flicker frequency calculation formula is as follows:
Figure FDA0002779427920000011
wherein f islightIs the flicker frequency of the light source, fchargeFor the charging signal frequency, fpreviewRound (x) is to round x for the flicker frequency of the camera preview picture;
and if the exposure time of the camera is not the integral multiple of the flicker period of the light source, setting the exposure time of the camera to be the integral multiple of the flicker period of the light source, wherein the flicker period of the light source is the reciprocal of the flicker frequency of the light source.
2. The shooting parameter setting method according to claim 1, further comprising, after the step of setting the exposure time of the camera to an integer multiple of a flicker period of the light source:
detecting whether a preview picture of the camera flickers;
if the preview picture of the camera flickers, the method comprises the following steps:
selecting a light source flicker frequency in a preset table, and adjusting the exposure time to be an integral multiple of the reciprocal of the selected light source flicker frequency, wherein the preset table stores the commonly used light source flicker frequencies in advance;
detecting whether the preview picture of the camera flickers again, if the preview picture of the camera flickers again, judging whether all light source flickering frequencies in the preset table are traversed or not, if the preset table is not traversed, removing the selected light source flickering frequency, selecting a light source flickering frequency again in the preset table, and adjusting the exposure time to be integral multiple of the reciprocal of the selected light source flickering frequency;
and returning to execute the step of detecting whether the preview picture of the camera flickers or not again and the subsequent steps.
3. The method as claimed in claim 2, wherein selecting a light source blinking frequency in a predetermined table comprises:
and selecting a light source flicker frequency with the minimum absolute value of the calculated flicker frequency difference value of the preview picture in the preset table.
4. The photographing parameter setting method according to claim 2, further comprising, after the step of determining whether all light source blinking frequencies in the preset table have been traversed,:
if the preset table is traversed, outputting prompt information, wherein the prompt information is used for prompting a user to input identification information of the light source;
searching the flicker frequency of the light source according to the identification information of the light source;
setting the exposure time of the camera to be integral multiple of the searched reciprocal of the flicker frequency.
5. A shooting parameter setting apparatus, applied to a terminal device in which a camera is built, includes:
the device comprises a preview image flicker calculation module, a preview image flicker calculation module and a preview image flicker calculation module, wherein the preview image flicker calculation module is used for calculating the flicker frequency of a preview image when the preview image flicker of a camera is detected;
the charging frequency acquisition module is used for acquiring the charging signal frequency of the location of the camera, and comprises: reading the charging signal frequency of the location of the camera from a preset storage device, wherein the charging signal frequency of the location of the camera is a pulse direct current signal output by a rectifying circuit in a charger when the terminal device is connected with the charger, and the terminal device calculates and acquires the charging signal frequency of the location of the terminal device according to the pulse direct current signal output by the rectifying circuit in the charger and stores the charging signal frequency into the preset storage device in advance;
a light source flicker frequency calculation module, configured to calculate a flicker frequency of the light source based on the flicker frequency of the preview picture, the charging signal frequency, and a light source flicker frequency calculation formula, where the light source flicker frequency calculation formula is:
Figure FDA0002779427920000031
wherein f islightIs the flicker frequency of the light source, fchargeFor the charging signal frequency, fpreviewRound (x) is to round x for the flicker frequency of the camera preview picture;
and the exposure time setting module is used for setting the exposure time of the camera to be the integral multiple of the flicker period of the light source if the exposure time of the camera is not the integral multiple of the flicker period of the light source, wherein the flicker period of the light source is the reciprocal of the flicker frequency of the light source.
6. The shooting parameter setting apparatus according to claim 5, further comprising:
the flicker detection module is used for detecting whether the preview picture of the camera flickers or not after the step of setting the exposure time of the camera to be integral multiple of the flicker period of the light source;
the preset table selecting module is used for selecting a light source flicker frequency from a preset table if the flicker detecting module detects that the preview picture of the camera flickers, and adjusting the exposure time to be an integral multiple of the reciprocal of the selected light source flicker frequency, wherein the preset table stores commonly used light source flicker frequencies in advance;
and the preset table re-selection module is used for detecting whether the preview picture of the camera flickers again, judging whether all the light source flickering frequencies in the preset table are traversed or not if the preview picture of the camera flickers again, removing the selected light source flickering frequencies if the preset table is not traversed, re-selecting one light source flickering frequency in the preset table, and adjusting the exposure time to be integral multiple of the reciprocal of the selected light source flickering frequency.
7. The shooting parameter setting apparatus of claim 6, wherein the preset table selection module is specifically configured to:
if the flicker detection module detects that the preview picture of the camera flickers, selecting a light source flicker frequency with the minimum absolute value of the calculated flicker frequency difference value of the preview picture from the preset table, and adjusting the exposure time to be integral multiple of the reciprocal of the selected light source flicker frequency.
8. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the photographing parameter setting method according to any one of claims 1 to 4 when executing the computer program.
9. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the photographing parameter setting method according to any one of claims 1 to 4.
CN201910573334.0A 2019-06-28 2019-06-28 Shooting parameter setting method, setting device, terminal equipment and readable storage medium Active CN110248110B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910573334.0A CN110248110B (en) 2019-06-28 2019-06-28 Shooting parameter setting method, setting device, terminal equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910573334.0A CN110248110B (en) 2019-06-28 2019-06-28 Shooting parameter setting method, setting device, terminal equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN110248110A CN110248110A (en) 2019-09-17
CN110248110B true CN110248110B (en) 2021-03-26

Family

ID=67890007

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910573334.0A Active CN110248110B (en) 2019-06-28 2019-06-28 Shooting parameter setting method, setting device, terminal equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN110248110B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111083384B (en) * 2019-12-06 2021-12-07 Oppo广东移动通信有限公司 Exposure adjusting method and device, electronic equipment and storage medium thereof
CN111163270A (en) * 2019-12-30 2020-05-15 Oppo广东移动通信有限公司 Method for eliminating flicker, electronic device and storage medium
CN111291620A (en) * 2020-01-14 2020-06-16 北京小马智行科技有限公司 Method, device and system for identifying light source
CN113542532A (en) * 2020-04-13 2021-10-22 深圳市万普拉斯科技有限公司 Shooting flicker elimination method and device, shooting equipment and readable storage medium
CN111935381B (en) * 2020-08-19 2023-08-25 北京小马慧行科技有限公司 Image acquisition and processing device and mobile carrier
CN111866401A (en) * 2020-08-31 2020-10-30 维沃移动通信有限公司 Shooting method and device and electronic equipment
CN114422714B (en) * 2020-10-28 2024-07-02 北京小米移动软件有限公司 Switching method and switching device between flash frequency light source and no-flash frequency light source
CN112616016A (en) * 2020-12-10 2021-04-06 南昌欧菲光电技术有限公司 Method and device for acquiring image by event camera, electronic equipment and storage medium
CN113301220B (en) * 2021-04-27 2024-01-05 上海欧菲智能车联科技有限公司 Synchronization method of vehicle-mounted camera and car lamp and FPGA chip
CN115529419B (en) * 2021-06-24 2024-04-16 荣耀终端有限公司 Shooting method under multiple artificial light sources and related device
CN114222070A (en) * 2021-09-27 2022-03-22 苏州科达科技股份有限公司 Brightness compensation method, device, equipment and storage medium
CN116389915B (en) * 2023-04-07 2024-03-22 北京拙河科技有限公司 Method and device for reducing flicker of light field camera
CN116996777B (en) * 2023-09-26 2024-04-05 荣耀终端有限公司 Shooting method, electronic equipment and storage medium

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6271884B1 (en) * 1999-09-28 2001-08-07 Conexant Systems, Inc. Image flicker reduction with fluorescent lighting
CN1245018C (en) * 2002-12-17 2006-03-08 北京中星微电子有限公司 Method for eliminating scintilltion of moving picture
JP4259998B2 (en) * 2003-12-19 2009-04-30 三洋電機株式会社 Flicker detection device and imaging device
JP4335849B2 (en) * 2005-06-13 2009-09-30 富士通マイクロエレクトロニクス株式会社 Imaging device capable of flicker detection
US7777787B2 (en) * 2005-10-17 2010-08-17 Nokia Corporation Preventing flicker effects in video electronic devices
JP5598029B2 (en) * 2010-03-10 2014-10-01 ソニー株式会社 IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND PROGRAM
JP2012010104A (en) * 2010-06-24 2012-01-12 Sony Corp Image processing apparatus, imaging apparatus, image processing method, and program
CN104104882B (en) * 2013-04-09 2017-08-11 展讯通信(上海)有限公司 Image flicker detection method and device, image capture device
CN109218621B (en) * 2018-10-23 2021-03-12 Oppo广东移动通信有限公司 Image processing method, device, storage medium and mobile terminal
CN109120863B (en) * 2018-10-23 2021-01-01 Oppo广东移动通信有限公司 Shooting method, shooting device, storage medium and mobile terminal
CN109547704A (en) * 2018-12-29 2019-03-29 与德科技有限公司 A kind of photographic method, device, terminal and the storage medium of anti-splashette

Also Published As

Publication number Publication date
CN110248110A (en) 2019-09-17

Similar Documents

Publication Publication Date Title
CN110248110B (en) Shooting parameter setting method, setting device, terminal equipment and readable storage medium
CN110310229B (en) Image processing method, image processing apparatus, terminal device, and readable storage medium
CN110933497B (en) Video image data frame insertion processing method and related equipment
CN109146855B (en) Image moire detection method, terminal device and storage medium
CN108737739B (en) Preview picture acquisition method, preview picture acquisition device and electronic equipment
CN107909569B (en) Screen-patterned detection method, screen-patterned detection device and electronic equipment
CN108769634B (en) Image processing method, image processing device and terminal equipment
CN109040596B (en) Method for adjusting camera, mobile terminal and storage medium
CN107690804B (en) Image processing method and user terminal
EP3822758A1 (en) Method and apparatus for setting background of ui control
CN110648296B (en) Pupil color correction method, correction device, terminal device and storage medium
CN106454100A (en) Focusing method and device and mobile terminal
CN111654637B (en) Focusing method, focusing device and terminal equipment
CN112383718A (en) Image exposure method and device and electronic equipment
CN110689565B (en) Depth map determination method and device and electronic equipment
CN106161952B (en) A kind of focusing method, device and mobile terminal
EP3068097A1 (en) Method and device for filtering information
CN113038026A (en) Image processing method and electronic device
CN105204720A (en) Method and device for displaying background image on mobile terminal
CN107507601A (en) A kind of method and system of the camera supervised interface display effect of adjust automatically
CN112351271A (en) Camera shielding detection method and device, storage medium and electronic equipment
CN104978731A (en) Information processing method and electronic equipment
CN108810407B (en) Image processing method, mobile terminal and computer readable storage medium
CN108833780B (en) Image parameter adjusting method, image parameter adjusting device and mobile terminal
CN110874814A (en) Image processing method, image processing device and terminal equipment

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