CN115546129A - FPGA-based infrared image bad element detection method - Google Patents

FPGA-based infrared image bad element detection method Download PDF

Info

Publication number
CN115546129A
CN115546129A CN202211170739.8A CN202211170739A CN115546129A CN 115546129 A CN115546129 A CN 115546129A CN 202211170739 A CN202211170739 A CN 202211170739A CN 115546129 A CN115546129 A CN 115546129A
Authority
CN
China
Prior art keywords
pixel point
pixel
infrared image
detected
element detection
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
CN202211170739.8A
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.)
Tianjin Jinhang Institute of Technical Physics
Original Assignee
Tianjin Jinhang Institute of Technical Physics
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 Tianjin Jinhang Institute of Technical Physics filed Critical Tianjin Jinhang Institute of Technical Physics
Priority to CN202211170739.8A priority Critical patent/CN115546129A/en
Publication of CN115546129A publication Critical patent/CN115546129A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Transforming Light Signals Into Electric Signals (AREA)

Abstract

The application provides an infrared image bad element detection method based on an FPGA, which comprises the following steps: selecting a bad element detection template with the size of n multiplied by n; placing a bad element detection template in a pixel array of an infrared image, and taking a to-be-detected pixel point as a central point of the bad element detection template to obtain a reference pixel point set; acquiring the gray value of each reference pixel point in the reference pixel point set to obtain a reference pixel gray data set; calculating the difference value between the gray value of each reference pixel point in the reference pixel gray data set and the gray value of the pixel point to be detected to obtain a difference data set; counting the number of data with the absolute value of the difference data in the difference data set smaller than a set threshold value to obtain a first number; and judging whether the first number is greater than nxn/2, if so, judging that the pixel to be detected is a normal pixel point, and if not, judging that the pixel to be detected is a bad pixel point. The bad element detection template with huge calculation amount is transplanted to the FPGA platform, so that the calculation amount is greatly reduced, and resources are saved.

Description

FPGA-based infrared image bad element detection method
Technical Field
The application relates to the technical field of infrared imaging, in particular to an infrared image bad element detection method based on an FPGA.
Background
The core device of the gaze-type infrared focal plane detector is a focal plane array. Due to the material and the production process, a bad element inevitably exists in the focal plane, and the imaging quality of the infrared equipment is influenced. The inherent bad elements of the focal plane can be corrected based on laboratory detection methods such as pixel response rate, noise voltage and the like, and after the thermal infrared imager is used, due to time degradation or the influence of an external environment, new bad elements appear, and the laboratory detection method is difficult to implement. In order to solve the problems, a bad element space searching method based on an image response value is mostly adopted in the prior art, and the method is simple, wide in applicability and strong in practicability, but has the defect that the calculated amount is large, and a large amount of resources are consumed in the application process. Therefore, the application provides an infrared image bad element detection method based on the FPGA.
Disclosure of Invention
The purpose of the application is to provide an infrared image bad element detection method based on an FPGA (field programmable gate array).
The application provides an infrared image bad element detection method based on an FPGA, which comprises the following steps:
selecting a bad element detection template with the size of nxn, wherein n is an odd number larger than 1;
placing the bad element detection template in a pixel array of an infrared image, and taking a to-be-detected pixel point as a central point of the bad element detection template to obtain a reference pixel point set; the reference pixel point set comprises n multiplied by n-1 reference pixel points adjacent to the pixel point to be detected;
acquiring the gray value of each reference pixel point in the reference pixel point set to obtain a reference pixel gray data set;
calculating the difference value between the gray value of each reference pixel point in the reference pixel gray data set and the gray value of the pixel point to be detected to obtain a difference data set;
counting the number of data with the absolute value of the difference data in the difference data set smaller than a set threshold value to obtain a first number;
and judging whether the first number is larger than nxn/2, if so, judging that the pixel to be detected is a normal pixel point, and if not, judging that the pixel to be detected is a bad pixel point.
According to the technical scheme provided by some embodiments of the present application, when the bad element detection template is placed in the pixel array of the infrared image, if the position of the pixel point to be detected in the infrared image satisfies the following condition, performing edge compensation on the infrared image, so that the bad element detection template can cover the pixel point:
the method comprises the following steps that firstly, the line number i < (n + 1)/2 of an image element point to be detected is set;
secondly, the column number j < (n + 1)/2 of the pixel point to be detected;
secondly, the line number i of the pixel point to be detected is greater than M- (n-1)/2;
the fourth condition is that the column number j of the pixel point to be detected is more than N- (N-1)/2;
wherein M is the row number of the pixel array of the infrared image, N is the column number of the pixel array of the infrared image, i is a natural number, 0< -i is less than or equal to M, j is a natural number, and 0< -j is less than or equal to N.
According to the technical solution provided by some embodiments of the present application, when the line number i < (n + 1)/2 of the pixel point to be detected, the edge compensation method includes: and (3) carrying out mirror image copying by taking a straight line where the pixel point with the row number of 1 is located as a mirror image axis, wherein the pixel point with the row number of more than 1 and less than or equal to (n + 1)/2-i +1 in the pixel array of the infrared image.
According to the technical scheme provided by some embodiments of the present application, when the row number i > M- (n-1)/2 of the pixel point to be detected, the edge compensation method includes: and carrying out mirror image copying by taking a straight line where the pixel point with the row number of M is positioned as a mirror image axis, wherein the pixel point with the row number of more than or equal to 2M- (n-1)/2-i and less than M in the pixel array of the infrared image.
According to the technical scheme provided by some embodiments of the present application, when the column number j < (n + 1)/2 of the pixel point to be detected, the edge compensation method includes: and carrying out mirror image copying by taking a straight line where the pixel point with the column number of 1 is positioned as a mirror image axis, wherein the pixel point with the column number of more than 1 and less than or equal to (n + 1)/2-j +1 in the pixel array of the infrared image.
According to the technical solution provided by some embodiments of the present application, when the column number j of the pixel point to be detected is > N- (N-1)/2, the edge compensation method includes: and carrying out mirror image copying by taking a straight line where pixel points with the row number of N are located as a mirror image axis, wherein the column number of the pixel points in the pixel array of the infrared image is greater than or equal to 2N- (N-1)/2-j and less than N.
According to the technical scheme provided by some embodiments of the present application, the value of n is 9.
According to the technical scheme provided by some embodiments of the application, the value range of the set threshold is 50-200.
Compared with the prior art, the beneficial effect of this application: the method and the device transplant a bad element detection template with huge calculation amount to an FPGA platform, realize the engineering application of the technology, and use n! The secondary comparison operation is converted into n x (n-1) times of subtraction operation and n x (n-1) times of addition operation, so that a large amount of resources are saved, and the assembly line instant output of the high-order search template is realized; when the n × n bad element detection template is expanded to (n + 1) × (n + 1) bad element detection template, the original increase is n × n! The secondary comparison operation is changed into the addition of 2 xn +1 subtraction operations and 2 xn +1 addition operations, and the expansibility is strong.
Drawings
Fig. 1 is a flowchart of an infrared image bad element detection method based on an FPGA according to an embodiment of the present application;
fig. 2 is a schematic diagram of a bad element detection template provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of an infrared image before edge compensation;
FIG. 4 is a schematic diagram of an infrared image after edge compensation;
FIG. 5 is a schematic diagram of corner compensation provided by an embodiment of the present application;
fig. 6 is a schematic diagram of a hardware structure implemented on an FPGA platform by the FPGA-based infrared image bad element detection method according to the embodiment of the present application.
Detailed Description
The following detailed description of the present application is given for the purpose of enabling those skilled in the art to better understand the technical solutions of the present application, and the description in this section is only exemplary and explanatory, and should not be taken as limiting the scope of the present application in any way.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures.
The embodiment provides an infrared image bad element detection method based on an FPGA, a flow chart of the method is shown in figure 1, and the method comprises the following steps:
s1, selecting a bad element detection template with the size of n multiplied by n, wherein n is an odd number larger than 1.
Referring to fig. 2, the bad element detection template is actually a window of n × n size, and when the window is placed in the pixel array of the infrared image, the window corresponds to n × n pixels in the pixel array, that is, n × n pixels are circled from the pixel array of the infrared image.
The larger the bad element search window is, the more accurate the bad element search result is, but the larger the window is, the larger the calculation amount is when judging the bad element. Considering the actual engineering requirements comprehensively, the value of n is generally 9, that is, a bad element detection template of 9 × 9 is selected to meet the use requirements; the value of n is set to be an odd number here, so as to determine the center point of the window conveniently.
S2, placing the bad element detection template in a pixel array of an infrared image, and taking a pixel point to be detected as a central point of the bad element detection template to obtain a reference pixel point set; the reference pixel point set comprises n multiplied by n-1 reference pixel points adjacent to the pixel point to be detected.
The infrared image of this embodiment is an infrared image obtained when an infrared detector shoots a uniform object, where the uniform object is an infrared image obtained when each portion of the uniform object has a uniform temperature, and ideally, the infrared image of the uniform object shot by the infrared detector should be uniform, that is, the gray value of each pixel is uniform, and due to the existence of some bad elements, the actual infrared image may have an excessively bright or dark condition, so that the purpose of this application is to detect the bad elements in the pixel array, so as to correct the infrared image in the following.
The infrared detector of this embodiment includes 640 × 512 pixels, that is, the specification of the pixel array of the infrared image is 640 × 512, that is, the total column number of the pixel array of the infrared image is 640, and the total row number is 512.
In the retrieval process, the bad element detection template is placed in the pixel array of the infrared image, and each pixel in the pixel array is detected and judged one by one, specifically, a pixel point to be detected is used as a central point of the bad element detection template, in the embodiment, the bad element detection template surrounds 81 pixels in total, and the obtained reference pixel points, namely other pixel points except the pixel point to be detected, namely the reference pixel point set comprises 80 reference pixel points in total.
And S3, obtaining the gray value of each reference pixel point in the reference pixel point set to obtain a reference pixel gray data set.
Each pixel point corresponds to a gray value, and 80 reference pixel points correspond to 80 gray values, namely, the reference pixel gray data set contains 80 gray values.
And S4, calculating the difference value between the gray value of each reference pixel point in the reference pixel gray data set and the gray value of the pixel point to be detected to obtain a difference data set.
And (4) subtracting the 80 gray values obtained in the step (S3) from the gray value of the pixel point to be detected positioned at the center of the window respectively to obtain a difference data set, wherein the difference data set totally comprises 80 gray difference values.
And S5, counting the number of data with the absolute value of the difference data in the difference data set smaller than a set threshold value to obtain a first number.
The set threshold is artificially set, the value range of the set threshold is generally 50-200, preferably 100, and the absolute values of the 80 gray scale differences obtained in the step S4 are respectively compared with the set threshold, that is, whether the 80 gray scale differences fall within the range of (-T, T), that is, the set threshold is sequentially judged; in the judgment, the result within the range (-T, T) may be denoted as 1, the result not within the range (-T, T) may be denoted as 0, and the count of the result of 1 may obtain a first number, which is the number of results greater than 1, that is, the number of data falling within the range (-T, T) among the 80 gray scale differences.
S6, judging whether the first number is larger than nxn/2;
s7, if yes, judging that the pixel to be detected is a normal pixel point;
and S8, if not, judging that the pixel to be detected is a bad element point.
And judging whether the number of the data falling in the range of (-T, T) exceeds half, namely whether the number of the data is more than 40.5, if so, judging that the pixel to be detected is a normal pixel point, and if not, judging that the pixel to be detected is a bad pixel point.
Next, taking an example of the above detection method, table 1 is a gray value table of 9 × 9 pixel points framed by the bad pixel detection module, where the gray value of the pixel point to be detected is 2006, the absolute values of the respective values in the calculated difference data set are shown in table 2, and are respectively compared with the set threshold 100, and the number of the pixel points to be detected in the set threshold range is counted as 74, and the number of the pixel points to be detected in the set threshold range is counted as 6, that is, the first number is 74, and since 74 is greater than 81/2, the pixel point to be detected is determined as a normal pixel point.
TABLE 1
2002 2003 2001 2004 2022 2003 2010 2409 3010
2004 2003 2004 2001 2003 2010 2055 2310 2516
2003 2022 2002 2002 2002 2018 2004 2010 2004
2001 2001 2010 2004 2018 2004 2002 2035 2010
2022 2004 2003 2010 2006 3060 2031 2004 2003
2003 2001 2010 2002 2001 2018 2003 2054 2015
2022 2020 2002 2022 2003 2033 2022 2003 2038
2004 2001 2022 2003 2022 2004 2008 2010 2003
2010 2103 2121 2004 2022 2003 2004 2002 2001
TABLE 2
Figure BDA0003860854420000051
Figure BDA0003860854420000061
Table 3 is a gray scale value table of another case of 9 × 9 pixel points framed and selected by the bad pixel detection module, where the gray scale value of the pixel point to be detected is 3006, the absolute values of the respective numerical values in the calculated difference data set are shown in table 4, and are respectively compared with the set threshold 100, and the number of the difference data set in the set threshold range is calculated to be 2, and the number of the difference data set in the set threshold range is 786, that is, the first number is 2, and since 2 is smaller than 81/2, it is determined that the pixel to be detected is a bad pixel.
TABLE 3
2002 2003 2001 2004 2022 2003 2010 2409 3010
2004 2003 2004 2001 2003 2010 2055 2310 2516
2003 2022 2002 2002 2002 2018 2004 2010 2004
2001 2001 2010 2004 2018 2004 2002 2035 2010
2022 2004 2003 2010 3006 3060 2031 2004 2003
2003 2001 2010 2002 2001 2018 2003 2054 2015
2022 2020 2002 2022 2003 2033 2022 2003 2038
2004 2001 2022 2003 2022 2004 2008 2010 2003
2010 2103 2121 2004 2022 2003 2004 2002 2001
TABLE 4
Figure BDA0003860854420000062
Figure BDA0003860854420000071
It should be noted that the infrared detector of this embodiment is 14-bit, and the original gray value range of the image element of the collected image is 0 to 16383, where the gray value in this application refers to the original gray value.
Further, when the bad element detection template is placed in an image element array of an infrared image, if the position of the image element point to be detected in the infrared image meets the following conditions, performing edge compensation on the infrared image so that the bad element detection template can cover the image element point:
the method comprises the following steps that firstly, the line number i < (n + 1)/2 of an image element point to be detected is obtained;
secondly, the column number j < (n + 1)/2 of the pixel point to be detected;
secondly, the line number i of the pixel point to be detected is larger than M- (n-1)/2;
the fourth condition is that the column number j of the pixel point to be detected is more than N- (N-1)/2;
wherein M is the number of rows of the pixel array of the infrared image, N is the number of columns of the pixel array of the infrared image, i is a natural number, 0-woven fabric i is less than or equal to M, j is a natural number, and 0-woven fabric j is less than or equal to N.
In this embodiment, M takes 512, n takes 640, and i takes the following values: 0 is less than or equal to 512, and j has the value range: 0 is less than or equal to 640.
Because each pixel in the pixel array of the infrared image needs to be detected, for some pixel points located at the edge, that is, pixel points with small or large row numbers and/or small or large column numbers, when the bad element detection template is used for frame selection, the bad element search window cannot cover n × n pixel points but only covers part of the pixel points, and therefore edge compensation needs to be performed on the infrared image, that is, some pixel points are supplemented at the edge of the infrared image, so as to ensure that the bad element detection template can cover the pixel points. The following describes the method of edge compensation in cases.
The first condition is as follows: when the line number i < (n + 1)/2 of the pixel point to be detected, the edge compensation method comprises the following steps: and carrying out mirror image copying by taking a straight line where the pixel point with the row number of 1 is positioned as a mirror image axis, wherein the pixel point with the row number of more than 1 and less than or equal to (n + 1)/2-i +1 in the pixel array of the infrared image.
Specifically, referring to fig. 3, the pixel to be detected is a (i, j), i =3, j =8, the center point of the bad element detection template is opposite to the point a, i < (n + 1)/2, i <5, at this time, the window can only frame 63 pixels, and therefore edge compensation is required, and the specific edge compensation method is as follows: taking the straight line where the pixel point in the 1 st row is located as a mirror symmetry axis, turning over the pixel points with the row number larger than 1 and smaller than or equal to 3 upwards symmetrically to obtain pixel distribution of the infrared image after edge compensation as shown in fig. 4, wherein at this time, 81 pixels can be framed and selected in the search window. It should be noted that "symmetric inversion" is to invert the gray values of the pixels at the corresponding positions, because the comparison of the gray values of the pixels is used to calculate the gray values in the determination process.
Case two: when the line number i of the pixel point to be detected is greater than M- (n-1)/2, the edge compensation method comprises the following steps: and (3) carrying out mirror image copying by taking a straight line where the pixel point with the row number of M is located as a mirror image axis, wherein the pixel point with the row number of more than or equal to 2M- (n-1)/2-i and less than M in the pixel array of the infrared image.
Specifically, the pixel to be detected is too close to the lower edge of the infrared image, the pixel to be detected is assumed to be B (i, j), i =512, j =8, the center point of the bad element detection template is opposite to the point B, i > M- (n-1)/2, i >508, at this time, the window can only frame 45 pixels, so that edge compensation is required, and the specific compensation method is as follows: and taking a straight line where the 512 th row (namely the last row) of pixel points is positioned as a mirror symmetry axis, and turning over the pixel points with the row numbers being more than or equal to 508 and less than 508 downwards symmetrically to obtain the pixel distribution condition of the infrared image after edge compensation, wherein at the moment, the search window can select 81 pixels in a frame. It should be noted that the "symmetric inversion" is to invert the gray value of the pixel at the corresponding position, because the comparison of the gray values of the pixels is used to calculate the gray value in the determination process.
Case three: when the column number j < (n + 1)/2 of the pixel point to be detected, the edge compensation method comprises the following steps: and carrying out mirror image copying by taking a straight line where the pixel point with the column number of 1 is positioned as a mirror image axis, wherein the pixel point with the column number of more than 1 and less than or equal to (n + 1)/2-j +1 in the pixel array of the infrared image.
Specifically, the pixel to be detected is too close to the left edge of the infrared image, assuming that the pixel to be detected is C (i, j), i =8, j =3, the center point of the bad element detection template is opposite to the C point, j < (n + 1)/2, i.e. j <5, at this time, the window can only frame 63 pixels, so that edge compensation needs to be performed, and the specific edge compensation method is as follows: and taking a straight line where the pixel point of the 1 st column is located as a mirror symmetry axis, and symmetrically turning the pixel points with the column number being more than 1 and less than or equal to 3 to the left to obtain the pixel distribution condition of the infrared image after edge compensation, wherein at the moment, the search window can select 81 pixels in a frame. It should be noted that the "symmetric inversion" is to invert the gray value of the pixel at the corresponding position, because the comparison of the gray values of the pixels is used to calculate the gray value in the determination process.
Case four: when the column number j of the pixel point to be detected is greater than N- (N-1)/2, the edge compensation method comprises the following steps: and carrying out mirror image copying by taking a straight line where pixel points with the row number of N are located as a mirror image axis, wherein the column number of the pixel points in the pixel array of the infrared image is greater than or equal to 2N- (N-1)/2-j and less than N.
Specifically, the pixel to be detected is too close to the right edge of the infrared image, assuming that the pixel to be detected is D (i, j), i =8, j =640, the center point of the bad element detection template is opposite to the point D, j is greater than N- (N-1)/2, i.e., j is greater than 636, at this time, the window can only frame 45 pixels, so that edge compensation is required, and the specific compensation method is as follows: and taking a straight line where the picture element point in the 636 th column (namely the last column) is as a mirror symmetry axis, symmetrically turning the picture element points with the column numbers of more than or equal to 636 and less than 640 to the right to obtain the picture element distribution condition of the infrared image after edge compensation, and at the moment, selecting 81 picture elements in a frame in a search window. It should be noted that "symmetric inversion" is to invert the gray values of the pixels at the corresponding positions, because the comparison of the gray values of the pixels is used to calculate the gray values in the determination process.
The four conditions respectively provide a specific edge compensation method for detecting the pixels to be detected which are relatively close to the upper edge, the lower edge, the left edge and the right edge in the pixel array of the infrared image. In practical application, some pixels to be detected are positioned at four corners of a pixel array of an infrared image, that is, after edge compensation is performed by the mirror image copying and turning method, it still cannot be satisfied that all positions of a window of a bad element detection template correspond to pixel points, and therefore corner compensation needs to be further performed on the condition.
The corner compensation method specifically comprises the following steps: firstly, determining the corner of an infrared image closest to a pixel to be detected (wherein the infrared image is of a rectangular structure and comprises four vertex angles, namely an upper left vertex angle, an upper right vertex angle, a lower left vertex angle and a lower right vertex angle) and recording the corner as a target vertex angle; then determining a mirror symmetry axis, wherein the mirror symmetry axis passes through the target vertex angle and is perpendicular to a diagonal line of the infrared image passing through the target vertex angle; and finally, according to the number of the missing pixel points, mirror image copying and turning the pixel points close to the top angle of the target on the infrared image about a mirror image symmetry axis, so that all positions of a window of the bad element detection template are corresponding to the pixel points.
Next, the corner compensation will be further described in the case shown in fig. 5.
In fig. 5, when detecting the pixels (3, 3) to be detected, edge compensation is required to be performed first, that is, two times of edge compensation of upper edge compensation and left edge compensation are required to be performed, the upper edge compensation corresponds to an X1 region in the graph, the left edge compensation corresponds to an X2 region in the graph, after the two times of edge compensation are completed, all positions of the window which still cannot meet the requirement of the dead pixel detection template correspond to pixel points, and at this time, corner compensation is required to be performed: firstly, determining an angle of an infrared image closest to a pixel to be detected as an upper left vertex angle, and taking the angle as a target vertex angle; secondly, selecting a straight line which passes through the left upper vertex angle and is perpendicular to a connecting line of the left upper vertex angle and the right lower vertex angle as a mirror symmetry axis; finally, turning over the pixel points at the top left corner to the upper left as required, wherein the corner compensation corresponds to an X3 area in the figure, and in the embodiment, four pixel points in the X3 area are pixels (2, 2), (1, 2), (2, 1) and (1, 1) respectively; so far, pixel points correspond to all positions of the window of the 9 × 9 bad element detection wood block.
The infrared image bad element detection method provided by the application is applied to an FPGA platform, and a hardware structure of a 9 x 9 bad element retrieval template realized on the FPGA platform is shown in FIG. 6. The method and the device have the advantages that the computing resources of n-1, namely 8 cache FIFOs and 160 adders are required in the application, a pipeline structure design is adopted, and each clock cycle processes one pixel, so that the instant output is realized.
Specifically, an FPGA platform is adopted for parallel processing, when pixels of an infrared image are read, the pixels are read one by one, namely 9 times of bad element retrieval templates are required to be read in total for 9 times, so that 8 cache FIFOs are adopted for caching 8 lines of pixel data, then the 9 lines of pixel data are subjected to difference processing respectively, namely the gray values of 9 pixel points of each line are subjected to difference processing with the gray value of a central pixel respectively; a total of 80 data subtractions and 80 additions are required to count after comparing the data with the set threshold, so a total of 160 adders is required.
The application adopts the FPGA platform to perform parallel processing, and can save time compared with the serial processing of the DSP platform. In addition, in the conventional bad cell search method, i.e. the bad cell space search method based on image response value, 9! The secondary comparison operation needs to calculate a median of gray values of pixels in a search window, and then judge whether the pixels to be detected are bad pixels by judging whether the median falls within a set threshold after the median is differentiated from the gray of the pixels to be detected, wherein the median refers to a middle value of the gray value sequence of n × n pixels in the window, and in the process of solving the median, the pixel values need to be compared, so that the calculation amount is large; while the present application will use 9 | in the prior art! The secondary comparison operation is converted into 80 times of subtraction operation and 80 times of addition operation, and internal resources of the FPGA are greatly saved.
When the bad element search template needs to be expanded, for example, when the bad element search template is expanded from a 9 × 9 template to a 10 × 10 template, the detection method in the prior art needs to add 9 × 9! The bad element detection method provided by the application only needs to add 19 times of subtraction operation and 19 times of addition operation, namely under the condition that the order needs to be expanded, the calculation amount of the application is greatly reduced compared with the method in the prior art.
According to the infrared image bad element detection method, a bad element detection template with huge calculated amount is transplanted to an FPGA platform, engineering application of the technology is achieved, and n! The secondary comparison operation is converted into n x (n-1) times of subtraction operation and n x (n-1) times of addition operation, so that a large amount of resources are saved, and the assembly line instant output of the high-order search template is realized; when the n × n bad element detection template is expanded to (n + 1) × (n + 1) bad element detection template, the original number is increased by n × n! The secondary comparison operation is changed into the addition of 2 xn +1 subtraction operations and 2 xn +1 addition operations, and the expansibility is strong.
The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. The foregoing is only a preferred embodiment of the present application, and it should be noted that there are no specific structures which are objectively limitless due to the limited character expressions, and it will be apparent to those skilled in the art that a plurality of modifications, decorations or changes can be made without departing from the principle of the present invention, and the technical features mentioned above can be combined in a suitable manner; such modifications, variations, combinations, or adaptations of the invention in other instances, which may or may not be practiced, are intended to be within the scope of the present application.

Claims (8)

1. An FPGA-based infrared image bad element detection method is characterized by comprising the following steps:
selecting a bad element detection template with the size of nxn, wherein n is an odd number larger than 1;
placing the bad element detection template in a pixel array of an infrared image, and taking a pixel point to be detected as a central point of the bad element detection template to obtain a reference pixel point set; the reference pixel point set comprises n multiplied by n-1 reference pixel points adjacent to the pixel point to be detected;
acquiring the gray value of each reference pixel point in the reference pixel point set to obtain a reference pixel gray data set;
calculating the difference value between the gray value of each reference pixel point in the reference pixel gray data set and the gray value of the pixel point to be detected to obtain a difference data set;
counting the number of data with the absolute value of the difference data smaller than a set threshold in the difference data set to obtain a first number;
and judging whether the first number is greater than nxn/2, if so, judging that the pixel to be detected is a normal pixel point, and if not, judging that the pixel to be detected is a bad pixel point.
2. The FPGA-based infrared image bad element detection method as defined in claim 1, wherein when the bad element detection template is placed in a pixel array of an infrared image, if the position of the pixel point to be detected in the infrared image satisfies the following condition, edge compensation is performed on the infrared image so that the bad element detection template can cover the pixel point:
the method comprises the following steps that firstly, the line number i < (n + 1)/2 of an image element point to be detected is obtained;
secondly, the column number j < (n + 1)/2 of the pixel point to be detected;
secondly, the line number i of the pixel point to be detected is larger than M- (n-1)/2;
the fourth condition is that the column number j of the pixel point to be detected is more than N- (N-1)/2;
wherein M is the number of rows of the pixel array of the infrared image, N is the number of columns of the pixel array of the infrared image, i is a natural number, 0-woven fabric i is less than or equal to M, j is a natural number, and 0-woven fabric j is less than or equal to N.
3. The FPGA-based infrared image bad element detection method of claim 2, wherein when the line number i < (n + 1)/2 of the pixel point to be detected, the edge compensation method comprises: and (3) carrying out mirror image copying by taking a straight line where the pixel point with the row number of 1 is located as a mirror image axis, wherein the pixel point with the row number of more than 1 and less than or equal to (n + 1)/2-i +1 in the pixel array of the infrared image.
4. The FPGA-based infrared image bad element detection method as claimed in claim 2, wherein when the row number i of the pixel point to be detected is > M- (n-1)/2, the edge compensation method comprises: and carrying out mirror image copying by taking a straight line where the pixel point with the row number of M is positioned as a mirror image axis, wherein the pixel point with the row number of more than or equal to 2M- (n-1)/2-i and less than M in the pixel array of the infrared image.
5. The FPGA-based infrared image bad element detection method according to claim 2, wherein when a column number j < (n + 1)/2 of the pixel point to be detected, the edge compensation method comprises: and (3) carrying out mirror image copying by taking a straight line where the pixel point with the column number of 1 is located as a mirror image axis, wherein the pixel point with the column number of more than 1 and less than or equal to (n + 1)/2-j +1 in the pixel array of the infrared image.
6. The FPGA-based infrared image bad element detection method as claimed in claim 2, wherein when the column number j of the pixel point to be detected is > N- (N-1)/2, the edge compensation method comprises: and carrying out mirror image copying by taking a straight line where pixel points with the row number of N are located as a mirror image axis, wherein the column number of the pixel points in the pixel array of the infrared image is greater than or equal to 2N- (N-1)/2-j and less than N.
7. The FPGA-based infrared image bad element detection method as claimed in claim 1, wherein a value of n is 9.
8. The FPGA-based infrared image bad element detection method as claimed in claim 1, wherein the value range of the set threshold is 50-200.
CN202211170739.8A 2022-09-23 2022-09-23 FPGA-based infrared image bad element detection method Pending CN115546129A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211170739.8A CN115546129A (en) 2022-09-23 2022-09-23 FPGA-based infrared image bad element detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211170739.8A CN115546129A (en) 2022-09-23 2022-09-23 FPGA-based infrared image bad element detection method

Publications (1)

Publication Number Publication Date
CN115546129A true CN115546129A (en) 2022-12-30

Family

ID=84729173

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211170739.8A Pending CN115546129A (en) 2022-09-23 2022-09-23 FPGA-based infrared image bad element detection method

Country Status (1)

Country Link
CN (1) CN115546129A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117221747A (en) * 2023-11-09 2023-12-12 海豚乐智科技(成都)有限责任公司 SOPC-based single-period dead pixel compensation and non-uniform correction method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117221747A (en) * 2023-11-09 2023-12-12 海豚乐智科技(成都)有限责任公司 SOPC-based single-period dead pixel compensation and non-uniform correction method
CN117221747B (en) * 2023-11-09 2024-01-26 海豚乐智科技(成都)有限责任公司 SOPC-based single-period dead pixel compensation and non-uniform correction method

Similar Documents

Publication Publication Date Title
CN110660052B (en) Hot-rolled strip steel surface defect detection method based on deep learning
KR20230124713A (en) Fault detection methods, devices and systems
CN110335204B (en) Thermal imaging image enhancement method
CN110598558A (en) Crowd density estimation method, device, electronic equipment and medium
CN112837303A (en) Defect detection method, device, equipment and medium for mold monitoring
RU2008105393A (en) COMPUTER-BASED APPLICATION FORMATION AND VERIFICATION OF TRAINING IMAGES INTENDED FOR MULTI-POINT THEOSTATISTIC ANALYSIS
US20120182442A1 (en) Hardware generation of image descriptors
CN113421263A (en) Part defect detection method, device, medium and computer program product
CN112580668B (en) Background fraud detection method and device and electronic equipment
CN115546129A (en) FPGA-based infrared image bad element detection method
CN113469074A (en) Remote sensing image change detection method and system based on twin attention fusion network
CN111832228A (en) Vibration transmission system based on CNN-LSTM
CN101937562A (en) Construction method for gray-level information content histogram
Zheng et al. Mango grading system based on optimized Convolutional Neural Network
CN111738272A (en) Target feature extraction method and device and electronic equipment
CN117576108A (en) Visual optimization method and device for wafer defect detection and computer equipment
CN111080683B (en) Image processing method, device, storage medium and electronic equipment
CN112085727A (en) Intelligent identification method for scale structure on surface of hot rolled steel
CN111814820A (en) Image processing method and device
CN111047654A (en) High-definition high-speed video background modeling method based on color information
CN107220651B (en) Method and device for extracting image features
CN114463764A (en) Table line detection method and device, computer equipment and storage medium
US11348251B2 (en) Device and method for determining edge location based on adaptive weighing of gradients
CN112561001A (en) Video target detection method based on space-time feature deformable convolution fusion
Zheng et al. MD-YOLO: Surface Defect Detector for Industrial Complex Environments

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