CN115908404B - Image stripe interference detection method and device, electronic equipment and medium - Google Patents

Image stripe interference detection method and device, electronic equipment and medium Download PDF

Info

Publication number
CN115908404B
CN115908404B CN202310001291.5A CN202310001291A CN115908404B CN 115908404 B CN115908404 B CN 115908404B CN 202310001291 A CN202310001291 A CN 202310001291A CN 115908404 B CN115908404 B CN 115908404B
Authority
CN
China
Prior art keywords
straight line
line groups
lines
straight
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310001291.5A
Other languages
Chinese (zh)
Other versions
CN115908404A (en
Inventor
崔超齐
张志勇
刘海峰
艾坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Zhongke Leinao Intelligent Technology Co ltd
Original Assignee
Hefei Zhongke Leinao Intelligent 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 Hefei Zhongke Leinao Intelligent Technology Co ltd filed Critical Hefei Zhongke Leinao Intelligent Technology Co ltd
Priority to CN202310001291.5A priority Critical patent/CN115908404B/en
Publication of CN115908404A publication Critical patent/CN115908404A/en
Application granted granted Critical
Publication of CN115908404B publication Critical patent/CN115908404B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a method and a device for detecting stripe interference of an image, electronic equipment and a medium. The method comprises the following steps: performing edge detection on the target image to obtain an edge image, and performing straight line detection on the edge image to obtain M straight lines on the edge image; grouping M straight lines to obtain N straight line groups; screening the N straight line groups according to the area of the minimum bounding rotation rectangle corresponding to each straight line group in the N straight line groups to obtain T straight line groups; performing region expansion on the straight lines in the T straight line groups to obtain P expanded straight line groups, and calculating the average length of the connected domain of the corresponding expanded straight line groups; screening the straight lines in the T straight line groups according to the average length to obtain K straight line groups, calculating the minimum area surrounding the rotating rectangle for the K straight line groups, and screening the K straight line groups to obtain Q straight line groups; and carrying out stripe interference detection according to the interval distribution among the lines in the Q line groups.

Description

Image stripe interference detection method and device, electronic equipment and medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and apparatus for monitoring image stripe interference, an electronic device, and a medium.
Background
The appearance of a large amount of streak interference in an image can affect the quality of the image, and even the key event of the image can be missed due to the shielding of the streak interference. In the related art, streak interference may be detected by a conventional image processing and deep learning method.
In the traditional image processing method, high-frequency information is mostly calculated in a frequency domain, the number of stripe interference contained in an image is obtained through analysis, screening is carried out according to a set threshold, and in the screening process, the stripe interference cannot be distinguished from other high-frequency noise, so that a high misjudgment rate exists.
Disclosure of Invention
The present invention aims to solve at least one of the technical problems in the related art to some extent. Therefore, an object of the present invention is to provide a method, an apparatus, an electronic device, and a medium for detecting image streak interference, which reduce the false determination rate of the image streak interference.
The method for detecting the image streak interference comprises the following steps:
determining a target image;
performing edge detection on the target image to obtain an edge image, and performing straight line detection on the edge image to obtain M straight lines on the edge image;
grouping M straight lines to obtain N straight line groups;
determining the area of the minimum bounding rotation rectangle corresponding to each of the N straight line groups, and screening the N straight line groups according to the area of the minimum bounding rotation rectangle corresponding to each of the N straight line groups to obtain T straight line groups;
carrying out region expansion on the straight lines in the T straight line groups to obtain P expansion straight line groups, determining the corresponding connected domains of each expansion straight line group, and calculating the average length of the connected domains of the corresponding expansion straight line groups according to the corresponding connected domains of each expansion straight line group, wherein P is greater than or equal to T;
screening straight lines in the T straight line groups according to the average length, discarding the straight line groups with the number of reserved straight lines smaller than 1 to obtain K straight line groups, determining the area of the minimum bounding rotation rectangle corresponding to each straight line group in the K straight line groups, and screening the K straight line groups according to the area of the minimum bounding rotation rectangle corresponding to each straight line group in the K straight line groups to obtain Q straight line groups, wherein Q is smaller than or equal to K and T;
and carrying out stripe interference detection according to the interval distribution among the lines in the Q line groups.
In the above-mentioned scheme, before performing edge detection on the target image to obtain an edge image, the method includes:
and respectively adopting a transverse 3 multiplied by 1 Gaussian check target image and a longitudinal 3 multiplied by 1 Gaussian check target image to carry out filtering processing.
In the above scheme, the length of the M straight lines on the edge image is greater than or equal to the length of the set minimum straight line; the set minimum straight line length is set according to the image size of the edge image.
In the above scheme, grouping the M lines to obtain N line groups includes:
determining the angles of M straight lines;
dividing lines with the angle difference smaller than a first preset value in the M lines into the same line group; wherein each straight line corresponds to a straight line group.
In the above scheme, when performing region expansion on the lines in the T line groups to obtain P expansion line groups, the method includes:
determining the slope k of a straight line, and determining an included angle alpha between the straight line and a horizontal line according to the slope k of the straight line;
and determining the expansion area of the straight line according to the included angle alpha and the second preset value.
In the above scheme, determining the expansion area of the straight line according to the included angle α and the second preset value includes:
when the included angle alpha is smaller than a second preset value, determining an expansion area according to an upper parallel straight line and a lower parallel straight line which are adjacent to each other;
when the 90-included angle alpha is smaller than a second preset value, determining an expansion area according to a left straight line and a right straight line which are adjacent to each other;
when the included angle alpha is more than or equal to a second preset value and the included angle alpha is more than or equal to a second preset value, determining an expansion area according to the straight line and the adjacent upper and lower parallel straight lines, or determining the expansion area according to the straight line and the adjacent left and right parallel straight lines.
In the above-mentioned scheme, when detecting the fringe interference according to the interval distribution among the lines in the Q line groups, the method includes:
determining the intercept sizes of all the lines in the line group, and sorting according to the intercept sizes of all the lines to generate a first list;
respectively calculating the difference value between the j+1th intercept size and the j-th intercept size in the first list to generate a second list;
removing elements smaller than a fourth preset value in the second list, generating a third list, and determining a variance value corresponding to the third list according to the elements in the third list;
if the variance value corresponding to the third list is smaller than a fifth preset value, determining that the straight line in the straight line group is stripe interference.
According to an embodiment of the invention, a detection device for image streak interference comprises:
the first screening module is used for determining a target image;
the processing module is used for carrying out edge detection on the target image to obtain an edge image, and carrying out straight line detection on the edge image to obtain M straight lines on the edge image, wherein M is an integer greater than 1;
the grouping module is used for grouping the M straight lines to obtain N straight line groups, wherein N is smaller than or equal to M;
the second screening module is used for determining the area of the minimum bounding rotation rectangle corresponding to each of the N straight line groups, and screening the N straight line groups according to the area of the minimum bounding rotation rectangle corresponding to each of the N straight line groups to obtain T straight line groups, wherein T is smaller than or equal to N;
the calculation module is used for carrying out region expansion on the straight lines in the T straight line groups to obtain P extended straight line groups, determining the connected domains corresponding to each extended straight line group, and calculating the average length of the connected domains of the corresponding extended straight line groups according to the connected domains corresponding to each extended straight line group, wherein P is greater than or equal to T;
the third screening module is used for screening the straight lines in the T straight line groups according to the average length, discarding the straight line groups with the number of reserved straight lines smaller than 1 to obtain K straight line groups, determining the area of the minimum bounding rotation rectangle corresponding to each straight line group in the K straight line groups, and screening the K straight line groups according to the area of the minimum bounding rotation rectangle corresponding to each straight line group in the K straight line groups to obtain Q straight line groups, wherein Q is smaller than or equal to K and T;
and the detection module is used for carrying out stripe interference detection according to the interval distribution among the straight lines in the Q straight line groups.
The electronic equipment according to the embodiment of the invention comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps of the method for detecting the image streak interference when executing the method.
A computer-readable storage medium according to an embodiment of the present invention has stored thereon a computer program which, when executed by a processor, implements the steps of the above-described image streak interference detection method.
According to the method, the device, the electronic equipment and the medium for detecting the image stripe interference, provided by the embodiment of the invention, the multiple screening conditions are designed according to the characteristics of the stripe interference, and the stripe interference is detected on the target image through the multiple screening conditions, so that the false judgment rate of the stripe interference can be reduced.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
FIG. 1 is a flow chart of a method for detecting image streak interference in an embodiment;
FIG. 2 is a flow chart of a method for detecting image streak interference in yet another embodiment;
FIG. 3 is a schematic diagram of a straight line corresponding minimum bounding rectangle of revolution in one embodiment;
FIG. 4 is a flow chart of a method for detecting image streak interference in one embodiment;
FIG. 5 is a schematic diagram of an extended area in one embodiment;
FIG. 6 is a schematic diagram of an extended area in yet another embodiment;
FIG. 7 is a schematic illustration of an extended area in yet another embodiment;
FIG. 8 is a flow chart of a method for detecting image streak interference in one embodiment;
FIG. 9 is a schematic overall flow chart of a method for detecting image streak interference in one embodiment;
fig. 10 is a block diagram of a detection apparatus for image streak interference in one embodiment.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative and intended to explain the present invention and should not be construed as limiting the invention.
The following describes a detection method of image streak interference according to an embodiment of the present invention with reference to the drawings.
In one embodiment, as shown in fig. 1, a method for detecting image streak interference is provided, and the method for detecting image streak interference may include the following steps:
step S101, a target image is determined.
The detected original image can be a plurality of frames in video data or different pictures, the original image needing stripe interference detection is converted into a frequency domain image by utilizing two-dimensional discrete Fourier transform, and then the frequency domain image passes through a preset threshold D 1 Filtering the converted frequency domain image once, and obtaining a target image after filtering, wherein the target image is a high-frequency signal with a duty ratio larger than a preset threshold D 1 For high frequency signals the duty ratio is less than or equal to a preset threshold D 1 The frequency domain image of (2) can be directly judged to not contain the streak interference, namely, the subsequent streak interference detection is carried out on the target image.
It should be noted that, in the embodiment of the present invention, the frequency domain is greater than the preset threshold D 1 The streak detection is performed on the basis of the original image (i.e., the target image) and not on the frequency domain image.
In practical application, preset threshold D 1 Can be determined by testing a normal image and a noisy image (such as an image with streak interference or other interference), and by presetting a threshold D 1 Filtering the frequency domain image, screening the image to obtain more interference image, and detecting the subsequent fringe interference of the imageSo as to reduce the image data to be processed and save the time for detecting the streak interference of the normal image.
Step S102, edge detection is carried out on the target image to obtain an edge image, and straight line detection is carried out on the edge image to obtain M straight lines on the edge image.
The edge detection is used for identifying pixel points with obvious brightness change in the target image, so that the data size of the target image to be processed can be greatly reduced, irrelevant information is removed, and important structural attributes of the target image are reserved.
And selecting a proper edge detection method, and carrying out edge detection on the target image to obtain a corresponding edge image.
In one embodiment, before edge detection is performed on the target image, a preprocessing operation is required to perform a filtering operation on the target image by using a horizontal and vertical 3×1 gaussian kernel, and then edge detection is performed on the target image after the filtering operation.
It can be understood that the streak interference can be regarded as different straight lines, based on which the edge image is subjected to straight line detection, for example, M straight lines on the edge image are extracted by using a straight line detection algorithm such as an inchworm creep algorithm or a hough straight line detection algorithm, where M is an integer greater than 1, and a plurality of streak interference are included in the M straight lines.
In one embodiment, during the process of detecting the straight line of the edge image, the minimum straight line length is set according to the image size (including the width-height size) of the edge image, and during the process of detecting the straight line, the straight line smaller than the minimum straight line length is not detected on the edge image, that is, the lengths of the M straight lines acquired on the edge image are all greater than or equal to the minimum straight line length.
Step S103, grouping M straight lines to obtain N straight line groups.
Here, the M straight lines are grouped, specifically, N straight line groups are obtained by grouping the angular distribution of the M straight lines, where N is smaller than M.
In this embodiment, the policy of grouping the straight lines is to group the straight lines having smaller differences in the angle of the straight lines into one straight line group, based on which the straight lines within each straight line group can be regarded as approximate parallel lines. By grouping the M straight lines, the influence of the characteristics of the non-stripe interference straight lines existing in the image on stripe interference detection can be reduced, and the accuracy rate of detecting the stripe interference is improved.
In one embodiment, as shown in fig. 2, grouping M lines to obtain N line groups includes:
in step S201, the angles of the M straight lines are determined.
The M straight lines are distributed on the edge image, and the angles and lengths of the M straight lines may also vary, in this embodiment, the M straight lines are grouped according to the angles of the M straight lines, where the angles of the M straight lines are determined by the same reference, for example, the vertical direction may be taken as a reference, the determined angles of the straight lines are angles of the straight lines deviating from the vertical direction, or the horizontal direction may be taken as a reference, and the determined angles of the straight lines are angles of the straight lines deviating from the horizontal direction.
In step S202, the lines of the M lines having the angle difference smaller than the first preset value are divided into the same line group.
After determining the angles of the M straight lines, comparing the angles of the M straight lines, it can be understood that when the angle difference between the two straight lines is small, the two straight lines can be regarded as approximate parallel lines, so that the two straight lines can be divided into the same straight line group, and based on the fact, the angle difference between the M straight lines is smaller than a first preset value D 2 Is divided into the same straight line group, for example, the angle of the straight line 1 is a, the angle of the straight line 2 is b, wherein the difference between the angle a of the straight line 1 and the angle b of the straight line 2 is smaller than a first preset value D 2 Then straight lines 1 and 2 can be determined as one straight line group, and so on, and M straight lines can be divided into N straight line groups.
In practical application, each straight line belongs to one straight line group, and the condition that any straight line is in a plurality of straight line groups does not exist, so that the condition that the same straight line is subjected to multiple stripe interference detection can be avoided.
Step S104, determining the area of the minimum bounding rotation rectangle corresponding to each of the N straight line groups, and screening the N straight line groups according to the area of the minimum bounding rotation rectangle corresponding to each of the N straight line groups to obtain T straight line groups.
Here, step S104 will be described by taking one straight line group as an example. As shown in fig. 3, fig. 3 shows a schematic diagram of a minimum bounding rotation rectangle corresponding to a straight line, wherein 3 straight lines in fig. 3 are straight lines in a straight line group, and a rectangle bounding 3 straight lines is a minimum bounding rotation rectangle, and it can be understood from fig. 3 that the minimum bounding rotation rectangle is a minimum rectangle bounding all straight lines in one straight line group.
According to the distribution of all the straight lines in the straight line group, determining the minimum bounding rotation rectangle corresponding to the straight line group, further determining the area of the minimum bounding rotation rectangle, screening the straight line group according to the area of the minimum bounding rotation rectangle, specifically, determining the whole area of the target image, and calculating the ratio of the area of the minimum bounding rotation rectangle to the whole area of the target image, wherein when the ratio is larger than a preset threshold D 3 When the ratio is smaller than or equal to the preset threshold value D 3 And judging the next straight line group. And so on, so that T straight line groups can be obtained by screening from N straight line groups, wherein T is less than or equal to N.
In the present embodiment, a threshold D is preset 3 Can be set according to the tolerance to the streak interference by presetting a threshold D 3 And screening the N linear groups, filtering the stripe interference occupying the small-proportion area of the target image, reserving the stripe interference occupying the small-proportion area of the target image, and carrying out subsequent stripe interference detection.
In practical application, if the corresponding ratios of the N straight line groups are all smaller than or equal to the preset threshold D 3 It can be determined that there is no streak disturbance in the target image.
Step S105, carrying out region expansion on the straight lines in the T straight line groups to obtain P extended straight line groups, determining the connected domain corresponding to each extended straight line group, and calculating the average length of the connected domain of the corresponding extended straight line group according to the connected domain corresponding to each extended straight line group.
Here, the region expansion is performed on each line in each line group of the T line groups, so that P expanded line groups can be obtained, and for example, assuming that there are 5 line groups and 3 lines in each line group, 15 expanded line groups can be obtained after the region expansion is performed. The extended straight line group is composed of 3 straight lines, wherein one straight line (denoted as H 1 ) The other two straight lines are the same as the straight line H 1 The two parallel lines, up and down or left and right, are adjacent to each other, and the group of extension lines may be regarded as extension regions corresponding to the lines, and are not used for grouping the lines.
In one embodiment, as shown in fig. 4, when performing region expansion on the lines in the T line groups, obtaining P expanded line groups includes:
in step S401, the slope k of the straight line is determined, and the angle α between the straight line and the horizontal line is determined according to the slope k of the straight line.
Here, a straight line (denoted as H 1 ) An explanation is given. Determining straight line H 1 Slope k of (in particular, straight line H) 1 Is C1 (x) 1 ,y 1 ),C2(x 2 ,y 2 ) A straight line H can be obtained 1 The slope k of (a) is: k= (y) 2 -y 1 )/(x 2 -x 1 )。
Determine straight line H 1 After the slope k of (a), a straight line H can also be calculated 1 The included angle alpha between the horizontal line is as follows:
Figure 136390DEST_PATH_IMAGE001
step S402, determining an expansion area of the straight line according to the included angle alpha and a second preset value.
From the foregoing, it can be seen that the extended area of the straight line is composed of 3 straight lines, respectively one straight line in the straight line group (denoted as H 1 ) The other two straight lines are the same as the straight line H 1 Two adjacent parallel lines, up and down or left and right, are arranged at the position according to the included angle alpha and the second preset value D 4 Is used for determining the formation straight line H 1 Is a parallel line of the expanded area of (c).
In one embodiment, the extended area of the determined straight line may be divided into the following three cases.
In the first case, as shown in FIG. 5, when the included angle α < the second preset value D 4 When it is indicated that straight line H 1 Is approximately horizontal, and can be straight line H 1 As an approximate horizontal line, according to line H 1 And straight line H 1 The upper and lower two adjacent parallel straight lines determine the expansion area.
In the second case, as shown in FIG. 6, when the 90-degree angle α < the second preset value D 4 When it is indicated that straight line H 1 Is approximately vertical, a straight line H can be formed 1 As an approximate vertical line, according to line H 1 And straight line H 1 The adjacent left and right parallel straight lines determine the expansion area.
In the third case, as shown in FIG. 7, when the included angle α is equal to or greater than the second preset value D 4 And 90-the included angle alpha is larger than or equal to a second preset value D 4 When it is indicated that straight line H 1 The direction of (2) is not close to the horizontal direction or the vertical direction, then the direction can be according to the straight line H 1 And straight line H 1 The expansion area is determined by two parallel lines, namely an upper line and a lower line, which are adjacent to each other, and can also be determined according to a line H 1 And straight line H 1 The adjacent left and right parallel straight lines determine the expansion area.
After obtaining the P extended straight line groups, determining the corresponding connected domain of each extended straight line group, in practical application, a plurality of connected domains may exist in one extended straight line group, and determining the lengths of all connected domains in one extended straight line group to obtain the average length of the connected domains of the extended straight line group. The average length here is the average length of the connected domain in the parallel direction of the two parallel straight lines constituting the extended straight line group.
In this embodiment, by obtaining the average lengths corresponding to the P extended straight line groups, the influence of the straight line formed by a plurality of adjacent noise points in the target image can be reduced, so that the accuracy of detecting the streak interference is improved.
And S106, screening the straight lines in the T straight line groups according to the average length, discarding the straight line groups with the number of reserved straight lines smaller than 1 to obtain K straight line groups, determining the area of the minimum bounding rotation rectangle corresponding to each straight line group in the K straight line groups, and screening the K straight line groups according to the area of the minimum bounding rotation rectangle corresponding to each straight line group in the K straight line groups to obtain Q straight line groups.
Here, a preset threshold value D is set 5 Presetting a threshold value D by using average length corresponding to the extended straight line group 5 Screening the straight lines in the T straight line groups to obtain K straight line groups, specifically, when the average length of the connected domain corresponding to the extended straight line groups is greater than a preset threshold D 5 In this case, the straight lines constituting the extended straight line group are retained, for example, for the straight line H in one straight line group 1 From straight line H 1 And straight line H 1 Two adjacent left and right parallel straight lines form an extended straight line group, and the average length of all connected domains on the extended straight line group is larger than a preset threshold D 5 When the straight line H in the straight line group is reserved 1 . In the screening process, when all the straight lines in one straight line group are not reserved, discarding the straight line group, wherein K is less than or equal to P. By analogy, K straight line groups can be obtained by screening straight lines in the T straight line groups.
It should be noted that, the K straight line groups herein are obtained by screening the straight lines in the T straight line groups according to the average length of the connected domains of the P extended straight line groups, and the K straight line groups are obtained according to the preset threshold D 5 And screening and reserving a straight line group where the obtained straight line is located. Let p=3, i.e. there are 3 straight line groups (P respectively 1 ,P 2 And P 3 ) Each straight line group comprises two straight lines (H respectively 1 And H 2 ) In the region expansion of each line in the 3 line groups, 6 expanded line groups (T respectively) can be finally obtained 1 ,T 2 ,T 3 ,T 4 ,T 5 And T 6 ) Wherein the straight line group T is expanded 1 Is a straight line group P 1 Straight line H of (3) 1 Corresponding extended straight line group, extended straight line group T 2 Is a straight line group P 1 Straight line H of (3) 2 Corresponding extended straight line groups, and so on. In the process of screening according to the average length corresponding to the extended straight line group, it is assumed that T 1 ,T 2 And T 3 The corresponding average length is greater than a preset threshold D 5 That is, the straight line group P is reserved 1 Straight line H of (3) 1 Straight line group P 1 Straight line H of (3) 2 Straight line group P 2 Straight line H of (3) 1 Finally, k=2 straight line groups are obtained, and k=2 straight line groups are the straight line groups P among the P straight line groups 1 And straight line group P 2 . In practical applications, there may be a linear group in which the average length of all the expansion areas is less than or equal to the preset threshold D 5 Therefore, K is equal to or less than P.
Based on the above, the extended straight line groups corresponding to each straight line group can be screened, so that the straight line which needs to be reserved for each straight line group can be determined according to the average length of the extended straight line groups corresponding to each straight line group.
After obtaining the K line groups, determining an area of a minimum bounding rotation rectangle corresponding to each line group of the K line groups, wherein the minimum bounding rotation rectangle corresponding to each line group is a minimum rotation matrix of lines reserved by the bounding line groups, and screening the K line groups according to the area of the minimum bounding rotation rectangle corresponding to each line group, specifically, when a ratio of the area of the minimum bounding rotation rectangle corresponding to the line group to the whole area of the target image is greater than a preset threshold D 6 And reserving the linear groups, and finally screening to obtain Q linear groups, wherein Q is smaller than or equal to K and T.
In step S104 and step S107, the plurality of line groups are filtered according to the area of the smallest bounding rotation rectangle corresponding to the line group, and the preset threshold D in step S107 is typically set 6 Is set to a value smaller than the preset threshold D in step S104 3 Thus, the straight line group more likely to contain streak interference can be accurately screened in step S107.
In addition, in the case where there is only one straight line in the straight line group, the area of the smallest bounding rotation rectangle corresponding to the straight line group may also be calculated, but in this case, the ratio of the area of the smallest bounding rotation rectangle to the entire area of the target image is highly likely to be insufficient to be larger than the preset threshold D 6 I.e. the straight line group is generally determined to be free of streak interference.
In practical application, when detecting that the area of the minimum bounding rotation rectangle corresponding to one of the K straight line groups does not meet the preset condition, continuing to judge the next straight line group, and if all the groups are judged completely and all the groups do not meet the preset condition, judging that the target image does not contain stripe interference.
Step S107, performing streak interference detection according to the interval distribution between the respective lines in the Q line groups.
Here, the interval distribution between the respective straight lines included in each of the Q straight line groups is calculated, and the streak interference detection is performed based on the interval distribution between the respective straight lines. In this embodiment, the interval distribution among the lines is calculated, so that whether the lines conform to the characteristics of the stripes can be determined, and the influence of the non-stripe interference linear characteristics existing in the image on the stripe interference detection, such as a telegraph pole, a house eave, a window edge and the like, can be reduced, so that the accuracy of detecting the stripe interference is improved.
In one embodiment, as shown in fig. 8, when stripe interference detection is performed according to the interval distribution between the respective straight lines in the Q straight line groups, it includes:
in step S801, the intercept sizes of the lines in the line group are determined, and the first list is generated by sorting the intercept sizes of the lines.
Here, the intercept sizes of the respective lines in the line group are calculated, and a first list l is generated by sorting the intercept sizes of the n lines on the assumption that the line group contains the n lines 1 ([b 1 ,b 2 ,b 3 ,…,b n-1 ,b n ])。
Step S802, respectively calculating the difference value between the j+1st intercept size and the j-th intercept size in the first list, and generating a second list.
Here, the difference between the j+1th intercept size and the j-th intercept size in the first list is calculated, that is, a second list is generated based on the difference between the last intercept size and the previous intercept size in the first list, for example, the 2 nd intercept size b 2 With the 1 st intercept size b 1 As the first element of the second list, based on which a second list l can be derived 2 ([b 2 -b 1 ,b 3 -b 2 ,…,b n -b n-1 ])。
Step S803, elements smaller than the fourth preset value in the second list are removed, a third list is generated, and variance values corresponding to the third list are determined according to the elements in the third list.
Here, the second list is smaller than the fourth preset value D 7 Element removal of (2), i.e. by a fourth preset value D 7 The elements in the second list are filtered to generate a third list, where the elements refer to intercept differences in the second list.
And calculating to obtain a variance value corresponding to the third list according to each element in the third list.
In step S804, if the variance value corresponding to the third list is smaller than the fifth preset value, it is determined that the straight line in the straight line group is the stripe interference.
If the variance value corresponding to the third list is smaller than the fifth preset value D 8 When the straight lines in the straight line group are determined to accord with the distribution of the stripe interference, if the variance value corresponding to the third list is larger than or equal to the fifth preset value D 8 When the line group is in the same state, the straight line group is not in line with the distribution of the stripe interference.
By determining the respective lines remaining in each of the Q line groups in the above steps S801 to S804, it is possible to determine whether the respective lines in each line group are streak interference.
In the above embodiment, by setting different detection conditions of the stripe interference, whether the straight line on the target image accords with the characteristic of the stripe interference is analyzed, so that the influence of other straight line characteristics in the target image and straight lines formed by a plurality of noises on the judgment of the stripe interference can be avoided, the misjudgment rate is greatly reduced, and meanwhile, the duration of the detection of the stripe interference can be reduced.
The invention also provides an application embodiment, as shown in fig. 9, and fig. 9 shows an overall flow diagram of the detection of streak interference of an image.
Step S901, randomly extracting an original image from a video.
In step S902, the original image is converted into a frequency domain using a two-dimensional discrete fourier transform, where a frequency domain image corresponding to the original image may be generated.
In step S903, it is determined whether the high frequency signal duty cycle is greater than a first preset threshold. If the high frequency signal duty ratio is less than or equal to the first preset threshold, step S904 is performed, and if the high frequency signal duty ratio is greater than the first preset threshold, step S905 is performed.
In step S904, it is determined that the original image does not contain streak interference.
In step S905, edge detection is performed to obtain an edge image, where the edge detection is performed on a target image, and the target image is an original image with a high frequency signal duty ratio greater than a first preset threshold.
In step S906, the line detection obtains a plurality of lines, where the line detection is performed on the edge image.
Step S907, grouping the straight lines. In the process of grouping the straight lines, the straight lines are grouped according to the angle distribution of a plurality of straight lines, specifically, the angle of each straight line is determined, and the straight lines with smaller angle differences are determined to be the same straight line group, so that the straight lines in each straight line group are approximate parallel lines.
In step S908, the area of the smallest bounding rotation rectangle of each straight line group is determined.
In step S909, it is determined whether the area ratio is greater than a second preset threshold, where the area ratio is a ratio of the area of the minimum bounding rectangle to the entire area of the image. Step S910 is performed when the area ratio is less than or equal to the second preset threshold, and step S911 is performed when the area ratio is greater than the second preset threshold.
In step S910, a judgment is made for the next line group.
In step S911, each line in the line group is expanded to obtain a corresponding expansion area.
Step S912, determining the average length of all connected domains in the extension area.
Step S913, judging whether the average length is larger than a third preset threshold. Step S914 is performed when the average length is less than or equal to the third preset threshold, and step S915 is performed when the average length is greater than the third preset threshold.
In step S914, the straight lines are removed, where the straight lines refer to the straight lines belonging to the straight line group in the extension area smaller than or equal to the third preset threshold.
In step S915, a straight line is reserved, where the straight line refers to a straight line belonging to the straight line group in the extension area larger than the third preset threshold.
In step S916, the area of the smallest bounding rectangle of the lines remaining in the line group is determined.
Step S917, judging whether the area ratio is larger than a fourth preset threshold. The area ratio is the ratio of the area of the smallest bounding rectangle of rotation to the entire area of the target image. Step S918 is performed when the area ratio is greater than the fourth preset threshold, and step S910 is performed when the area ratio is less than or equal to the fourth preset threshold.
In step S918, the interval distribution between the respective straight lines in the straight line group is calculated.
In step S919, it is determined whether a fifth preset threshold is satisfied, where this refers to whether the interval distribution between the lines in the line group satisfies the fifth preset threshold. If the fifth preset threshold is not satisfied, step S910 is performed, and if the fifth preset threshold is satisfied, step S920 is performed.
In step S920, it is determined that the target image includes streak interference.
In step S910, if all the line groups do not satisfy the preset condition in the process of determining the next line group, it may be determined that the target image does not include streak interference.
In one embodiment, an apparatus for detecting image streak interference is provided, and referring to fig. 10, the apparatus 1000 for detecting image streak interference may include: a first screening module 1001, a processing module 1002, a grouping module 1003, a second screening module 1004, a calculation module 1005, a third screening module 1006, and a detection module 1007.
Wherein, the first filtering module 1001 is configured to determine a target image; the processing module 1002 is configured to perform edge detection on a target image to obtain an edge image, and perform line detection on the edge image to obtain M lines on the edge image; a grouping module 1003, configured to group M lines to obtain N line groups; the second screening module 1004 is configured to determine an area of a minimum bounding rotation rectangle corresponding to each of the N line groups, and screen the N line groups according to the area of the minimum bounding rotation rectangle corresponding to each of the N line groups, to obtain T line groups, where T is less than or equal to N; the calculating module 1005 is configured to perform region expansion on the lines in the T line groups to obtain P extended line groups, determine a connected domain corresponding to each extended line group, and calculate an average length of the connected domains of the corresponding extended line groups according to the connected domain corresponding to each extended line group, where P is greater than or equal to T; a third screening module 1006, configured to screen the lines in the T line groups according to the average length, discard the line groups with the number of remaining lines less than 1 to obtain K line groups, determine an area of a minimum bounding rotation rectangle corresponding to each line group in the K line groups, and screen the K line groups according to an area of a minimum bounding rotation rectangle corresponding to each line group in the K line groups to obtain Q line groups, where Q is less than or equal to K and T; and the detection module 1007 is configured to perform stripe interference detection according to the interval distribution between the lines in the Q line groups.
In one embodiment, before the processing module 1002 performs edge detection on the target image to obtain an edge image, the processing module is further configured to perform filtering processing by using a 3×1 gaussian kernel of the target image in the horizontal direction and the vertical direction, respectively.
In one embodiment, the length of the M straight lines on the edge image is greater than or equal to the set minimum straight line length; the set minimum straight line length is set according to the image size of the edge image.
In one embodiment, the grouping module 1003 is specifically configured to determine an angle of the M straight lines; dividing lines with the angle difference smaller than a first preset value in the M lines into the same line group; wherein each straight line corresponds to a straight line group.
In one embodiment, the calculating module 1005 is specifically configured to determine a slope k of the line, and determine an angle α between the line and the horizontal line according to the slope k of the line; and determining the expansion area of the straight line according to the included angle alpha and the second preset value.
In one embodiment, the calculating module 1005 is specifically configured to determine the expansion area according to an upper parallel line and a lower parallel line adjacent to the straight line when the included angle α is smaller than the second preset value; when the 90-included angle alpha is smaller than a second preset value, determining an expansion area according to a left straight line and a right straight line which are adjacent to each other; when the included angle alpha is more than or equal to a second preset value and the included angle alpha is more than or equal to a second preset value, determining an expansion area according to the straight line and the adjacent upper and lower parallel straight lines, or determining the expansion area according to the straight line and the adjacent left and right parallel straight lines.
In one embodiment, the detection module 1007 is specifically configured to determine an intercept size of each line in the line group, and order the lines according to the intercept sizes of the lines to generate a first list; respectively calculating the difference value between the j+1th intercept size and the j-th intercept size in the first list to generate a second list; removing elements smaller than a fourth preset value in the second list, generating a third list, and determining a variance value corresponding to the third list according to the elements in the third list; if the variance value corresponding to the third list is smaller than a fifth preset value, determining that the straight line in the straight line group is stripe interference.
In one embodiment, an electronic device is provided that includes a memory storing a computer program and a processor that when executing the computer program implements a method of detecting image streak interference.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, implements a method of detecting image streak interference.
While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.

Claims (10)

1. A method for detecting image streak interference, comprising:
determining a target image;
performing edge detection on the target image to obtain an edge image, and performing straight line detection on the edge image to obtain M straight lines on the edge image;
grouping the M straight lines to obtain N straight line groups;
determining the area of the minimum bounding rotation rectangle corresponding to each of the N straight line groups, and screening the N straight line groups according to the area of the minimum bounding rotation rectangle corresponding to each of the N straight line groups to obtain T straight line groups;
performing region expansion on the straight lines in the T straight line groups to obtain P extended straight line groups, determining a connected domain corresponding to each extended straight line group, and calculating the average length of the connected domains of the corresponding extended straight line groups according to the connected domain corresponding to each extended straight line group, wherein P is greater than or equal to T; the extended straight line group comprises one straight line H in the straight line group 1 And the straight line H 1 Two adjacent parallel lines up and down or left and right;
screening the straight lines in the T straight line groups according to the average length, discarding the straight line groups with the number of reserved straight lines smaller than 1 to obtain K straight line groups, determining the area of the minimum bounding rotation rectangle corresponding to each straight line group in the K straight line groups, and screening the K straight line groups according to the area of the minimum bounding rotation rectangle corresponding to each straight line group in the K straight line groups to obtain Q straight line groups, wherein Q is smaller than or equal to K and T;
and carrying out stripe interference detection according to the interval distribution among the straight lines in the Q straight line groups.
2. The method for detecting image streak interference according to claim 1, wherein before edge detecting the target image, the method further comprises, before obtaining an edge image:
and respectively adopting a transverse 3 multiplied by 1 Gaussian core and a longitudinal 3 multiplied by 1 Gaussian core to carry out filtering processing on the target image.
3. The method for detecting image streak interference according to claim 1, wherein the length of M straight lines on the edge image is greater than or equal to a set minimum straight line length; the set minimum straight line length is set according to the image size of the edge image.
4. The method for detecting image streak interference according to claim 1, wherein grouping the M straight lines to obtain N straight line groups includes:
determining the angles of M straight lines;
dividing lines with the angle difference smaller than a first preset value in the M lines into the same line group; wherein each straight line corresponds to a straight line group.
5. The method for detecting image streak interference according to claim 1, wherein when performing region expansion on the lines in the T line groups to obtain P expanded line groups, comprising:
determining the slope k of a straight line, and determining an included angle alpha between the straight line and a horizontal line according to the slope k of the straight line;
and determining the expansion area of the straight line according to the included angle alpha and the second preset value.
6. The method for detecting image streak interference according to claim 5, wherein determining the extended area of the straight line according to the included angle α and the second preset value includes:
when the included angle alpha is smaller than a second preset value, determining the expansion area according to an upper parallel straight line and a lower parallel straight line, wherein the upper parallel straight line and the lower parallel straight line are adjacent to each other;
when the 90-included angle alpha is smaller than a second preset value, determining the expansion area according to the left and right parallel straight lines, wherein the straight lines are adjacent to each other;
and when the included angle alpha is more than or equal to a second preset value and the included angle alpha is more than or equal to a second preset value, determining the expansion area according to the straight line and the adjacent upper and lower parallel straight lines, or determining the expansion area according to the straight line and the adjacent left and right parallel straight lines.
7. The method according to claim 1, wherein when the streak detection is performed based on the interval distribution between the respective straight lines in the Q straight line groups, the method comprises:
determining the intercept sizes of all the lines in the line group, and sorting according to the intercept sizes of all the lines to generate a first list;
respectively calculating the difference value between the j+1th intercept size and the j-th intercept size in the first list to generate a second list;
removing elements smaller than a fourth preset value in the second list, generating a third list, and determining a variance value corresponding to the third list according to the elements in the third list;
and if the variance value corresponding to the third list is smaller than a fifth preset value, determining that the straight line in the straight line group is stripe interference.
8. A detection apparatus for image streak interference, comprising:
the first screening module is used for determining a target image;
the processing module is used for carrying out edge detection on the target image to obtain an edge image, and carrying out straight line detection on the edge image to obtain M straight lines on the edge image;
the grouping module is used for grouping the M straight lines to obtain N straight line groups;
the second screening module is used for determining the area of the minimum bounding rotation rectangle corresponding to each of the N straight line groups, and screening the N straight line groups according to the area of the minimum bounding rotation rectangle corresponding to each of the N straight line groups to obtain T straight line groups;
the calculation module is used for carrying out region expansion on the straight lines in the T straight line groups to obtain P extended straight line groups, determining a connected domain corresponding to each extended straight line group, and calculating the average length of the corresponding extended straight line groups according to the connected domain corresponding to each extended straight line group, wherein P is greater than or equal to T; the extended straight line group comprises one straight line H in the straight line group 1 And the straight line H 1 Two adjacent parallel lines up and down or left and right;
the third screening module is used for screening the straight lines in the T straight line groups according to the average length, discarding the straight line groups with the number of reserved straight lines smaller than 1 to obtain K straight line groups, determining the area of the minimum bounding rotation rectangle corresponding to each straight line group in the K straight line groups, and screening the K straight line groups according to the area of the minimum bounding rotation rectangle corresponding to each straight line group in the K straight line groups to obtain Q straight line groups, wherein Q is smaller than or equal to K and T;
and the detection module is used for carrying out stripe interference detection according to the interval distribution among the straight lines in the Q straight line groups.
9. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, carries out the steps of the method for detecting image streak interference as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method for detecting image streak interference as claimed in any one of claims 1 to 7.
CN202310001291.5A 2023-01-03 2023-01-03 Image stripe interference detection method and device, electronic equipment and medium Active CN115908404B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310001291.5A CN115908404B (en) 2023-01-03 2023-01-03 Image stripe interference detection method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310001291.5A CN115908404B (en) 2023-01-03 2023-01-03 Image stripe interference detection method and device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN115908404A CN115908404A (en) 2023-04-04
CN115908404B true CN115908404B (en) 2023-05-12

Family

ID=85744564

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310001291.5A Active CN115908404B (en) 2023-01-03 2023-01-03 Image stripe interference detection method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN115908404B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116778232A (en) * 2023-06-01 2023-09-19 自然资源部国土卫星遥感应用中心 SAR image vertical stripe detection method, device, equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190617A (en) * 2018-08-09 2019-01-11 腾讯科技(深圳)有限公司 A kind of rectangle detection method of image, device and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104282011B (en) * 2013-07-04 2018-05-25 浙江大华技术股份有限公司 The method and device of interference stripes in a kind of detection video image
CN103473779B (en) * 2013-09-22 2016-06-29 杭州智诺科技股份有限公司 The detection method of stripe interference and device in image
CN104331876B (en) * 2014-10-09 2020-12-08 北京配天技术有限公司 Method for detecting straight line and processing image and related device
CN112752093B (en) * 2020-12-25 2022-08-16 浙江大华技术股份有限公司 Video fringe detection method and device, storage medium and electronic device
CN113592801A (en) * 2021-07-23 2021-11-02 浙江大华技术股份有限公司 Method and device for detecting stripe interference of video image
CN115546568B (en) * 2022-12-01 2023-03-10 合肥中科类脑智能技术有限公司 Insulator defect detection method, system, equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190617A (en) * 2018-08-09 2019-01-11 腾讯科技(深圳)有限公司 A kind of rectangle detection method of image, device and storage medium

Also Published As

Publication number Publication date
CN115908404A (en) 2023-04-04

Similar Documents

Publication Publication Date Title
CN110163219B (en) Target detection method based on image edge recognition
CN110414507B (en) License plate recognition method and device, computer equipment and storage medium
CN107507173B (en) No-reference definition evaluation method and system for full-slice image
CN104933721B (en) Stitching image altering detecting method based on color filter array characteristic
CN113610774B (en) Glass scratch defect detection method, system, device and storage medium
CN111080661A (en) Image-based line detection method and device and electronic equipment
CN115908404B (en) Image stripe interference detection method and device, electronic equipment and medium
CN114332513B (en) New energy automobile abnormal parking amplification data detection method for smart city
CN110263595B (en) Two-dimensional code detection method and device
CN116433666B (en) Board card line defect online identification method, system, electronic equipment and storage medium
US20130163869A1 (en) Apparatus and method for extracting edge in image
CN114820631B (en) Fabric defect detection method capable of resisting texture interference
CN113538603B (en) Optical detection method and system based on array product and readable storage medium
CN110708568A (en) Video content mutation detection method and device
CN112381727A (en) Image denoising method and device, computer equipment and storage medium
CN116416268A (en) Method and device for detecting edge position of lithium battery pole piece based on recursion dichotomy
CN113344907B (en) Image detection method and device
CN114693543B (en) Image noise reduction method and device, image processing chip and image acquisition equipment
CN113744200B (en) Camera dirt detection method, device and equipment
CN112465835B (en) Method for jadeite image segmentation and model training method
CN113205497B (en) Image processing method, device, equipment and medium for double-wire type image quality meter
CN111951254B (en) Edge-guided weighted-average-based source camera identification method and system
CN112862846A (en) Official seal identification method and system combining multiple detection methods
JP6114559B2 (en) Automatic unevenness detector for flat panel display
CN117423113B (en) Adaptive denoising method for archive OCR (optical character recognition) image

Legal Events

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