CN109525776B - Image acquisition method and device - Google Patents

Image acquisition method and device Download PDF

Info

Publication number
CN109525776B
CN109525776B CN201811295037.6A CN201811295037A CN109525776B CN 109525776 B CN109525776 B CN 109525776B CN 201811295037 A CN201811295037 A CN 201811295037A CN 109525776 B CN109525776 B CN 109525776B
Authority
CN
China
Prior art keywords
image
mean square
square error
determining
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811295037.6A
Other languages
Chinese (zh)
Other versions
CN109525776A (en
Inventor
郑佳枫
蒋青锋
卢二利
陈明珠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201811295037.6A priority Critical patent/CN109525776B/en
Publication of CN109525776A publication Critical patent/CN109525776A/en
Application granted granted Critical
Publication of CN109525776B publication Critical patent/CN109525776B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Landscapes

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

Abstract

The invention discloses an image acquisition method and device, wherein the method comprises the following steps: A. determining a first mean square error of the first image; B. judging whether the first mean square error is smaller than a pre-stored mean square error threshold value, if so, determining a second contrast according to the current first contrast and a preset contrast step length, and acquiring a second image; C. determining a second mean square error of the second image; D. and B, judging whether the second mean square error is smaller than a mean square error threshold value which is stored in advance, if not, taking the second image as a target image, if so, taking the second image as a first image, and performing the step A. And when the first mean square error is smaller than a mean square error threshold, determining a second contrast according to a preset contrast step length, determining a second image, if the second mean square error of the second image is not smaller than a pre-stored mean square error threshold, determining the second image as a target image, otherwise, continuously adjusting the contrast, so that the target image is ensured to be good in transparency and good in quality.

Description

Image acquisition method and device
Technical Field
The invention relates to the technical field of image processing, in particular to an image acquisition method and device.
Background
With the rapid development of the field of video monitoring, the magnification of a camera lens is also continuously improved, and particularly under many scenes, users have higher requirements on the quality of images acquired under high magnification. Due to the limitation of the manufacturing process of the lens, the collected image has reduced transparency along with the increase of the magnification, and the low transparency can cause the image to be frosty and affect the image quality. As shown in fig. 1, the two images in fig. 1 have low transparency and poor image quality.
In order to solve the problem that the image transparency is reduced along with the increase of the magnification, the prior art tries to alleviate the problem by improving the camera manufacturing process, but the improvement process is high in cost, difficult in the improvement manufacturing process and generally difficult to implement. In addition, because contrast is the main factor that influences image transparency, make the image transparency of collection better through artificial repetition adjustment contrast among the prior art. However, this wastes manpower, and the subjectivity is large by manual adjustment, and the finally obtained image does not necessarily satisfy the requirements.
Disclosure of Invention
The embodiment of the invention provides an image acquisition method and device, which are used for solving the problems of low image transparency and poor image quality in a large-magnification scene in the prior art.
The embodiment of the invention provides an image acquisition method, which comprises the following steps:
A. identifying a first brightness value of each first pixel point in a first image, and determining a first mean square error of the first image according to the first brightness value of each first pixel point;
B. judging whether the first mean square error is smaller than a pre-stored mean square error threshold value, if so, acquiring the current first contrast of the image acquisition equipment, determining a second contrast according to a preset contrast step length, controlling the image acquisition equipment to adjust to the second contrast, and acquiring a second image;
C. identifying a second brightness value of each second pixel point in the second image, and determining a second mean square error of the second image according to the second brightness value of each second pixel point;
D. and B, judging whether the second mean square error is smaller than a pre-stored mean square error threshold value, if not, taking the second image as a target image, if so, taking the second image as a first image, and performing the step A.
Further, the process of pre-saving the mean square error threshold value comprises:
under a wide-angle scene of a lens, obtaining a test image, identifying a third brightness value of each third pixel point in the test image, determining a third mean square error of the test image according to the third brightness value of each third pixel point, and taking and storing the third mean square error as a mean square error threshold.
Further, identifying the brightness value of each pixel point in the image, and determining the mean square error of the image according to the brightness value of each pixel point comprises:
dividing the image into a plurality of regions according to a preset rule, and determining the mean square error of each region according to the brightness value of each pixel point in the region aiming at each region;
and determining the mean square error of the image according to the mean square error of each region.
Further, determining the mean square error of the image according to the mean square error of each region comprises:
determining the sum of the mean square deviations of the images according to the mean square deviation of each region;
determining the weight of each region according to the sum of the mean square error of each region and the mean square error of the image;
and determining the mean square error of the image according to the mean square error of each region and the weight of each region.
Further, after the first mean square error is judged to be smaller than a pre-stored mean square error threshold, the current first contrast of the image acquisition device is obtained, and before the second contrast is determined according to a preset contrast step length, the method further comprises:
respectively determining the absolute value of the difference value of the mean square error of each region and other regions in the first image, counting the first number of the regions of which the absolute values are smaller than a preset first threshold, and taking the first number as the first number corresponding to the region;
and counting the second number of the area in the first image, judging whether the ratio of the first number to the second number is larger than a preset second threshold value, and if not, performing the subsequent steps.
Further, if there is a ratio of the first number to the second number greater than a preset second threshold, the method further includes:
and taking the first image as a target image.
In another aspect, an embodiment of the present invention provides an image capturing apparatus, where the apparatus includes:
the first determining module is used for identifying a first brightness value of each first pixel point in a first image and determining a first mean square error of the first image according to the first brightness value of each first pixel point;
the first judgment module is used for judging whether the first mean square error is smaller than a pre-stored mean square error threshold value or not, if so, acquiring the current first contrast of the image acquisition equipment, determining a second contrast according to a preset contrast step length, controlling the image acquisition equipment to adjust to the second contrast, and acquiring a second image;
the second determining module is used for identifying a second brightness value of each second pixel point in the second image and determining a second mean square error of the second image according to the second brightness value of each second pixel point;
and the second judgment module is used for judging whether the second mean square error is smaller than a pre-stored mean square error threshold value, if not, the second image is taken as a target image, and if so, the second image is taken as a first image, and the first determination module is triggered.
Further, the apparatus further comprises:
and the storage module is used for acquiring a test image in a wide-angle scene of a lens, identifying a third brightness value of each third pixel point in the test image, determining a third mean square error of the test image according to the third brightness value of each third pixel point, and storing the third mean square error as a mean square error threshold.
Further, the determining module is specifically configured to divide the image into a plurality of regions according to a preset rule, and determine, for each region, a mean square error of the region according to a brightness value of each pixel point in the region; and determining the mean square error of the image according to the mean square error of each region.
Further, the determining module is specifically configured to determine a sum of the mean square deviations of the images according to the mean square deviation of each region; determining the weight of each region according to the sum of the mean square error of each region and the mean square error of the image; and determining the mean square error of the image according to the mean square error of each region and the weight of each region.
Further, the apparatus further comprises:
a third judging module, configured to determine, for each region in the first image, an absolute value of a difference between the mean square deviations of the region and other regions, respectively, count a first number of regions whose absolute values are smaller than a preset first threshold, and use the first number as a first number corresponding to the region; and counting the second number of the area in the first image, judging whether the ratio of the first number to the second number is larger than a preset second threshold value, and if not, triggering the first judging module.
Further, the third determining module is further configured to take the first image as a target image if a ratio of the first number to the second number is greater than a preset second threshold.
The embodiment of the invention provides an image acquisition method and device, wherein the method comprises the following steps: A. identifying a first brightness value of each first pixel point in a first image, and determining a first mean square error of the first image according to the first brightness value of each first pixel point; B. judging whether the first mean square error is smaller than a pre-stored mean square error threshold value, if so, acquiring the current first contrast of the image acquisition equipment, determining a second contrast according to a preset contrast step length, controlling the image acquisition equipment to adjust to the second contrast, and acquiring a second image; C. identifying a second brightness value of each second pixel point in the second image, and determining a second mean square error of the second image according to the second brightness value of each second pixel point; D. and B, judging whether the second mean square error is smaller than a pre-stored mean square error threshold value, if not, taking the second image as a target image, if so, taking the second image as a first image, and performing the step A.
In the embodiment of the invention, when the first mean square error of the first image is smaller than a pre-stored mean square error threshold, the second contrast is determined according to a preset contrast step length, the second image is obtained, if the second mean square error of the second image is not smaller than the pre-stored mean square error threshold, the second image is determined as the target image, otherwise, the second image is used as the first image, and the contrast is continuously adjusted, so that the determined mean square error of the target image is larger than the pre-stored mean square error threshold, and the target image has good transparency and good quality.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of two images with low transparency in the prior art;
fig. 2 is a schematic diagram of an image acquisition process provided in embodiment 1 of the present invention;
fig. 3 is a schematic diagram of an image acquisition process provided in embodiment 5 of the present invention;
fig. 4 is a comparison graph of a first image and a target image in a first scene provided by the embodiment of the present invention;
fig. 5 is a comparison graph of a first image and a target image in a second scene provided in the embodiment of the present invention;
fig. 6 is a comparison graph of a first image and a target image in a third scene provided in the embodiment of the present invention;
fig. 7 is a schematic structural diagram of an image capturing device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the attached drawings, and it should be understood that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
Example 1:
fig. 2 is a schematic diagram of an image acquisition process provided in an embodiment of the present invention, where the process includes the following steps:
s101: identifying a first brightness value of each first pixel point in a first image, and determining a first mean square error of the first image according to the first brightness value of each first pixel point.
The image acquisition method provided by the embodiment of the invention is applied to the electronic equipment, and the electronic equipment can be image acquisition equipment such as a camera.
The electronic device can acquire the image in real time, and in the embodiment of the invention, the image acquired currently by the electronic device is used as the first image. After the electronic device collects the first image, the first brightness value of each first pixel point in the first image can be identified, and the first mean square error of the first image can be determined according to the first brightness value of each first pixel point.
Specifically, according to the first brightness value of each first pixel point, the first brightness average value is determined first, and then a formula is adopted
Figure BDA0001850944570000061
A first mean square error of the first image is determined. In the formula, n is the number of first pixel points in the first image, xnThe first brightness value of the nth pixel point in the first image is μ, the first brightness average value is μ, and the first mean square error is σ.
S102: and judging whether the first mean square error is smaller than a pre-stored mean square error threshold value, and if so, performing S103.
S103: the method comprises the steps of obtaining a current first contrast of an image acquisition device, determining a second contrast according to a preset contrast step length, controlling the image acquisition device to adjust to the second contrast, and obtaining a second image.
A mean square error threshold, which may be the mean square error of an image with sufficient transparency, may be pre-stored in the electronic device. The electronic device determines whether the first mean square error is less than a pre-stored mean square error threshold, and if so, determines that the first image is not clear of the requirement. Contrast is a key factor affecting image clarity, and the unsatisfactory image clarity is mainly caused by the low contrast of the image, so in the embodiment of the present invention, the clarity of the first image can be improved by increasing the contrast.
Specifically, a preset contrast step may be saved in the electronic device, and the contrast step may be a small contrast value, for example, 1, 2, and the like. After determining that the first mean square error of the first image is smaller than a pre-stored mean square error threshold, that is, after determining that the first image is not satisfactory in terms of transparency, the electronic device first obtains a current first contrast of the image acquisition device, that is, obtains a contrast of the image acquisition device when acquiring the first image, and then determines a second contrast according to the first contrast and a preset contrast step, for example, by adding the first contrast to the preset contrast step, the second contrast is obtained. And after the second contrast is determined, controlling the image acquisition device to adjust to the second contrast, wherein the image acquired after the image acquisition device adjusts the contrast is the second image in the embodiment of the invention.
S104: and identifying a second brightness value of each second pixel point in the second image, and determining a second mean square error of the second image according to the second brightness value of each second pixel point.
S105: and judging whether the second mean square error is smaller than a pre-stored mean square error threshold value, if not, performing S106, and if so, taking the second image as a first image, and performing S101.
S106: and taking the second image as a target image.
After the electronic device determines the second image, the second brightness value of each second pixel point in the second image can be identified, and the second mean square error of the second image can be determined according to the second brightness value of each second pixel point. The process of determining the second mean square error of the second image is the same as the process of determining the first mean square error of the first image, and is not repeated herein.
The electronic device then determines whether the second mean square error is less than a pre-stored mean square error threshold, and if so, determines that the second image's thoroughness is still unsatisfactory. And taking the second image as the first image, and continuously increasing the contrast until the second mean square error of the second image is not less than a pre-stored mean square error threshold value, and taking the second image as the target image.
In the embodiment of the invention, when the first mean square error of the first image is smaller than a pre-stored mean square error threshold, the second contrast is determined according to a preset contrast step length, the second image is obtained, if the second mean square error of the second image is not smaller than the pre-stored mean square error threshold, the second image is determined as the target image, otherwise, the second image is used as the first image, and the contrast is continuously adjusted, so that the determined mean square error of the target image is larger than the pre-stored mean square error threshold, and the target image has good transparency and good quality.
Example 2:
in order to ensure that the acquired target image is sufficiently thorough, an accurate mean square error threshold needs to be saved in the electronic device, and therefore, on the basis of the above embodiment, in the embodiment of the present invention, the process of saving the mean square error threshold in advance includes:
under a wide-angle scene of a lens, obtaining a test image, identifying a third brightness value of each third pixel point in the test image, determining a third mean square error of the test image according to the third brightness value of each third pixel point, and taking and storing the third mean square error as a mean square error threshold.
When the mean square error threshold is stored, the lens is adjusted to a wide-angle scene, a test image is collected in the wide-angle scene, and in order to further enable the determined mean square error threshold to be more accurate, the test image can contain richer contents as much as possible. And after the electronic equipment acquires the test image, identifying a third brightness value of each third pixel point in the test image, and determining a third mean square error of the test image according to the third brightness value of each third pixel point, wherein the third mean square error is a determined mean square error threshold value and is stored.
The process of determining the third mean square error of the third image is the same as the process of determining the first mean square error of the first image, and is not repeated herein.
Because the test image acquired under the wide-angle scene has better penetrability, the third mean square error of the test image is used as the mean square error threshold value, so that the penetrability of the obtained target image is better when the image is acquired subsequently.
Example 3:
in the foregoing embodiment, the mean square error of the image is determined according to the brightness value of each pixel point in the image, that is, the mean square error of the image is determined based on the global idea, so that the determined mean square error of the image may be inaccurate, for example, when the brightness value of the pixel point in the edge area of the image is small, and the brightness value of the pixel point in other areas is large, the mean square error of the image determined based on the global idea may be larger or smaller, in order to make the determination of the mean square error of the image more accurate to a certain extent, on the basis of the foregoing embodiments, in the embodiment of the present invention, the brightness value of each pixel point in the image is identified, and the determining of the mean square error of the image:
dividing the image into a plurality of regions according to a preset rule, and determining the mean square error of each region according to the brightness value of each pixel point in the region aiming at each region;
and determining the mean square error of the image according to the mean square error of each region.
The image in the embodiment of the present invention refers to the first image or the second image or the test image. After the electronic device acquires the image, the image is firstly divided into a plurality of areas according to a preset rule, wherein the divided areas can be circular areas, rhombic areas or irregular areas, and preferably, the image can be divided into a plurality of rectangular areas for the convenience of area division.
For example, a division is performed in the horizontal direction of the image by a, and b division is performed in the vertical direction of the image by b, so that a × b rectangular regions are obtained, wherein a and b may be the same or different.
After the electronic equipment divides the image into a plurality of areas, aiming at each area, the mean square error of the area is determined according to the brightness value of each pixel point in the area.
Specifically, for each region, according to the brightness value of each pixel point in the region, firstly, the brightness average value is determined, and then, the mean square error of the region is determined by adopting a mean square error calculation formula. The process of determining the mean square error of each region is the same as the process of determining the first mean square error of the first image, and is not repeated herein.
After the mean square difference of each area is determined, the mean square difference is calculated according to the formula
Figure BDA0001850944570000091
And determining the mean square error of the image, namely calculating the mean value of the mean square error of each area to obtain the mean square error of the image. Wherein p is the number of regions, σpIs the mean square error, σ, of each regionthreshIs the mean square error of the image.
In the embodiment of the invention, the mean square error of each region is determined, and then the mean square error of the image is determined according to the mean square error of each region, so that the determined mean square error of the image can be more accurate to a certain extent.
In addition, after the image is divided into a plurality of regions, a plurality of operation modules can be configured in the electronic device, mean square error calculation is performed on each region, and then the mean square error of the image is determined by one specified operation module.
Example 4:
in order to further make the determination of the mean square error of the image more accurate, on the basis of the above embodiments, in an embodiment of the present invention, the determining the mean square error of the image according to the mean square error of each region includes:
determining the sum of the mean square deviations of the images according to the mean square deviation of each region;
determining the weight of each region according to the sum of the mean square error of each region and the mean square error of the image;
and determining the mean square error of the image according to the mean square error of each region and the weight of each region.
After the electronic equipment determines the mean square difference of each area, the electronic equipment determinesDetermining the sum of the mean square deviations of the images, i.e. substituting the mean square deviations of each region into a formula
Figure BDA0001850944570000101
Wherein p is the number of regions, σpFor the mean square error of each region, the sum of the mean square errors σ is obtainedsum. Then for each region, the mean square error σ for that regionpSum of mean square error σsumDetermining the weight of the region, i.e. the mean square error σ of the regionpSum of mean square error σsumSubstitution into the formula omegap=σpsumAnd obtaining the weight of the region.
After determining the mean square error and the weight of each region, the electronic device may determine the mean square error of the image according to the mean square error and the weight of each region. That is, the mean square error and the weight of each region are substituted into the formula
Figure BDA0001850944570000102
The mean square error of the image is obtained.
In the embodiment of the present invention, for the region with a large mean square error, the corresponding weight is also larger, whereas for the region with a small mean square error, the corresponding weight is also smaller. Therefore, when the mean square error of the image is determined according to the mean square error of each area and the weight of each area, the area with the larger mean square error has a larger proportion, and the determined mean square error of the image is more accurate.
Example 5:
for a large area monochromatic image, the mean square error of the brightness is small, and even if the transparency is satisfied, the calculated mean square error is smaller than the mean square error threshold, so that misjudgment can be generated. In order to determine whether the image is more accurate in terms of the image transparency, on the basis of the above embodiments, in an embodiment of the present invention, after determining that the first mean square error is smaller than a pre-stored mean square error threshold, a current first contrast of the image capturing device is obtained, and before determining a second contrast according to a preset contrast step, the method further includes:
respectively determining the absolute value of the difference value of the mean square error of each region and other regions in the first image, counting the first number of the regions of which the absolute values are smaller than a preset first threshold, and taking the first number as the first number corresponding to the region;
and counting the second number of the area in the first image, judging whether the ratio of the first number to the second number is larger than a preset second threshold value, and if not, performing the subsequent steps.
In the embodiment of the present invention, after determining the mean square difference of each region in the first image, for each region in the first image, an absolute value of a difference between the mean square differences of the region and other regions may be determined, a preset first threshold may be stored in the electronic device, where the first threshold may be a smaller value, and the electronic device counts a first number of regions where the absolute value of the difference is smaller than the preset first threshold, where the first number of regions are regions with similar brightness.
The electronic device may also count a second number of regions in the first image, i.e., the total number of regions in the first image. The preset second threshold is stored in the electronic device, and the preset second threshold may be 0.5, 0.6, and the like. And determining a first number corresponding to each region, counting a second number of the regions in the first image, determining a ratio of each first number to the second number, and judging whether the ratio of the first number to the second number is larger than a preset second threshold. And if the first image does not exist, determining that the first image is not a large-area monochromatic image, judging that the first mean square error is smaller than a pre-stored mean square error threshold value at the moment, then acquiring the current first contrast of the image acquisition equipment, and determining a second contrast according to a preset contrast step.
If there is a ratio of the first number to the second number greater than a preset second threshold, the method further comprises:
and taking the first image as a target image.
And if the ratio of the first number to the second number is larger than a preset second threshold value, determining that the first image is a large-area monochromatic image, and directly taking the first image as a target image at the moment without adjusting the contrast.
In the embodiment of the invention, the electronic device respectively determines the absolute value of the difference value of the mean square error between each region and other regions for each region in the first image, counts the first number of regions with the absolute value smaller than a preset first threshold, and takes the first number as the first number corresponding to the region; and counting the second number of the area in the first image, judging whether the ratio of the first number to the second number is larger than a preset second threshold, if not, adjusting the contrast, and if so, taking the first image as a target image. Therefore, the large-area monochromatic image with better penetrability can be prevented from being wrongly judged as the image with poor penetrability, and the image penetrability can be more accurately determined.
Fig. 3 is a schematic diagram of an image acquisition process provided in an embodiment of the present invention, where the process includes the following steps:
s301: dividing the first image into a plurality of regions according to a preset rule, and determining the mean square error of each region according to the brightness value of each pixel point in the region aiming at each region; and determining the mean square error of the first image according to the mean square error of each region.
S302: and judging whether the first mean square error is smaller than a pre-stored mean square error threshold value, if so, performing S303, and if not, performing S308.
S303: and respectively determining the absolute value of the difference value of the mean square error of each region and other regions in the first image, counting the first number of the regions of which the absolute values are smaller than a preset first threshold, and taking the first number as the first number corresponding to the region.
S304: and counting the second number of the areas in the first image, judging whether the ratio of the first number to the second number is larger than a preset second threshold, if not, performing S305, and if so, performing S308.
S305: the method comprises the steps of obtaining a current first contrast of an image acquisition device, determining a second contrast according to a preset contrast step length, controlling the image acquisition device to adjust to the second contrast, and obtaining a second image.
S306: and identifying a second brightness value of each second pixel point in the second image, determining a second mean square error of the second image according to the second brightness value of each second pixel point, judging whether the second mean square error is smaller than a pre-stored mean square error threshold value, if so, taking the second image as a first image, and performing S301, and if not, performing S307.
S307: and taking the second image as a target image.
S308: and taking the first image as a target image.
Fig. 4 is a comparison diagram of a first image and a target image in a first scene provided by the embodiment of the present invention, fig. 5 is a comparison diagram of a first image and a target image in a second scene provided by the embodiment of the present invention, and fig. 6 is a comparison diagram of a first image and a target image in a third scene provided by the embodiment of the present invention. As can be seen from fig. 4, 5, and 6, the target image acquired by the method provided by the embodiment of the present invention has better transparency and higher image quality. In fig. 4, 5, and 6, the left side is the first image, and the right side is the target image.
Fig. 7 is a schematic structural diagram of an image capturing device according to an embodiment of the present invention, where the image capturing device includes:
a first determining module 71, configured to identify a first brightness value of each first pixel in a first image, and determine a first mean square error of the first image according to the first brightness value of each first pixel;
a first judging module 72, configured to judge whether the first mean square error is smaller than a pre-stored mean square error threshold, if so, obtain a current first contrast of an image capturing device, determine a second contrast according to a preset contrast step length, control the image capturing device to adjust to the second contrast, and obtain a second image;
a second determining module 73, configured to identify a second brightness value of each second pixel in the second image, and determine a second mean square error of the second image according to the second brightness value of each second pixel.
A second judging module 74, configured to judge whether the second mean square error is smaller than a mean square error threshold that is pre-stored, if not, take the second image as a target image, and if so, take the second image as a first image, and trigger the first determining module 71.
The device further comprises:
the storage module 75 is configured to obtain a test image in a wide-angle scene of a lens, identify a third brightness value of each third pixel in the test image, determine a third mean square error of the test image according to the third brightness value of each third pixel, and store the third mean square error as a mean square error threshold.
The first determining module 71 is specifically configured to divide the image into a plurality of regions according to a preset rule, and determine, for each region, a mean square error of the region according to a brightness value of each pixel point in the region; and determining the mean square error of the image according to the mean square error of each region.
The first determining module 71 is specifically configured to determine a sum of the mean square deviations of the images according to the mean square deviation of each region; determining the weight of each region according to the sum of the mean square error of each region and the mean square error of the image; and determining the mean square error of the image according to the mean square error of each region and the weight of each region.
The device further comprises:
a third determining module 76, configured to determine, for each region in the first image, an absolute value of a difference between the mean square deviations of the region and other regions, respectively, count a first number of regions whose absolute values are smaller than a preset first threshold, and use the first number as a first number corresponding to the region; counting the second number of the area in the first image, determining whether the ratio of the first number to the second number is greater than a preset second threshold, and if not, triggering the first determining module 72.
The third determining module 76 is further configured to, if the ratio of the first number to the second number is greater than a preset second threshold, take the first image as a target image.
The embodiment of the invention provides an image acquisition method and device, wherein the method comprises the following steps: A. identifying a first brightness value of each first pixel point in a first image, and determining a first mean square error of the first image according to the first brightness value of each first pixel point; B. judging whether the first mean square error is smaller than a pre-stored mean square error threshold value, if so, acquiring the current first contrast of the image acquisition equipment, determining a second contrast according to a preset contrast step length, controlling the image acquisition equipment to adjust to the second contrast, and acquiring a second image; C. identifying a second brightness value of each second pixel point in the second image, and determining a second mean square error of the second image according to the second brightness value of each second pixel point; D. and B, judging whether the second mean square error is smaller than a pre-stored mean square error threshold value, if not, taking the second image as a target image, if so, taking the second image as a first image, and performing the step A.
In the embodiment of the invention, when the first mean square error of the first image is smaller than a pre-stored mean square error threshold, the second contrast is determined according to a preset contrast step length, the second image is obtained, if the second mean square error of the second image is not smaller than the pre-stored mean square error threshold, the second image is determined as the target image, otherwise, the second image is used as the first image, and the contrast is continuously adjusted, so that the determined mean square error of the target image is larger than the pre-stored mean square error threshold, and the target image has good transparency and good quality.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (12)

1. An image acquisition method, characterized in that the method comprises:
A. identifying a first brightness value of each first pixel point in a first image, and determining a first mean square error of the first image according to the first brightness value of each first pixel point;
B. judging whether the first mean square error is smaller than a pre-stored mean square error threshold value, if so, acquiring the current first contrast of the image acquisition equipment, determining a second contrast according to a preset contrast step length, controlling the image acquisition equipment to adjust to the second contrast, and acquiring a second image;
C. identifying a second brightness value of each second pixel point in the second image, and determining a second mean square error of the second image according to the second brightness value of each second pixel point;
D. and B, judging whether the second mean square error is smaller than a pre-stored mean square error threshold value, if not, taking the second image as a target image, if so, taking the second image as a first image, and performing the step A.
2. The method of claim 1, wherein pre-saving the mean square error threshold comprises:
under a wide-angle scene of a lens, obtaining a test image, identifying a third brightness value of each third pixel point in the test image, determining a third mean square error of the test image according to the third brightness value of each third pixel point, and taking and storing the third mean square error as a mean square error threshold.
3. The method of claim 1 or 2, wherein identifying a luminance value for each pixel in an image, and determining a mean square error of the image based on the luminance value for each pixel comprises:
dividing the image into a plurality of regions according to a preset rule, and determining the mean square error of each region according to the brightness value of each pixel point in the region aiming at each region;
and determining the mean square error of the image according to the mean square error of each region.
4. The method of claim 3, wherein determining the mean square error of the image from the mean square error of each region comprises:
determining the sum of the mean square deviations of the images according to the mean square deviation of each region;
determining the weight of each region according to the sum of the mean square error of each region and the mean square error of the image;
and determining the mean square error of the image according to the mean square error of each region and the weight of each region.
5. The method as claimed in claim 3, wherein after determining that the first mean square error is smaller than a pre-stored mean square error threshold, acquiring a current first contrast of the image capturing device, and before determining a second contrast according to a preset contrast step, the method further comprises:
respectively determining the absolute value of the difference value of the mean square error of each region and other regions in the first image, counting the first number of other regions of which the absolute value is smaller than a preset first threshold, and taking the first number as the first number corresponding to the region;
and counting the second number of the area in the first image, judging whether the ratio of the first number to the second number is larger than a preset second threshold value, and if not, performing the subsequent steps.
6. The method of claim 5, wherein if there is a ratio of the first number to the second number that is greater than a preset second threshold, the method further comprises:
and taking the first image as a target image.
7. An image acquisition apparatus, characterized in that the apparatus comprises:
the first determining module is used for identifying a first brightness value of each first pixel point in a first image and determining a first mean square error of the first image according to the first brightness value of each first pixel point;
the first judgment module is used for judging whether the first mean square error is smaller than a pre-stored mean square error threshold value or not, if so, acquiring the current first contrast of the image acquisition equipment, determining a second contrast according to a preset contrast step length, controlling the image acquisition equipment to adjust to the second contrast, and acquiring a second image;
the second determining module is used for identifying a second brightness value of each second pixel point in the second image and determining a second mean square error of the second image according to the second brightness value of each second pixel point;
and the second judgment module is used for judging whether the second mean square error is smaller than a pre-stored mean square error threshold value, if not, the second image is taken as a target image, and if so, the second image is taken as a first image, and the first determination module is triggered.
8. The apparatus of claim 7, wherein the apparatus further comprises:
and the storage module is used for acquiring a test image in a wide-angle scene of a lens, identifying a third brightness value of each third pixel point in the test image, determining a third mean square error of the test image according to the third brightness value of each third pixel point, and storing the third mean square error as a mean square error threshold.
9. The apparatus according to claim 7 or 8, wherein the determining module is specifically configured to divide the image into a plurality of regions according to a preset rule, and determine, for each region, a mean square error of the region according to a brightness value of each pixel point in the region; and determining the mean square error of the image according to the mean square error of each region.
10. The apparatus according to claim 9, wherein the determining means is specifically configured to determine a sum of the mean square deviations of the images based on the mean square deviations of each of the regions; determining the weight of each region according to the sum of the mean square error of each region and the mean square error of the image; and determining the mean square error of the image according to the mean square error of each region and the weight of each region.
11. The apparatus of claim 9, wherein the apparatus further comprises:
a third judging module, configured to determine, for each region in the first image, an absolute value of a difference between the mean square deviations of the region and other regions, respectively, count a first number of other regions of which the absolute value is smaller than a preset first threshold, and use the first number as a first number corresponding to the region; and counting the second number of the area in the first image, judging whether the ratio of the first number to the second number is larger than a preset second threshold value, and if not, triggering the first judging module.
12. The apparatus of claim 11, wherein the third determining module is further configured to take the first image as a target image if a ratio of the first number to the second number is greater than a preset second threshold.
CN201811295037.6A 2018-11-01 2018-11-01 Image acquisition method and device Active CN109525776B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811295037.6A CN109525776B (en) 2018-11-01 2018-11-01 Image acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811295037.6A CN109525776B (en) 2018-11-01 2018-11-01 Image acquisition method and device

Publications (2)

Publication Number Publication Date
CN109525776A CN109525776A (en) 2019-03-26
CN109525776B true CN109525776B (en) 2020-12-08

Family

ID=65774014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811295037.6A Active CN109525776B (en) 2018-11-01 2018-11-01 Image acquisition method and device

Country Status (1)

Country Link
CN (1) CN109525776B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007096510A (en) * 2005-09-27 2007-04-12 Omron Corp Front photographing apparatus
CN101303765A (en) * 2008-06-23 2008-11-12 四川虹微技术有限公司 Method for reinforcing image contrast based on image mean-squared deviation
CN204258976U (en) * 2014-12-10 2015-04-08 泉州市宇云电子科技有限公司 A kind of vehicle-mounted panoramic visible system
CN104732487A (en) * 2013-12-20 2015-06-24 比亚迪股份有限公司 Method and system for enhancing picture contrast
CN106303250A (en) * 2016-08-26 2017-01-04 维沃移动通信有限公司 A kind of image processing method and mobile terminal
CN107203982A (en) * 2017-06-26 2017-09-26 郑州云海信息技术有限公司 A kind of image processing method and device
CN108009997A (en) * 2017-11-08 2018-05-08 青岛海信电器股份有限公司 Method and device for adjusting image contrast
CN108537736A (en) * 2017-02-28 2018-09-14 上海顺久电子科技有限公司 Method for enhancing picture contrast and device in a kind of camber display screen

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007096510A (en) * 2005-09-27 2007-04-12 Omron Corp Front photographing apparatus
CN101303765A (en) * 2008-06-23 2008-11-12 四川虹微技术有限公司 Method for reinforcing image contrast based on image mean-squared deviation
CN104732487A (en) * 2013-12-20 2015-06-24 比亚迪股份有限公司 Method and system for enhancing picture contrast
CN204258976U (en) * 2014-12-10 2015-04-08 泉州市宇云电子科技有限公司 A kind of vehicle-mounted panoramic visible system
CN106303250A (en) * 2016-08-26 2017-01-04 维沃移动通信有限公司 A kind of image processing method and mobile terminal
CN108537736A (en) * 2017-02-28 2018-09-14 上海顺久电子科技有限公司 Method for enhancing picture contrast and device in a kind of camber display screen
CN107203982A (en) * 2017-06-26 2017-09-26 郑州云海信息技术有限公司 A kind of image processing method and device
CN108009997A (en) * 2017-11-08 2018-05-08 青岛海信电器股份有限公司 Method and device for adjusting image contrast

Also Published As

Publication number Publication date
CN109525776A (en) 2019-03-26

Similar Documents

Publication Publication Date Title
CN110099222B (en) Exposure adjusting method and device for shooting equipment, storage medium and equipment
EP3641298B1 (en) Method and device for capturing target object and video monitoring device
CN109936698B (en) Automatic exposure control method and device, electronic equipment and storage medium
CN111491108B (en) Exposure parameter adjusting method and device
CN111770285B (en) Exposure brightness control method and device, electronic equipment and storage medium
US20150093040A1 (en) Backlight Detection Method and Device
CN103297789A (en) White balance correcting method and white balance correcting device
CN105740792B (en) Object detection method and device
CN110889328B (en) Method, device, electronic equipment and storage medium for detecting road traffic condition
CN113554004B (en) Detection method and detection system for material overflow of mixer truck, electronic equipment and mixing station
CN110784659B (en) Exposure control method and device and storage medium
CN110049240B (en) Camera control method and device, electronic equipment and computer readable storage medium
CN108419015A (en) A kind of focus method and device
CN110766711A (en) Video shot segmentation method, system, device and storage medium
CN112927247A (en) Graph cutting method based on target detection, graph cutting device and storage medium
CN111260604A (en) Fault detection method and device for fill-in light, electronic equipment and readable storage medium
CN111798482A (en) Target tracking method and device
US20110221921A1 (en) Electronic camera
CN109525776B (en) Image acquisition method and device
CN112492191A (en) Image acquisition method, device, equipment and medium
CN110428411B (en) Backlight plate detection method and system based on secondary exposure
US10748397B2 (en) Monitoring system
CN111885371A (en) Image occlusion detection method and device, electronic equipment and computer readable medium
CN107958222A (en) A kind of pavement detection method, apparatus and terminal
CN109151336B (en) Camera synchronization method, device and system, storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant