CN112104815A - Image brightness calculation method and device, storage medium and electronic equipment - Google Patents

Image brightness calculation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN112104815A
CN112104815A CN202010958930.3A CN202010958930A CN112104815A CN 112104815 A CN112104815 A CN 112104815A CN 202010958930 A CN202010958930 A CN 202010958930A CN 112104815 A CN112104815 A CN 112104815A
Authority
CN
China
Prior art keywords
brightness
value
images
image
target
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.)
Withdrawn
Application number
CN202010958930.3A
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.)
OFilm Microelectronics Technology Co Ltd
Original Assignee
OFilm Microelectronics Technology 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 OFilm Microelectronics Technology Co Ltd filed Critical OFilm Microelectronics Technology Co Ltd
Priority to CN202010958930.3A priority Critical patent/CN112104815A/en
Publication of CN112104815A publication Critical patent/CN112104815A/en
Withdrawn 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/70Circuitry for compensating brightness variation in the scene
    • H04N23/76Circuitry for compensating brightness variation in the scene by influencing the image signals

Landscapes

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

Abstract

The embodiment of the application discloses a method and a device for calculating the brightness of an image, a storage medium and electronic equipment, wherein the method comprises the following steps: the method comprises the steps that an iTOF module is obtained, aiming at a plurality of brightness images with 90-degree phase difference shot in the same area, the plurality of brightness images are respectively subjected to grid division according to the same grid size, the brightness value of a pixel at a grid intersection point in each brightness image is obtained, and the brightness value of a target brightness image corresponding to the area is determined based on the brightness value of the pixel at the grid intersection point in each brightness image. By adopting the embodiment of the application, the brightness value of the target brightness image corresponding to the shooting area can be calculated by respectively acquiring the brightness values of the pixels at the grid intersections in the plurality of brightness images without acquiring the brightness values of the pixels outside the grid intersections, so that the workload of acquiring the brightness values of the pixels is reduced, the time for calculating the brightness values of the images is saved, and the automatic exposure speed is accelerated.

Description

Image brightness calculation method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a method and an apparatus for calculating brightness of an image, a storage medium, and an electronic device.
Background
Before performing an automatic exposure algorithm, an indirect Time Of Flight (ietf) module needs to calculate an image brightness value. The current calculation method is to calculate the brightness value of each pixel on the image, and finally calculate the brightness value of the image according to the brightness value of each pixel. This process takes much time, and thus the speed of exposure becomes slow.
Disclosure of Invention
The embodiment of the application provides a method and a device for calculating brightness of an image, a storage medium and an electronic device, which can divide a plurality of brightness images with a same grid size after obtaining the plurality of brightness images with a phase difference of 90 degrees, calculate the brightness value of a target brightness image corresponding to a shooting area by respectively obtaining the brightness values of pixels at grid intersections in the plurality of brightness images without obtaining the brightness values of pixels outside the grid intersections, thereby reducing the workload of obtaining the brightness values of the pixels, saving the time for calculating the brightness values of the images and accelerating the automatic exposure speed. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for calculating brightness of an image, where the method includes:
acquiring a plurality of brightness images with 90-degree phase difference shot by an iTOF module aiming at the same area;
respectively carrying out grid division on the multiple luminance images according to the same grid size to obtain the luminance value of the pixel at the grid intersection point in each luminance image;
and determining the brightness value of the target brightness image corresponding to the region based on the brightness value of the pixel at the grid intersection point in each brightness image.
The beneficial effects of the above embodiment are as follows: after acquiring a plurality of brightness images with the phase difference of 90 degrees, the same grid size division is carried out on the plurality of brightness images, the brightness value of the target brightness image corresponding to the shooting area is calculated by respectively acquiring the brightness value of the pixel at the grid intersection point in the plurality of brightness images, and the brightness value of the pixel outside the grid intersection point is not required to be acquired, so that the workload of acquiring the brightness value of the pixel is reduced, the time for calculating the brightness value of the image is saved, and the automatic exposure speed is accelerated.
Optionally, the determining, based on the brightness value of the pixel at the grid intersection in each of the brightness images, the brightness value of the target brightness image corresponding to the region includes:
calculating the difference value of the brightness values of pixels at the same grid intersection point in two spaced brightness images;
calculating a sum of absolute values of the differences;
and adding the sum value into a brightness value set, and determining the brightness value of the target brightness image corresponding to the region based on the brightness value set.
The beneficial effects of the above embodiment are as follows: the brightness values of the pixels at the same grid intersection point of the target brightness image can be obtained only by simply performing subtraction and summation operations on the brightness values of the pixels at the same grid intersection point in the brightness images with the phase difference of 90 degrees. The calculation method is simple, and the exposure efficiency can be effectively improved.
Optionally, the determining, based on the brightness value set, the brightness value of the target brightness image corresponding to the region includes:
and calculating the average value of the sum values in the brightness value set, and taking the average value as the brightness value of the target brightness image corresponding to the region.
The beneficial effects of the above embodiment are as follows: and taking the average value of the sum values in the brightness value set as the brightness value of the target brightness image corresponding to the shooting area. This calculation process is simpler, thereby reducing the workload of calculating the brightness values of the image.
Optionally, before calculating an average value of each sum value in the set of luminance values, the method further includes:
eliminating target sum values of which the sum values are larger than a threshold value in the brightness value set;
the calculating an average of each sum value in the set of luminance values comprises:
an average of the sum values of the set of luminance values, except the target sum value, is calculated.
The beneficial effects of the above embodiment are as follows: the iTOF module is provided with a light source, so that the local brightness is too high, and the brightness value of the local brightness too high area in the shooting area is eliminated by eliminating the target sum value of which the sum value is greater than the threshold value in the brightness value set, so that the brightness value of the target brightness image corresponding to the shooting area is calculated more accurately.
Optionally, before calculating the average value of the sum values in the set of luminance values, except for the target sum value, the method further includes:
sorting sum values in the brightness value set except the target sum value according to a high-low order;
selecting the sum of the preset number arranged in the front;
said calculating an average of each sum value in said set of luminance values, except for said target sum value, comprises:
and calculating the average value of the sum of the preset numbers arranged in the front.
The beneficial effects of the above embodiment are as follows: the brightness of the brightness image is calculated according to the average value of the brightness values in the middle, so that the error of eliminating the target sum value is made up, and the brightness value of the target brightness image corresponding to the shooting area is calculated more accurately.
Optionally, after determining the brightness value of the target brightness image corresponding to the region, the method further includes:
calculating a difference value between the brightness value of the target brightness image and a reference brightness value;
and calculating an exposure gain coefficient based on the difference, and adjusting the exposure amount based on the exposure gain coefficient.
The beneficial effects of the above embodiment are as follows: and calculating an exposure gain coefficient according to the difference value between the brightness value of the target brightness image and the reference brightness value, and adjusting the exposure amount, thereby accelerating the automatic exposure speed.
Optionally, the obtaining multiple luminance images of the ietf module with a phase difference of 90 ° shot for the same region includes:
the method comprises the steps of obtaining at least two groups of brightness images shot by an iTOF module aiming at the same area, wherein each group of brightness images comprises two brightness images, the phase difference of the two brightness images is 180 degrees, and the phase difference of adjacent brightness images between each group of brightness images is 90 degrees.
The beneficial effects of the above embodiment are as follows: the grid division is carried out by acquiring at least two groups of brightness images and the brightness value of the target brightness image is calculated, so that the calculation mode is simpler, and the exposure efficiency can be effectively improved.
In a second aspect, an embodiment of the present application provides an apparatus for calculating brightness of an image, where the apparatus includes:
the image acquisition module is used for acquiring a plurality of brightness images with phase difference of 90 degrees shot by the iTOF module aiming at the same region;
the pixel brightness value acquisition module is used for respectively carrying out grid division on the multiple brightness images according to the same grid size to acquire the brightness value of the pixel at the grid intersection point in each brightness image;
and the image brightness value determining module is used for determining the brightness value of the target brightness image corresponding to the region based on the brightness value of the pixel at the grid intersection point in each brightness image.
The beneficial effects of the above embodiment are as follows: after acquiring a plurality of brightness images with the phase difference of 90 degrees, the same grid size division is carried out on the plurality of brightness images, the brightness value of the target brightness image corresponding to the shooting area is calculated by respectively acquiring the brightness value of the pixel at the grid intersection point in the plurality of brightness images, and the brightness value of the pixel outside the grid intersection point is not required to be acquired, so that the workload of acquiring the brightness value of the pixel is reduced, the time for calculating the brightness value of the image is saved, and the automatic exposure speed is accelerated.
Optionally, the image brightness value determining module includes:
the difference value calculating unit is used for calculating the difference value of the brightness values of the pixels at the same grid intersection point in two spaced brightness images;
a sum value calculation unit for calculating a sum value of absolute values of the difference values;
and the brightness value determining unit is used for adding the sum value into a brightness value set and determining the brightness value of the target brightness image corresponding to the region based on the brightness value set.
The beneficial effects of the above embodiment are as follows: the brightness values of the pixels at the same grid intersection point of the target brightness image can be obtained only by simply performing subtraction and summation operations on the brightness values of the pixels at the same grid intersection point in the brightness images with the phase difference of 90 degrees. The calculation method is simple, and the exposure efficiency can be effectively improved.
Optionally, the luminance value determining unit includes:
and the average value operator unit is used for calculating the average value of each sum value in the brightness value set and taking the average value as the brightness value of the target brightness image corresponding to the region.
The beneficial effects of the above embodiment are as follows: and taking the average value of the sum values in the brightness value set as the brightness value of the target brightness image corresponding to the shooting area. This calculation process is simpler, thereby reducing the workload of calculating the brightness values of the image.
Optionally, the luminance value determining unit further includes:
the target sum value eliminating subunit is used for eliminating the target sum values of which the sum values in the brightness value set are greater than a threshold value;
the average value operator unit is specifically configured to:
an average of the sum values of the set of luminance values, except the target sum value, is calculated.
The beneficial effects of the above embodiment are as follows: the iTOF module is provided with a light source, so that the local brightness is too high, and the brightness value of the local brightness too high area in the shooting area is eliminated by eliminating the target sum value of which the sum value is greater than the threshold value in the brightness value set, so that the brightness value of the target brightness image corresponding to the shooting area is calculated more accurately.
Optionally, the luminance value determining unit further includes:
a brightness value sorting subunit, configured to sort, in a high-low order, sum values in the brightness value set, except for the target sum value;
a sum value selecting subunit, configured to select a preset number of sum values arranged in the past;
the average value operator unit is specifically configured to:
and calculating the average value of the sum of the preset numbers arranged in the front.
The beneficial effects of the above embodiment are as follows: the brightness of the brightness image is calculated according to the average value of the brightness values in the middle, so that the error of eliminating the target sum value is made up, and the brightness value of the target brightness image corresponding to the shooting area is calculated more accurately.
Optionally, the apparatus further includes:
a brightness value difference calculation module for calculating the difference between the brightness value of the target brightness image and a reference brightness value;
and the exposure adjusting module is used for calculating an exposure gain coefficient based on the difference value and adjusting the exposure based on the exposure gain coefficient.
The beneficial effects of the above embodiment are as follows: and calculating an exposure gain coefficient according to the difference value between the brightness value of the target brightness image and the reference brightness value, and adjusting the exposure amount, thereby accelerating the automatic exposure speed.
Optionally, the image obtaining module is specifically configured to:
the method comprises the steps of obtaining at least two groups of brightness images shot by an iTOF module aiming at the same area, wherein each group of brightness images comprises two brightness images, the phase difference of the two brightness images is 180 degrees, and the phase difference of adjacent brightness images between each group of brightness images is 90 degrees.
The beneficial effects of the above embodiment are as follows: the grid division is carried out by acquiring at least two groups of brightness images and the brightness value of the target brightness image is calculated, so that the calculation mode is simpler, and the exposure efficiency can be effectively improved.
In a third aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
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 application, a plurality of luminance images with a phase difference of 90 ° shot by an ietf module for the same region are obtained, the plurality of luminance images are respectively subjected to grid division according to the same grid size, the luminance value of a pixel at a grid intersection point in each luminance image is obtained, and finally, the luminance value of a target luminance image corresponding to the region is determined based on the luminance value of a pixel at a grid intersection point in each luminance image. Therefore, the brightness value of the target brightness image corresponding to the shooting area is calculated by respectively acquiring the brightness values of the pixels at the grid intersections in the plurality of brightness images without acquiring the brightness values of the pixels outside the grid intersections, so that the workload of acquiring the brightness values of the pixels is reduced, the time for calculating the brightness values of the images is saved, and the automatic exposure speed is increased.
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 method for calculating brightness of an image according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram illustrating an example of a pixel at a grid intersection according to an embodiment of the present disclosure;
FIG. 3 is an exemplary diagram of pixels at intersections of another grid provided by an embodiment of the present application;
FIG. 4 is a schematic flowchart of another method for calculating brightness of an image according to an embodiment of the present disclosure;
FIG. 5 is a diagram illustrating an example of automatically setting a threshold of a brightness value according to an embodiment of the present disclosure;
FIG. 6 is a diagram illustrating an example of a reference luminance value setting according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an apparatus for calculating brightness of an image according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an image brightness value determining module according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a luminance value determining unit provided in an embodiment of the present application;
FIG. 10 is a schematic structural diagram of an apparatus for calculating brightness of an image according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
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. In the description of the present application, it is noted that, unless explicitly stated or limited otherwise, "including" and "having" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. 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 present application will be described in detail with reference to specific examples.
In one embodiment, as shown in fig. 1, a method for calculating brightness of an image is specifically proposed, which can be implemented by relying on a computer program and can be run on an encryption device based on software lifetime information of von neumann system. The computer program may be integrated into the application or may run as a separate tool-like application.
Specifically, the method for calculating the brightness of the image includes:
s101: and acquiring a plurality of brightness images of which the phase difference is 90 degrees and which are shot by the iTOF module aiming at the same area.
The iTOF module is a module for measuring the brightness value of a shooting area by using an indirect time-of-flight technology, and a core component of the iTOF module comprises a Vertical-Cavity Surface-Emitting Laser (VCSEL) and an image sensor.
The same region refers to a region including a photographic subject. And when a plurality of brightness images are acquired, the position and the direction of the iTOF module are kept unchanged, so that the areas of the acquired brightness images corresponding to the shooting objects are the same.
Specifically, the process of acquiring the plurality of luminance images is as follows: the VCSEL emits a modulated light wave of a specific frequency in a shooting area. The modulated light wave is reflected by a photographic subject in the photographic area to become reflected light and is transmitted to the image sensor. The image sensor receives the reflected light, performs photoelectric conversion, and outputs the luminance image.
The modulated light waves with the specific frequency are multiple light waves with the phase difference of 90 degrees, and multiple brightness images with the phase difference of 90 degrees are obtained through the multiple light waves with the phase difference of 90 degrees. Alternatively, taking four light waves with a phase difference of 90 ° as an example, the phases of the four light waves are 0 °, 90 °, 180 °, and 270 °, respectively, so as to obtain a luminance image with a phase of 0 °, a luminance image with a phase of 90 °, a luminance image with a phase of 180 °, and a luminance image with a phase of 270 °.
Specifically, the plurality of luminance images with a phase difference of 90 ° refer to at least two groups of luminance images, each group of luminance images includes two luminance images, the phase difference between the two luminance images is 180 °, and the phase difference between adjacent luminance images between each group of luminance images is 90 °.
The brightness images with the phase difference of 90 degrees comprise brightness values corresponding to each pixel on different phase images. For example, when the phase of the light wave is 0 °, the luminance image with the phase of 0 ° includes a luminance value corresponding to each pixel in the image.
S102: and respectively carrying out grid division on the multiple luminance images according to the same grid size to obtain the luminance value of the pixel at the grid intersection point in each luminance image.
The same grid size means that the positions and the sizes of the divided grids in the plurality of luminance images are the same in order to meet the condition that the grid intersection points of the plurality of luminance images correspond to the same position of the shooting area. Specifically, a MATLAB program for image processing, that is, dividing the plurality of luminance images by the same grid size, may be written in the ietof module.
The pixel is the smallest unit in the luminance image, with a well-defined position and assigned color value.
The pixel at the grid intersection point refers to a pixel on which the grid intersection point is located. As shown in fig. 2, an exemplary diagram of pixels at grid intersections includes a luminance image of one phase, a divided grid, and an enlarged image of the pixels at the grid intersections.
Specifically, the mesh may be divided by an MATLAB program, the positions of the pixels at the mesh intersections are extracted, and the brightness values corresponding to the pixels are obtained from the extracted pixel positions as the brightness values of the pixels at the mesh intersections in each of the brightness images.
Optionally, the pixels at the grid intersections refer to pixels within a certain range. The certain range is a range of a rectangular frame centered on a pixel where the grid intersection is located. An exemplary schematic diagram of pixels at grid intersections, as shown in fig. 3, includes a luminance image of one phase, a divided grid, and an enlarged image of pixels at grid intersections within a rectangular frame. Nine pixels within the rectangular box are the pixels at the grid intersections.
Specifically, a MATLAB program is used for respectively dividing grids of a plurality of luminance images and extracting the positions of pixels in a certain range at grid intersections, then the luminance values corresponding to the pixels are obtained through the extracted pixel positions, finally the obtained luminance values corresponding to the pixels are summed through a calculation module of an iTOF module, and the average value of the sum values is respectively used as the luminance values of the pixels at the grid intersections in the plurality of luminance images.
S103: and determining the brightness value of the target brightness image corresponding to the region based on the brightness value of the pixel at the grid intersection point in each brightness image.
The determining of the brightness value of the target brightness image corresponding to the region means that the brightness value of the target brightness image corresponding to the shooting region is obtained by calculating the brightness value of the pixels at the grid intersection point at the same position in the multiple brightness images with the phase difference of 90 degrees.
Specifically, taking this case as an example, the plurality of luminance images that are different in phase by 90 ° are respectively the first luminance image with a phase of 0 °, the second luminance image with a phase of 90 °, the third luminance image with a phase of 180 °, and the fourth luminance image with a phase of 270 °. Wherein the first group of luminance images includes a first luminance image with a phase of 0 ° and a third luminance image with a phase of 180 °, and the second group of luminance images includes a first luminance image with a phase of 90 ° and a third luminance image with a phase of 270 °. Generally, for the same pixel, the brightness difference between different phases is generally larger, and only a few pixels with darker brightness have smaller brightness difference between different phases. The difference in luminance of the images that are 180 ° out of phase represents the luminance value of the external environment, i.e., the luminance value of the target luminance image. And aiming at the pixels at the same grid intersection point, calculating a first difference value between the brightness value of the first brightness image and the brightness value of the third brightness image of the pixels in the first group of brightness images, calculating a second difference value between the brightness value of the second brightness image and the brightness value of the fourth brightness image of the pixels in the second group of brightness images, and calculating the sum of the absolute value of the first difference value and the absolute value of the second difference value. Wherein the absolute value of the first difference is indicative of the pixel luminance value corresponding to a first set of luminance images, the absolute value of the second difference is indicative of the pixel luminance value corresponding to a second set of luminance images, and the sum is the luminance value of the pixel.
The brightness value of the pixel at each grid intersection point of the target image is calculated by adopting the algorithm, the brightness value is added into the brightness value set, the brightness values are added to calculate the average value, and the average value is the brightness value of the target brightness image corresponding to the shooting area.
In the embodiment of the application, a plurality of brightness images with a phase difference of 90 degrees shot by an iTOF module in a same area are obtained first, then the plurality of brightness images are subjected to grid division according to the same grid size, the brightness value of a pixel at a grid intersection point in each brightness image is obtained, and finally the brightness value of a target brightness image corresponding to the area is determined based on the brightness value of the pixel at the grid intersection point in each brightness image. Therefore, the brightness value of the target brightness image corresponding to the shooting area is calculated by respectively acquiring the brightness values of the pixels at the grid intersections in the plurality of brightness images without acquiring the brightness values of the pixels outside the grid intersections, so that the workload of acquiring the brightness values of the pixels is reduced, the time for calculating the brightness values of the images is saved, and the automatic exposure speed is increased.
Referring to fig. 4, fig. 4 is a flowchart illustrating a method for calculating brightness of an image according to the present application. Specifically, the method comprises the following steps:
s201: and acquiring a plurality of brightness images of which the phase difference is 90 degrees and which are shot by the iTOF module aiming at the same area.
See S101 for details, which are not described herein.
S202: and respectively carrying out grid division on the multiple luminance images according to the same grid size to obtain the luminance value of the pixel at the grid intersection point in each luminance image.
See S102 for details, which are not described herein.
S203: and determining the brightness value of the target brightness image corresponding to the region based on the brightness value of the pixel at the grid intersection point in each brightness image.
And calculating the brightness value of the pixel at each grid intersection point of the target image, adding the brightness values into a brightness value set, and adding the brightness values to calculate an average value, wherein the average value is the brightness value of the target brightness image corresponding to the shooting area.
See S103 specifically, and the details are not repeated here.
Optionally, before the luminance values are added to calculate an average value, the luminance values of pixels with higher values in the luminance value set are removed. Specifically, a brightness value threshold is set, and when the brightness value of a pixel at a grid intersection of a target image in a brightness value set is higher than the brightness value threshold, the brightness value of the pixel is eliminated; when the brightness value of the pixel at the grid intersection of the target image in the set of brightness values is lower than the brightness value threshold, the brightness value of the pixel is retained. The brightness value threshold may be set manually according to an empirical value or automatically according to the type of the detected photographic subject. As shown in fig. 5, an exemplary diagram of detecting a type of a photographic subject and automatically setting a threshold of a brightness value is shown. The camera detects that the shooting object is a person, a scene, or a food, and the like, and sets a brightness value threshold value, so that a suitable brightness value of the target image is determined.
Optionally, the pixel brightness value with a higher value in the brightness value set is removed, so that the brightness value of the target image is smaller, and the exposure amount cannot be accurately adjusted. Therefore, after the pixel brightness values with higher values in the brightness value set are removed, the brightness values of the remaining pixels are sorted from large to small, the preset number of pixel brightness values arranged in the front are selected to be added to calculate an average value, and the average value is the brightness value of the target brightness image corresponding to the shooting area.
The sorting and selecting of the pixel intensity values can be done by a MATLAB program. The arrangement refers to the pixel luminance values with larger values. The preset number refers to the number of the selected pixel brightness values, and the preset number of encoding programs can be written into an MATLAB program, so that the preset number is set.
S204: and calculating the difference value between the brightness value of the target brightness image and the reference brightness value.
The reference brightness value refers to a brightness value required for adjusting the exposure amount to a target image to be photographed. The reference brightness value may be set manually or may be set by the device after the user selects the automatic setting. As shown in fig. 6, an exemplary diagram of a reference luminance value setting is shown, taking a smart phone as an example. The user can set the reference brightness value by inputting a numerical value, moving a slider or clicking an adjusting button, and can also select an 'automatic reference value' to set the reference brightness value through other components of the smartphone.
Specifically, the iTOF module calls a reference brightness value after determining the brightness value of the target brightness image, and performs difference calculation on the reference brightness value and the target brightness image through a calculation module.
S205: and calculating an exposure gain coefficient based on the difference, and adjusting the exposure amount based on the exposure gain coefficient.
The exposure amount refers to the light received by a photoreceptor in the shooting instrument in the exposure time. The photographing apparatus refers to an apparatus for exposing and imaging a photosensitive medium by reflecting light from a photographic object, such as a camera, a video recorder, a mobile phone camera, and the like. The exposure amount is equal to the product of the exposure time and the illuminance. Here, the exposure time is a time from pressing a shutter button of the photographing apparatus to releasing the shutter button, i.e., a shutter speed. Illuminance refers to the luminous flux of visible light received per unit area. The shooting instrument controls light rays to penetrate through the lens to enter the photosensitive surface in the machine body through the diaphragm, so that the illumination intensity is controlled.
The exposure gain coefficient is a coefficient obtained by converting a difference value between a brightness value of a target brightness image and a reference brightness value, and is used for determining and adjusting a shutter speed value and an aperture value.
Thus, the exposure amount can be adjusted by three methods: simultaneously adjusting the shutter speed and the aperture value by setting a program; the exposure is adjusted by adjusting the shutter speed, and when the shutter speed reaches the limit, the aperture value is adjusted, and the method is usually used for shooting a fast moving object; the exposure is adjusted by adjusting the aperture value, and when the aperture value reaches the limit, the shutter speed is adjusted.
In the embodiment of the application, the iTOF module is provided with a light source, so that the local brightness is too high, and the brightness value of the local brightness too high area in the shooting area is eliminated by eliminating the target sum value of which the sum value is greater than the threshold value in the brightness value set, so that the brightness value of the target brightness image corresponding to the shooting area is calculated more accurately. Meanwhile, the brightness of the brightness image is calculated according to the average value of the brightness values in the middle, so that the error of eliminating the target sum value is made up, and the accuracy of calculating the brightness value of the target brightness image is further improved. In addition, the exposure amount can be adjusted by respectively adjusting the shutter speed and the aperture value or simultaneously adjusting the shutter speed and the aperture value, so that the method can be flexibly applied to the condition of shooting different objects.
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.
Referring to fig. 7, a schematic structural diagram of a luminance calculating apparatus for an image according to an exemplary embodiment of the present application is shown. The means for calculating the brightness of the image may be implemented as all or part of the device in software, hardware or a combination of both. The apparatus 1 comprises an image acquisition module 11, a pixel luminance value acquisition module 12 and an image luminance value determination 13.
The image acquisition module 11 is configured to acquire a plurality of luminance images, which are shot by the ietf module in the same region and have a phase difference of 90 degrees;
a pixel brightness value obtaining module 12, configured to perform mesh division on the multiple brightness images according to the same mesh size, and obtain a brightness value of a pixel at a mesh intersection in each brightness image;
an image brightness value determining module 13, configured to determine, based on a brightness value of a pixel at a grid intersection in each of the brightness images, a brightness value of a target brightness image corresponding to the area.
Optionally, as shown in fig. 8, the image brightness value determining module 13 includes:
a difference value calculating unit 131, configured to calculate a difference value between luminance values of pixels at the same grid intersection in two spaced luminance images;
a sum value calculation unit 132 for calculating a sum value of absolute values of the difference values;
a brightness value determining unit 133, configured to add the sum value to a set of brightness values, and determine a brightness value of the target brightness image corresponding to the region based on the set of brightness values.
Optionally, as shown in fig. 9, the brightness value determining unit 133 includes:
and an average value operator unit 1331, configured to calculate an average value of each sum value in the brightness value set, and use the average value as a brightness value of the target brightness image corresponding to the region.
Optionally, the luminance value determining unit 133 further includes:
a target sum value removing subunit 1332, configured to remove target sum values in the brightness value set whose sum values are greater than a threshold;
the average value operator unit 1331 is specifically configured to:
an average of the sum values of the set of luminance values, except the target sum value, is calculated.
Optionally, the brightness value determining unit 133 further includes:
a luminance value sorting subunit 1333, configured to sort, in order of high or low, the sum values in the luminance value set, except for the target sum value;
a sum value selecting subunit 1334, configured to select a sum value of a preset number arranged in the past;
the average value operator unit 1331 is specifically configured to:
and calculating the average value of the sum of the preset numbers arranged in the front.
Optionally, as shown in fig. 10, the apparatus 1 further includes:
a luminance value difference calculation module 14, configured to calculate a difference between a luminance value of the target luminance image and a reference luminance value;
and the exposure adjusting module 15 is used for calculating an exposure gain coefficient based on the difference value and adjusting the exposure based on the exposure gain coefficient.
Optionally, the image obtaining module 11 is specifically configured to:
the method comprises the steps of obtaining at least two groups of brightness images shot by an iTOF module aiming at the same area, wherein each group of brightness images comprises two brightness images, the phase difference of the two brightness images is 180 degrees, and the phase difference of adjacent brightness images between each group of brightness images is 90 degrees.
In the embodiment of the application, a plurality of brightness images with a phase difference of 90 degrees shot by an iTOF module in a same area are obtained first, then the plurality of brightness images are subjected to grid division according to the same grid size, the brightness value of a pixel at a grid intersection point in each brightness image is obtained, and finally the brightness value of a target brightness image corresponding to the area is determined based on the brightness value of the pixel at the grid intersection point in each brightness image. Therefore, the brightness value of the target brightness image corresponding to the shooting area is calculated by respectively acquiring the brightness values of the pixels at the grid intersections in the plurality of brightness images without acquiring the brightness values of the pixels outside the grid intersections, so that the workload of acquiring the brightness values of the pixels is reduced, the time for calculating the brightness values of the images is saved, and the automatic exposure speed is increased.
It should be noted that, when the brightness calculation method of the image is executed by the brightness calculation apparatus of the image provided in the above embodiment, only the division of the above functional modules is taken as an example, in practical applications, the above 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 image brightness calculation apparatus provided in the above embodiment and the image brightness calculation method embodiment belong to the same concept, and details of implementation processes thereof are referred to in the method embodiment, and 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.
An embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method for calculating brightness of an image according to the embodiments shown in fig. 1 to 6, and a specific execution process may refer to specific descriptions of the embodiments shown in fig. 1 to 6, which is not described herein again.
The present application further provides a computer program product, where at least one instruction is stored, and the at least one instruction is loaded by the processor and executed by the method for calculating brightness of an image according to the embodiment shown in fig. 1 to 6, and a specific execution process may refer to specific descriptions of the embodiment shown in fig. 1 to 6, which is not described herein again.
Please refer to fig. 11, which is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 11, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, memory 1005, at least one communication bus 1002.
Wherein a communication bus 1002 is used to enable connective communication between these components.
The user interface 1003 may include a Display screen (Display) and a Camera (Camera), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
Processor 1001 may include one or more processing cores, among other things. The processor 1001 connects various parts throughout the server 1000 using various interfaces and lines, and performs various functions of the server 1000 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Alternatively, the processor 1001 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 1001 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 1001, but may be implemented by a single chip.
The Memory 1005 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable medium. The memory 1005 may be used to store an instruction, a program, code, a set of codes, or a set of instructions. The memory 1005 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 11, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a brightness calculation application program for images.
In the electronic device 1000 shown in fig. 11, the user interface 1003 is mainly used as an interface for providing input for a user, and acquiring data input by the user; and the processor 1001 may be configured to invoke a brightness calculation application for the image stored in the memory 1005, and specifically perform the following operations:
acquiring a plurality of brightness images with 90-degree phase difference shot by an iTOF module aiming at the same area;
respectively carrying out grid division on the multiple luminance images according to the same grid size to obtain the luminance value of the pixel at the grid intersection point in each luminance image;
and determining the brightness value of the target brightness image corresponding to the region based on the brightness value of the pixel at the grid intersection point in each brightness image.
In one embodiment, when the processor 1001 determines the luminance value of the target luminance image corresponding to the region based on the luminance value of the pixel at the grid intersection in each of the luminance images, the following operation is specifically performed:
calculating the difference value of the brightness values of pixels at the same grid intersection point in two spaced brightness images;
calculating a sum of absolute values of the differences;
and adding the sum value into a brightness value set, and determining the brightness value of the target brightness image corresponding to the region based on the brightness value set.
In one embodiment, when the processor 1001 determines the luminance value of the target luminance image corresponding to the region based on the luminance value set, it specifically performs the following operations:
and calculating the average value of the sum values in the brightness value set, and taking the average value as the brightness value of the target brightness image corresponding to the region.
In one embodiment, the processor 1001 further performs the following operations before performing the calculation of the average value of each sum value in the set of luminance values:
eliminating target sum values of which the sum values are larger than a threshold value in the brightness value set;
the calculating an average of each sum value in the set of luminance values comprises:
an average of the sum values of the set of luminance values, except the target sum value, is calculated.
In one embodiment, the processor 1001, before performing the calculation of the average of the sum values of the set of luminance values, except for the target sum value, further performs the following operations:
sorting sum values in the brightness value set except the target sum value according to a high-low order;
selecting the sum of the preset number arranged in the front;
said calculating an average of each sum value in said set of luminance values, except for said target sum value, comprises:
and calculating the average value of the sum of the preset numbers arranged in the front.
In one embodiment, after determining the brightness value of the target brightness image corresponding to the region, the processor 1001 further performs the following operations:
calculating a difference value between the brightness value of the target brightness image and a reference brightness value;
and calculating an exposure gain coefficient based on the difference, and adjusting the exposure amount based on the exposure gain coefficient.
In one embodiment, when the processor 1001 performs the following operation to acquire multiple luminance images with a phase difference of 90 ° captured by the ietf module for the same region:
the method comprises the steps of obtaining at least two groups of brightness images shot by an iTOF module aiming at the same area, wherein each group of brightness images comprises two brightness images, the phase difference of the two brightness images is 180 degrees, and the phase difference of adjacent brightness images between each group of brightness images is 90 degrees.
In the embodiment of the application, a plurality of brightness images with a phase difference of 90 degrees shot by an iTOF module in a same area are obtained first, then the plurality of brightness images are subjected to grid division according to the same grid size, the brightness value of a pixel at a grid intersection point in each brightness image is obtained, and finally the brightness value of a target brightness image corresponding to the area is determined based on the brightness value of the pixel at the grid intersection point in each brightness image. Therefore, the brightness value of the target brightness image corresponding to the shooting area is calculated by respectively acquiring the brightness values of the pixels at the grid intersections in the plurality of brightness images without acquiring the brightness values of the pixels outside the grid intersections, so that the workload of acquiring the brightness values of the pixels is reduced, the time for calculating the brightness values of the images is saved, and the automatic exposure speed is increased.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory or a random access memory.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (10)

1. A method for calculating brightness of an image, the method comprising:
acquiring a plurality of brightness images with 90-degree phase difference shot by an iTOF module aiming at the same area;
respectively carrying out grid division on the multiple luminance images according to the same grid size to obtain the luminance value of the pixel at the grid intersection point in each luminance image;
and determining the brightness value of the target brightness image corresponding to the region based on the brightness value of the pixel at the grid intersection point in each brightness image.
2. The method according to claim 1, wherein the determining the brightness value of the target brightness image corresponding to the region based on the brightness value of the pixel at the grid intersection in each of the brightness images comprises:
calculating the difference value of the brightness values of pixels at the same grid intersection point in two spaced brightness images;
calculating a sum of absolute values of the differences;
and adding the sum value into a brightness value set, and determining the brightness value of the target brightness image corresponding to the region based on the brightness value set.
3. The method of claim 2, wherein said determining a luminance value of the target luminance image corresponding to the region based on the set of luminance values comprises:
and calculating the average value of the sum values in the brightness value set, and taking the average value as the brightness value of the target brightness image corresponding to the region.
4. The method of claim 3, wherein prior to calculating the average of the sums of the set of luminance values, further comprising:
eliminating target sum values of which the sum values are larger than a threshold value in the brightness value set;
the calculating an average of each sum value in the set of luminance values comprises:
an average of the sum values of the set of luminance values, except the target sum value, is calculated.
5. The method of claim 4, wherein prior to calculating the average of the sums of the set of luminance values other than the target sum, further comprising:
sorting sum values in the brightness value set except the target sum value according to a high-low order;
selecting the sum value of the preset number arranged in the front;
said calculating an average of each sum value in said set of luminance values, except for said target sum value, comprises:
and calculating the average value of the sum of the preset numbers arranged in the front.
6. The method according to claim 1, wherein after determining the brightness value of the target brightness image corresponding to the region, the method further comprises:
calculating a difference value between the brightness value of the target brightness image and a reference brightness value;
and calculating an exposure gain coefficient based on the difference, and adjusting the exposure amount based on the exposure gain coefficient.
7. The method according to any one of claims 1 to 6, wherein the acquiring of the plurality of luminance images of the iTOF module with the phase difference of 90 ° for the same region comprises:
the method comprises the steps of obtaining at least two groups of brightness images shot by an iTOF module aiming at the same area, wherein each group of brightness images comprises two brightness images, the phase difference of the two brightness images is 180 degrees, and the phase difference of adjacent brightness images between each group of brightness images is 90 degrees.
8. An apparatus for calculating brightness of an image, the apparatus comprising:
the image acquisition module is used for acquiring a plurality of brightness images with the phase difference of 90 degrees, which are shot by the iTOF module aiming at the same area;
the pixel brightness value acquisition module is used for respectively carrying out grid division on the multiple brightness images according to the same grid size to acquire the brightness value of the pixel at the grid intersection point in each brightness image;
and the image brightness value determining module is used for determining the brightness value of the target brightness image corresponding to the region based on the brightness value of the pixel at the grid intersection point in each brightness image.
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. An electronic device, 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.
CN202010958930.3A 2020-09-14 2020-09-14 Image brightness calculation method and device, storage medium and electronic equipment Withdrawn CN112104815A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010958930.3A CN112104815A (en) 2020-09-14 2020-09-14 Image brightness calculation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010958930.3A CN112104815A (en) 2020-09-14 2020-09-14 Image brightness calculation method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112104815A true CN112104815A (en) 2020-12-18

Family

ID=73752066

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010958930.3A Withdrawn CN112104815A (en) 2020-09-14 2020-09-14 Image brightness calculation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112104815A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114708138A (en) * 2022-06-06 2022-07-05 天津联想协同科技有限公司 Network disk image watermark adding method and device, network disk and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114708138A (en) * 2022-06-06 2022-07-05 天津联想协同科技有限公司 Network disk image watermark adding method and device, network disk and storage medium
CN114708138B (en) * 2022-06-06 2022-10-04 天津联想协同科技有限公司 Network disk image watermark adding method and device, network disk and storage medium

Similar Documents

Publication Publication Date Title
CN108898567B (en) Image noise reduction method, device and system
CN109547701B (en) Image shooting method and device, storage medium and electronic equipment
CN110121882A (en) A kind of image processing method and device
CN107909569B (en) Screen-patterned detection method, screen-patterned detection device and electronic equipment
CN109040523B (en) Artifact eliminating method and device, storage medium and terminal
US9058655B2 (en) Region of interest based image registration
CN111667420B (en) Image processing method and device
CN109040589B (en) Image processing method, image processing device, storage medium and electronic equipment
CN109005367B (en) High dynamic range image generation method, mobile terminal and storage medium
CN110324532A (en) A kind of image weakening method, device, storage medium and electronic equipment
WO2021040896A1 (en) Automatically generating an animatable object from various types of user input
CN111028276A (en) Image alignment method and device, storage medium and electronic equipment
CN108665510B (en) Rendering method and device of continuous shooting image, storage medium and terminal
CN112104815A (en) Image brightness calculation method and device, storage medium and electronic equipment
CN112351197B (en) Shooting parameter adjusting method and device, storage medium and electronic equipment
CN114650361B (en) Shooting mode determining method, shooting mode determining device, electronic equipment and storage medium
CN113628259A (en) Image registration processing method and device
CN114339060A (en) Exposure adjusting method and device, storage medium and electronic equipment
CN115022552A (en) Camera exposure method for self-walking equipment and self-walking equipment
CN114255177B (en) Exposure control method, device, equipment and storage medium in imaging
CN112995633B (en) Image white balance processing method and device, electronic equipment and storage medium
CN111369612A (en) Three-dimensional point cloud image generation method and equipment
CN112861687B (en) Mask wearing detection method, device, equipment and medium for access control system
CN115037883A (en) Exposure parameter adjusting method and device, storage medium and electronic equipment
JP7475959B2 (en) Image processing device, image processing method, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information

Address after: 330096 No.699 Tianxiang North Avenue, Nanchang hi tech Industrial Development Zone, Nanchang City, Jiangxi Province

Applicant after: Jiangxi OMS Microelectronics Co.,Ltd.

Address before: 330096 Jiangxi Nanchang Nanchang hi tech Industrial Development Zone, east of six road, south of Tianxiang Avenue.

Applicant before: OFilm Microelectronics Technology Co.,Ltd.

CB02 Change of applicant information
WW01 Invention patent application withdrawn after publication

Application publication date: 20201218

WW01 Invention patent application withdrawn after publication