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:
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:
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:
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:
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.