CN114845062A - Image processing method, nonvolatile storage medium, processor and electronic device - Google Patents

Image processing method, nonvolatile storage medium, processor and electronic device Download PDF

Info

Publication number
CN114845062A
CN114845062A CN202210469050.9A CN202210469050A CN114845062A CN 114845062 A CN114845062 A CN 114845062A CN 202210469050 A CN202210469050 A CN 202210469050A CN 114845062 A CN114845062 A CN 114845062A
Authority
CN
China
Prior art keywords
region
brightness
interest
sub
adjusted
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.)
Granted
Application number
CN202210469050.9A
Other languages
Chinese (zh)
Other versions
CN114845062B (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.)
Shenzhen Lianzhou International Technology Co Ltd
Original Assignee
Shenzhen Lianzhou International 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 Shenzhen Lianzhou International Technology Co Ltd filed Critical Shenzhen Lianzhou International Technology Co Ltd
Priority to CN202210469050.9A priority Critical patent/CN114845062B/en
Publication of CN114845062A publication Critical patent/CN114845062A/en
Application granted granted Critical
Publication of CN114845062B publication Critical patent/CN114845062B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/14Picture signal circuitry for video frequency region
    • H04N5/144Movement detection
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Abstract

The application provides an image processing method, a nonvolatile storage medium, a processor and an electronic device, wherein the method comprises the following steps: acquiring a time sequence image, and determining at least one region of interest by adopting motion detection; determining whether to adjust the brightness of the region of interest or not according to the average brightness and the preset brightness of the region of interest; under the condition that the adjustment of the brightness of the region of interest is determined, adjusting the brightness of the region of interest to reduce the difference value between the average brightness of the region of interest and the preset brightness; the timing sequence image of the region of interest after adjustment is output, the brightness of the region of interest is adjusted in the scheme, so that the brightness of each region of interest in the timing sequence image is guaranteed to be free of sudden change, the problem that each region of interest is overexposed or too dark is avoided, the picture quality of the output whole timing sequence image is guaranteed to be good, and the problem that the image quality is poor in the prior art is solved.

Description

Image processing method, nonvolatile storage medium, processor and electronic device
Technical Field
The present application relates to the field of image processing, and in particular, to an image processing method, a non-volatile storage medium, a processor, and an electronic device.
Background
With the social security getting more and more national importance, video monitoring has been widely applied to various fields, monitoring equipment needs to keep working for a long time at any time and any place, and ensuring normal and clear monitoring pictures becomes the basic requirement of video monitoring. Under the condition of low illumination at night, the problem of too dark images needs to be solved through infrared lamp light supplement for normal monitoring.
The scheme that the inventor knows, it is comparatively simple to the control of infrared light, generally controls the light filling of infrared lamp through simple opening and closing, and such mode luminance is fixed, and under night vision mode, near prospect object is because infrared reflection is stronger easily overexposed, and object far away apart from may be because infrared reflection is not enough and fuzzy, and the light filling effect of this scheme is relatively poor again.
Therefore, a method for improving the picture quality of an image is needed.
The above information disclosed in this background section is only for enhancement of understanding of the background of the technology described herein and, therefore, certain information may be included in the background that does not form the prior art that is already known in this country to a person of ordinary skill in the art.
Disclosure of Invention
The present application mainly aims to provide an image processing method, a non-volatile storage medium, a processor and an electronic device, so as to solve the problem of poor image quality in the prior art.
According to an aspect of the embodiments of the present invention, there is provided an image processing method, including: acquiring a time sequence image, and determining at least one region of interest by adopting motion detection; determining whether the brightness of the region of interest is adjusted or not according to the average brightness and preset brightness of the region of interest; under the condition that the adjustment of the brightness of the region of interest is determined, adjusting the brightness of the region of interest to reduce the difference value between the average brightness of the region of interest and the preset brightness; outputting the time sequence image comprising the adjusted region of interest.
Optionally, acquiring time series images and determining at least one region of interest using motion detection comprises: performing motion detection on a plurality of time sequence images to determine at least one motion area; and detecting a connected component of at least one motion area, and determining at least one region of interest.
Optionally, determining whether to adjust the brightness of the region of interest according to the average brightness of the region of interest and a preset brightness, includes: determining a first difference value between the average brightness and the preset brightness of the region of interest; and when the first difference value is not in a first preset range, determining to adjust the brightness of the region of interest.
Optionally, in a case that it is determined to adjust the brightness of the region of interest, after the adjusting the brightness of the region of interest, the method further includes: dividing the region of interest to obtain a plurality of sub-regions; acquiring the average brightness of a plurality of sub-regions; determining whether the brightness of the sub-regions is adjusted or not according to the average brightness of the plurality of sub-regions, the adjusted average brightness of the region of interest and the preset brightness; and under the condition that the adjustment of the brightness of the sub-area is determined, adjusting the brightness of the corresponding sub-area.
Optionally, determining whether to adjust the brightness of the sub-regions according to the average brightness of the plurality of sub-regions, the adjusted average brightness of the region of interest, and the preset brightness, includes: calculating the absolute value of the difference between the average brightness of each sub-region and the adjusted average brightness of the region of interest to obtain a plurality of second differences; obtaining a plurality of third difference values according to the absolute value of the difference value between the average brightness and the preset brightness of each sub-region; and determining to adjust the brightness of the corresponding sub-region under the condition that the second difference value is not in a second predetermined range and/or the corresponding third difference value is not in a third predetermined range.
Optionally, adjusting the brightness of the region of interest includes at least one of: adjusting a duty cycle of the region of interest; adjusting target brightness, gain and coding parameters of the AE of the region of interest, wherein adjusting brightness of the corresponding sub-region comprises at least one of: adjusting a duty cycle of the sub-region; target brightness, gain and coding parameters of the AEs of the subregions are adjusted.
Optionally, the method further comprises: determining whether the region of interest is updated to a non-motion region; in the event that an update to the non-motion region is determined, adjusting the brightness of the non-motion region.
According to another aspect of the embodiments of the present invention, there is also provided a nonvolatile storage medium including: the non-volatile storage medium includes a stored program, wherein the program executes any one of the image processing methods.
According to still another aspect of the embodiments of the present invention, there is further provided a processor, configured to execute a program, where the program executes any one of the image processing methods.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a processor; a memory for storing the processor-executable instructions, the memory communicatively coupled to the processor; wherein the processor is configured to execute the instructions to implement any of the image processing methods.
In the embodiment of the invention, in the image processing method, firstly, a time sequence image is obtained, and the obtained time sequence image is subjected to motion detection to obtain at least one region of interest; secondly, determining whether the brightness of the region of interest is adjusted or not according to the average brightness and the preset brightness of the region of interest; and then, under the condition that the brightness of the region of interest needs to be adjusted, adjusting the brightness of the region of interest to reduce the difference between the adjusted average brightness of the region of interest and the preset brightness, and finally, outputting the time sequence image comprising the adjusted region of interest. Compared with the prior art that the average brightness of the whole acquired time sequence image is compared with the preset brightness, and then the brightness of the time sequence image is adjusted, in the scheme, performing motion detection on the acquired time sequence image to obtain at least one region of interest, comparing the brightness of the obtained region of interest with preset brightness, in the event that it is determined that an adjustment of the brightness of the region of interest is required, adjusting the brightness of the region of interest, and outputting the adjusted time sequence image including the interested region, adjusting the brightness of the interested region in the scheme, thus ensuring that the brightness of each interested area in the time sequence image has no sudden change, avoiding the problem of overexposure or over darkness of each interested area, and the image quality of the output whole time sequence image is better, so that the problem of poor image quality in the prior art is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
FIG. 1 shows a schematic diagram of a method of processing an image according to an embodiment of the present application;
FIG. 2 shows a schematic diagram of an apparatus for processing an image according to an embodiment of the present application;
FIG. 3 shows a flow diagram of a method of processing an image according to an embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions of the present application better understood by those skilled in the art, 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 some embodiments of the present application, and not all 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.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
As mentioned in the background, in order to solve the above problem, in the prior art, the image quality is poor, and in an exemplary embodiment of the present application, an image processing method, a non-volatile storage medium, a processor and an electronic device are provided.
According to an embodiment of the present application, there is provided a method of processing an image.
Fig. 1 is a flowchart of a method of processing an image according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S101, acquiring a time sequence image, and determining at least one region of interest by adopting motion detection;
step S102, determining whether to adjust the brightness of the region of interest according to the average brightness and preset brightness of the region of interest;
step S103, under the condition that the brightness of the region of interest is determined to be adjusted, adjusting the brightness of the region of interest to reduce the difference value between the average brightness of the region of interest and the preset brightness;
and step S104, outputting the time sequence image comprising the adjusted region of interest.
In the image processing method, firstly, a time sequence image is obtained, and the obtained time sequence image is subjected to motion detection to obtain at least one region of interest; secondly, determining whether to adjust the brightness of the region of interest or not according to the average brightness and preset brightness of the region of interest; and then, under the condition that the brightness of the region of interest needs to be adjusted, adjusting the brightness of the region of interest to reduce the difference between the adjusted average brightness of the region of interest and the preset brightness, and finally, outputting the time sequence image comprising the adjusted region of interest. Compared with the prior art that the average brightness of the whole acquired time sequence image is compared with the preset brightness, and then the brightness of the time sequence image is adjusted, in the scheme, performing motion detection on the acquired time sequence image to obtain at least one region of interest, comparing the brightness of the obtained region of interest with preset brightness, in the event that it is determined that an adjustment of the brightness of the region of interest is required, adjusting the brightness of the region of interest, and outputting the adjusted time sequence image including the interested region, adjusting the brightness of the interested region in the scheme, thus ensuring no sudden change of brightness of each interested area in the time sequence image, avoiding the problem of overexposure or over-darkness of each interested area, and the image quality of the output whole time sequence image is better, so that the problem of poor image quality in the prior art is solved.
In addition, it should be noted that in the technical scheme of the application, each frame of the acquired time sequence image is detected in real time, whether an interested area of a corresponding frame in the time sequence image needs to be adjusted is determined, under the condition that the interested area needs to be adjusted, the brightness of the interested area is adjusted, the adjusted time sequence image including the interested area is output, and subsequently, the adjusted multi-frame time sequence images can be combined, so that a video with better image quality can be obtained.
In an actual application process, a time sequence image can be acquired through electronic equipment with a video or image acquisition function, such as a network camera, a smart phone, a tablet or a computer. Secondly, the preset brightness can be adjusted in advance according to the size of the area of the actual region of interest.
Of course, in the present scheme, the method for obtaining the average brightness of the region of interest is not limited, and only the average brightness of the region of interest needs to be obtained, for example, the sum of the brightness of the region of interest and the area of the region of interest may be obtained, and the sum of the brightness of the region of interest is divided by the area of the region of interest to obtain the average brightness of the region of interest.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
In order to determine the region of interest more accurately, in an embodiment of the present application, acquiring a time series image, and determining at least one region of interest by using motion detection includes: carrying out motion detection on a plurality of time sequence images to determine at least one motion area; and detecting a connected region of at least one motion region, and determining at least one region of interest.
In addition, in the practical application process, the connected domain detection is performed on the motion region, and the region of interest is determined by a plurality of methods.
In another embodiment of the present application, determining whether to adjust the brightness of the region of interest according to the average brightness of the region of interest and a preset brightness, includes: determining a first difference between the average brightness and the preset brightness of the region of interest; and determining to adjust the brightness of the region of interest when the first difference is not in a first preset range. In the embodiment, the first difference value is obtained according to the average brightness and the preset brightness of the region of interest, and when the first difference value is not within the first preset range, the brightness of the region of interest is determined to be adjusted, so that whether the brightness of the region of interest is adjusted is determined more simply.
Specifically, when the first difference is within the first predetermined range, it is determined that the brightness of the region of interest is not adjusted, that is, it can be understood that the brightness of the region of interest is not adjusted when the first difference is smaller than a certain tolerance, so that not only can the consumption of resources be reduced, but also the picture details of the region of interest can be retained, and the quality of the obtained time sequence image is further ensured to be good.
In order to achieve fine adjustment of the sub-regions and further ensure that the quality of the obtained time-series image is better, in another embodiment of the present application, after the adjusting the brightness of the region of interest is performed when it is determined that the brightness of the region of interest is adjusted, the method further includes: dividing the region of interest to obtain a plurality of sub-regions; acquiring the average brightness of a plurality of sub-regions; determining whether to adjust the brightness of the sub-regions according to the average brightness of the plurality of sub-regions, the adjusted average brightness of the region of interest and the preset brightness; and when the adjustment of the brightness of the sub-area is determined, adjusting the brightness of the corresponding sub-area.
Specifically, after the brightness of the region of interest is adjusted, a time-series image with better picture quality can be generally obtained, but the effect of individual sub-regions is still not good, therefore, in the scheme, the region of interest is further divided to obtain a plurality of sub-regions, the obtained average brightness of the plurality of sub-regions is obtained, whether the brightness of the sub-region is adjusted or not is determined according to the average brightness of the plurality of sub-regions, the adjusted average brightness of the region of interest and the preset brightness, and the brightness of the corresponding sub-region is adjusted under the condition that the brightness of the sub-region is determined to be adjusted, that is, the scheme realizes fine adjustment of the sub-region, and further ensures better quality of the obtained image.
In another embodiment of the present application, determining whether to adjust the brightness of the sub-regions according to the average brightness of the plurality of sub-regions, the adjusted average brightness of the region of interest, and the preset brightness includes: calculating the absolute value of the difference between the average brightness of each sub-region and the adjusted average brightness of the region of interest to obtain a plurality of second differences; obtaining a plurality of third difference values according to the absolute value of the difference value between the average brightness and the preset brightness of each sub-region; and determining to adjust the brightness of the corresponding sub-area under the condition that the second difference is not in a second preset range and/or the corresponding third difference is not in a third preset range. In this embodiment, a second difference value is obtained according to the average brightness of each sub-region and the adjusted average brightness of the region of interest, a plurality of third difference values are obtained according to the average brightness of each sub-region and the preset brightness, and when the second difference value is not within a second predetermined range, or the third difference value is not within a third predetermined range, or the second difference value is not within the second predetermined range and the third difference value is not within the third predetermined range, the brightness of the sub-region that needs to be adjusted is determined, so that whether the brightness of the sub-region is adjusted is determined more efficiently and comprehensively.
In an embodiment of the application, the adjusting the brightness of the region of interest includes at least one of: adjusting the duty ratio of the region of interest; adjusting the target brightness, gain and coding parameters of the AE of the region of interest, wherein adjusting the brightness of the corresponding sub-region comprises at least one of: adjusting the duty ratio of the sub-region; target brightness, gain and coding parameters of the AEs of the subregions are adjusted.
In a specific embodiment of the present application, for a camera with adjustable infrared lamp brightness, infrared lamp brightness control may be performed by adjusting a duty ratio PWM (Pulse Width Modulation for short), and for a camera with unadjustable infrared lamp brightness, a target brightness (target offset) of AE (Automatic exposure for short), a gain for limiting AE, and a quantization Parameter QP (quantum Parameter for short) are optimized, so that a moving target is clear.
In order to further ensure that the quality of the obtained image is good, in another embodiment of the present application, the method further includes: determining whether the region of interest is updated to a non-motion region; and adjusting the brightness of the non-motion area when the non-motion area is determined to be updated.
The embodiment of the present application further provides an image processing apparatus, and it should be noted that the image processing apparatus according to the embodiment of the present application may be used to execute the image processing method provided in the embodiment of the present application. The following describes an image processing apparatus according to an embodiment of the present application.
Fig. 2 is a schematic diagram of an image processing apparatus according to an embodiment of the present application. As shown in fig. 2, the apparatus includes:
a first acquisition unit 10, configured to acquire a time series image and determine at least one region of interest by using motion detection;
a determining unit 20, configured to determine whether to adjust the brightness of the region of interest according to the average brightness of the region of interest and a preset brightness;
a first adjusting unit 30, configured to, in a case that it is determined that the brightness of the region of interest is adjusted, adjust the brightness of the region of interest so as to reduce a difference between the average brightness of the region of interest and the preset brightness;
an output unit 40, configured to output the time-series image including the adjusted region of interest.
In the image processing device, the first obtaining unit is configured to obtain a time-series image, and determine at least one region of interest by using motion detection; the determining unit is used for determining whether to adjust the brightness of the region of interest according to the average brightness and preset brightness of the region of interest; the first adjusting unit is used for adjusting the brightness of the region of interest under the condition that the brightness of the region of interest is determined to be adjusted, so that the difference value between the average brightness of the region of interest and the preset brightness is reduced; the output unit is used for outputting the time sequence image comprising the adjusted interested region. Compared with the prior art that the average brightness of the whole acquired time sequence image is compared with the preset brightness, and then the brightness of the time sequence image is adjusted, in the scheme, performing motion detection on the acquired time sequence image to obtain at least one region of interest, comparing the brightness of the obtained region of interest with preset brightness, in the event that it is determined that an adjustment of the brightness of the region of interest is required, adjusting the brightness of the region of interest, and outputting the adjusted time sequence image including the interested region, adjusting the brightness of the interested region in the scheme, thus ensuring no sudden change of brightness of each interested area in the time sequence image, avoiding the problem of overexposure or over-darkness of each interested area, and the image quality of the output whole time sequence image is better, so that the problem of poor image quality in the prior art is solved.
In addition, it should be noted that in the technical scheme of the application, each frame of the acquired time sequence image is detected in real time, whether an area of interest of a corresponding frame in the time sequence image needs to be adjusted is determined, under the condition that the area of interest needs to be adjusted, the brightness of the area of interest is adjusted, the adjusted time sequence image including the area of interest is output, and subsequently, the adjusted multi-frame time sequence images can be combined, so that a video with better image quality can be obtained.
In an actual application process, a time sequence image can be acquired through electronic equipment with a video or image acquisition function, such as a network camera, a smart phone, a tablet or a computer. Secondly, the preset brightness can be adjusted in advance according to the size of the area of the actual region of interest.
Of course, in the present scheme, the method for obtaining the average brightness of the region of interest is not limited, and only the average brightness of the region of interest needs to be obtained, for example, the sum of the brightness of the region of interest and the area of the region of interest may be obtained, and the sum of the brightness of the region of interest is divided by the area of the region of interest to obtain the average brightness of the region of interest.
In order to determine the region of interest more accurately, in an embodiment of the present application, the first obtaining unit includes a first determining module and a second determining module, where the first determining module is configured to perform motion detection on a plurality of time-series images to determine at least one motion region; the second determining module is configured to perform connected domain detection on at least one of the motion regions, and determine at least one of the regions of interest.
In addition, in the practical application process, the connected domain detection is performed on the motion region, and the region of interest is determined by a plurality of methods.
In another embodiment of the present application, the determining unit includes a third determining module and a fourth determining module, wherein the third determining module is configured to determine a first difference between the average brightness and the preset brightness of the region of interest; the fourth determining module is configured to determine to adjust the brightness of the region of interest when the first difference is not within a first predetermined range. In the embodiment, the first difference value is obtained according to the average brightness and the preset brightness of the region of interest, and when the first difference value is not within the first preset range, the brightness of the region of interest is determined to be adjusted, so that whether the brightness of the region of interest is adjusted is determined more simply.
Specifically, when the first difference is within the first predetermined range, it is determined that the brightness of the region of interest is not adjusted, that is, it can be understood that the brightness of the region of interest is not adjusted when the first difference is smaller than a certain tolerance, so that not only can the consumption of resources be reduced, but also the picture details of the region of interest can be retained, and the quality of the obtained time sequence image is further ensured to be good.
In order to achieve fine adjustment of the sub-regions and further ensure that the quality of the obtained time sequence image is better, in another embodiment of the present application, the processing apparatus further includes a dividing unit, a second obtaining unit, a second adjusting unit and a third adjusting unit, where the dividing unit is configured to, under a condition that it is determined that the brightness of the region of interest is adjusted, divide the region of interest to obtain a plurality of sub-regions after adjusting the brightness of the region of interest; the second acquiring unit is used for acquiring the average brightness of a plurality of sub-areas; the second adjusting unit is configured to determine whether to adjust the brightness of the sub-regions according to the average brightness of the plurality of sub-regions, the adjusted average brightness of the region of interest, and the preset brightness; the third adjusting unit is configured to adjust the brightness of the corresponding sub-region when it is determined that the brightness of the sub-region is adjusted.
Specifically, after the brightness of the region of interest is adjusted, a time-series image with better picture quality can be generally obtained, but the effect of individual sub-regions is still not good, therefore, in the scheme, the region of interest is further divided to obtain a plurality of sub-regions, the obtained average brightness of the plurality of sub-regions is obtained, whether the brightness of the sub-region is adjusted or not is determined according to the average brightness of the plurality of sub-regions, the adjusted average brightness of the region of interest and the preset brightness, and the brightness of the corresponding sub-region is adjusted under the condition that the brightness of the sub-region is determined to be adjusted, that is, the scheme realizes fine adjustment of the sub-region, and further ensures better quality of the obtained image.
In yet another embodiment of the present application, the second adjusting unit includes a first calculating module, a second calculating module and a fifth determining module, wherein the first calculating module is configured to calculate an absolute value of a difference between the average brightness of each of the sub-regions and the adjusted average brightness of the region of interest, so as to obtain a plurality of second differences; the second calculating module is configured to obtain a plurality of third difference values according to an absolute value of a difference between the average brightness of each sub-region and the preset brightness; the fifth determining module is configured to determine that the brightness of the corresponding sub-area is not adjusted when the second difference is not within a second predetermined range and/or the corresponding third difference is not within a third predetermined range. In this embodiment, a second difference value is obtained according to the average brightness of each sub-region and the adjusted average brightness of the region of interest, a plurality of third difference values are obtained according to the average brightness of each sub-region and the preset brightness, and when the second difference value is not within a second predetermined range, or the third difference value is not within a third predetermined range, or the second difference value is not within the second predetermined range and the third difference value is not within the third predetermined range, the brightness of the sub-region that needs to be adjusted is determined, so that whether the brightness of the sub-region is adjusted is determined more efficiently and comprehensively.
In an embodiment of the application, the adjusting the brightness of the region of interest includes at least one of: adjusting the duty ratio of the region of interest; adjusting the target brightness, gain and coding parameters of the AE of the region of interest, wherein adjusting the brightness of the corresponding sub-region comprises at least one of: adjusting the duty ratio of the sub-region; target brightness, gain and coding parameters of the AEs of the subregions are adjusted.
In a specific embodiment of the present application, for a camera with adjustable infrared lamp brightness, infrared lamp brightness control may be performed by adjusting a duty ratio PWM (Pulse Width Modulation for short), and for a camera with unadjustable infrared lamp brightness, a target brightness (target offset) of AE (Automatic exposure for short), a gain for limiting AE, and a quantization Parameter QP (quantum Parameter for short) are optimized, so that a moving target is clear.
In order to further ensure that the quality of the obtained image is better, in another embodiment of the present application, the processing apparatus further includes an updating unit and a fourth adjusting unit, where the updating unit is configured to determine whether the region of interest is updated to a non-motion region; the fourth adjusting unit is configured to adjust the brightness of the non-moving area when the non-moving area is determined to be updated.
In order to make the technical solutions of the present application more clearly understood and more obvious to those skilled in the art, the following description is given with reference to specific embodiments:
examples
As shown in fig. 3, it is a flowchart of an image processing method of the present application, and the specific processing steps are: firstly, acquiring a time sequence image to be processed in an infrared lamp state, specifically, acquiring the time sequence image to be processed in real time through electronic equipment such as a network camera, a smart phone and a tablet personal computer which has a video or image acquisition function; secondly, carrying out motion detection on the time sequence image to obtain at least one motion area; then, detecting a connected region of the obtained at least one motion region to obtain at least one region of interest; thirdly, counting the average brightness of the region of interest, comparing the average brightness of the region of interest with the preset brightness, and determining whether to adjust the brightness of the region of interest; then, under the condition that the brightness of the region of interest is determined to be adjusted, adjusting the brightness of the region of interest, namely adjusting according to a preset infrared lamp brightness adjusting method: for the model with adjustable infrared lamp brightness, the infrared lamp brightness can be controlled by adjusting the duty ratio PWM, and for the model with nonadjustable brightness, the target brightness of AE is optimized or the gain of AE and the coding parameter QP are limited, so that the moving target is clear; the brightness of the region of interest can be adjusted to achieve better image quality, but the effect of individual sub-regions is not eliminated, so that after the region of interest is adjusted, namely after the region of interest is roughly adjusted, the region of interest can be divided into a plurality of sub-regions, whether the brightness of the sub-regions is adjusted or not is determined according to the average brightness of the sub-regions, the average brightness of the region of interest and preset brightness, and the brightness of the sub-regions is adjusted under the condition that the brightness of the sub-regions is determined to be adjusted; and finally, adjusting the brightness of the non-motion area, namely recovering the duty ratio and the target brightness, the gain and the coding parameter QP of the AE to preset values in a common state for the non-motion area, and outputting the optimized time sequence image in the infrared lamp state.
The image processing device comprises a processor and a memory, wherein the first acquisition unit, the determination unit, the first adjustment unit, the output unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the problem of poor image quality in the prior art is solved by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a non-volatile storage medium having a program stored thereon, which when executed by a processor implements the above-described image processing method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the processing method of the image is executed when the program runs.
In an exemplary embodiment of the present application, there is also provided an electronic device, including: a processor; a memory for storing instructions executable by said processor, said memory communicatively coupled to said processor; wherein the processor is configured to execute the instructions to implement the image processing method as any one of the above.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein when the processor executes the program, at least the following steps are realized:
step S101, acquiring a time sequence image, and determining at least one region of interest by adopting motion detection;
step S102, determining whether to adjust the brightness of the region of interest according to the average brightness and preset brightness of the region of interest;
step S103, under the condition that the brightness of the region of interest is determined to be adjusted, adjusting the brightness of the region of interest to reduce the difference value between the average brightness of the region of interest and the preset brightness;
and step S104, outputting the time sequence image comprising the adjusted region of interest.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program of initializing at least the following method steps when executed on a data processing device:
step S101, acquiring a time sequence image, and determining at least one region of interest by adopting motion detection;
step S102, determining whether to adjust the brightness of the region of interest according to the average brightness and preset brightness of the region of interest;
step S103, under the condition that the brightness of the region of interest is determined to be adjusted, adjusting the brightness of the region of interest to reduce the difference value between the average brightness of the region of interest and the preset brightness;
and step S104, outputting the time sequence image comprising the adjusted region of interest.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
From the above description, it can be seen that the above-described embodiments of the present application achieve the following technical effects:
1) the image processing method comprises the steps of firstly, acquiring a time sequence image, and carrying out motion detection on the acquired time sequence image to obtain at least one region of interest; secondly, determining whether to adjust the brightness of the region of interest or not according to the average brightness and preset brightness of the region of interest; and then, under the condition that the brightness of the region of interest needs to be adjusted, adjusting the brightness of the region of interest to reduce the difference between the adjusted average brightness of the region of interest and the preset brightness, and finally, outputting the time sequence image comprising the adjusted region of interest. Compared with the prior art that the average brightness of the whole acquired time sequence image is compared with the preset brightness, and then the brightness of the time sequence image is adjusted, in the scheme, performing motion detection on the acquired time sequence image to obtain at least one region of interest, comparing the brightness of the obtained region of interest with preset brightness, in the event that it is determined that an adjustment of the brightness of the region of interest is required, adjusting the brightness of the region of interest, and outputting the adjusted time sequence image including the interested region, adjusting the brightness of the interested region in the scheme, thus ensuring no sudden change of brightness of each interested area in the time sequence image, avoiding the problem of overexposure or over-darkness of each interested area, and the image quality of the output whole time sequence image is better, so that the problem of poor image quality in the prior art is solved.
2) In the image processing device, a first acquisition unit is used for acquiring a time sequence image and determining at least one region of interest by adopting motion detection; the determining unit is used for determining whether to adjust the brightness of the region of interest according to the average brightness and preset brightness of the region of interest; the first adjusting unit is used for adjusting the brightness of the region of interest under the condition that the brightness of the region of interest is determined to be adjusted, so as to reduce the difference value between the average brightness of the region of interest and the preset brightness; the output unit is used for outputting the time sequence image comprising the adjusted interested region. Compared with the prior art that the average brightness of the whole acquired time sequence image is compared with the preset brightness, and then the brightness of the time sequence image is adjusted, in the scheme, performing motion detection on the acquired time sequence image to obtain at least one region of interest, comparing the brightness of the obtained region of interest with preset brightness, in the event that it is determined that an adjustment of the brightness of the region of interest is required, adjusting the brightness of the region of interest, and outputting the adjusted time sequence image including the interested region, adjusting the brightness of the interested region in the scheme, thus ensuring no sudden change of brightness of each interested area in the time sequence image, avoiding the problem of overexposure or over-darkness of each interested area, and the image quality of the output whole time sequence image is better, so that the problem of poor image quality in the prior art is solved.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method of processing an image, comprising:
acquiring a time sequence image, and determining at least one region of interest by adopting motion detection;
determining whether the brightness of the region of interest is adjusted or not according to the average brightness and preset brightness of the region of interest;
under the condition that the adjustment of the brightness of the region of interest is determined, adjusting the brightness of the region of interest to reduce the difference value between the average brightness of the region of interest and the preset brightness;
outputting the time sequence image comprising the adjusted region of interest.
2. The method of claim 1, wherein acquiring time series images and determining at least one region of interest using motion detection comprises:
performing motion detection on a plurality of time sequence images to determine at least one motion area;
and carrying out connected domain detection on at least one motion region, and determining at least one region of interest.
3. The method of claim 1, wherein determining whether to adjust the brightness of the region of interest according to the average brightness of the region of interest and a preset brightness comprises:
determining a first difference value between the average brightness and the preset brightness of the region of interest;
and when the first difference value is not in a first preset range, determining to adjust the brightness of the region of interest.
4. The method according to claim 1, wherein in the case where it is determined that the adjustment is made to the brightness of the region of interest, after the adjustment is made to the brightness of the region of interest, the method further comprises:
dividing the region of interest to obtain a plurality of sub-regions;
acquiring the average brightness of a plurality of sub-regions;
determining whether the brightness of the sub-regions is adjusted or not according to the average brightness of the plurality of sub-regions, the adjusted average brightness of the region of interest and the preset brightness;
and under the condition that the adjustment of the brightness of the sub-area is determined, adjusting the brightness of the corresponding sub-area.
5. The method according to claim 4, wherein determining whether to adjust the brightness of the sub-regions according to the average brightness of the plurality of sub-regions, the adjusted average brightness of the region of interest, and the preset brightness comprises:
calculating the absolute value of the difference between the average brightness of each sub-region and the adjusted average brightness of the region of interest to obtain a plurality of second differences;
obtaining a plurality of third difference values according to the absolute value of the difference value between the average brightness and the preset brightness of each sub-region;
and determining to adjust the brightness of the corresponding sub-region under the condition that the second difference value is not in a second predetermined range and/or the corresponding third difference value is not in a third predetermined range.
6. The method of claim 4,
adjusting the brightness of the region of interest includes at least one of:
adjusting a duty cycle of the region of interest;
adjusting target brightness, gain and coding parameters of the AE of the region of interest,
adjusting the brightness of the corresponding sub-region comprises at least one of:
adjusting a duty cycle of the sub-region;
target brightness, gain and coding parameters of the AEs of the subregions are adjusted.
7. The method according to any one of claims 1 to 6, further comprising:
determining whether the region of interest is updated to a non-motion region;
in the event that an update to the non-motion region is determined, adjusting the brightness of the non-motion region.
8. A non-volatile storage medium characterized by comprising a stored program, wherein the program executes the image processing method according to any one of claims 1 to 7.
9. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to execute the method of processing the image according to any one of claims 1 to 7 when running.
10. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions, the memory communicatively coupled to the processor;
wherein the processor is configured to execute the instructions to implement the method of processing an image according to any one of claims 1 to 7.
CN202210469050.9A 2022-04-29 2022-04-29 Image processing method, nonvolatile storage medium, processor and electronic device Active CN114845062B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210469050.9A CN114845062B (en) 2022-04-29 2022-04-29 Image processing method, nonvolatile storage medium, processor and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210469050.9A CN114845062B (en) 2022-04-29 2022-04-29 Image processing method, nonvolatile storage medium, processor and electronic device

Publications (2)

Publication Number Publication Date
CN114845062A true CN114845062A (en) 2022-08-02
CN114845062B CN114845062B (en) 2024-04-02

Family

ID=82568322

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210469050.9A Active CN114845062B (en) 2022-04-29 2022-04-29 Image processing method, nonvolatile storage medium, processor and electronic device

Country Status (1)

Country Link
CN (1) CN114845062B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978710A (en) * 2015-07-02 2015-10-14 广东欧珀移动通信有限公司 Method and device for identifying and adjusting human face luminance based on photographing
CN106897963A (en) * 2017-01-04 2017-06-27 奇酷互联网络科技(深圳)有限公司 Adjust method, device and the terminal device of brightness of image
CN107205125A (en) * 2017-06-30 2017-09-26 广东欧珀移动通信有限公司 A kind of image processing method, device, terminal and computer-readable recording medium
CN110505412A (en) * 2018-05-18 2019-11-26 杭州海康威视数字技术股份有限公司 A kind of calculation method and device of area-of-interest brightness value
CN110569822A (en) * 2019-09-16 2019-12-13 深圳市商汤科技有限公司 image processing method and device, electronic equipment and storage medium
US20200005731A1 (en) * 2018-07-02 2020-01-02 Boe Technology Group Co., Ltd. Backlight adjustment method, device, system, head-up display and storage medium
WO2020113833A1 (en) * 2018-12-05 2020-06-11 北京图森未来科技有限公司 Image exposure and gain adjusting method, imaging apparatus and vehicle
CN111479070A (en) * 2019-01-24 2020-07-31 杭州海康机器人技术有限公司 Image brightness determination method, device and equipment
WO2020258808A1 (en) * 2019-06-27 2020-12-30 Zhejiang Dahua Technology Co., Ltd. Systems and methods for determining exposure parameter of an image capture device
WO2020261816A1 (en) * 2019-06-28 2020-12-30 ソニーセミコンダクタソリューションズ株式会社 Sending device, receiving device, and transmission system
CN113240590A (en) * 2021-04-13 2021-08-10 浙江大华技术股份有限公司 Image processing method and device
US20220044369A1 (en) * 2019-12-27 2022-02-10 Shenzhen Skyworth-Rgb Electronic Co., Ltd. Image processing method, terminal and non-transitory computer-readable storage medium
CN114066785A (en) * 2020-07-31 2022-02-18 北京小米移动软件有限公司 Image processing method and device, terminal and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978710A (en) * 2015-07-02 2015-10-14 广东欧珀移动通信有限公司 Method and device for identifying and adjusting human face luminance based on photographing
CN106897963A (en) * 2017-01-04 2017-06-27 奇酷互联网络科技(深圳)有限公司 Adjust method, device and the terminal device of brightness of image
CN107205125A (en) * 2017-06-30 2017-09-26 广东欧珀移动通信有限公司 A kind of image processing method, device, terminal and computer-readable recording medium
CN110505412A (en) * 2018-05-18 2019-11-26 杭州海康威视数字技术股份有限公司 A kind of calculation method and device of area-of-interest brightness value
US20200005731A1 (en) * 2018-07-02 2020-01-02 Boe Technology Group Co., Ltd. Backlight adjustment method, device, system, head-up display and storage medium
WO2020113833A1 (en) * 2018-12-05 2020-06-11 北京图森未来科技有限公司 Image exposure and gain adjusting method, imaging apparatus and vehicle
CN111479070A (en) * 2019-01-24 2020-07-31 杭州海康机器人技术有限公司 Image brightness determination method, device and equipment
WO2020258808A1 (en) * 2019-06-27 2020-12-30 Zhejiang Dahua Technology Co., Ltd. Systems and methods for determining exposure parameter of an image capture device
WO2020261816A1 (en) * 2019-06-28 2020-12-30 ソニーセミコンダクタソリューションズ株式会社 Sending device, receiving device, and transmission system
CN110569822A (en) * 2019-09-16 2019-12-13 深圳市商汤科技有限公司 image processing method and device, electronic equipment and storage medium
US20220044369A1 (en) * 2019-12-27 2022-02-10 Shenzhen Skyworth-Rgb Electronic Co., Ltd. Image processing method, terminal and non-transitory computer-readable storage medium
CN114066785A (en) * 2020-07-31 2022-02-18 北京小米移动软件有限公司 Image processing method and device, terminal and storage medium
CN113240590A (en) * 2021-04-13 2021-08-10 浙江大华技术股份有限公司 Image processing method and device

Also Published As

Publication number Publication date
CN114845062B (en) 2024-04-02

Similar Documents

Publication Publication Date Title
CN108335279B (en) Image fusion and HDR imaging
US10277820B2 (en) Scene motion correction in fused image systems
US8866927B2 (en) Determining an image capture payload burst structure based on a metering image capture sweep
EP2854389A1 (en) Scene recognition method and apparatus
US20180109711A1 (en) Method and device for overexposed photography
CN111586314B (en) Image fusion method and device and computer storage medium
CN105578068A (en) High-dynamic-range image generation method, device and mobile terminal
CN108322651B (en) Photographing method and device, electronic equipment and computer readable storage medium
US9087391B2 (en) Determining an image capture payload burst structure
CN110956679B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN110881108B (en) Image processing method and image processing apparatus
CN111510637A (en) Brightness adjusting method and device of light supplementing device, road light supplementing device and electronic equipment
CN109618102B (en) Focusing processing method and device, electronic equipment and storage medium
CN112738411B (en) Exposure adjusting method, exposure adjusting device, electronic equipment and storage medium
CN106791451B (en) Photographing method of intelligent terminal
CN105306806A (en) Mobile terminal and photographing method thereof
CN112258380A (en) Image processing method, device, equipment and storage medium
CN111489320A (en) Image processing method and device
CN112036201B (en) Image processing method, device, equipment and medium
CN113840095B (en) Light supplement lamp control method and related device
CN113747008B (en) Camera and light supplementing method
CN111127367A (en) Method, device and system for processing face image
CN114845062A (en) Image processing method, nonvolatile storage medium, processor and electronic device
CN109120856B (en) Camera shooting method and device
CN115278103A (en) Security monitoring image compensation processing method and system based on environment perception

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