CN113763293A - Image processing method, image processing device, computer readable storage medium and processor - Google Patents

Image processing method, image processing device, computer readable storage medium and processor Download PDF

Info

Publication number
CN113763293A
CN113763293A CN202110932762.5A CN202110932762A CN113763293A CN 113763293 A CN113763293 A CN 113763293A CN 202110932762 A CN202110932762 A CN 202110932762A CN 113763293 A CN113763293 A CN 113763293A
Authority
CN
China
Prior art keywords
mapping
gray
histogram
region
gray level
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110932762.5A
Other languages
Chinese (zh)
Inventor
杨宏双
陈德智
季云松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Fujirui Optoelectronic Technology Co ltd
Original Assignee
Beijing Fujirui Optoelectronic 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 Beijing Fujirui Optoelectronic Technology Co ltd filed Critical Beijing Fujirui Optoelectronic Technology Co ltd
Priority to CN202110932762.5A priority Critical patent/CN113763293A/en
Publication of CN113763293A publication Critical patent/CN113763293A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10048Infrared image

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

The application provides an image processing method, an image processing device, a computer readable storage medium and a processor. The method comprises the following steps: dividing an image to be processed into a plurality of areas; determining a gray level histogram of each region, wherein the horizontal axis of the gray level histogram represents gray level distribution, and the vertical axis of the gray level histogram represents the number of pixel points corresponding to each gray level; correcting each gray level histogram to obtain a corrected gray level histogram; under the condition that the gray value of the corrected gray histogram is not in the range of 0 to 255, mapping the gray value of each corrected gray histogram to the range of 0 to 255 to obtain a mapping area; and performing linear interpolation processing on the gray value of each mapping area to obtain an output image. The scheme enlarges the gray dynamic range of the target area, does not enlarge the dynamic range of the background area, improves the target contrast, inhibits background noise and effectively improves the image quality.

Description

Image processing method, image processing device, computer readable storage medium and processor
Technical Field
The present application relates to the field of image processing, and in particular, to an image processing method, an image processing apparatus, a computer-readable storage medium, and a processor.
Background
The image of the thermal infrared imager has the characteristics of high background, low contrast, low signal-to-noise ratio, fuzzy edge and the like; the image quality of thermal imaging systems is increasingly demanded. Therefore, the enhancement processing of the infrared image becomes an important means for improving the quality of the infrared image.
At present, a traditional histogram equalization processing algorithm is often adopted, and after the traditional histogram equalization algorithm is processed, the contrast of the background and noise is generally improved, the contrast of a target is reduced, and an over-bright phenomenon may occur in a high gray level area.
Disclosure of Invention
The present application mainly aims to provide an image processing method, an image processing apparatus, a computer-readable storage medium, and a processor, so as to solve the problem in the prior art that the processing effect of the conventional histogram equalization algorithm is poor.
In order to achieve the above object, according to an aspect of the present application, there is provided an image processing method including: dividing an image to be processed into a plurality of areas; determining a gray level histogram of each region, wherein the horizontal axis of the gray level histogram represents gray level distribution, and the vertical axis of the gray level histogram represents the number of pixel points corresponding to each gray level; correcting each gray level histogram to obtain a corrected gray level histogram; under the condition that the gray value of the corrected gray histogram is not in the range of 0 to 255, mapping the gray value of each corrected gray histogram to the range of 0 to 255 to obtain a mapping area; and performing linear interpolation processing on the gray value of each mapping area to obtain an output image.
Optionally, performing a correction process on each of the gray level histograms to obtain a corrected gray level histogram, including: determining a quantity threshold; adjusting the number of the pixel points larger than the number threshold value to the number threshold value; and keeping the number of the pixel points smaller than or equal to the number threshold unchanged.
Optionally, mapping the gray value of each of the modified gray histograms to a range from 0 to 255 to obtain a mapping region, including: acquiring the total number of pixel points of the corrected gray level histogram; acquiring the number of accumulated pixel points of each gray value in the corrected gray histogram; and mapping the gray value in the corrected gray histogram to a range from 0 to 255 according to the accumulated pixel number and the total pixel number to obtain the mapping area.
Optionally, mapping the gray value in the corrected gray histogram to a range from 0 to 255 according to the accumulated number of the pixels and the total number of the pixels to obtain the mapping region, including: the formula is adopted: and mapping the gray value in the corrected gray histogram to a range from 0 to 255 to obtain the mapping area, wherein P represents the mapped gray value, M represents the number of the accumulated pixels, and N represents the total number of the pixels.
Optionally, performing linear interpolation processing on each mapping region to obtain an output image, including: dividing each mapping area into four mapping sub-areas; keeping the gray value of a first type mapping sub-region unchanged, wherein the first type mapping sub-region is the mapping sub-region which is not adjacent to other mapping regions; performing the linear interpolation processing on a second type mapping sub-region in a transverse direction, wherein the second type mapping sub-region is the mapping sub-region adjacent to the other mapping regions only in the transverse direction; performing the linear interpolation processing on a third type mapping sub-region in the longitudinal direction, wherein the third type mapping sub-region is the mapping sub-region adjacent to the other mapping regions only in the longitudinal direction; and performing the linear interpolation processing on a fourth type mapping subregion in the transverse direction and the longitudinal direction, wherein the fourth type mapping subregion is the mapping subregion adjacent to the other mapping regions in the transverse direction and the longitudinal direction.
Optionally, the image to be processed is an image captured by a thermal infrared imager.
According to another aspect of the present application, there is provided an image processing apparatus including: the dividing unit is used for dividing the image to be processed into a plurality of areas; the determining unit is used for determining a gray histogram of each region, wherein the horizontal axis of the gray histogram represents gray value distribution, and the vertical axis of the gray histogram represents the number of pixel points corresponding to each gray value; the first processing unit is used for correcting each gray level histogram to obtain a corrected gray level histogram; a mapping unit, configured to map the gray scale value of each of the corrected gray scale histograms to a range from 0 to 255 to obtain a mapping region when the gray scale value of the corrected gray scale histogram is not in the range from 0 to 255; and the second processing unit is used for performing linear interpolation processing on each mapping area to obtain an output image.
Optionally, the first processing unit comprises: a determination module to determine a quantity threshold; the correction module is used for adjusting the number of the pixel points larger than the number threshold value to the number threshold value; and the processing module is used for keeping the number of the pixel points smaller than or equal to the number threshold unchanged.
According to still another aspect of the present application, there is provided a computer-readable storage medium including a stored program, wherein the program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform any one of the image processing methods.
According to yet another aspect of the present application, there is provided a processor for executing a program, wherein the program executes to perform any one of the image processing methods.
By applying the technical scheme of the application, the image to be processed is divided into a plurality of areas, then the gray histogram of each area is determined, then each gray histogram is corrected, the gray value of the corrected gray histogram is mapped to the range from 0 to 255, and finally the gray value of the mapping area is subjected to linear interpolation processing to obtain the output image. The output image obtained by adopting the scheme improves the contrast of the target, and the phenomenon of over-brightness of a high-gray area can not occur. The scheme enlarges the gray dynamic range of the target area, does not enlarge the dynamic range of the background area, improves the target contrast, inhibits background noise and effectively improves the image quality.
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 flow diagram of an image processing method according to an embodiment of the application;
FIG. 2 shows a grayscale histogram of a region according to an embodiment of the application;
FIG. 3 illustrates a modified gray-scale histogram according to an embodiment of the application;
FIG. 4 is a schematic diagram illustrating a linear interpolation of gray values of mapping regions according to an embodiment of the application;
FIG. 5 shows an image to be processed according to an embodiment of the application;
FIG. 6 shows an output image after processing using a prior art scheme;
FIG. 7 shows an output image after processing using the scheme of the present application;
fig. 8 shows a schematic diagram of an image processing apparatus according to an embodiment of the application.
Wherein the figures include the following reference numerals:
10. a first type mapping sub-region; 20. a second type mapping sub-region; 30. a third type mapping sub-region; 40. the fourth type maps sub-regions.
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 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 partial embodiments of the present application, but 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. Furthermore, 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.
It will be understood that when an element such as a layer, film, region, or substrate is referred to as being "on" another element, it can be directly on the other element or intervening elements may also be present. Also, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element or "connected" to the other element through a third element.
As introduced in the background art, the conventional histogram equalization algorithm in the prior art has a poor processing effect, and to solve the problem of the poor processing effect of the conventional histogram equalization algorithm, embodiments of the present application provide an image processing method, an image processing apparatus, a computer-readable storage medium, and a processor.
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, dividing an image to be processed into a plurality of areas;
step S102, determining a gray level histogram of each region, wherein the horizontal axis of the gray level histogram represents gray level distribution, and the vertical axis of the gray level histogram represents the number of pixel points corresponding to each gray level;
step S103, correcting each gray level histogram to obtain a corrected gray level histogram;
step S104, under the condition that the gray value of the corrected gray histogram is not in the range of 0 to 255, mapping the gray value of each corrected gray histogram to the range of 0 to 255 to obtain a mapping area;
and step S105, performing linear interpolation processing on the gray values of the mapping areas to obtain an output image.
In the scheme, the image to be processed is divided into a plurality of areas, then the gray histogram of each area is determined, then each gray histogram is corrected, the gray value of the corrected gray histogram is mapped to the range from 0 to 255, and finally the gray value of the mapping area is subjected to linear interpolation processing to obtain the output image. The output image obtained by adopting the scheme improves the contrast of the target, and the phenomenon of over-brightness of a high-gray area can not occur. The scheme enlarges the gray dynamic range of the target area, does not enlarge the dynamic range of the background area, improves the target contrast, inhibits background noise and effectively improves the image quality.
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 an embodiment of the present application, the obtaining a modified gray-scale histogram by performing a modification process on each of the gray-scale histograms includes: determining a quantity threshold; adjusting the number of the pixel points larger than the number threshold value to the number threshold value; and keeping the number of the pixel points smaller than or equal to the number threshold unchanged. For example, fig. 2 is a gray level histogram before being corrected, and for example, fig. 3 is a corrected gray level histogram after being corrected, the number of the pixel points greater than the number threshold is corrected to the number threshold, so that the number of the pixel points corresponding to one or some pixel values is reduced. Further reducing the computational load of subsequent mappings.
In an embodiment of the present application, mapping the gray scale value of each of the modified gray scale histograms to a range from 0 to 255 to obtain a mapping region includes: acquiring the total number of pixel points of the corrected gray level histogram; acquiring the number of accumulated pixel points of each gray value in the corrected gray histogram; and mapping the gray value in the corrected gray histogram to a range from 0 to 255 according to the accumulated number of the pixel points and the total number of the pixel points to obtain the mapping area. The gray values of the corrected gray histograms are in different intervals, and in order to ensure the processing effect of the image, the gray value of each corrected gray histogram is mapped to be in a range from 0 to 255. For example, grayscale values of 100-1000 are mapped to a range of 0 to 255, and grayscale values of 50-500 are mapped to a range of 0 to 255. Since only an 8-bit image can be displayed on a general display device, the gray scale value of each of the above-described modified gray scale histograms is mapped to a range of 0 to 255 in order to facilitate displaying an image on a display device.
In an embodiment of the application, mapping the gray value in the corrected gray histogram to a range from 0 to 255 according to the accumulated number of the pixels and the total number of the pixels to obtain the mapping region includes: the formula is adopted: and mapping the gray value in the corrected gray histogram to a range from 0 to 255 to obtain the mapping area, wherein P represents the mapped gray value, M represents the number of the accumulated pixels, and N represents the total number of the pixels. The accumulated number of pixels refers to the number of pixels accumulated from the number of pixels corresponding to the minimum pixel value to the number of pixels corresponding to the current pixel value, and as shown in fig. 3, the accumulated number of pixels corresponding to the pixel value 50 is the sum of the number of pixels corresponding to the pixel value 0-10, the number of pixels corresponding to 10-20, the number of pixels corresponding to 20-30, the number of pixels corresponding to 30-40, and the number of pixels corresponding to 40-50. The total number of pixels refers to the sum of all the pixel numbers in fig. 3.
In an embodiment of the present application, as shown in fig. 4, performing linear interpolation processing on each of the mapping regions to obtain an output image includes: dividing each mapping area into four mapping sub-areas; keeping the gray value of a first type mapping sub-region 10 unchanged, wherein the first type mapping sub-region 10 is the mapping sub-region which is not adjacent to other mapping regions; performing the linear interpolation processing on a second-type mapping sub-region 20 in a lateral direction, the second-type mapping sub-region 20 being the mapping sub-region adjacent to the other mapping regions only in the lateral direction; performing the linear interpolation processing on a third-type mapping sub-region 30 in the longitudinal direction, where the third-type mapping sub-region 30 is the mapping sub-region adjacent to the other mapping regions only in the longitudinal direction; the linear interpolation processing is performed on the fourth-type map sub-area 40 in both the lateral direction and the longitudinal direction, and the fourth-type map sub-area 40 is the map sub-area adjacent to the other map area in both the lateral direction and the longitudinal direction. The region where the gradation at the boundary of the mapping region is highlighted is processed as a region where the gradation changes continuously by the linear interpolation processing. Ensuring that the output image has no gray abrupt change.
In a specific embodiment, as shown in fig. 4, no linear interpolation processing is performed on the first-type mapping sub-region 10, the linear interpolation processing is performed only in the lateral direction on the second-type mapping sub-region 20, the linear interpolation processing is performed only in the longitudinal direction on the third-type mapping sub-region 30, and the linear interpolation processing is performed on the fourth-type mapping sub-region 40 in both the lateral direction and the longitudinal direction, taking the fourth-type mapping sub-region 40 as an example, a specific processing principle of the linear interpolation is as follows:
let the pixel value after mapping of a certain pixel value in the fourth type mapping sub-region 40 be: pA1(i, j), the mapping values of the other three regions are PA2(i,j)、PA3(i,j)、PA4(i, j). Let the width of the region be W, the height be H, the interpolated value be P:
Px1=(PA1(i,j)×I1+PA2(i,j)×I2)/W,
Px2=(PA3(i,j)×I1+PA4(i,j)×I2)/W,
P=((Px1×I3)+(Px2×I4))/H。
specifically, the image to be processed is an image captured by a thermal infrared imager. By adopting the scheme, the image captured by the thermal infrared imager is processed, the gray dynamic range of the target area is enlarged, the dynamic range of the background area is not enlarged, the target contrast is improved, the background noise is suppressed, and the image quality is effectively improved.
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. 8 is a schematic diagram of an image processing apparatus according to an embodiment of the present application. As shown in fig. 8, the apparatus includes:
a dividing unit 100 configured to divide an image to be processed into a plurality of regions;
a determining unit 200 configured to determine a gray histogram of each of the regions, wherein a horizontal axis of the gray histogram represents gray value distribution, and a vertical axis of the gray histogram represents the number of pixels corresponding to each of the gray values;
a first processing unit 300, configured to perform correction processing on each of the grayscale histograms to obtain a corrected grayscale histogram;
a mapping unit 400, configured to map the gray scale value of each of the corrected gray scale histograms to a range from 0 to 255 to obtain a mapping region when the gray scale value of the corrected gray scale histogram is not in the range from 0 to 255;
the second processing unit 500 is configured to perform linear interpolation processing on each of the mapping regions to obtain an output image.
In the scheme, the dividing unit divides the image to be processed into a plurality of regions, the determining unit determines the gray level histograms of the regions, the first processing unit performs correction processing on the gray level histograms, the mapping unit maps the gray level values of the corrected gray level histograms into a range from 0 to 255, and the second processing unit performs linear interpolation processing on the gray level values of the mapping regions to obtain the output image. The output image obtained by adopting the scheme improves the contrast of the target, and the phenomenon of over-brightness of a high-gray area can not occur.
In one embodiment of the application, the first processing unit includes a determining module, a modifying module and a first processing module, wherein the determining module is configured to determine a quantity threshold; the correction module is used for adjusting the number of the pixel points larger than the number threshold value to the number threshold value; the first processing module is used for keeping the number of the pixel points smaller than or equal to the number threshold unchanged.
In an embodiment of the present application, the mapping unit includes a first obtaining module, a second obtaining module, and a mapping module, where the first obtaining module is configured to obtain a total number of pixel points of the modified gray histogram; the second acquisition module is used for acquiring the number of accumulated pixel points of each gray value in the corrected gray histogram; and the mapping module is used for mapping the gray value in the corrected gray histogram to a range from 0 to 255 according to the accumulated number of the pixel points and the total number of the pixel points to obtain the mapping area.
In an embodiment of the application, the mapping module is further configured to use a formula: and mapping the gray value in the corrected gray histogram to a range from 0 to 255 to obtain the mapping area, wherein P represents the mapped gray value, M represents the number of the accumulated pixels, and N represents the total number of the pixels.
In an embodiment of the present application, the second processing unit includes an averaging module, a second processing module, a third processing module, a fourth processing module, and a fifth processing module, and the averaging module is configured to equally divide each of the mapping regions into four mapping sub-regions; the second processing module is used for keeping the gray value of a first type mapping sub-region unchanged, wherein the first type mapping sub-region is the mapping sub-region which is not adjacent to other mapping regions; a third processing module, configured to perform the linear interpolation processing on a second-type mapping sub-region in a lateral direction, where the second-type mapping sub-region is the mapping sub-region adjacent to the other mapping regions only in the lateral direction; a fourth processing module, configured to perform the linear interpolation processing on a third-type mapping sub-region in a longitudinal direction, where the third-type mapping sub-region is the mapping sub-region that is adjacent to the other mapping regions only in the longitudinal direction; the fifth processing module is configured to perform the linear interpolation processing on a fourth type mapping sub-region in both the lateral direction and the longitudinal direction, where the fourth type mapping sub-region is the mapping sub-region adjacent to the other mapping regions in both the lateral direction and the longitudinal direction.
The image processing device comprises a processor and a memory, wherein the dividing unit, the determining unit, the first processing unit, the mapping unit, the second processing 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, and the contrast of the image is improved by adjusting the 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.
The embodiment of the invention provides a computer-readable storage medium, which comprises a stored program, wherein when the program runs, a device where the computer-readable storage medium is located is controlled to execute the 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.
The embodiment of the invention provides a thermal infrared imager, which comprises a processor, a memory and a program which is stored on the memory and can be run on the processor, wherein the processor is used for executing any one of the image processing methods.
Specifically, the thermal infrared imager further comprises a display device, and the display device is used for displaying the output image.
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, dividing an image to be processed into a plurality of areas;
step S102, determining a gray level histogram of each region, wherein the horizontal axis of the gray level histogram represents gray level distribution, and the vertical axis of the gray level histogram represents the number of pixel points corresponding to each gray level;
step S103, correcting each gray level histogram to obtain a corrected gray level histogram;
step S104, under the condition that the gray value of the corrected gray histogram is not in the range of 0 to 255, mapping the gray value of each corrected gray histogram to the range of 0 to 255 to obtain a mapping area;
and step S105, performing linear interpolation processing on the gray values of the mapping areas to obtain an output image.
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, dividing an image to be processed into a plurality of areas;
step S102, determining a gray level histogram of each region, wherein the horizontal axis of the gray level histogram represents gray level distribution, and the vertical axis of the gray level histogram represents the number of pixel points corresponding to each gray level;
step S103, correcting each gray level histogram to obtain a corrected gray level histogram;
step S104, under the condition that the gray value of the corrected gray histogram is not in the range of 0 to 255, mapping the gray value of each corrected gray histogram to the range of 0 to 255 to obtain a mapping area;
and step S105, performing linear interpolation processing on the gray values of the mapping areas to obtain an output image.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. 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.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
Examples
The embodiment relates to a specific image processing method, which comprises the following steps:
step A: dividing an image to be processed into 9 regions with equal size;
and B: acquiring a gray level histogram of each region, wherein fig. 2 shows the gray level histogram of one region;
and C: performing correction processing on each gray level histogram to obtain a corrected gray level histogram, wherein fig. 3 is the corrected gray level histogram obtained after the gray level histogram in fig. 2 is corrected;
step D: mapping the gray value of each corrected gray histogram to the range from 0 to 255 to obtain a mapping area;
step E: performing linear interpolation processing on the gray values of the mapping regions to obtain an output image, as shown in fig. 4, equally dividing each mapping region into four mapping sub-regions, keeping the gray values of the first type mapping sub-regions unchanged, performing the linear interpolation processing on the second type mapping sub-regions in the transverse direction, performing the linear interpolation processing on the third type mapping sub-regions in the longitudinal direction, and performing the linear interpolation processing on the fourth type mapping sub-regions in both the transverse direction and the longitudinal direction.
Fig. 5 shows an image to be processed, fig. 6 shows an output image obtained by using a scheme in the prior art, and fig. 7 shows an output image obtained by using the method of the present embodiment, which shows that the contrast effect of the image is good. Fig. 7 is a view showing the trunk of the tree in the lower right corner of fig. 7, as compared to fig. 6.
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 dividing an image to be processed into a plurality of areas, then determining a gray histogram of each area, then performing correction processing on each gray histogram, mapping the gray value of the corrected gray histogram to the range of 0-255, and finally performing linear interpolation processing on the gray value of the mapping area to obtain an output image. The output image obtained by adopting the scheme improves the contrast of the target, and the phenomenon of over-brightness of a high-gray area can not occur. The scheme enlarges the gray dynamic range of the target area, does not enlarge the dynamic range of the background area, improves the target contrast, inhibits background noise and effectively improves the image quality.
2) According to the image processing device, the dividing unit divides an image to be processed into a plurality of areas, the determining unit determines the gray level histograms of the areas, the first processing unit corrects the gray level histograms, the mapping unit maps the gray level values of the corrected gray level histograms into the range from 0 to 255, and the second processing unit performs linear interpolation processing on the gray level values of the mapping areas to obtain an output image. The output image obtained by adopting the scheme improves the contrast of the target, and the phenomenon of over-brightness of a high-gray area can not occur.
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. An image processing method, comprising:
dividing an image to be processed into a plurality of areas;
determining a gray level histogram of each region, wherein the horizontal axis of the gray level histogram represents gray level distribution, and the vertical axis of the gray level histogram represents the number of pixel points corresponding to each gray level;
correcting each gray level histogram to obtain a corrected gray level histogram;
under the condition that the gray value of the corrected gray histogram is not in the range of 0 to 255, mapping the gray value of each corrected gray histogram to the range of 0 to 255 to obtain a mapping area;
and performing linear interpolation processing on the gray value of each mapping area to obtain an output image.
2. The method of claim 1, wherein performing a modification process on each of the histogram grayscales to obtain a modified histogram grayscales comprises:
determining a quantity threshold;
adjusting the number of the pixel points larger than the number threshold value to the number threshold value;
and keeping the number of the pixel points smaller than or equal to the number threshold unchanged.
3. The method of claim 1, wherein mapping the gray level value of each of the modified gray level histograms to a range of 0 to 255 to obtain a mapping region comprises:
acquiring the total number of pixel points of the corrected gray level histogram;
acquiring the number of accumulated pixel points of each gray value in the corrected gray histogram;
and mapping the gray value in the corrected gray histogram to a range from 0 to 255 according to the accumulated pixel number and the total pixel number to obtain the mapping area.
4. The method of claim 3, wherein mapping the gray value in the modified gray histogram to a range of 0 to 255 according to the accumulated number of pixels and the total number of pixels to obtain the mapping region comprises:
the formula is adopted: and mapping the gray value in the corrected gray histogram to a range from 0 to 255 to obtain the mapping area, wherein P represents the mapped gray value, M represents the number of the accumulated pixels, and N represents the total number of the pixels.
5. The method of claim 1, wherein performing linear interpolation on each of the mapping regions to obtain an output image comprises:
dividing each mapping area into four mapping sub-areas;
keeping the gray value of a first type mapping sub-region unchanged, wherein the first type mapping sub-region is the mapping sub-region which is not adjacent to other mapping regions;
performing the linear interpolation processing on a second type mapping sub-region in a transverse direction, wherein the second type mapping sub-region is the mapping sub-region adjacent to the other mapping regions only in the transverse direction;
performing the linear interpolation processing on a third type mapping sub-region in the longitudinal direction, wherein the third type mapping sub-region is the mapping sub-region adjacent to the other mapping regions only in the longitudinal direction;
and performing the linear interpolation processing on a fourth type mapping subregion in the transverse direction and the longitudinal direction, wherein the fourth type mapping subregion is the mapping subregion adjacent to the other mapping regions in the transverse direction and the longitudinal direction.
6. The method according to any of claims 1 to 5, characterized in that the image to be processed is an image captured by a thermal infrared imager.
7. An image processing apparatus characterized by comprising:
the dividing unit is used for dividing the image to be processed into a plurality of areas;
the determining unit is used for determining a gray histogram of each region, wherein the horizontal axis of the gray histogram represents gray value distribution, and the vertical axis of the gray histogram represents the number of pixel points corresponding to each gray value;
the first processing unit is used for correcting each gray level histogram to obtain a corrected gray level histogram;
a mapping unit, configured to map the gray scale value of each of the corrected gray scale histograms to a range from 0 to 255 to obtain a mapping region when the gray scale value of the corrected gray scale histogram is not in the range from 0 to 255;
and the second processing unit is used for performing linear interpolation processing on each mapping area to obtain an output image.
8. The apparatus of claim 7, wherein the first processing unit comprises:
a determination module to determine a quantity threshold;
the correction module is used for adjusting the number of the pixel points larger than the number threshold value to the number threshold value; and the processing module is used for keeping the number of the pixel points smaller than or equal to the number threshold unchanged.
9. A computer-readable storage medium, comprising a stored program, wherein the program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform the image processing method according to any one of claims 1 to 6.
10. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to execute the image processing method according to any one of claims 1 to 6 when running.
CN202110932762.5A 2021-08-13 2021-08-13 Image processing method, image processing device, computer readable storage medium and processor Pending CN113763293A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110932762.5A CN113763293A (en) 2021-08-13 2021-08-13 Image processing method, image processing device, computer readable storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110932762.5A CN113763293A (en) 2021-08-13 2021-08-13 Image processing method, image processing device, computer readable storage medium and processor

Publications (1)

Publication Number Publication Date
CN113763293A true CN113763293A (en) 2021-12-07

Family

ID=78789316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110932762.5A Pending CN113763293A (en) 2021-08-13 2021-08-13 Image processing method, image processing device, computer readable storage medium and processor

Country Status (1)

Country Link
CN (1) CN113763293A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706953A (en) * 2009-11-13 2010-05-12 北京中星微电子有限公司 Histogram equalization based image enhancement method and device
CN103353349A (en) * 2013-06-18 2013-10-16 南京理工大学 Infrared-thermometer self-adaption three platform histogram equalization system and method thereof
US20190080441A1 (en) * 2017-02-17 2019-03-14 Boe Technology Group Co., Ltd. Image processing method and device
US20190096031A1 (en) * 2017-09-25 2019-03-28 Shanghai Zhaoxin Semiconductor Co., Ltd. Image interpolation methods and related image interpolation devices thereof
WO2019169851A1 (en) * 2018-03-08 2019-09-12 深圳市华星光电半导体显示技术有限公司 Image processing method and system
CN112365424A (en) * 2020-11-17 2021-02-12 昆明物理研究所 Infrared image denoising enhancement method, device and system based on local self-adaptive CLAHE and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706953A (en) * 2009-11-13 2010-05-12 北京中星微电子有限公司 Histogram equalization based image enhancement method and device
CN103353349A (en) * 2013-06-18 2013-10-16 南京理工大学 Infrared-thermometer self-adaption three platform histogram equalization system and method thereof
US20190080441A1 (en) * 2017-02-17 2019-03-14 Boe Technology Group Co., Ltd. Image processing method and device
US20190096031A1 (en) * 2017-09-25 2019-03-28 Shanghai Zhaoxin Semiconductor Co., Ltd. Image interpolation methods and related image interpolation devices thereof
WO2019169851A1 (en) * 2018-03-08 2019-09-12 深圳市华星光电半导体显示技术有限公司 Image processing method and system
CN112365424A (en) * 2020-11-17 2021-02-12 昆明物理研究所 Infrared image denoising enhancement method, device and system based on local self-adaptive CLAHE and computer readable storage medium

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
史德琴,李俊山,杨威: "一种新的红外图像自适应增强算法", 《电光与控制》, pages 1 *
史德琴;李俊山;杨威;: "一种新的红外图像自适应增强算法", 电光与控制, no. 09, pages 1 *
张冬妍;贾明伟;: "基于空中连续红外图像的可视化处理研究", 机电产品开发与创新, no. 02 *
董静: "基于DDE技术分析的红外图像细节增强算法", 《光学与光电技术》, pages 1 - 2 *
董静;: "基于DDE技术分析的红外图像细节增强算法", 光学与光电技术, no. 05, pages 1 - 2 *
顾建雄,田亚菲: "保持图像细节的红外图像直方图均衡算法", 《微计算机信息》, pages 2 *
顾建雄;田亚菲;: "保持图像细节的红外图像直方图均衡算法", 微计算机信息, no. 02, pages 2 *

Similar Documents

Publication Publication Date Title
CN108205804B (en) Image processing method and device and electronic equipment
US20220383463A1 (en) Method and device for image fusion, computing processing device, and storage medium
US8644605B2 (en) Mapping colors of an image
US10755394B2 (en) Image processing method and device
WO2019196542A1 (en) Image processing method and apparatus
JP2015225665A (en) Image noise removal method and image noise removal device
WO2014168587A1 (en) Method and system for processing an input image
CN114549670B (en) Image processing method and image processing system
CN111340732B (en) Low-illumination video image enhancement method and device
US9286653B2 (en) System and method for increasing the bit depth of images
CN111127342B (en) Image processing method, device, storage medium and terminal equipment
WO2019153731A1 (en) Image processing method and system
CN114862725B (en) Method and device for realizing motion perception fuzzy special effect based on optical flow method
CN109242877B (en) Image segmentation method and device
CN111079793A (en) Icon similarity determining method and electronic equipment
CN115239653A (en) Multi-split-screen-supporting black screen detection method and device, electronic equipment and readable storage medium
US20230117976A1 (en) Methods and systems for improving a quality of digital images
CN111160063B (en) Internet of things IPC two-dimensional code distribution network image enhancement method and system
CN111915497B (en) Image black-and-white enhancement method and device, electronic equipment and readable storage medium
CN113763293A (en) Image processing method, image processing device, computer readable storage medium and processor
CN115278104B (en) Image brightness adjustment method and device, electronic equipment and storage medium
US20230093967A1 (en) Purple-fringe correction method and purple-fringe correction device
CN109741274B (en) Image processing method and device
CN109712094B (en) Image processing method and device
CN107404600B (en) Image processing apparatus and method

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