[go: up one dir, main page]

CN110891142A - Night scene mode determining method and device, storage medium and terminal - Google Patents

Night scene mode determining method and device, storage medium and terminal Download PDF

Info

Publication number
CN110891142A
CN110891142A CN201910976207.5A CN201910976207A CN110891142A CN 110891142 A CN110891142 A CN 110891142A CN 201910976207 A CN201910976207 A CN 201910976207A CN 110891142 A CN110891142 A CN 110891142A
Authority
CN
China
Prior art keywords
peak value
pixel peak
gray level
value
pixel
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.)
Pending
Application number
CN201910976207.5A
Other languages
Chinese (zh)
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.)
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Original Assignee
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority to CN201910976207.5A priority Critical patent/CN110891142A/en
Publication of CN110891142A publication Critical patent/CN110891142A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-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

Landscapes

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

Abstract

The embodiment of the application discloses a night scene mode determining method, a night scene mode determining device, a storage medium and a terminal, wherein the method comprises the following steps: acquiring a preview image aiming at a shooting area through a camera, and acquiring an ISO value and a gray level histogram corresponding to the preview image, wherein the gray level histogram comprises a plurality of gray levels and the number of pixels corresponding to each gray level; acquiring a pixel peak value set in the gray level histogram, and acquiring a gray level corresponding to each pixel peak value in the pixel peak value set; determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculating the ratio of the total pixel number in the first preset gray level range to the global pixel number of the preview image; and when the first pixel peak value is larger than the first pixel peak value threshold value, the second pixel peak value is smaller than the second pixel peak value threshold value, the ratio is larger than the first ratio threshold value, and the ISO value is larger than the first ISO threshold value, starting a night scene shooting mode. Therefore, the night scene shooting mode can be accurately judged and automatically entered.

Description

Night scene mode determining method and device, storage medium and terminal
Technical Field
The present application relates to the field of computer technologies, and in particular, to a night scene mode determining method, apparatus, storage medium, and terminal.
Background
The popularization of portable intelligent equipment makes the photography more convenient easy to operate, and people can open the camera on the portable equipment at any time and any place to shoot and record video.
In the shooting process, aiming at different external environments, a user needs to manually switch/select a proper shooting mode for shooting so as to obtain an image with higher quality and better effect.
For an environment with weak light, if a night scene shooting mode is to be entered, a user needs to manually click/slide to change the current shooting mode, and the operation causes that the shooting mode is not intelligent and convenient enough in switching; moreover, the mode of changing the current shooting mode to the night scene shooting mode is not accurate enough by judging the external environment by naked eyes alone, and images with poor effects are easy to shoot.
Disclosure of Invention
The embodiment of the application provides a night scene mode determining method, a night scene mode determining device, a storage medium and a terminal, and can solve the problems that night scene shooting mode judgment is inaccurate, and shooting mode switching is not intelligent and convenient enough. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a night scene mode determining method, where the method includes:
acquiring a preview image aiming at a shooting area through a camera, and acquiring an ISO value and a gray level histogram corresponding to the preview image, wherein the gray level histogram comprises a plurality of gray levels and the number of pixels corresponding to each gray level;
acquiring a pixel peak value set in the gray level histogram, and acquiring a gray level corresponding to each pixel peak value in the pixel peak value set;
determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculating the ratio of the total pixel number of a first preset gray level range to the global pixel number of the preview image;
when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value, a night scene shooting mode is started;
the first pixel peak value is located in a second preset gray level range and corresponds to the lowest gray level in the pixel peak value set, and the second pixel peak value is located in a third preset gray level range and corresponds to the highest gray level in the pixel peak value set.
In a second aspect, an embodiment of the present application provides a night scene mode determining apparatus, where the apparatus includes:
the device comprises a first parameter acquisition module, a second parameter acquisition module and a third parameter acquisition module, wherein the first parameter acquisition module is used for acquiring a preview image aiming at a shooting area through a camera and acquiring an ISO value and a gray level histogram corresponding to the preview image, and the gray level histogram comprises a plurality of gray levels and the number of pixels corresponding to each gray level;
the second parameter acquisition module is used for acquiring a pixel peak value set in the gray level histogram and acquiring the gray level corresponding to each pixel peak value in the pixel peak value set;
the parameter determining and calculating module is used for determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level and calculating the ratio of the total pixel number in a first preset gray level range to the global pixel number of the preview image; wherein the first pixel peak is located in a second predetermined gray level range and corresponds to a lowest gray level in the set of pixel peaks, and the second pixel peak is located in a third predetermined gray level range and corresponds to a highest gray level in the set of pixel peaks;
and the night scene mode starting module is used for starting the night scene shooting mode when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value.
In a third aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of any one of the above methods.
In a fourth aspect, an embodiment of the present application provides a terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of any one of the above methods when executing the program.
The beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:
in one or more embodiments of the present application, during shooting, a camera is used to collect a preview image of a shooting area, an ISO value and a gray histogram corresponding to the preview image are obtained, and a pixel peak value set and a gray level corresponding to each pixel peak value in the pixel peak value set are obtained in the gray histogram; determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculating the ratio of the total pixel number of a first preset gray level range to the global pixel number of the preview image; and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value, starting a night scene shooting mode. The night view mode determining method provided by the embodiment of the application performs condition judgment by using each shooting parameter of the preview image, so as to determine whether the current shooting environment is suitable for a night view shooting mode, when the parameter of the preview image meets a night view mode starting condition, the terminal automatically changes the current shooting mode to the night view shooting mode, the mode switching is intelligent and convenient, and the judgment accuracy of the night view shooting mode based on the parameter data of the preview image is high, so that the quality of shooting the night view image can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a night scene mode determination method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a gray histogram and EXIF information corresponding to a frame of preview image according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a night scene mode determination method according to an embodiment of the present application;
fig. 4a to 4c are schematic flow charts of a night scene mode determination method provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a night scene mode determining apparatus according to an embodiment of the present application;
fig. 6 is a block diagram of a terminal structure according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The night scene mode determination method provided by the embodiment of the present application will be described in detail below with reference to fig. 1 to 4 b.
Please refer to fig. 1, which is a flowchart illustrating a night scene mode determining method according to an embodiment of the present application.
As shown in fig. 1, the method of the embodiment of the present application may include the steps of:
s101, acquiring a preview image aiming at a shooting area through a camera, and acquiring an ISO value and a gray level histogram corresponding to the preview image, wherein the gray level histogram comprises a plurality of gray levels and the number of pixels corresponding to each gray level;
when a user starts a camera of the terminal to take a picture or record a video, before a shooting instruction is input, the terminal collects an image in real time based on a shooting area indicated by the camera and displays the image on a display screen, wherein the image displayed on the display screen is a preview image.
The preview image is a real-time frame image, and the terminal can continuously generate a plurality of frames of preview images before a shooting instruction is input. When the preview image is analyzed according to the ISO value and the gray histogram, each frame of the preview image may be analyzed in real time, or a currently acquired frame of the preview image may be analyzed every fixed time period, for example, every 2 ms. The input shooting command may be, for example, a voice shooting command, or a shooting command input to a physical/physical shooting button.
Each frame of image has its corresponding EXIF information and a grey histogram.
The EXIF is an image file format, which is the same as the JPEG format in terms of data storage, and simply, the EXIF format inserts the shooting parameter information of an image into the JPEG format header, and the ISO value corresponding to the image is obtained from the EXIF information. ISO is sensitivity, and the ISO value represents a light perception value of the current photograph to the external environment, and a larger value represents a darker external environment. Different terminal devices ISO value ranges can be different, and in the embodiment of the present application, the ISO value range is ISO 0-ISO 6400.
The gray level histogram is a luminance information distribution statistical graph corresponding to all pixels in a frame image, 0-255 gray levels are arranged on the abscissa of the graph, the lower the gray level is, the darker the corresponding pixel luminance is, and the ordinate represents the number of pixels corresponding to each gray level/the frequency of occurrence. The number of pixels is acquired by a longitudinal coordinate of a gray level histogram corresponding to a preview image in the embodiment of the application.
The light intensity of the external environment can be reflected to a certain extent by the ISO value and the gray level histogram statistical result, the current shooting environment can be obtained by the terminal through previewing the ISO value and the gray level histogram of the image, so that the terminal automatically enters a proper shooting mode, and a high-quality image is shot. Specifically, in the embodiment of the present application, that is, when the terminal knows that the current shooting environment is dark, the night scene shooting mode is automatically started, so that an image with a better effect is shot.
The terminal in this embodiment includes, but is not limited to, a smart phone, a tablet computer, a palm computer, a Personal digital assistant (PAD), an interactive smart tablet, and other devices.
S102, acquiring a pixel peak value set in the gray level histogram, and acquiring a gray level corresponding to each pixel peak value in the pixel peak value set;
under different shooting environments, the distribution of the number of pixels on each gray level in the gray level histogram is different, the heights are different, and peaks with different numbers are formed. Along the increasing direction of the gray level, each pixel peak value and the corresponding gray level can be determined according to the increasing and decreasing trend of the number of the pixels on each gray level. All pixel peaks in the gray histogram constitute a set of pixel peaks.
S103, determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculating the ratio of the total pixel number in a first preset gray level range to the global pixel number of the preview image; wherein the first pixel peak is located in a second predetermined gray level range and corresponds to a lowest gray level in the set of pixel peaks, and the second pixel peak is located in a third predetermined gray level range and corresponds to a highest gray level in the set of pixel peaks;
in the embodiment of the present application, the first pixel peak value represents a first pixel peak value appearing in the increasing direction of the gray level in the gray level histogram, that is, the corresponding gray level of the first pixel peak value in the pixel peak value set is the lowest; the second pixel peak represents the last pixel peak in the gray histogram that occurs in the direction of increasing gray level, i.e. the second pixel peak has the highest corresponding gray level in the set of pixel peaks.
The gray level histogram has 256 gray levels, and a first preset gray level range is divided according to the brightness degree, and pixels with very dark brightness are distributed in the first preset gray level range. For example, when 256 gray levels are divided into a very dark portion, a bright portion and a very bright portion according to the level, the very dark portion corresponds to a first predetermined gray level range, which may be set from 0 to 64. Based on the fact that the total amount of the pixels of the same equipment is fixed, the ratio of the total amount of the pixels of the dark part in the overall total amount is obtained, and the darkness degree of the current shooting environment can be determined according to the ratio. The pixels in the length of the image are multiplied by the pixels in the width, and the number of the pixels in the image is the total number of the pixels in the image. For example, a frame 640 × 480 of images shows that the frame of images has 640 pixels in each length direction and 480 pixels in each width direction, and the total number of pixels of the image is 640 × 480 ═ 307200 (pixels), i.e., 30 ten thousand pixels. Of course, the division of 256 gray levels may be divided into three or five parts, and the first preset gray level range may be set to 0 to 60, 0 to 70, and the like.
It should be noted that, this embodiment is used to determine the night mode, and therefore, the first pixel peak appearing along the increasing direction of the gray level in the gray level histogram should be located in the gray level range where dark pixel points are distributed, so that the night mode determination method provided by the present application can be implemented only when there is a dark portion in the image. Specifically, the gray level corresponding to the first pixel peak may be located in a second preset gray level range, and the second preset gray level range is smaller than the first preset gray level range, so that the brightness corresponding to the pixel point is ensured to be sufficiently dark, for example, set in a gray level range of 0 to 50. In other embodiments, the gray level corresponding to the first pixel peak may also be located in the first predetermined gray level range. For the determination of the night view mode, the brightness corresponding to the pixel point in the image is mainly dark and mostly gathered in a range with a lower gray level, so that the corresponding gray level of the last pixel peak value appearing in the gray level histogram along the increasing direction of the gray level can be located in a third preset gray level range with a relatively wider range, and the range can be, for example, 100-255 gray levels. In other embodiments, the third predetermined gray scale range may be, for example, 90-255 gray scales.
Please refer to fig. 2, which is a schematic diagram of a gray histogram and EXIF information corresponding to a frame of preview image according to an embodiment of the present disclosure.
As shown in fig. 2, the leftmost image is a preview image of one frame; the middle image is a gray level histogram corresponding to the preview image, the abscissa of the middle image is divided into four gray level ranges of 0-64, 64-128, 128-192 and 192-255, and the four gray level ranges respectively correspond to a very dark part, a darker part, a lighter part and a very bright part, and as can be seen from the figure, a plurality of different pixel peak values are distributed on the gray level of 0-255 of the gray level histogram; the rightmost list is an EXIF information table corresponding to the preview image, and the shooting parameter information corresponding to the preview image can be acquired from the list, for example, the ISO value corresponding to the preview image is acquired as ISO 100.
And S104, when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value, starting a night scene shooting mode.
And when the first pixel peak value appearing in the second preset gray level range, the second pixel peak value appearing in the third preset gray level range, the ratio of the pixel quantity of the first preset gray level range to the total pixels and the ISO value meet the night scene shooting mode starting condition, indicating that the external shooting environment is dark, and starting the night scene shooting mode.
Specifically, when the first pixel peak value in the gray level range of 0 to 50 is greater than 15 ten thousand pixels (the first pixel peak threshold value), the second pixel peak value in the gray level range of 100 to 255 is less than 10 ten thousand pixels (the second pixel peak threshold value), the ratio of the total amount of pixels in the gray level range of 0 to 64 to the total amount of global pixels of the preview image is greater than 80% (the first ratio threshold value), and the ISO value of the preview image is greater than 3000 (the first ISO threshold value), it indicates that the external shooting environment is dark, and the night view shooting mode is started.
The first pixel peak threshold, the second pixel peak threshold, the first ratio threshold and the first ISO threshold can be properly adjusted according to an actual test. For example, the first pixel peak threshold may be adjusted to 18 thousand pixels, the second pixel peak threshold may be adjusted to 9 thousand pixels, the first ratio threshold may be adjusted to 85%, the first ISO threshold may be adjusted to 3500, and so on.
It should be noted that the night view mode determining method provided in this embodiment is not limited to the number of peaks in the gray histogram, and the night view shooting mode may be started as long as the corresponding parameter of the preview image satisfies the night view shooting mode starting condition.
In the embodiment of the application, when shooting, a preview image aiming at a shooting area is collected through a camera, an ISO value and a gray level histogram corresponding to the preview image are obtained, a pixel peak value set and a gray level corresponding to each pixel peak value in the pixel peak value set are obtained from the gray level histogram; determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculating the ratio of the total pixel number of a first preset gray level range to the global pixel number of the preview image; and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value, starting a night scene shooting mode. The night view mode determining method provided by the embodiment of the application performs condition judgment by using each shooting parameter of the preview image, so as to determine whether the current shooting environment is suitable for a night view shooting mode, when the parameter of the preview image meets a night view mode starting condition, the terminal automatically changes the current shooting mode to the night view shooting mode, the mode switching is intelligent and convenient, and the judgment accuracy of the night view shooting mode based on the parameter data of the preview image is high, so that the quality of shooting the night view image can be improved.
Please refer to fig. 3, which is a flowchart illustrating a night scene mode determining method according to an embodiment of the present application.
As shown in fig. 3, the method of the embodiment of the present application may include the steps of:
s201, acquiring a preview image aiming at a shooting area through a camera, and acquiring an ISO value and a gray level histogram corresponding to the preview image, wherein the gray level histogram comprises a plurality of gray levels and the number of pixels corresponding to each gray level;
this step can be referred to as S101, and is not described herein.
S202, acquiring a pixel peak value set in the gray level histogram, and acquiring a gray level corresponding to each pixel peak value in the pixel peak value set;
this step can be referred to as S102, and is not described herein.
S203, determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculating the ratio of the total pixel number in a first preset gray level range to the global pixel number of the preview image; wherein the first pixel peak is located in a second predetermined gray level range and corresponds to a lowest gray level in the set of pixel peaks, and the second pixel peak is located in a third predetermined gray level range and corresponds to a highest gray level in the set of pixel peaks;
in this step, it should be noted that, if the last pixel peak appearing along the increasing direction of the gray level in the gray level histogram does not correspond to the gray level in the third preset gray level range (100 to 255 gray levels), it indicates that there is no peak in the bright portion and the bright portion, and the pixels are basically concentrated in the dark portion and the dark portion, and at this time, step S204 is executed.
Please refer to S103 for a part of this step that is not described in detail herein.
S204, judging whether the gray level corresponding to the first pixel peak value is in a fourth preset gray level range or not;
when determining whether the gray level corresponding to the first pixel peak value in the gray histogram corresponding to the preview image is located in the fourth preset gray level range, the gray level range may be determined for each frame of preview image acquired in real time, or the gray level range may be determined for each frame of preview image acquired periodically (for example, one frame is acquired every 3ms, one frame is acquired every 5ms, etc.). And judging the gray level range of the gray level corresponding to the first pixel peak value, and executing the next step when the gray level corresponding to the first pixel peak value meets the condition.
And S205, when the gray level corresponding to the first pixel peak value is in a fourth preset gray level range, and when the first pixel peak value is greater than a first pixel peak value threshold value and the ratio is greater than a first ratio threshold value, starting a night scene shooting mode.
When the gray level corresponding to the first pixel peak value in the gray level histogram corresponding to the preview image is within the range of 0-20 gray levels (the fourth preset gray level range), it indicates that the current shooting environment is dark and the light is weak enough, and at this time, when the ratio of the first pixel peak value appearing in the fourth preset gray level range, the pixel quantity in the first preset gray level range and the total pixels meets the night-scene shooting mode starting condition, the night-scene shooting mode can be started. Specifically, when the first pixel peak value in the 0-20 gray scale range is greater than 15 ten thousand pixels (first pixel peak value threshold), and the ratio of the total amount of pixels in the 0-64 gray scale range to the total amount of global pixels of the preview image is greater than 80% (first ratio threshold), it indicates that the current shooting environment is dark, and the night view shooting mode is started.
Certainly, in this embodiment, in order to accurately determine the current shooting environment, the determination of the ISO value may also be added in the night view mode starting condition, that is, when the first pixel peak value in the range of 0 to 20 gray levels is greater than 15 ten thousand pixels (the first pixel peak value threshold), the ratio of the total amount of pixels in the range of 0 to 64 gray levels in the total amount of global pixels of the preview image is greater than 80% (the first ratio threshold), and the ISO value of the preview image is greater than 3000 (the first ISO threshold), the night view shooting mode is started.
The first pixel peak threshold and the first ratio threshold can be properly adjusted according to the actual test. For example, the first pixel peak threshold may be adjusted to 20 ten thousand pixels, the first ratio threshold may be adjusted to 90%, the first ISO threshold may be adjusted to 3500, and so on.
It should be noted that the embodiment can make corresponding adjustment to the steps in the implementation process. For example, a first pixel peak value and a corresponding gray level thereof in the gray histogram may be found, and after it is determined that the gray level corresponding to the first pixel peak value is located in a fourth preset gray level range, the night mode starting condition may be determined only by obtaining a ratio of a pixel amount in the first preset gray level range to a total pixel. The adjustment of the steps can reduce the acquisition times of the parameters, reduce the calculation amount of the terminal and reduce the loss.
In the embodiment of the application, when shooting, a preview image aiming at a shooting area is collected through a camera, an ISO value and a gray level histogram corresponding to the preview image are obtained, a pixel peak value set and a gray level corresponding to each pixel peak value in the pixel peak value set are obtained from the gray level histogram; determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculating the ratio of the total pixel number of a first preset gray level range to the global pixel number of the preview image; and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value, starting a night scene shooting mode. The night view mode determining method provided by the embodiment of the application performs condition judgment by using each shooting parameter of the preview image, so as to determine whether the current shooting environment is suitable for a night view shooting mode, when the parameter of the preview image meets a night view mode starting condition, the terminal automatically changes the current shooting mode to the night view shooting mode, the mode switching is intelligent and convenient, and the judgment accuracy of the night view shooting mode based on the parameter data of the preview image is high, so that the quality of shooting the night view image can be improved.
Please refer to fig. 4a to 4c, which are schematic flow charts of a night scene mode determining method according to an embodiment of the present application.
As shown in fig. 4a-4c, the method of the embodiments of the present application may include the steps of:
s301, acquiring a preview image aiming at a shooting area through a camera, and acquiring an ISO value and a gray level histogram corresponding to the preview image, wherein the gray level histogram comprises a plurality of gray levels and the number of pixels corresponding to each gray level;
this step can be referred to as S101, and is not described herein.
S302, acquiring a pixel peak value set in the gray level histogram, and acquiring a gray level corresponding to each pixel peak value in the pixel peak value set;
this step can be referred to as S102, and is not described herein.
S303, determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculating the ratio of the total pixel number in a first preset gray level range to the global pixel number of the preview image; wherein the first pixel peak is located in a second predetermined gray level range and corresponds to a lowest gray level in the set of pixel peaks, and the second pixel peak is located in a third predetermined gray level range and corresponds to a highest gray level in the set of pixel peaks;
this step can be referred to as S103, and is not described herein.
S304, judging whether the gray level corresponding to the second pixel peak value is in a fifth preset gray level range or not;
when determining whether the gray level corresponding to the second pixel peak value in the gray histogram corresponding to the preview image is located in the fifth preset gray level range, the gray level range may be determined for each frame of preview image acquired in real time, or the gray level range may be determined for each frame of preview image acquired periodically (for example, one frame is acquired every 2ms, one frame is acquired every 4ms, etc.). And judging the gray level range of the gray level corresponding to the peak value of the second pixel, and executing the next step when the gray level corresponding to the peak value of the second pixel meets the condition.
S305, when the gray level corresponding to the second pixel peak value is in a fifth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a second ISO threshold value, starting a night scene shooting mode;
and when the first pixel peak value appearing in the second preset gray level range, the second pixel peak value appearing in the fifth preset gray level range, the ratio of the pixel quantity of the first preset gray level range to the total pixels and the ISO value meet the night scene shooting mode starting condition, indicating that the external shooting environment is dark, and starting the night scene shooting mode.
Specifically, when the first pixel peak value in the 0-50 gray scale range is greater than 15 ten thousand pixels (the first pixel peak value threshold), the second pixel peak value in the 250-255 gray scale range is less than 10 ten thousand pixels (the second pixel peak value threshold), the ratio of the total amount of pixels in the 0-64 gray scale range in the total amount of global pixels of the preview image is greater than 80% (the first ratio threshold), and the ISO value of the preview image is greater than 2500 (the second ISO threshold), it indicates that the external shooting environment is dark, and the night view shooting mode is started.
More specifically, the gray level corresponding to the third pixel peak may be determined in the pixel peak set based on the gray level, and the judgment on the gray level of the third pixel peak may be added to the night view shooting mode starting condition, that is: when the first pixel peak value in the 0-50 gray level range is larger than 15 ten thousand pixels (the first pixel peak value threshold), the second pixel peak value in the 250-255 gray level range is smaller than 10 ten thousand pixels (the second pixel peak value threshold), the third pixel peak value is in the 0-50 gray level range, the ratio of the total amount of the pixels in the 0-64 gray level range in the total amount of the global pixels of the preview image is larger than 70% (the third ratio threshold), and the ISO value of the preview image is larger than 2000 (the second ISO threshold), indicating that the external shooting environment is dark, and starting a night scene shooting mode.
Or when the first pixel peak value in the 0-50 gray level range is greater than 15 ten thousand pixels (the first pixel peak value threshold), the second pixel peak value in the 250-255 gray level range is less than 10 ten thousand pixels (the second pixel peak value threshold), the third pixel peak value is in the 50-1000 gray level range, the ratio of the total amount of the pixels in the 0-64 gray level range in the total amount of the global pixels of the preview image is greater than 80% (the first ratio threshold), and the ISO value of the preview image is greater than 2500 (the third ISO threshold), indicating that the external shooting environment is dark, and starting the night-scene shooting mode.
The third pixel peak represents a penultimate pixel peak appearing in the gray level increasing direction in the gray level histogram, that is, the second pixel peak corresponds to the next highest gray level in the pixel peak set.
S306, judging whether the gray level corresponding to the second pixel peak value is in a sixth preset gray level range or not;
this step can be referred to as S304, and is not described herein.
S307, when the gray level corresponding to the second pixel peak value is in a sixth preset gray level range, when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a second ratio threshold value, and the ISO value is larger than a first ISO threshold value, a night scene shooting mode is started;
and when the first pixel peak value appearing in the second preset gray level range, the second pixel peak value appearing in the sixth preset gray level range, the ratio of the pixel quantity of the first preset gray level range to the total pixels and the ISO value meet the night scene shooting mode starting condition, indicating that the external shooting environment is dark, and starting the night scene shooting mode.
Specifically, when the first pixel peak value in the 0-50 gray scale range is greater than 15 ten thousand pixels (the first pixel peak value threshold), the second pixel peak value in the 200-250 gray scale range is less than 10 ten thousand pixels (the second pixel peak value threshold), the ratio of the total amount of pixels in the 0-64 gray scale range in the total amount of global pixels of the preview image is greater than 75% (the second ratio threshold), and the ISO value of the preview image is greater than 3000 (the first ISO threshold), it indicates that the external shooting environment is dark, and the night view shooting mode is started.
S308, judging whether the gray level corresponding to the second pixel peak value is in a seventh preset gray level range or not;
this step can be referred to as S304, and is not described herein.
S309, when the gray level corresponding to the second pixel peak value is in a seventh preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a third ratio threshold value, and the ISO value is larger than a third ISO threshold value, starting a night scene shooting mode;
and when the first pixel peak value appearing in the second preset gray level range, the second pixel peak value appearing in the seventh preset gray level range, the ratio of the pixel quantity of the first preset gray level range to the total pixels and the ISO value meet the night scene shooting mode starting condition, indicating that the external shooting environment is dark, and starting the night scene shooting mode.
Specifically, when the first pixel peak value in the 0-50 gray scale range is greater than 15 ten thousand pixels (the first pixel peak value threshold), the second pixel peak value in the 150-200 gray scale range is less than 10 ten thousand pixels (the second pixel peak value threshold), the ratio of the total amount of pixels in the 0-64 gray scale range in the total amount of global pixels of the preview image is greater than 70% (the third ratio threshold), and the ISO value of the preview image is greater than 2500 (the third ISO threshold), it indicates that the external shooting environment is dark, and the night view shooting mode is started.
S310, judging whether the gray level corresponding to the second pixel peak value is in an eighth preset gray level range or not;
this step can be referred to as S304, and is not described herein.
S311, when the gray level corresponding to the second pixel peak value is in an eighth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a fourth ratio threshold value, and the ISO value is larger than a second ISO threshold value, starting a night scene shooting mode;
and when the first pixel peak value appearing in the second preset gray level range, the second pixel peak value appearing in the eighth preset gray level range, the ratio of the pixel quantity of the first preset gray level range to the total pixels and the ISO value meet the night scene shooting mode starting condition, indicating that the external shooting environment is dark, and starting the night scene shooting mode.
Specifically, when the first pixel peak value in the gray level range of 0 to 50 is greater than 15 ten thousand pixels (the first pixel peak value threshold), the second pixel peak value in the gray level range of 100 to 150 is less than 10 ten thousand pixels (the second pixel peak value threshold), the ratio of the total amount of pixels in the gray level range of 0 to 64 in the total amount of global pixels of the preview image is greater than 68% (the fourth ratio threshold), and the ISO value of the preview image is greater than 2000 (the second ISO threshold), it indicates that the external shooting environment is dark, and the night view shooting mode is started.
S312, determining whether the gray level corresponding to the second pixel peak is within a ninth preset gray level range;
this step can be referred to as S304, and is not described herein.
And S313, when the gray level corresponding to the second pixel peak value is in a ninth preset gray level range, and when the first pixel peak value is greater than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is greater than a fourth ratio threshold value, and the ISO value is greater than a fourth ISO threshold value, starting a night scene shooting mode.
And when the first pixel peak value appearing in the second preset gray level range, the second pixel peak value appearing in the ninth preset gray level range, the ratio of the pixel quantity of the first preset gray level range to the total pixels and the ISO value meet the night scene shooting mode starting condition, indicating that the external shooting environment is dark, and starting the night scene shooting mode.
Specifically, when the first pixel peak value in the 0-50 gray scale range is greater than 15 ten thousand pixels (the first pixel peak value threshold), the second pixel peak value in the 50-100 gray scale range is less than 10 ten thousand pixels (the second pixel peak value threshold), the ratio of the total amount of pixels in the 0-64 gray scale range in the total amount of global pixels of the preview image is greater than 68% (the fourth ratio threshold), and the ISO value of the preview image is greater than 1500 (the fourth ISO threshold), it indicates that the external shooting environment is dark, and the night view shooting mode is started.
In addition, if no pixel peak value appears in the range of 50-255 gray levels, when the ratio of the total pixel amount of the range of 0-64 gray levels in the global pixel amount of the preview image is greater than 68% (fourth ratio threshold value) and the ISO value of the preview image is greater than 1500 (fourth ISO threshold value), it can be determined that the external shooting environment is dark, and the night view shooting mode is started.
The pixel peak threshold, the gray level range, the ratio threshold and the ISO threshold involved in each step can be properly adjusted according to the actual test, and are not described herein again.
It should be noted that, in the embodiments recited in the present application, when all of the consecutive multi-frame preview images satisfy the night view shooting mode starting condition, the night view shooting mode may be entered. For example, 4 frames of preview images are continuously acquired, and when the parameter data of each frame of preview image meets the starting condition of the night scene shooting mode, the night scene shooting mode can be entered again; and when the parameter data of at least one preview image in the 4 frames cannot meet the starting condition of the night scene shooting mode, the terminal controls the camera to keep the current shooting mode.
In the embodiment of the application, when shooting, a preview image aiming at a shooting area is collected through a camera, an ISO value and a gray level histogram corresponding to the preview image are obtained, a pixel peak value set and a gray level corresponding to each pixel peak value in the pixel peak value set are obtained from the gray level histogram; determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculating the ratio of the total pixel number of a first preset gray level range to the global pixel number of the preview image; and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value, starting a night scene shooting mode. The night view mode determining method provided by the embodiment of the application performs condition judgment by using each shooting parameter of the preview image, so as to determine whether the current shooting environment is suitable for a night view shooting mode, when the parameter of the preview image meets a night view mode starting condition, the terminal automatically changes the current shooting mode to the night view shooting mode, the mode switching is intelligent and convenient, and the judgment accuracy of the night view shooting mode based on the parameter data of the preview image is high, so that the quality of shooting the night view image can be improved.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Please refer to fig. 5, which is a schematic structural diagram of a night scene mode determining apparatus according to an exemplary embodiment of the present application. The night scene mode determining device can be realized by software, hardware or a combination of the software and the hardware to be all or part of the terminal, and can also be integrated on a server as an independent module. The night scene mode determining apparatus in the embodiment of the present application is applied to a terminal, as shown in fig. 5, the night scene mode determining apparatus 1 includes a first parameter obtaining module 11, a second parameter obtaining module 12, a parameter determining and calculating module 13, and a night scene mode starting module 14, where:
the first parameter acquisition module 11 is configured to acquire a preview image for a shooting area through a camera, and acquire an ISO value and a gray level histogram corresponding to the preview image, where the gray level histogram includes multiple gray levels and the number of pixels corresponding to each gray level;
a second parameter obtaining module 12, configured to obtain a pixel peak value set in the gray histogram, and obtain a gray level corresponding to each pixel peak value in the pixel peak value set;
a parameter determining and calculating module 13, configured to determine a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculate a ratio of a total pixel number in a first preset gray level range to a global pixel number of the preview image; wherein the first pixel peak is located in a second predetermined gray level range and corresponds to a lowest gray level in the set of pixel peaks, and the second pixel peak is located in a third predetermined gray level range and corresponds to a highest gray level in the set of pixel peaks;
a night scene mode starting module 14, configured to start a night scene shooting mode when the first pixel peak value is greater than a first pixel peak value threshold, the second pixel peak value is smaller than a second pixel peak value threshold, the ratio is greater than a first ratio threshold, and the ISO value is greater than a first ISO threshold.
Optionally, the night scene mode starting module 14 is specifically configured to:
judging whether the gray level corresponding to the first pixel peak value is in a fourth preset gray level range or not;
and when the gray level corresponding to the first pixel peak value is in a fourth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value, starting a night scene shooting mode.
Optionally, the night scene mode starting module 14 is specifically configured to:
judging whether the gray level corresponding to the second pixel peak value is in a fifth preset gray level range or not;
and when the gray level corresponding to the second pixel peak value is in a fifth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a second ISO threshold value, starting a night scene shooting mode.
Optionally, the night scene mode starting module 14 is specifically configured to:
judging whether the gray level corresponding to the second pixel peak value is in a sixth preset gray level range or not;
and when the gray level corresponding to the second pixel peak value is in a sixth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a second ratio threshold value, and the ISO value is larger than a first ISO threshold value, starting a night scene shooting mode.
Optionally, the night scene mode starting module 14 is specifically configured to:
judging whether the gray level corresponding to the second pixel peak value is in a seventh preset gray level range or not;
and when the gray level corresponding to the second pixel peak value is in a seventh preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a third ratio threshold value, and the ISO value is larger than a third ISO threshold value, starting a night scene shooting mode.
Optionally, the night scene mode starting module 14 is specifically configured to:
judging whether the gray level corresponding to the second pixel peak value is in an eighth preset gray level range or not;
and when the gray level corresponding to the second pixel peak value is in an eighth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a fourth ratio threshold value, and the ISO value is larger than a second ISO threshold value, starting a night scene shooting mode.
Optionally, the night scene mode starting module 14 is specifically configured to:
judging whether the gray level corresponding to the second pixel peak value is in a ninth preset gray level range or not;
and when the gray level corresponding to the second pixel peak value is in a ninth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a fourth ratio threshold value, and the ISO value is larger than a fourth ISO threshold value, starting a night scene shooting mode.
It should be noted that, when the night scene mode determining apparatus provided in the foregoing embodiment executes the night scene mode determining method, only the division of the functional modules is taken as an example, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the functions described above. In addition, the night scene mode determining apparatus and the night scene mode determining method provided by the above embodiments belong to the same concept, and details of the implementation process are found in the method embodiments, which are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the embodiment of the application, when shooting, a preview image aiming at a shooting area is collected through a camera, an ISO value and a gray level histogram corresponding to the preview image are obtained, a pixel peak value set and a gray level corresponding to each pixel peak value in the pixel peak value set are obtained from the gray level histogram; determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculating the ratio of the total pixel number of a first preset gray level range to the global pixel number of the preview image; and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value, starting a night scene shooting mode. The night view mode determining method provided by the embodiment of the application performs condition judgment by using each shooting parameter of the preview image, so as to determine whether the current shooting environment is suitable for a night view shooting mode, when the parameter of the preview image meets a night view mode starting condition, the terminal automatically changes the current shooting mode to the night view shooting mode, the mode switching is intelligent and convenient, and the judgment accuracy of the night view shooting mode based on the parameter data of the preview image is high, so that the quality of shooting the night view image can be improved.
The embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the steps of the method of any one of the foregoing embodiments. The computer-readable storage medium may include, but is not limited to, any type of disk including floppy disks, optical disks, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
The embodiment of the present application further provides a terminal, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the program, the steps of any of the above-mentioned embodiments of the method are implemented.
Please refer to fig. 6, which is a block diagram of a terminal according to an embodiment of the present disclosure.
As shown in fig. 6, the terminal 600 includes: a processor 601 and a memory 602.
In this embodiment, the processor 601 is a control center of a computer system, and may be a processor of an entity machine or a processor of a virtual machine. The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 601 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable logic Array). The processor 601 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state.
The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments of the present application, a non-transitory computer readable storage medium in the memory 602 is used to store at least one instruction for execution by the processor 601 to implement a method in embodiments of the present application.
In some embodiments, the terminal 600 further includes: a peripheral interface 603 and at least one peripheral. The processor 601, memory 602, and peripheral interface 603 may be connected by buses or signal lines. Various peripheral devices may be connected to the peripheral interface 603 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a display screen 604, a camera 605, and an audio circuit 606.
The peripheral interface 603 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 601 and the memory 602. In some embodiments of the present application, the processor 601, memory 602, and peripheral interface 603 are integrated on the same chip or circuit board; in some other embodiments of the present application, any one or both of the processor 601, the memory 602, and the peripheral interface 603 may be implemented on separate chips or circuit boards. The embodiment of the present application is not particularly limited to this.
The display screen 604 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 604 is a touch display screen, the display screen 604 also has the ability to capture touch signals on or over the surface of the display screen 604. The touch signal may be input to the processor 601 as a control signal for processing. At this point, the display screen 604 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments of the present application, the display screen 604 may be one, and is provided as a front panel of the terminal 600; in other embodiments of the present application, the display screens 604 may be at least two, respectively disposed on different surfaces of the terminal 600 or in a folding design; in still other embodiments of the present application, the display 604 may be a flexible display disposed on a curved surface or a folded surface of the terminal 600. Even further, the display screen 604 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The Display screen 604 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera 605 is used to capture images or video. Optionally, the camera 605 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments of the present application, camera 605 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
Audio circuitry 606 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 601 for processing. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the terminal 600. The microphone may also be an array microphone or an omni-directional pick-up microphone.
Power supply 607 is used to provide power to the various components in terminal 600. The power supply 607 may be ac, dc, disposable or rechargeable. When power supply 607 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
The block diagram of the terminal structure shown in the embodiments of the present application does not constitute a limitation to the terminal 600, and the terminal 600 may include more or less components than those shown, or combine some components, or adopt a different arrangement of components.
In this application, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or order; the term "plurality" means two or more unless expressly limited otherwise. The terms "mounted," "connected," "fixed," and the like are to be construed broadly, and for example, "connected" may be a fixed connection, a removable connection, or an integral connection; "coupled" may be direct or indirect through an intermediary. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
In the description of the present application, it is to be understood that the terms "upper", "lower", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience in describing the present application and simplifying the description, but do not indicate or imply that the referred device or unit must have a specific direction, be configured and operated in a specific orientation, and thus, should not be construed as limiting the present application.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Accordingly, all equivalent changes made by the claims of this application are intended to be covered by this application.

Claims (10)

1. A night scene mode determination method, the method comprising:
acquiring a preview image aiming at a shooting area through a camera, and acquiring an ISO value and a gray level histogram corresponding to the preview image, wherein the gray level histogram comprises a plurality of gray levels and the number of pixels corresponding to each gray level;
acquiring a pixel peak value set in the gray level histogram, and acquiring a gray level corresponding to each pixel peak value in the pixel peak value set;
determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level, and calculating the ratio of the total pixel number of a first preset gray level range to the global pixel number of the preview image;
when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value, a night scene shooting mode is started;
the first pixel peak value is located in a second preset gray level range and corresponds to the lowest gray level in the pixel peak value set, and the second pixel peak value is located in a third preset gray level range and corresponds to the highest gray level in the pixel peak value set.
2. The method of claim 1, wherein the turning on the night view shooting mode when the first pixel peak value is greater than a first pixel peak value threshold, the second pixel peak value is less than a second pixel peak value threshold, the ratio is greater than a first ratio threshold, and the ISO value is greater than a first ISO threshold comprises:
judging whether the gray level corresponding to the first pixel peak value is in a fourth preset gray level range or not;
and when the gray level corresponding to the first pixel peak value is in a fourth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value, starting a night scene shooting mode.
3. The method of claim 1, wherein the turning on the night view shooting mode when the first pixel peak value is greater than a first pixel peak value threshold, the second pixel peak value is less than a second pixel peak value threshold, the ratio is greater than a first ratio threshold, and the ISO value is greater than a first ISO threshold comprises:
judging whether the gray level corresponding to the second pixel peak value is in a fifth preset gray level range or not;
and when the gray level corresponding to the second pixel peak value is in a fifth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a second ISO threshold value, starting a night scene shooting mode.
4. The method of claim 1, wherein the turning on the night view shooting mode when the first pixel peak value is greater than a first pixel peak value threshold, the second pixel peak value is less than a second pixel peak value threshold, the ratio is greater than a first ratio threshold, and the ISO value is greater than a first ISO threshold comprises:
judging whether the gray level corresponding to the second pixel peak value is in a sixth preset gray level range or not;
and when the gray level corresponding to the second pixel peak value is in a sixth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a second ratio threshold value, and the ISO value is larger than a first ISO threshold value, starting a night scene shooting mode.
5. The method of claim 1, wherein the turning on the night view shooting mode when the first pixel peak value is greater than a first pixel peak value threshold, the second pixel peak value is less than a second pixel peak value threshold, the ratio is greater than a first ratio threshold, and the ISO value is greater than a first ISO threshold comprises:
judging whether the gray level corresponding to the second pixel peak value is in a seventh preset gray level range or not;
and when the gray level corresponding to the second pixel peak value is in a seventh preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a third ratio threshold value, and the ISO value is larger than a third ISO threshold value, starting a night scene shooting mode.
6. The method of claim 1, wherein the turning on the night view shooting mode when the first pixel peak value is greater than a first pixel peak value threshold, the second pixel peak value is less than a second pixel peak value threshold, the ratio is greater than a first ratio threshold, and the ISO value is greater than a first ISO threshold comprises:
judging whether the gray level corresponding to the second pixel peak value is in an eighth preset gray level range or not;
and when the gray level corresponding to the second pixel peak value is in an eighth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a fourth ratio threshold value, and the ISO value is larger than a second ISO threshold value, starting a night scene shooting mode.
7. The method of claim 1, wherein the turning on the night view shooting mode when the first pixel peak value is greater than a first pixel peak value threshold, the second pixel peak value is less than a second pixel peak value threshold, the ratio is greater than a first ratio threshold, and the ISO value is greater than a first ISO threshold comprises:
judging whether the gray level corresponding to the second pixel peak value is in a ninth preset gray level range or not;
and when the gray level corresponding to the second pixel peak value is in a ninth preset gray level range, and when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a fourth ratio threshold value, and the ISO value is larger than a fourth ISO threshold value, starting a night scene shooting mode.
8. A night scene mode determining apparatus, characterized in that the apparatus comprises:
the device comprises a first parameter acquisition module, a second parameter acquisition module and a third parameter acquisition module, wherein the first parameter acquisition module is used for acquiring a preview image aiming at a shooting area through a camera and acquiring an ISO value and a gray level histogram corresponding to the preview image, and the gray level histogram comprises a plurality of gray levels and the number of pixels corresponding to each gray level;
the second parameter acquisition module is used for acquiring a pixel peak value set in the gray level histogram and acquiring the gray level corresponding to each pixel peak value in the pixel peak value set;
the parameter determining and calculating module is used for determining a first pixel peak value and a second pixel peak value in the pixel peak value set based on the gray level and calculating the ratio of the total pixel number in a first preset gray level range to the global pixel number of the preview image; wherein the first pixel peak is located in a second predetermined gray level range and corresponds to a lowest gray level in the set of pixel peaks, and the second pixel peak is located in a third predetermined gray level range and corresponds to a highest gray level in the set of pixel peaks;
and the night scene mode starting module is used for starting the night scene shooting mode when the first pixel peak value is larger than a first pixel peak value threshold value, the second pixel peak value is smaller than a second pixel peak value threshold value, the ratio is larger than a first ratio threshold value, and the ISO value is larger than a first ISO threshold value.
9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to carry out the method steps according to any one of claims 1 to 7.
10. A terminal, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 7.
CN201910976207.5A 2019-10-15 2019-10-15 Night scene mode determining method and device, storage medium and terminal Pending CN110891142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910976207.5A CN110891142A (en) 2019-10-15 2019-10-15 Night scene mode determining method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910976207.5A CN110891142A (en) 2019-10-15 2019-10-15 Night scene mode determining method and device, storage medium and terminal

Publications (1)

Publication Number Publication Date
CN110891142A true CN110891142A (en) 2020-03-17

Family

ID=69746204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910976207.5A Pending CN110891142A (en) 2019-10-15 2019-10-15 Night scene mode determining method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN110891142A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1503575A (en) * 2002-11-19 2004-06-09 奥林巴斯株式会社 White balance processing apparatus, processing method thereof and digital camera
CN101710425A (en) * 2009-12-25 2010-05-19 南京航空航天大学 Self-adaptive pre-segmentation method based on gray scale and gradient of image and gray scale statistic histogram
CN103945088A (en) * 2013-01-21 2014-07-23 华为终端有限公司 Method and device for scene recognition
CN105049743A (en) * 2015-08-21 2015-11-11 宇龙计算机通信科技(深圳)有限公司 Backlight testing method, backlight testing system, picture taking device and terminal
JP2018120148A (en) * 2017-01-27 2018-08-02 富士通株式会社 Image processing apparatus, image processing program, and image processing method
CN108476272A (en) * 2016-02-05 2018-08-31 Nec平台株式会社 Image data conversion equipment, image data conversion method, image data conversion program, POS terminal equipment and server
CN109003249A (en) * 2017-06-07 2018-12-14 展讯通信(天津)有限公司 Enhance the method, apparatus and terminal of image detail
CN109068058A (en) * 2018-08-22 2018-12-21 Oppo广东移动通信有限公司 Shooting control method and device in super night scene mode and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1503575A (en) * 2002-11-19 2004-06-09 奥林巴斯株式会社 White balance processing apparatus, processing method thereof and digital camera
CN101710425A (en) * 2009-12-25 2010-05-19 南京航空航天大学 Self-adaptive pre-segmentation method based on gray scale and gradient of image and gray scale statistic histogram
CN103945088A (en) * 2013-01-21 2014-07-23 华为终端有限公司 Method and device for scene recognition
CN105049743A (en) * 2015-08-21 2015-11-11 宇龙计算机通信科技(深圳)有限公司 Backlight testing method, backlight testing system, picture taking device and terminal
CN108476272A (en) * 2016-02-05 2018-08-31 Nec平台株式会社 Image data conversion equipment, image data conversion method, image data conversion program, POS terminal equipment and server
JP2018120148A (en) * 2017-01-27 2018-08-02 富士通株式会社 Image processing apparatus, image processing program, and image processing method
CN109003249A (en) * 2017-06-07 2018-12-14 展讯通信(天津)有限公司 Enhance the method, apparatus and terminal of image detail
CN109068058A (en) * 2018-08-22 2018-12-21 Oppo广东移动通信有限公司 Shooting control method and device in super night scene mode and electronic equipment

Similar Documents

Publication Publication Date Title
US11330194B2 (en) Photographing using night shot mode processing and user interface
CN110505411B (en) Image shooting method and device, storage medium and electronic equipment
CN110798627B (en) Shooting method, shooting device, storage medium and terminal
KR101545883B1 (en) Method for controlling camera of terminal and terminal thereof
JP6388673B2 (en) Mobile terminal and imaging method thereof
CN110868533B (en) HDR mode determination method, device, storage medium and terminal
CN110572584B (en) Image processing method, image processing device, storage medium and electronic equipment
CN110012209A (en) Panorama image generation method, device, storage medium and electronic equipment
CN110225237B (en) Image acquisition method, device and mobile terminal
US20110090345A1 (en) Digital camera, image processing apparatus, and image processing method
EP4175280A1 (en) Image photographing method and electronic device
JP2012199675A (en) Image processing apparatus, image processing method, and program
CN103813108A (en) Array camera, mobile terminal, and methods for operating the same
CN112866576A (en) Image preview method, storage medium and display device
CN111182208B (en) Photographing method and device, storage medium and electronic equipment
CN111050211B (en) Video processing method, device and storage medium
US20150237248A1 (en) Image processing method and image processing device
CN110661971A (en) Image shooting method and device, storage medium and electronic equipment
CN113038165A (en) Method, apparatus and storage medium for determining a set of coding parameters
CN110992268A (en) Background setting method, device, terminal and storage medium
JP5479850B2 (en) Moving image creating apparatus and moving image creating method
CN114757866B (en) Clarity detection method, device and computer storage medium
JP2013017218A (en) Image processing device, image processing method, and program
CN110891142A (en) Night scene mode determining method and device, storage medium and terminal
JP5911300B2 (en) Imaging apparatus and control method thereof

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200317