CN107688832B - Method for detecting heterogeneous region of periodic image - Google Patents

Method for detecting heterogeneous region of periodic image Download PDF

Info

Publication number
CN107688832B
CN107688832B CN201710792538.4A CN201710792538A CN107688832B CN 107688832 B CN107688832 B CN 107688832B CN 201710792538 A CN201710792538 A CN 201710792538A CN 107688832 B CN107688832 B CN 107688832B
Authority
CN
China
Prior art keywords
image
area
differential mode
region
width
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
CN201710792538.4A
Other languages
Chinese (zh)
Other versions
CN107688832A (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.)
Hangzhou Zhantuo Intelligent Technology Co ltd
Original Assignee
Hangzhou Zhantuo 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 Hangzhou Zhantuo Intelligent Technology Co ltd filed Critical Hangzhou Zhantuo Intelligent Technology Co ltd
Priority to CN201710792538.4A priority Critical patent/CN107688832B/en
Publication of CN107688832A publication Critical patent/CN107688832A/en
Application granted granted Critical
Publication of CN107688832B publication Critical patent/CN107688832B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/758Involving statistics of pixels or of feature values, e.g. histogram matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to a method for detecting a heterogeneous region of a periodic image, which comprises the steps of detecting an eigen period of the periodic image, determining a periodic region, obtaining an eigen differential mode image, detecting feature points in the eigen differential mode image, respectively defining 5 differential mode feature regions, counting the number of the detected feature points falling into the maximum range of each differential mode feature region, determining the actual range and the actual width of the distribution of the feature points in each region, and screening out the differential mode feature regions of which the number of the falling is not lower than a specified threshold value and the actual width is not lower than the specified threshold value to serve as the heterogeneous region. The invention has the beneficial effects that: the heterogeneous region of the periodic image is detected with low calculation overhead, the detected heterogeneous region is more accurate and reliable, and particularly, the more important improvement is that the problem that the heterogeneous region located in the central position of the periodic image cannot be detected by the conventional method is solved.

Description

Method for detecting heterogeneous region of periodic image
Technical Field
The invention relates to the technical field of computer image processing and machine vision, in particular to a method for detecting a period image heterogeneous region.
Background
The method provided by the invention is suitable for machine vision detection systems in many current industrial fields. In these lines, the images scanned by the machine vision inspection system are periodic images, i.e., successive images that repeat at a certain period along the direction of travel of the production line. The visual inspection system for realizing the surface inspection of the product by facing the periodic image generally adopts an image comparison method. The premise behind the successful application of this method is that a precise reference image must be provided for the vision inspection system in advance to make it possible to compare the real-time scanned image with the reference image. The period of an image in the present invention is referred to as a period height.
In the periodic image, there is only one minimum period for each specific coordinate region in the image, but there may be two minimum periods of different height values in two different coordinate regions of the image. The dimension of the coordinates referred to herein means a dimension in a direction perpendicular to the periodic direction of the periodic image, that is, the running direction of the production line. The minimum periods in which the two height values are different are distinguished into an eigenperiod and a heterogeneous period.
The eigenperiod is defined as the period height having the highest distribution frequency in the entire period image, and the highest distribution frequency associated therewith is defined as the eigenfrequency. Here, the distribution frequency of a certain period height value in an image is defined as the frequency of occurrence or the number of occurrences of the period height value in the corresponding image. In fact, the eigenperiods thus defined are in fact the minimum period height at which the frequency of occurrence or the number of occurrences or the probability of occurrence in the periodic image is the highest.
The minimum periods other than the eigenperiods in the periodic image all belong to heterogeneous periods. The number of heterogeneous periods is 2 or more times the eigenperiod, so heterogeneous periods are defined as the minimum period height where the value of the period height present in the periodic image is at least 2 times the value of the eigenperiod of the image. The heterogeneous region is defined as a local region in which the minimum cycle height of the feature points existing in the periodic image is a heterogeneous cycle and the number of the feature points is not less than a prescribed threshold.
When the reference image contains heterogeneous regions, the height of the reference image must be an integer multiple of the heterogeneous period value, and is generally equal to the heterogeneous period value, so that the reference image can be used for image comparison without causing errors. When the reference image does not include the heterogeneous regions, the height of the reference image only needs to be an integer multiple of the eigenperiod value, and is generally equal to the eigenperiod value. Therefore, the height of the reference image depends on whether the heterogeneous regions are included in the reference image.
Since many products are made of soft materials, such as paper or plastic films, rather than rigid bodies, the 2 images of the same size that are shifted by an integral multiple of the intrinsic period or an integral multiple of the heterogeneous period in the periodic height direction are not exactly identical to each other in the periodic images, and there are always image differences caused by shaking between them. In this case, the smaller the height of the reference image, the more accurate the result of the image comparison, whereas the larger the height of the reference image, the worse the accuracy of the result of the image comparison.
For the above reasons, in order to ensure that the most accurate image comparison result is obtained, the reference image with a smaller height value should be selected as much as possible, that is, the reference image with an image height equal to the eigenperiod value should be selected as much as possible for the vision inspection system to use when performing image comparison, but this goal can only be achieved on the premise that the reference image without heterogeneous regions can be extracted from the periodic image. On the contrary, when the reference picture cut out from the periodic picture has to contain heterogeneous regions, only the reference picture having the picture height equal to the heterogeneous period value must be used.
It is easy to see that the precondition for selecting the reference image with the optimal height value is that heterogeneous regions in the periodic image can be accurately detected. In the conventional method, a method of searching the column period of the column image in the front and back is used, and the heterogeneous region and the heterogeneous period are detected based on the numerical value of the column period obtained from the search. The method has the defects of insufficient accuracy, easy interference, low reliability and high calculation cost.
In the above-mentioned conventional method using a search column image, which is prone to be interfered, generally, when heterogeneous regions and intrinsic period regions of an image at boundaries on the left and right sides of the image are often interlaced, in this case, the number of feature points of heterogeneous periods in the heterogeneous regions is generally much smaller than that of feature points of intrinsic periods, so that the heterogeneous periods are submerged in the feature points of numerous intrinsic periods, and the column period obtained by using the method using the search column image often reflects only the intrinsic periods but cannot reflect the heterogeneous periods.
There is also a disadvantage that when the feature points of the heterogeneous period in the heterogeneous regions at the boundaries of the left and right sides of the image are small in size and in number, the heterogeneous regions and the heterogeneous period are often not searched out using the method of searching the column image.
Further, there is a fatal problem in the method of using the search column image in that it cannot detect the heterogeneous region and the heterogeneous period at the central position of the periodic image, but only detects the heterogeneous regions at the boundaries of the left and right sides of the periodic image, and thus once the heterogeneous region exists only at the central position of the periodic image and the heterogeneous regions do not exist at the boundaries of the left and right sides, the reference image determined from the heterogeneous regions detected according to the above method is likely to have a serious error in the obtained reference image due to omission of the heterogeneous region at the central position of the periodic image.
The above problems with the method of searching column images in several aspects illustrate the lack of capability of the method.
In order to solve the problems existing in the existing method, the invention provides a method for detecting a heterogeneous region of a periodic image.
Disclosure of Invention
In order to solve the problems of the existing method, the invention provides a method for detecting a period image heterogeneous region.
The technical scheme of the invention is as follows: a method for detecting a period image heterogeneous region comprises the following steps: 1) detecting an eigen period of the periodic image, determining a distribution range of characteristic points with a period height not less than a specified threshold value in the periodic image, and defining the range as a periodic area; 2) acquiring an eigen differential mode image from the periodic image based on the detected eigen period and the periodic region; 3) detecting characteristic points in the intrinsic differential mode image; 4) respectively defining a plurality of differential mode characteristic regions in the intrinsic differential mode image along the width direction of the intrinsic differential mode image, wherein each differential mode characteristic region has a set maximum range and a set maximum width; 5) counting the number of the detected characteristic points falling into the maximum range of each differential mode characteristic region respectively based on the width-direction coordinates of the characteristic points detected in the intrinsic differential mode image, and defining the number as the falling number of the corresponding region; 6) determining the actual range and the actual width of the distribution of the characteristic points in each differential mode characteristic region according to the coordinates in the width direction of the characteristic points falling into the maximum range of each differential mode characteristic region; 7) and screening out differential mode characteristic regions with the number of falls below a specified threshold value and the actual width not below the specified threshold value from the differential mode characteristic regions to serve as heterogeneous regions of the periodic image.
Preferably, the plurality of differential mode feature regions comprises: left zone, middle right zone, right zone.
Preferably, the method further comprises the steps of: 8) when the number of the left zone or the right zone is lower than a specified threshold value or the actual width is lower than a specified threshold value, then blob analysis is carried out on a local image of which the intrinsic differential mode image falls in the maximum range of the zone, blobs existing in the local image are detected, the actual range and the actual width of blob distribution in the zone are determined according to the coordinate of the width direction of the blobs falling in the maximum range of the zone, and if the number of the blobs detected from the local image is not lower than the specified threshold value and the actual width of the blob distribution is not lower than the specified threshold value, the zone is determined as a heterogeneous zone.
Preferably, the method further comprises the steps of: 9) if the left area or the right area still cannot be determined as the heterogeneous area after the step (8), feature points are detected again for the local image of which the periodic image falls within the maximum range of the area, if the number of the detected feature points is lower than a predetermined threshold value, the local image is determined as the heterogeneous area, and otherwise, the local image is determined not to be the heterogeneous area.
Definition of the width direction mentioned above: the width direction in the present invention refers to a direction perpendicular to the period height direction, that is, a direction perpendicular to the running direction of the production line.
In addition, the coordinates referred to in the present invention generally refer to the coordinates in the width direction unless otherwise specified.
As described in the background art, the eigenperiod is defined as a period height having the highest distribution frequency in the entire period image, and the highest distribution frequency associated therewith is defined as an eigenfrequency. Heterogeneous periodicity is defined as the minimum period height present in a periodic image with a period height value at least 2 times the intrinsic period value of the image. The heterogeneous region is defined as a local region in which the minimum cycle height of the feature points existing in the periodic image is a heterogeneous cycle and the number of the feature points is not less than a prescribed threshold.
The method provided by the invention detects the eigenperiod and the eigenfrequency through the following steps and determines the period region: 1) dividing the whole periodic image into a plurality of columns of images with the same height, the same step pitch and the same column width along the width direction of the periodic image, wherein the height is equal to the height of the whole periodic image; 2) sequentially detecting the cycle height with the highest distribution frequency and the height value not lower than a specified threshold value in the corresponding column for each column of images from left to right, and defining the cycle height value as the column cycle of the corresponding column, wherein the corresponding highest distribution frequency is defined as the column frequency of the corresponding column; 3) when a column of images cannot detect a cycle height having a height value not lower than a prescribed threshold value, the column cycle of the column is equal to 0; 4) then, for each detected column period not lower than a specified threshold, respectively finding out each column period equivalent to the column period from all the detected column periods, then accumulating the column frequencies of the found equivalent column periods, and defining the accumulated value as an accumulated value of the column frequencies corresponding to the column period value, wherein the equivalent column periods refer to the column periods with errors between the column period values within a specified threshold range; besides, the accumulated value of the row frequency of the row period value is counted, and the equivalent row period mean value of the row period value is counted at the same time; it cannot be seen that all the equivalent column periods have the same equivalent column period mean value and the same column frequency accumulated value; 5) according to the method, the average value of the same row period of all the appeared row periods and the row frequency accumulated value corresponding to the average value of the same row period are obtained; 6) then, the maximum value of the row frequency accumulated value is found out from the row frequency accumulated values of all the counted equal row period mean values, the equal row period mean value corresponding to the maximum value is used as the eigenperiod of the periodic image, and the maximum value of the row frequency accumulated value is used as the eigenfrequency of the periodic image; 7) and taking the distribution range of all the column images with the column period not lower than a specified threshold value as a periodic area, selecting a left boundary with the minimum coordinate value from the left boundaries of all the column images meeting the condition as the left boundary of the periodic area, and selecting a right boundary with the maximum coordinate value from the right boundaries of all the column images meeting the condition as the right boundary of the periodic area.
Feature points in the eigendifferential mode image are preferably detected using the Fast algorithm, i.e. a feature detection algorithm based on accelerated segmentation testing, which is commonly used in the field of image processing and machine vision.
Preferably, the method for detecting the column period of the column image is: 1) firstly, detecting characteristic points of the column images by using the Fast algorithm; 2) then calculating a feature description vector for each feature point by using a Surf algorithm which is commonly used in the field of image processing and machine vision, namely an acceleration robust feature description algorithm; 3) next, calculating feature matching distances among all feature description vectors by using a Brute Force algorithm, namely a Brute Force algorithm, which is commonly used in the field of image processing and machine vision; 4) then screening the number of the characteristic points, the coordinates of the characteristic points and the characteristic matching distances, and taking out all the characteristic point pairs with the matching distances smaller than a set maximum matching distance threshold value as matching characteristic point pairs of the column images; 5) calculating coordinate distances among all matched characteristic point pairs, and defining the distances as matched point pair distances; 6) counting all the calculated matching point pair distances, and counting the occurrence frequency of each matching point pair distance not less than a specified threshold value and the statistical mean value of the matching point pair distances, 8) taking the matching point pair distance mean value in the statistical result not less than the specified threshold value and with the highest occurrence frequency as the column period of the column image, wherein the corresponding highest frequency is the column frequency.
The eigen-differential-mode image is defined as a binarized image obtained by comparing a translated image obtained by translating the periodic image by one eigen-period height in the direction of the period height with the image before translation.
Preferably, the intrinsic differential mode image is obtained by: 1) intercepting 2 images with equal height and equal width from the periodic image, wherein the left boundary of the 2 intercepted images is the left boundary of the periodic area, and the right boundary of the 2 intercepted images is the right boundary of the periodic area; 2) the height range of the first image in the 2 truncated images is from the topmost edge of the periodic image to the position where the distance from the topmost edge of the periodic image is equal to the height of the periodic image minus one intrinsic period value, and the height range of the second image is from the position where the distance from the topmost edge of the periodic image is equal to one intrinsic period value in the periodic image to the bottommost edge of the periodic image, and the second image is used as a template image; 3) respectively performing morphological expansion and morphological corrosion on the template image, wherein the deformation width of the morphological expansion or corrosion is 7-13, the deformation height is 30-50, so as to obtain 2 result images, the expansion image is obtained by the expansion processing, and the corrosion image is obtained by the corrosion processing; 4) taking the expanded image as an upper threshold image and the corroded image as a lower threshold image, and then respectively carrying out threshold filtering processing on the two threshold images by using a comparison image to obtain a new binaryzation result image serving as an intrinsic differential mode image; 5) if the pixel value at a certain coordinate in the eigendifferential mode image is equal to 0, the pixel value at the same coordinate in the comparison image falls within the pixel value range determined by the pixel values at the corresponding coordinates in the upper threshold image and the lower threshold image, otherwise, if the pixel value at a certain coordinate in the eigendifferential mode image is equal to 255, the pixel value at the same coordinate in the comparison image is either greater than the pixel value at the corresponding coordinate in the upper threshold image or less than the pixel value at the corresponding coordinate in the lower threshold image.
Preferably, the maximum extent of each differential mode feature region is determined according to the following rule: 1) taking the left boundary of the intrinsic differential mode image as the left boundary of a left area, wherein the maximum width of the left area is equal to the width of the row image, and the coordinate value of the right boundary in the width direction is equal to the coordinate value of the left boundary in the width direction plus the maximum width; 2) taking the right boundary of the intrinsic differential mode image as the right boundary of a right area, wherein the maximum width of the right area is equal to the width of the column image, and the coordinate value of the left boundary in the width direction is equal to the coordinate value of the right boundary in the width direction minus the maximum width; 3) the center coordinate in the width direction of the middle region is the coordinate of the center in the width direction of the eigen differential mode image, the coordinate value in the width direction of the left boundary is equal to the center coordinate value minus the width of the column image, and the coordinate value in the width direction of the right boundary is equal to the center coordinate value plus the width of the column image; 4) the middle left area is defined as the area between the left area and the middle area in the intrinsic differential mode image, the left boundary of the middle left area is the right boundary of the left area, and the right boundary of the middle area is the left boundary of the middle area; 5) the middle right area is defined as an area between the middle area and the right area in the intrinsic differential mode image, the left boundary of the middle area is the right boundary of the middle area, and the right boundary of the middle area is the left boundary of the right area; 6) the area between the left and right boundaries of each zone is the maximum extent of the respective zone.
Preferably, the actual extent of the distribution of feature points detected from the intrinsic differential mode image that fall within the respective differential mode feature regions is determined by: 1) dividing the detected feature points into different differential mode feature areas according to the width direction coordinates and the maximum range of the different differential mode feature areas; 2) for any one of the differential mode feature areas, finding out a minimum coordinate and a maximum coordinate along the width direction from the width direction coordinates of the feature points divided to the area, wherein the minimum coordinate is used as a left boundary of an actual range of the area feature distribution, the maximum coordinate is used as a right boundary of the actual range of the area feature distribution, an area between the left boundary and the right boundary is the actual range of the area feature distribution, and the width of the actual range is the actual width.
Preferably, the actual range of blob distribution detected from a local image whose eigenmode differential image falls within the largest range of the left or right region is determined by: performing connectivity analysis or blob analysis on a local image of which the intrinsic differential mode image falls in the maximum range of the left region or the right region by using a common blob analysis algorithm for image processing, and detecting a connected region or blob existing in the local image; and finding out a minimum coordinate and a maximum coordinate along the width direction from coordinates of the blob detected by the local image in the maximum range of the region, wherein the minimum coordinate is used as a left boundary, the maximum coordinate is used as a right boundary, and a region between the left boundary and the right boundary is an actual range of the blob distribution detected by the local image in the maximum range of the region, and the width of the actual range is the actual width of the blob distribution.
The invention has the beneficial effects that: the method has the advantages that heterogeneous regions of periodic images are detected with small calculation cost, differential mode characteristic regions are divided into a left region, a middle right region and a right region, local differential mode image blob analysis and local periodic image characteristic point detection are further added to the 2 regions when differential mode characteristic points cannot reflect whether the regions are heterogeneous regions, and the detected heterogeneous regions are more accurate and reliable.
Drawings
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of detecting a heterogeneous region according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a periodic image divided into column images when detecting eigenperiods and periodic zones in an embodiment of the invention;
FIG. 3 is a flow chart of detecting a column period of a column image in an embodiment of the present invention;
FIG. 4 is a flow chart of detecting the eigenperiods and eigenfrequencies in an embodiment of the invention;
FIG. 5 is a flow chart of obtaining an eigendifferential mode image in an embodiment of the invention;
FIG. 6 is a flow chart of determining the maximum range of each differential mode feature region in an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be further described below with reference to the accompanying drawings, but the present invention is not limited to these embodiments.
With reference to fig. 1, the present invention divides the process of detecting the heterogeneous regions of the periodic image into three stages, as shown in the figure, from left to right, the first stage is an illustration of the left part of fig. 1, the division of the 5 differential mode feature regions is completed in the first stage, and which of the 5 differential mode feature regions are heterogeneous regions and which are not heterogeneous regions are determined according to the number of feature points and the actual width. The second stage is a diagram of the middle part of fig. 1, and the second stage and the third stage are processes for performing further detection on the left region or the right region, and the detection of the second stage and the third stage is only performed when the first stage cannot determine whether the left region or the right region is a heterogeneous region.
a. The first stage divides 5 differential mode feature regions and determines which of the 5 differential mode feature regions are heterogeneous regions according to the number of feature points and actual width by the following steps:
(1.1) detection of intrinsic cycles and periodic regions: as described in the summary of the invention, the detection of the eigenperiod and the period region is performed on the whole period image, and the specific method can be referred to in the summary of the invention;
(1.2) acquiring an intrinsic differential mode image: as described in the above invention, the eigen differential mode image is a new binary result image obtained by performing threshold filtering processing on two threshold images obtained by morphological processing on the template image by using the comparison image, the left boundary of the detected period region is the left boundary of the eigen differential mode image, the right boundary of the period region is the right boundary of the eigen differential mode image, and the height of the eigen differential mode image is equal to the height of the comparison image and the template image;
(1.3) detecting characteristic points in the intrinsic differential mode image: preferably, feature points in the eigendifferential mode image are detected using the Fast algorithm;
(1.4) dividing a differential mode characteristic region: dividing 5 differential mode characteristic regions into an intrinsic differential mode image, namely a left region, a right region, a middle left region and a middle right region, wherein the selection of the coordinate position in the width direction of each region and the determination of the maximum range are as described in the invention content, the maximum width of the left region and the right region is the width of a divided column image when an intrinsic period is detected, the width of the column image is generally 192-256 pixels, and the maximum width of the middle region is 2 times of the width of the column image;
(1.5) dividing the characteristic points into different mode characteristic regions: dividing each characteristic point detected in the intrinsic differential mode image by using the Fast algorithm into differential mode characteristic regions in which the width direction coordinates fall according to the width direction coordinates and the determined maximum range of each differential mode characteristic region;
(1.6) counting the falling number and actual range of each region: after the feature points are divided into the differential mode feature areas, counting the number (namely, the falling number) of the feature points falling into the maximum range of each differential mode feature area and the actual range of the distribution of the falling feature points;
(1.7) screening the isomerization zone: according to the statistics of the falling number and the actual distribution range of the feature points of each differential mode feature region, screening out the falling number which is not lower than a specified threshold value and the actual width which is not lower than the specified threshold value from the 5 differential mode feature regions as a heterogeneous region; in this embodiment, the threshold value regarding the number of feature point falls is taken as 3, and the threshold value regarding the actual width of the feature distribution is taken as 16 pixel width;
b. if the left area or the right area is found not to meet the heterogeneous area condition of the first stage after the first stage, entering a second stage, and further determining whether the left area or the right area is a heterogeneous area by the following steps:
(2.1) intercepting a local image of the intrinsic differential mode image falling in the region: the zone is a left zone or a right zone which is detected again in sequence and does not meet the heterogeneous zone condition of the first stage; if the region is a left region, according to the maximum range of the left region in the above invention, a local image falling within the coordinate range determined by the maximum range of the left region is extracted from the eigen-differential-mode image, the height of the local image is equal to the height of the eigen-differential-mode image, and the width of the local image is equal to the maximum width of the left region; on the contrary, if the region is the right region, according to the maximum range of the right region in the above invention, a local image falling within the coordinate range determined by the maximum range of the right region is intercepted from the eigen differential mode image, the height of the local image is equal to the height of the eigen differential mode image, and the width of the local image is equal to the maximum width of the right region;
(2.2) detecting the blob: using a common blob analysis algorithm for image processing to perform connectivity analysis or blob analysis to the local images, and detecting connected regions or blobs existing in the local images;
(2.3) counting the number of the blobs in the region and the actual range: when the blob detection is completed, the blob analysis algorithm can automatically acquire the number of detected blobs; and finding out a minimum coordinate and a maximum coordinate along the width direction from the coordinates of the blob detected from the local image of the region, taking the minimum coordinate as a left boundary and the maximum coordinate as a right boundary, wherein the region between the left boundary and the right boundary is an actual range of the blob distribution detected from the local image of the region, and the width of the actual range is the actual width of the blob distribution.
(2.4) judging whether the region is an isomeric region: determining whether the region is a heterogeneous region according to the detected number of the blobs and the actual width of the blob distribution; if the number of blobs detected from the partial images of the region is not lower than a prescribed threshold value and the actual width of the blob distribution is not lower than the prescribed threshold value, the region is determined as a heterogeneous region; in the present embodiment, the threshold value regarding the number of b l ob is taken to be 3, and the threshold value regarding the actual width of the b l ob distribution is taken to be 16 pixels wide
c. If the left area or the right area is found to not meet the heterogeneous area condition of the second stage after the second stage, entering a third stage, and further determining whether the left area or the right area is a heterogeneous area by the following steps:
(3.1) intercepting a partial image of the periodic image falling into the region: according to a coordinate range given by the maximum range of the left area or the right area which does not meet the heterogeneous area condition of the second stage, intercepting a local image in the coordinate range from the periodic image; for the left region, the left boundary of the coordinate range corresponds to the left boundary of the periodic region in the periodic image, the left boundary of the periodic region in the periodic image is taken as the left boundary of the local image, and the right boundary coordinate value of the local image is equal to the left boundary coordinate value of the local image plus the maximum width of the left region; for the right region, the right boundary of the coordinate range corresponds to the right boundary of the periodic region in the periodic image, the right boundary of the periodic region in the periodic image is taken as the right boundary of the local image, and the left boundary coordinate value of the local image is equal to the right boundary coordinate value of the local image minus the maximum width of the right region;
(3.2) detecting the characteristic points: detecting characteristic points in the local images by using a Fast algorithm;
(3.3) counting the characteristic number of the region: when the Fast algorithm detects the characteristic points in the local image, the number of the detected characteristic points is automatically acquired as the characteristic number of the area;
(3.4) determining whether the region is a heterogeneous region: if the number of the detected feature points is lower than a predetermined threshold value, the feature points are determined as a heterogeneous region, otherwise, the region is determined not to be a heterogeneous region; in the present embodiment, the threshold value is taken to be 100.
As shown in fig. 1, in the above three stages, once it is determined that both the left region and the right region are heterogeneous regions, or it is determined that the left region or the right region is not a heterogeneous region through the three stages, the process of detecting the heterogeneous region of the periodic image is completed.
With reference to fig. 2, a column image in which the entire periodic image is divided into a plurality of columns in the width direction thereof, the columns having the same height, the same pitch, the same column width, and the column width of 192 to 256 pixels will be described. First, it is to be noted that the height of a periodic image, in the present invention, the periodic image is a periodic image with a certain height value obtained by collecting and stitching in advance, and the height value is the height of an image formed by stitching a plurality of frames of collected images, and in this embodiment, a reference value for the height of the periodic image is 12000 pixels in height. Referring to FIG. 2, the top half of the figure shows a full cycle image; the image width is marked as the period image width at the upper part in fig. 2; and the image height is equal to the period image height; in a practical system, the width of the column image may be set to 192 pixel width; the step between column images is 1/2 the column image width, that is, it can be set to 96 pixels width. The height of each column of images is equal to the height of the periodic image. In the embodiment shown in fig. 2, the entire periodic image is divided into N column images (the sequence numbers are 0 to N-1) in the width direction thereof, and when the step distance between the column images is 96 pixel width, N is the width of the periodic image (unit: pixel width)/96-1.
The following example is given in conjunction with fig. 3 to illustrate a method of detecting the column period and column frequency of a column image.
a. Three thresholds are set: before detecting the column period and the column frequency, three thresholds are defined, the first being a maximum matching distance threshold thrs for feature matching, and the second being a minimum period height threshold minH, and the third being a threshold a for height deviation; in particular, one reference value of the threshold value a may take 2% of the corresponding column period value, and one reference value of the threshold value minH may take 155 pixel height;
b. detecting the characteristic points of the column of images: for a specific certain column of images, feature points are detected by using a Fast algorithm;
c. calculating a feature description vector for the detected feature points: then calculating a feature description vector for each detected feature point by using a Surf algorithm;
d. calculating feature matching distances between feature description vectors: then, calculating the feature matching distance between every two feature description vectors by using a BF (Brute force) algorithm;
e. screening out matched characteristic point pairs: then, filtering all feature matching results with the feature matching distance > thrs from the calculated feature matching distances, and only keeping the feature matching results with the feature matching distance less than or equal to thrs as matching feature point pairs of the image row;
f. calculating the distance of the matched point pair of the listed images: calculating coordinate distances between all matched feature point pairs, namely column image matched point pair distances for short, wherein the column image matched point pair distances comprise point pair x distances and point pair y distances, the point pair x distances are the absolute values of x coordinate differences between matched feature points, and the point pair y distances are the absolute values of y coordinate differences between matched feature points;
g. filtering out the result of self matching: after the matching point pair distances of all the column images are calculated, checking all the point pair x distances and the point pair y distances, and filtering out matching results corresponding to the point pair x distance being 0 and the point pair y distance being 0, wherein the matching results are the matching results of the same characteristic point pair;
h. the results without true periodicity are filtered out: then, filtering out the matching results of the points in the image, wherein the distance of the points to the x is more than 40 pixel widths, because the matching results meeting the condition belong to characteristic points without real periodicity for the periodic image;
i. grouping the filtered matching results: after the filtering is finished, dividing the matching results left after the filtering into a plurality of groups of sets according to the difference of the point pair y distance values, wherein each element in each group of sets is a point pair y distance value, and the deviation between the value of each element in the same group of sets and the mean value of the elements in the group of sets is less than or equal to A;
j. calculate the mean for each group: calculating the mean value of the elements contained in each group set;
k. finding out the groups with the mean value meeting the threshold requirement and the maximum number: and finding out a grouping set with the grouping set mean value being more than or equal to minH and containing the maximum number of elements from all the grouping sets, taking the mean value as the column period of the column image, and taking the number of the elements contained in the column period as the column frequency.
A method of detecting the eigenperiod and eigenfrequency is described in conjunction with fig. 4.
a. Dividing the whole periodic image into a plurality of columns of images with the same height, the same step pitch and the same column width along the width direction of the periodic image, wherein the height is equal to the height of the whole periodic image; in particular, the method of dividing the periodic image into column images may be as described above in connection with the embodiment of fig. 2;
b. detecting the column period and the column frequency of each column of images: sequentially detecting the column period and the column frequency of each column of images from left to right; when a column of images cannot detect a cycle height having a height value not lower than a prescribed threshold value, the column cycle of the column is equal to 0; in particular, the method of detecting the column period and the column frequency can be seen in the embodiment given above in connection with fig. 3;
d. counting the accumulated column frequency for the same column period: then, for each detected column period not lower than a specified threshold, respectively finding out each column period equivalent to the column period from all the detected column periods, then accumulating the column frequencies of the found equivalent column periods, and defining the accumulated value as a column frequency accumulated value corresponding to the column period value; it is to be noted that, here, the equivalent column periods refer to those column periods whose values of column periods have an error within a prescribed threshold value range from each other; besides, the accumulated value of the row frequency of the row period value is counted, and the equivalent row period mean value of the row period value is counted at the same time; it cannot be seen that all the equivalent column periods have the same equivalent column period mean value and the same column frequency accumulated value; according to the method, the average value of the equivalent row periods of all the appeared row periods and the frequency accumulated value corresponding to the average value are counted; in this embodiment, the threshold value specified for the equivalent column period is taken as the threshold value a for the height deviation used in the embodiment given above in connection with fig. 3;
f. find the maximum of the accumulated column frequency: finding out the maximum value of the row frequency accumulated value from the row frequency accumulated values of all the counted equal row period mean values, taking the equal row period mean value corresponding to the maximum value as the eigenperiod of the periodic image, and taking the maximum value of the row frequency accumulated value as the eigenfrequency of the periodic image;
g. taking the distribution range of the column images of which all the column periods are not lower than the specified threshold as a period area, wherein the specified threshold is the threshold minH of the minimum period height used in the embodiment given above in combination with the embodiment shown in FIG. 3;
h. the left boundary of the leftmost column is taken as the left boundary of the periodic region and the left boundary in which the coordinate value is the smallest is selected as the left boundary of the periodic region from among the left boundaries of all column images satisfying the condition (column period not lower than a prescribed threshold),
i. and selecting the right boundary with the largest coordinate value from the right boundaries of all the column images meeting the condition (the column period is not lower than a specified threshold) as the right boundary of the periodic area.
A method of acquiring an eigendifferential mode image is described with reference to fig. 5.
a. Intercepting 2 images with equal height and width from the periodic image, wherein the left boundary of the 2 intercepted images is the left boundary of the periodic area, and the right boundary of the 2 intercepted images is the right boundary of the periodic area;
b. the height range of the first image in the 2 truncated images is from the topmost edge of the periodic image to the position where the distance from the topmost edge of the periodic image is equal to the height of the periodic image minus one intrinsic period value, and the height range of the second image is from the position where the distance from the topmost edge of the periodic image is equal to one intrinsic period value in the periodic image to the bottommost edge of the periodic image, and the second image is used as a template image;
c. respectively performing morphological expansion and morphological corrosion on the template image, wherein the deformation width of the morphological expansion or corrosion is 7-13, the deformation height is 30-50, so as to obtain 2 result images, the expansion image is obtained by the expansion processing, and the corrosion image is obtained by the corrosion processing;
d. taking the expanded image as an upper threshold image and the corroded image as a lower threshold image, and then respectively carrying out threshold filtering processing on the two threshold images by using a comparison image to obtain a new binaryzation result image serving as an intrinsic differential mode image;
e. if the pixel value at a certain coordinate in the eigendifferential mode image is equal to 0, the pixel value at the same coordinate in the comparison image falls within the pixel value range determined by the pixel values at the corresponding coordinates in the upper threshold image and the lower threshold image, otherwise, if the pixel value at a certain coordinate in the eigendifferential mode image is equal to 255, the pixel value at the same coordinate in the comparison image is either greater than the pixel value at the corresponding coordinate in the upper threshold image or less than the pixel value at the corresponding coordinate in the lower threshold image.
A method of determining the maximum range of each differential mode feature region is described in conjunction with figure 6.
a. Taking the left boundary of the eigendifferential mode image as the left boundary of the left region, the maximum width of the left region being equal to the width of the column image in the embodiment given above in conjunction with fig. 2, and the coordinate value of the width direction of the right boundary being equal to the coordinate value of the width direction of the left boundary plus the maximum width thereof;
b. taking the right boundary of the eigen-differential-mode image as the right boundary of the right region, wherein the maximum width of the right region is equal to the width of the column image in the embodiment given above with reference to fig. 2, and the coordinate value of the left boundary in the width direction is equal to the coordinate value of the right boundary in the width direction minus the maximum width;
c. the width-directional center coordinate of the middle region is the width-directional center coordinate of the eigen-differential-mode image, the width-directional coordinate value of the left boundary thereof is equal to the center coordinate value minus the width of the column image in the embodiment given above in conjunction with fig. 2, and the width-directional coordinate value of the right boundary thereof is equal to the center coordinate value plus the width of the column image;
d. the middle left area is defined as the area between the left area and the middle area in the intrinsic differential mode image, the left boundary of the middle left area is the right boundary of the left area, and the right boundary of the middle area is the left boundary of the middle area;
e. the middle right area is defined as an area between the middle area and the right area in the intrinsic differential mode image, the left boundary of the middle area is the right boundary of the middle area, and the right boundary of the middle area is the left boundary of the right area;
f. the area between the left and right boundaries of each zone is the maximum extent of the respective zone.
The specific embodiments described herein are merely illustrative of the spirit of the invention. Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.

Claims (7)

1. A method for detecting a heterogeneous region of a periodic image is characterized by comprising the following steps: 1) detecting an eigen period of the periodic image, determining a distribution range of characteristic points with a period height not less than a specified threshold value in the periodic image, and defining the range as a periodic area; 2) acquiring an eigen differential mode image from the periodic image based on the detected eigen period and the periodic region; 3) detecting characteristic points in the intrinsic differential mode image; 4) respectively defining a plurality of differential mode characteristic regions in the intrinsic differential mode image along the width direction of the intrinsic differential mode image, wherein each differential mode characteristic region has a set maximum range and a set maximum width; 5) counting the number of the detected characteristic points falling into the maximum range of each differential mode characteristic region respectively based on the width-direction coordinates of the characteristic points detected in the intrinsic differential mode image, and defining the number as the falling number of the corresponding region; 6) determining the actual range and the actual width of the distribution of the characteristic points in each differential mode characteristic region according to the coordinates in the width direction of the characteristic points falling into the maximum range of each differential mode characteristic region; 7) and screening out the differential mode characteristic regions with the falling number not lower than a first threshold value and the actual width not lower than a second threshold value from the differential mode characteristic regions to serve as heterogeneous regions of the periodic image.
2. The method of claim 1, wherein the plurality of differential mode feature regions comprise: left zone, middle right zone, right zone.
3. The method for detecting the heterogeneous regions of the periodic image according to claim 2, further comprising the steps of: 8) when the number of the left zone or the right zone is lower than a first threshold value or the actual width is lower than a second threshold value, then blob analysis needs to be carried out on a local image of which the intrinsic differential mode image falls in the maximum range of the zone, blobs existing in the local image are detected, the actual range and the actual width of blob distribution in the zone are determined according to the coordinate of the width direction of the blobs falling in the maximum range of the zone, and if the number of the blobs detected from the local image is not lower than a third threshold value and the actual width of the blob distribution is not lower than a fourth threshold value, the zone is determined as a heterogeneous zone.
4. The method for detecting the heterogeneous regions of the periodic image according to claim 3, further comprising the steps of: 9) if the left area or the right area still cannot be determined as the heterogeneous area after the step (8), feature points of the local image of which the periodic image falls within the maximum range of the area need to be detected again, if the number of the detected feature points is lower than a fifth threshold value, the local image is determined as the heterogeneous area, and otherwise, the local image is determined not to be the heterogeneous area.
5. The method of claim 1, wherein the maximum range of the set differential mode feature region is determined by: 1) taking the left boundary of the intrinsic differential mode image as the left boundary of a left area, wherein the maximum width of the left area is equal to the set width, and the coordinate value of the right boundary of the left area in the width direction is equal to the coordinate value of the left boundary in the width direction plus the maximum width; 2) taking the right boundary of the intrinsic differential mode image as the right boundary of a right region, wherein the maximum width of the right region is equal to the set width, and the coordinate value of the left boundary of the right region in the width direction is equal to the coordinate value of the right boundary in the width direction minus the maximum width; 3) the central coordinate of the width direction of the middle area is the coordinate of the center of the width direction of the eigen differential mode image, the coordinate value of the width direction of the left boundary is equal to the central coordinate value minus the set width, and the coordinate value of the width direction of the right boundary is equal to the central coordinate value plus the set width; 4) the middle left area is defined as the area between the left area and the middle area in the intrinsic differential mode image, the left boundary of the middle left area is the right boundary of the left area, and the right boundary of the middle area is the left boundary of the middle area; 5) the middle right area is defined as an area between the middle area and the right area in the intrinsic differential mode image, the left boundary of the middle area is the right boundary of the middle area, and the right boundary of the middle area is the left boundary of the right area; 6) the area between the left and right boundaries of each zone is the maximum extent of the respective zone.
6. The method of detecting heterogeneous regions of periodic images according to claim 1, wherein the actual range of distribution of feature points detected from the eigen-differential mode image falling within each differential mode feature region is determined by: 1) dividing the detected feature points into different differential mode feature areas according to the width direction coordinates and the maximum range of the different differential mode feature areas; 2) for any one of the differential mode feature areas, finding out a minimum coordinate and a maximum coordinate along the width direction from the width direction coordinates of the feature points divided to the area, wherein the minimum coordinate is used as a left boundary of an actual range of the area feature distribution, the maximum coordinate is used as a right boundary of the actual range of the area feature distribution, an area between the left boundary and the right boundary is the actual range of the area feature distribution, and the width of the actual range is the actual width.
7. A method of detecting heterogeneous regions of periodic images according to claim 3, wherein the actual extent of blob distribution detected from a local image whose eigenmode difference image falls within the largest extent of the left or right region is determined by: finding out the minimum coordinate and the maximum coordinate along the width direction from the coordinates of the blob detected by the local image in the maximum range of the region, taking the minimum coordinate as a left boundary and the maximum coordinate as a right boundary, wherein the region between the left boundary and the right boundary is the actual range of the blob distribution detected by the local image in the maximum range of the region, and the width of the actual range is the actual width of the blob distribution.
CN201710792538.4A 2017-09-05 2017-09-05 Method for detecting heterogeneous region of periodic image Active CN107688832B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710792538.4A CN107688832B (en) 2017-09-05 2017-09-05 Method for detecting heterogeneous region of periodic image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710792538.4A CN107688832B (en) 2017-09-05 2017-09-05 Method for detecting heterogeneous region of periodic image

Publications (2)

Publication Number Publication Date
CN107688832A CN107688832A (en) 2018-02-13
CN107688832B true CN107688832B (en) 2020-07-24

Family

ID=61155192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710792538.4A Active CN107688832B (en) 2017-09-05 2017-09-05 Method for detecting heterogeneous region of periodic image

Country Status (1)

Country Link
CN (1) CN107688832B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101498660A (en) * 2008-02-02 2009-08-05 中国科学院物理研究所 Method and apparatus for no-mark detection of biochip

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9262834B2 (en) * 2012-07-30 2016-02-16 General Electric Company Systems and methods for performing segmentation and visualization of images

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101498660A (en) * 2008-02-02 2009-08-05 中国科学院物理研究所 Method and apparatus for no-mark detection of biochip

Also Published As

Publication number Publication date
CN107688832A (en) 2018-02-13

Similar Documents

Publication Publication Date Title
CN106204649B (en) A kind of method for tracking target based on TLD algorithm
CN109060836B (en) Machine vision-based high-pressure oil pipe joint external thread detection method
CN105096299B (en) Polygon detecting method and polygon detecting device
EP1524622A1 (en) Method and image processing device for analyzing an object contour image, method and image processing device for detecting an object, industrial vision apparatus, smart camera, image display, security system, and computer program product
CN109559324B (en) Target contour detection method in linear array image
CN101278314A (en) Method and apparatus for determining the shot type of an image
CN115144399B (en) Assembly quality detection method and device based on machine vision
CN115661143B (en) Rapid detection system for MiniLED wafer defects
CN116309565A (en) High-strength conveyor belt deviation detection method based on computer vision
CN110070560A (en) Movement direction of object recognition methods based on target detection
CN102129685A (en) Method for detecting irregular circle based on Gauss pyramid decomposition
CN101093546A (en) Method for recognizing outline shape of digital image
CN115620061A (en) Hardware part defect detection method and system based on image recognition technology
CN110458809B (en) Yarn evenness detection method based on sub-pixel edge detection
CN114511718A (en) Intelligent management method and system for materials for building construction
CN116309577A (en) Intelligent detection method and system for high-strength conveyor belt materials
CN117237747B (en) Hardware defect classification and identification method based on artificial intelligence
CN107688832B (en) Method for detecting heterogeneous region of periodic image
CN111145197B (en) Accurate turnout switch machine notch edge positioning method based on histogram and local gradient
CN110490170A (en) A kind of face candidate frame extracting method
CN111523576B (en) Density peak clustering outlier detection method suitable for electron quality detection
CN111047617B (en) Rectangle recognition optimization method, device and equipment
CN111275693B (en) Counting method and counting device for objects in image and readable storage medium
CN112750119A (en) Detection and measurement method for weak defects on surface of white glass cover plate
CN113192061A (en) LED package appearance detection image extraction method and device, electronic equipment and storage medium

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