CN113592870B - Printing defect detection method based on self-adaptive focal length - Google Patents

Printing defect detection method based on self-adaptive focal length Download PDF

Info

Publication number
CN113592870B
CN113592870B CN202111167099.0A CN202111167099A CN113592870B CN 113592870 B CN113592870 B CN 113592870B CN 202111167099 A CN202111167099 A CN 202111167099A CN 113592870 B CN113592870 B CN 113592870B
Authority
CN
China
Prior art keywords
acquisition range
camera
range
period
current
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
CN202111167099.0A
Other languages
Chinese (zh)
Other versions
CN113592870A (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.)
Wuhan Zhuoyuan Printing Co ltd
Original Assignee
Wuhan Haichuan Color Printing 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 Wuhan Haichuan Color Printing Co ltd filed Critical Wuhan Haichuan Color Printing Co ltd
Priority to CN202111167099.0A priority Critical patent/CN113592870B/en
Publication of CN113592870A publication Critical patent/CN113592870A/en
Application granted granted Critical
Publication of CN113592870B publication Critical patent/CN113592870B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals

Abstract

The invention relates to the field of industrial detection, in particular to a printing defect detection method based on a self-adaptive focal length. The method comprises the steps of obtaining the focal length of a current camera, calculating the current camera acquisition range, obtaining the number of pixel points in the current acquisition range and the number of row pixel points of the current acquisition range, and obtaining the actual length represented by a single pixel in the current acquisition range; obtaining the period of a printed product and the number of row pixel points in one period, and solving the classification number of the current period; calculating the adjustment degree of each group of data, and determining the optimal adjustment degree; labeling each adjusted cycle category; and solving the sampling frequency of the current acquisition range to acquire the printed product, detecting the same position of the same label area of the image acquired each time, and determining an abnormal area. According to the invention, the areas of the same type of the printed images are compared by adjusting the sampling frequency of the camera, so that the reliability of the detection result is improved.

Description

Printing defect detection method based on self-adaptive focal length
Technical Field
The invention relates to the field of industrial detection, in particular to a printing defect detection method based on a self-adaptive focal length.
Background
Because the process of printing production is immature, defects such as missing printing, missing printing and multiple printing exist on the printed products, and the use experience of users is affected by the defects, the defective products need to be detected, and the defective products are prohibited from flowing into the market. Most of the existing printing defect detection methods are manual visual inspection or comparison between an image to be detected and a standard template, but due to numerous interference factors existing in a real environment, the obtained printing image often has differences with the standard image in different degrees, and whether the differences are defects or not cannot be judged, so that great difficulty is brought to detection of the printing defects.
Disclosure of Invention
In order to overcome the shortcomings of the prior art, the invention aims to provide a printing defect detection method based on adaptive focal length.
In order to achieve the purpose, the invention adopts the following technical scheme, namely a printing defect detection method based on self-adaptive focal length.
The method comprises the following steps:
s1: acquiring a current camera focal length, acquiring a current camera acquisition range by using the current camera focal length, acquiring the number of row pixel points in the current acquisition range, and acquiring the actual length represented by a single pixel in the current acquisition range according to the acquired current camera acquisition range and the number of the row pixel points;
acquiring the period of a printed product and the number of row pixel points in one period, determining the period of the printed product and the maximum common factor of the current camera acquisition range, and solving the classification number of the current period according to the acquired maximum common factor and the number of row pixel points in one period;
s2: determining an adjustment range of a camera acquisition range, increasing the same pixel point quantity in the adjustment range each time to adjust the acquisition range of the camera, and solving a period classification number corresponding to the acquisition range after each adjustment and a single pixel length corresponding to the period classification number;
calculating the corresponding adjustment degree after each adjustment, and determining the optimal adjustment degree of the acquisition range adjustment amount according to all the obtained adjustment degrees;
s3: determining the adjusted focal length and the period classification number of the camera according to the optimal adjustment degree, and classifying and labeling the images in each period of the printed product according to the period classification number;
and acquiring a printed product image after the focal length of the camera is adjusted, and carrying out anomaly detection on the same position of the same label in the printed product image.
The current period classification number acquisition method comprises the following steps:
s101, acquiring the distance between a camera lens and a printed product, namely the working distance of the camera, the size of an imaging plane of the camera and the focal length of the current camera, and calculating the range of the current camera according to the following formula:
Figure 194133DEST_PATH_IMAGE002
in the formula:
Figure DEST_PATH_IMAGE003
is the working distance of the camera;
Figure 796016DEST_PATH_IMAGE004
the size of the camera imaging plane;
Figure DEST_PATH_IMAGE005
is the focal length of the current camera;
s102, acquiring the acquisition range of the current camera and the number of row pixel points in the acquisition range, wherein the ratio of the acquisition range of the current camera to the number of the row pixel points in the acquisition range is the actual length represented by a single pixel of the current camera;
s103, acquiring the period of the printed product and the acquisition range of the current camera, and determining the greatest common divisor of the period of the printed product and the acquisition range of the current camera by using a rolling division method;
acquiring the number of row pixel points in one period of a printed product;
the calculation formula of the classification number of the current period is as follows:
Figure DEST_PATH_IMAGE007
in the formula:
Figure 255947DEST_PATH_IMAGE008
for the classification number of the current period,
Figure DEST_PATH_IMAGE009
for the number of row pixels of the printed product in the next cycle of the initial acquisition range,
Figure 626885DEST_PATH_IMAGE010
the greatest common divisor of the printed product period and the current camera's acquisition range.
The method for determining the optimal adjustment degree of the visual field adjustment amount comprises the following steps:
calculating the corresponding adjustment degree in each case in the acquired collection range adjustment range, the period classification number and the single pixel length set, wherein the calculation formula is as follows:
Figure 107545DEST_PATH_IMAGE012
in the formula:
Figure DEST_PATH_IMAGE013
in order to adjust the degree of the acquisition range,
Figure 557243DEST_PATH_IMAGE014
for the initial number of periodic classifications, the number of periodic classifications,
Figure 148762DEST_PATH_IMAGE008
for the classification number of the current period,
Figure DEST_PATH_IMAGE015
for the amount of variation of the number of line pixels of the acquisition range,
Figure 639786DEST_PATH_IMAGE016
is the actual length represented by a single pixel in the initial acquisition range,
Figure DEST_PATH_IMAGE017
the actual length represented by a single pixel in the current acquisition range;
obtaining the maximum value of the adjustment degree of the visual field adjustment amount
Figure 697872DEST_PATH_IMAGE018
The optimal adjustment degree of the visual field adjustment amount is obtained.
The method for determining the adjustment range of the camera acquisition range comprises the following steps:
measuring the period of a printed product
Figure DEST_PATH_IMAGE019
In units of millimeters, inAnd width of the printed image
Figure 274347DEST_PATH_IMAGE020
In millimeters; calculating the corresponding row pixel number of the minimum acquisition range under the actual length represented by the initial single pixel as
Figure DEST_PATH_IMAGE021
The calculation formula is as follows:
Figure DEST_PATH_IMAGE023
in the formula:
Figure 325348DEST_PATH_IMAGE024
in order to print the width of the image,
Figure DEST_PATH_IMAGE025
is the actual length represented by the initial single pixel.
Then when
Figure 608562DEST_PATH_IMAGE026
The range of the abscissa of the adjustment range of the camera acquisition range is
Figure DEST_PATH_IMAGE027
(ii) a When in use
Figure 227762DEST_PATH_IMAGE028
The range of the abscissa of the adjustment range of the camera acquisition range is
Figure DEST_PATH_IMAGE029
And all values of the abscissa
Figure 166899DEST_PATH_IMAGE030
Are all integers, that is,
Figure DEST_PATH_IMAGE031
Figure 896958DEST_PATH_IMAGE032
the number of row pixel points of a printed product in the next period of the initial acquisition range is counted; wherein
Figure DEST_PATH_IMAGE033
An initial camera acquisition range;
calculating the corresponding adjustment degree in each case in the acquired collection range adjustment range, the period classification number and the single pixel length set, wherein the calculation formula is as follows:
Figure DEST_PATH_IMAGE035
in the formula:
Figure 189006DEST_PATH_IMAGE036
in order to adjust the acquisition range with the optimal adjustment degree,
Figure DEST_PATH_IMAGE037
the actual length represented by a single pixel in the acquisition range corresponding to the optimal degree of adjustment,
Figure 244686DEST_PATH_IMAGE038
the number of the line pixels in the acquisition range is adjusted according to the optimal adjustment degree;
Figure 733436DEST_PATH_IMAGE039
is a pair of
Figure DEST_PATH_IMAGE040
Rounding down;
calculating the focal length corresponding to the camera acquisition range adjusted by the optimal adjustment degree, wherein the calculation formula is as follows:
Figure DEST_PATH_IMAGE042
in the formula:
Figure 876973DEST_PATH_IMAGE043
the focal length corresponding to the camera acquisition range is adjusted by the optimal adjustment degree.
The steps of labeling each cycle category within the adjusted acquisition range are as follows:
obtaining the cycle classification number corresponding to the optimal adjustment degree, and classifying each cycle of the printed product;
calculating the length of each cycle category in the acquisition range adjusted by the optimal adjustment degree, wherein the calculation formula is as follows:
Figure 197096DEST_PATH_IMAGE045
the number of cycle categories contained in the acquisition range after the optimal adjustment degree is adjusted is taken as
Figure DEST_PATH_IMAGE046
Expressing the acquisition range as
Figure DEST_PATH_IMAGE047
To be provided with
Figure 282732DEST_PATH_IMAGE048
Cyclically labeling each class in the collection range for a labeling value, wherein
Figure DEST_PATH_IMAGE049
And the period classification number corresponding to the optimal adjustment degree.
The method of determining the abnormal region is as follows:
in a certain collection time, the pixel values of all positions are counted in the areas with the same mark values in the collected printed product images, the pixel value of each position is counted, and the mode is selected as the pixel standard value of the position
Figure DEST_PATH_IMAGE050
Setting an error threshold
Figure 524358DEST_PATH_IMAGE051
If the pixel value of the pixel point is in
Figure DEST_PATH_IMAGE052
If the pixel value of the pixel point is not in the range of (2), the pixel point is considered to be a normal pixel point
Figure 737164DEST_PATH_IMAGE052
If so, the pixel point is considered as an abnormal pixel point;
and connecting the abnormal pixel points to form an area, namely the abnormal area of the printed product.
The method for determining the acquisition time comprises the following steps:
acquiring the moving speed of the printed product, and calculating the time for completely moving out the acquisition range after the adjustment of the optimal adjustment degree, wherein the calculation formula is as follows:
Figure DEST_PATH_IMAGE054
in the formula:
Figure 646215DEST_PATH_IMAGE055
in order to adjust the time for which the acquisition range is completely shifted out with the optimum adjustment degree,
Figure DEST_PATH_IMAGE056
is the moving speed of the printed product;
calculating the corresponding camera sampling frequency after adjustment, wherein
Figure 404217DEST_PATH_IMAGE057
And the obtained sampling frequency of the camera is the acquisition time of the camera.
The invention has the beneficial effects that: the invention uses the method of self-adaptive adjusting the focal length of the camera, reasonably classifies the images collected by the camera, optimizes the collection range of the camera, adjusts the sampling frequency of the camera according to the collection range and the focal length of the camera after the optimization and adjustment, compares the areas of the same category of the printed images, improves the reliability of the detection result and more accurately detects the defect part.
Drawings
FIG. 1 is a schematic flow chart of the algorithm of the present invention;
FIG. 2 is a schematic diagram of a specific process of S1 in the present invention;
FIG. 3(a) is a schematic diagram of the field of view range not including one complete cycle in this embodiment;
FIG. 3(b) is a schematic diagram illustrating that the field of view of the embodiment does not have to be reduced by one complete cycle;
FIG. 4 is a schematic view of a mass printed product of the present invention;
fig. 5 is a schematic diagram of the imaging principle of the camera in the invention.
Detailed Description
The invention is described in detail below with reference to the figures and examples.
In the description of the present invention, it is to be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplicity of description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention.
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature; in the description of the present invention, "a plurality" means two or more unless otherwise specified.
Example 1
The method comprises the following steps:
s1: acquiring the focal length of a current camera, determining the acquisition range and the number of row pixel points of the current camera, calculating the actual length represented by a single pixel in the current acquisition range, acquiring the period of a printed product and the number of row pixel points in one period, determining the maximum common factor of the period of the printed product and the acquisition range of the current camera, and solving the classification number of the current period;
s2: determining an adjustment range of a camera acquisition range, adjusting in the adjustment range, solving the cycle classification number and the single pixel length corresponding to the acquisition range after each adjustment, calculating the corresponding adjustment degree after each adjustment, and determining the optimal adjustment degree;
s3: and determining the focal length and the periodic classification number of the adjusted camera according to the optimal adjustment degree, classifying and labeling the images in each period of the printed product according to the periodic classification number, acquiring the images of the printed product after the focal length of the camera is adjusted, and performing anomaly detection on the same position of the same label in the images of the printed product.
The following will explain the above steps:
in this embodiment, the optimal number of categories is found with the minimum visual field adjustment amount by calculating the adjustment cost performance, so as to reduce the comparison times and the calculation complexity in the subsequent image comparison operation process, and the calculation principle is as follows (
Figure DEST_PATH_IMAGE058
):
Calculating the ratio of the current visual field length to the printing period
Figure DEST_PATH_IMAGE060
The final result of the simplification
Figure 398718DEST_PATH_IMAGE061
Molecule of (5)
Figure DEST_PATH_IMAGE062
Corresponding to the number of complete cycles, denominator
Figure 149637DEST_PATH_IMAGE063
The value of (A) is the number of classes divided by one cycle, i.e. required
Figure DEST_PATH_IMAGE064
Can obtain one category
Figure 178772DEST_PATH_IMAGE062
And the whole printing period is completed, so that the process of solving the period classification number can be converted into the process of solving the minimum common factor of the visual field range and the printing period.
As shown in figure 3(a) of the drawings,
Figure 684840DEST_PATH_IMAGE065
in order to initiate the acquisition range of the camera,
Figure 635479DEST_PATH_IMAGE036
for the adjusted camera acquisition range, i.e. the acquisition range adjusted by the optimum adjustment degree, when
Figure DEST_PATH_IMAGE066
Before adjustment, i.e. when the field of view does not contain a complete printing cycle
Figure 173776DEST_PATH_IMAGE067
That is, 8 categories are needed to completely represent 5 printing cycles, and the same category label appears only after the 5 printing cycles are finished; after adjustment
Figure DEST_PATH_IMAGE068
That is, only 2 classes are needed to represent 1 complete cycle, and the process only adjusts the field of view range of 1/8, and 6 classes are reduced, so that the grouping mode is superior to the grouping mode before adjustment;
as shown in figure 3(b) of the drawings,
Figure 322998DEST_PATH_IMAGE065
in order to initiate the acquisition range of the camera,
Figure 999967DEST_PATH_IMAGE036
for the adjusted camera acquisition range, i.e. the acquisition range adjusted by the optimum adjustment degree, when
Figure 110005DEST_PATH_IMAGE069
In principle, before adjustment, i.e. when there is at least one complete printing cycle within the field of view
Figure DEST_PATH_IMAGE070
After adjustment of
Figure 265043DEST_PATH_IMAGE071
This process only adjusts 1/14 field of view, reducing 4 classes, so this grouping is superior to the grouping before adjustment.
S1: the method comprises the steps of obtaining a current camera focal length, determining a current camera collecting range and the number of line pixel points of the current camera collecting range, calculating the actual length represented by a single pixel in the current collecting range, obtaining the period of a printed product and the number of the line pixel points in one period, determining the maximum common factor of the period of the printed product and the current camera collecting range, and solving the classification number of the current period.
And (3) logical level: the printing of a large batch is usually performed first, and after the printing is finished, the printed product is divided, so that continuous periodic images appear in the printing process, as shown in fig. 4.
1. According to the camera imaging model, the relationship between the acquisition range and the focal length of the camera is obtained by combining the distance between the camera lens and the printed product, namely the working distance, and the size of a camera imaging plane CCD, and the principle is shown in FIG. 5;
the working distance D and the size L of the camera imaging plane CCD are known quantities, the field of view length range is the acquisition range of the camera, and is marked as G, and then the calculation formula of the current acquisition range of the camera is as follows:
Figure 534350DEST_PATH_IMAGE002
in the formula:
Figure DEST_PATH_IMAGE072
is the current acquisition range of the camera and,
Figure 548267DEST_PATH_IMAGE003
is the working distance of the camera and is,
Figure 207918DEST_PATH_IMAGE004
is the size of the imaging plane of the camera,
Figure 432226DEST_PATH_IMAGE005
is the current focal length of the camera.
Initial focal length is noted
Figure 556040DEST_PATH_IMAGE073
Initial acquisition range is noted
Figure 574812DEST_PATH_IMAGE065
Then, then
Figure 659442DEST_PATH_IMAGE065
Can be expressed as:
Figure 421862DEST_PATH_IMAGE075
2. resolution of the camera is
Figure DEST_PATH_IMAGE076
Then the number of pixels on the horizontal axis of the resulting image is
Figure DEST_PATH_IMAGE077
The number of pixels on the vertical axis is
Figure 869024DEST_PATH_IMAGE078
Wherein the transverse axis of the image is parallel to the print advance direction; the actual length represented by a single pixel is
Figure DEST_PATH_IMAGE079
And then:
Figure DEST_PATH_IMAGE081
the actual length of the initial single pixel representation is noted as
Figure 980068DEST_PATH_IMAGE025
Then, then
Figure 676629DEST_PATH_IMAGE025
Can be expressed as:
Figure DEST_PATH_IMAGE083
3. corresponding to number of classes
Figure DEST_PATH_IMAGE085
The calculation process of (2) is as follows:
1) when in use
Figure DEST_PATH_IMAGE087
Is taken as
Figure DEST_PATH_IMAGE089
When the camera has a visual field range of
Figure DEST_PATH_IMAGE091
When the length of each pixel is calculated
Figure DEST_PATH_IMAGE093
Minimum common factor of
Figure DEST_PATH_IMAGE095
Then the corresponding cycle classification number
Figure DEST_PATH_IMAGE097
Figure 9783DEST_PATH_IMAGE007
In the formula:
Figure 842610DEST_PATH_IMAGE009
the number of line pixels in one cycle for a printed product;
Figure 203184DEST_PATH_IMAGE009
the calculation formula of (a) is as follows:
Figure DEST_PATH_IMAGE099
2) calculating the actual length of the single pixel representation at that time
Figure DEST_PATH_IMAGE101
Wherein
Figure DEST_PATH_IMAGE103
The number of line pixels for which the camera resolution is correct;
3) recording
Figure DEST_PATH_IMAGE105
Update
Figure DEST_PATH_IMAGE107
Value of (1), i.e. order
Figure DEST_PATH_IMAGE109
Repeating the above calculation until
Figure DEST_PATH_IMAGE111
The operation is stopped.
S2: determining the adjustment range of the camera acquisition range, adjusting in the adjustment range, solving the period classification number and the single pixel length corresponding to the acquisition range after each adjustment, calculating the corresponding adjustment degree after each adjustment, and determining the optimal adjustment degree.
And (3) logical level: the continuous integral printing cycles can be divided into a plurality of limited areas, each area corresponds to one type, and the number of the areas divided by each cycle is the cycle classification number; the visual field acquisition range is reasonably adjusted, so that the number of categories divided by continuous periods in the acquisition range can be reduced; the optimal adjustment enables the reduction degree of the period classification number to be larger when the adjustment amount of the visual field acquisition range is smaller, the precision after the focal length is adjusted to be higher, three factors are integrated, the maximum adjustment degree of the visual field adjustment amount is recorded as the optimal adjustment degree, and the cost performance of the adjustment is highest at the moment.
The process of this step is as follows:
a) according to
Figure DEST_PATH_IMAGE113
The variation of the classification number during adjustment within the range is obtained by obtaining the variation of the acquisition range, the period classification number and the length of a single pixel
Figure DEST_PATH_IMAGE115
A set of points of (a).
b) According to relative initial state in point set
Figure DEST_PATH_IMAGE117
Adjustment degree cost performance of
Figure DEST_PATH_IMAGE119
Thereby obtaining the optimal adjustment degree of the visual field adjustment amount.
This step is described in the following:
a) according to
Figure 603685DEST_PATH_IMAGE072
In that
Figure 442328DEST_PATH_IMAGE120
The variation of the classification number during adjustment within the range is obtained by obtaining the variation of the acquisition range, the period classification number and the length of a single pixel
Figure DEST_PATH_IMAGE121
A set of points of (a).
Because of the periodicity of the printed products, if there are multiple periods within the collection range, their categories
Figure 254295DEST_PATH_IMAGE122
The change rule of (2) also has periodicity, so that the acquisition range can be directly obtained
Figure DEST_PATH_IMAGE123
Is limited to one printing cycle; namely when
Figure 848088DEST_PATH_IMAGE124
When the temperature of the water is higher than the set temperature,
Figure 191344DEST_PATH_IMAGE123
in a variation range of
Figure DEST_PATH_IMAGE125
(ii) a When in use
Figure 36941DEST_PATH_IMAGE126
When the temperature of the water is higher than the set temperature,
Figure 782043DEST_PATH_IMAGE072
in a variation range of
Figure DEST_PATH_IMAGE127
;
Measuring the period of a printed product
Figure 281157DEST_PATH_IMAGE019
In mm, and the width of the printed image
Figure 377289DEST_PATH_IMAGE020
In millimeters; calculating the corresponding row pixel number of the minimum acquisition range under the actual length represented by the initial single pixel as
Figure 246150DEST_PATH_IMAGE021
The calculation formula is as follows:
Figure DEST_PATH_IMAGE129
in the formula:
Figure 908076DEST_PATH_IMAGE024
in order to print the width of the image,
Figure 781354DEST_PATH_IMAGE025
is the actual length represented by the initial single pixel.
The number of pixels in a row corresponding to the initial acquisition range is
Figure DEST_PATH_IMAGE131A
Then when
Figure 771307DEST_PATH_IMAGE026
The range of the abscissa of the adjustment range of the camera acquisition range is
Figure 817760DEST_PATH_IMAGE027
(ii) a When in use
Figure 803034DEST_PATH_IMAGE028
The range of the abscissa of the adjustment range of the camera acquisition range is
Figure 847213DEST_PATH_IMAGE029
And all values of the abscissa
Figure 839309DEST_PATH_IMAGE030
Are all integers, that is,
Figure 627136DEST_PATH_IMAGE031
b) from within the set of points with respect to the initial state (
Figure DEST_PATH_IMAGE132
) Adjustment degree cost performance of
Figure DEST_PATH_IMAGE133
Thereby obtaining the optimal adjustment degree of the visual field adjustment amount.
And (3) logical level: the visual field adjustment amount is recorded as
Figure DEST_PATH_IMAGE135
The adjustment degree of the visual field adjustment amount is
Figure 404599DEST_PATH_IMAGE133
When the field of view is adjusted
Figure DEST_PATH_IMAGE137A
The smaller the change, the number of class changes
Figure DEST_PATH_IMAGE139A
The more the reduction, the more accurate the actual length represented by one pixel is, and the optimal adjustment degree is, so the adjustment degree can be expressed as:
Figure 836324DEST_PATH_IMAGE012
if it is
Figure DEST_PATH_IMAGE141
Then the value of the optimal adjustment degree is
Figure DEST_PATH_IMAGE143
At this time, the length of the camera acquisition range corresponding to the optimal adjustment proportion is
Figure DEST_PATH_IMAGE145A
Each pixel corresponding to a period classification number of
Figure DEST_PATH_IMAGE147A
The length of the corresponding single pixel is
Figure DEST_PATH_IMAGE149
Then the length of a class
Figure DEST_PATH_IMAGE151
The actual length of the acquisition range adjusted by the optimal adjustment degree
Figure DEST_PATH_IMAGE153
The adjustment should be:
Figure 518978DEST_PATH_IMAGE035
wherein
Figure DEST_PATH_IMAGE155A
Rounding down, adding the number of the original integer periods to the current length of the acquisition range.
S3: and determining the focal length and the periodic classification number of the adjusted camera according to the optimal adjustment degree, classifying and labeling the images in each period of the printed product according to the periodic classification number, acquiring the images of the printed product after the focal length of the camera is adjusted, and performing anomaly detection on the same position of the same label in the images of the printed product.
And (3) logical level: correspondingly adjusting the sampling range and the focal length of the camera according to the optimal adjustment degree, calculating the time when the current acquisition range is completely moved out, determining the sampling frequency of the camera, and labeling the periodic classification area in the acquisition range; and collecting the printed products according to the time interval of the sampling frequency, detecting the collected images, and determining the abnormal area.
The process of determining the camera sampling frequency is as follows:
i. adjusted focal length obtainable from camera imaging model
Figure DEST_PATH_IMAGE157A
The method comprises the following steps:
Figure DEST_PATH_IMAGE159A
obtaining the adjusted corresponding cycle classification number to classify each cycle of the printed products;
adjusted pairLength of each category within the field of view should be looked at
Figure DEST_PATH_IMAGE161A
The number of classes contained in the adjusted acquisition range is
Figure DEST_PATH_IMAGE162
(ii) a I.e. the acquisition range can be expressed as:
Figure DEST_PATH_IMAGE164
wherein
Figure 674278DEST_PATH_IMAGE165
The ranges are numbered cyclically
Figure DEST_PATH_IMAGE166
In the range of
Figure 102986DEST_PATH_IMAGE048
Wherein
Figure 551284DEST_PATH_IMAGE049
The periodic classification number corresponding to the optimal adjustment degree; recording the value of the label of the last area in the current acquisition range, and continuing to carry out cyclic labeling from the value after acquiring the image next time;
iv. according to the moving speed (known amount) of the printing paper, record as
Figure DEST_PATH_IMAGE168
Calculating the time when the current visual field is completely shifted out
Figure DEST_PATH_IMAGE170
Then the sampling frequency is
Figure DEST_PATH_IMAGE172A
The process of determining the abnormal region is as follows:
collecting the printed product according to the calculated sampling frequency (such as half hour interval with small change degree of illumination), and collecting all the class numbers in the image
Figure 517972DEST_PATH_IMAGE166
The same region is used for counting the pixel value of each position, the pixel value of each position can obtain a statistical chart, and the mode is selected as the standard value of the pixel point of the position
Figure DEST_PATH_IMAGE173
Thereby obtaining a reference image of the region, the class number of which is set to a value corresponding to the region class number participating in the statistics;
comparing the printed image with the reference image, and setting an error threshold
Figure 585285DEST_PATH_IMAGE051
If the pixel value of the pixel point is in
Figure 868499DEST_PATH_IMAGE052
If the pixel value of the pixel point is not in the range of (2), the pixel point is considered to be a normal pixel point
Figure 753279DEST_PATH_IMAGE052
If so, the pixel point is considered as an abnormal pixel point; and connecting the abnormal pixel points to form an area, namely the abnormal area of the printed product.
The above embodiments are merely illustrative of the present invention, and should not be construed as limiting the scope of the present invention, and all designs identical or similar to the present invention are within the scope of the present invention.

Claims (6)

1. A printing defect detection method based on self-adaptive focal length is characterized by comprising the following steps:
s1: acquiring a current camera focal length, acquiring a current camera acquisition range by using the current camera focal length, acquiring the number of row pixel points in the current acquisition range, and acquiring the actual length represented by a single pixel in the current acquisition range according to the acquired current camera acquisition range and the number of the row pixel points;
acquiring the period of a printed product and the number of row pixel points in one period, determining the period of the printed product and the maximum common factor of the current camera acquisition range, and solving the classification number of the current period according to the acquired maximum common factor and the number of row pixel points in one period;
s2: determining an adjustment range of a camera acquisition range, increasing the same pixel point quantity in the adjustment range each time to adjust the acquisition range of the camera, and solving a period classification number corresponding to the acquisition range after each adjustment and a single pixel length corresponding to the period classification number;
measuring a period T of the printed product in millimeters and a width W of the printed image in millimeters; and calculating the number e of the pixels of the corresponding row of the minimum acquisition range under the actual length represented by the initial single pixel, wherein the calculation formula is as follows:
Figure FDA0003378486180000011
in the formula: w is the width of the printed image, C0The actual length represented by the initial single pixel;
when G is turned on0When the value is less than T, the range of the abscissa of the adjustment range of the camera acquisition range is [ e, d ]](ii) a When G is0When the value is more than or equal to T, the range of the abscissa of the adjustment range of the camera acquisition range is (0, d)]And the values x of all the abscissa are integers, that is, x is 1,2,3, a. Wherein G is0An initial camera acquisition range;
calculating the corresponding adjustment degree in each case in the acquired collection range adjustment range, the period classification number and the single pixel length set, wherein the calculation formula is as follows:
Figure FDA0003378486180000012
in the formula: ADiFor the degree of adjustment of the acquisition range, N0Is an initial periodic classification number, NiFor the current period classification number, | Δ x | is the row pixel quantity variation of the acquisition range, C0Is the actual length, C, represented by a single pixel in the initial acquisition rangeiThe actual length represented by a single pixel in the current acquisition range;
maximum value max { AD) of adjustment degree of visual field adjustment amount is acquiredi}=ADj,ADjAdjusting the optimal adjustment degree of the visual field adjustment amount;
s3: determining the adjusted focal length and the period classification number of the camera according to the optimal adjustment degree, and classifying and labeling the images in each period of the printed product according to the period classification number;
and acquiring a printed product image after the focal length of the camera is adjusted, and carrying out anomaly detection on the same position of the same label in the printed product image.
2. The method for detecting the printing defects based on the adaptive focal length as claimed in claim 1, wherein the current period classification number is obtained by the following method:
s101, acquiring the distance between a camera lens and a printed product, namely the working distance of the camera, the size of an imaging plane of the camera and the focal length of the current camera, and calculating the acquisition range of the current camera according to the following formula:
Figure FDA0003378486180000021
in the formula: d is the working distance of the camera; l is the size of the imaging plane of the camera; f is the focal length of the current camera;
s102, acquiring the acquisition range of the current camera and the number of row pixel points in the acquisition range, wherein the ratio of the acquisition range of the current camera to the number of the row pixel points in the acquisition range is the actual length represented by a single pixel of the current camera;
s103, acquiring the period of the printed product and the acquisition range of the current camera, and determining the greatest common divisor of the period of the printed product and the acquisition range of the current camera by using a rolling division method;
acquiring the number of row pixel points in one period of a printed product;
the calculation formula of the classification number of the current period is as follows:
Figure FDA0003378486180000022
in the formula: n is a radical ofiThe classification number of the current period is d is the number of row pixel points of the printed product in the next period of the initial acquisition range, MiThe greatest common divisor of the printed product period and the current camera's acquisition range.
3. The printing defect detection method based on the adaptive focal length according to claim 1, wherein the calculation process of adjusting the focal length of the camera with the optimal adjustment degree is as follows:
calculating the camera acquisition range adjusted by the optimal adjustment degree, wherein the calculation formula is as follows:
Figure FDA0003378486180000023
in the formula: g' is the acquisition range adjusted by the optimal adjustment degree, CjActual length, x, of a single pixel representation in the acquisition range corresponding to the optimum degree of adjustmentjThe number of the line pixels in the acquisition range is adjusted according to the optimal adjustment degree;
Figure FDA0003378486180000024
is a pair of
Figure FDA0003378486180000025
Rounding down;
calculating the focal length corresponding to the camera acquisition range adjusted by the optimal adjustment degree, wherein the calculation formula is as follows:
Figure FDA0003378486180000031
in the formula: f' is the focal length corresponding to the camera acquisition range after the optimal adjustment degree is adjusted, D is the working distance of the camera, and L is the size of the camera imaging plane.
4. The method for detecting the printing defects based on the adaptive focal length as claimed in claim 1, wherein the step of labeling each cycle category in the adjusted acquisition range is as follows:
obtaining the cycle classification number corresponding to the optimal adjustment degree, and classifying each cycle of the printed product;
calculating the length of each cycle category in the acquisition range adjusted by the optimal adjustment degree, wherein the calculation formula is as follows:
l=Cjxj
in the formula: l is the length of each cycle class in the acquisition range adjusted by the optimal adjustment degree, CjActual length, x, of a single pixel representation in the acquisition range corresponding to the optimum degree of adjustmentjThe number of the line pixels in the acquisition range is adjusted according to the optimal adjustment degree;
the number of cycle categories contained in the acquisition range after the optimal adjustment degree is adjusted is taken as
Figure FDA0003378486180000032
The acquisition range is expressed as { (0, l), (l,2l), (2l,3l), …, ((k-1) l, kl) }, wherein G ″ is the acquisition range adjusted by the optimum adjustment degree;
with 1 to NjCyclically labeling each class in the collection range for a labeled value, where NjAnd the period classification number corresponding to the optimal adjustment degree.
5. The printing defect detection method based on the adaptive focal length is characterized in that the method for determining the abnormal area is as follows:
in a certain collection time, carrying out statistics on pixel values of all positions in areas with the same mark value in the collected printed product image, carrying out statistics on the pixel value of each position, and selecting the mode as the pixel standard value B of the position;
setting an error threshold value delta, if the pixel value of the pixel point is within the range of B +/-delta, considering the pixel point as a normal pixel point, and if the pixel value of the pixel point is not within the range of B +/-delta, considering the pixel point as an abnormal pixel point;
and connecting the abnormal pixel points to form an area, namely the abnormal area of the printed product.
6. The printing defect detection method based on the adaptive focal length is characterized in that the acquisition time is determined by the following method:
acquiring the moving speed of the printed product, and calculating the time for completely moving out the acquisition range after the adjustment of the optimal adjustment degree, wherein the calculation formula is as follows:
Figure FDA0003378486180000041
in the formula: g' is the acquisition range adjusted by the optimal adjustment degree, t is the time for completely moving out the acquisition range adjusted by the optimal adjustment degree, and v is the moving speed of the printed product;
calculating the corresponding camera sampling frequency after adjustment, wherein fSamplingAnd (4) obtaining the sampling frequency of the camera as 1/t, namely the acquisition time of the camera.
CN202111167099.0A 2021-10-02 2021-10-02 Printing defect detection method based on self-adaptive focal length Active CN113592870B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111167099.0A CN113592870B (en) 2021-10-02 2021-10-02 Printing defect detection method based on self-adaptive focal length

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111167099.0A CN113592870B (en) 2021-10-02 2021-10-02 Printing defect detection method based on self-adaptive focal length

Publications (2)

Publication Number Publication Date
CN113592870A CN113592870A (en) 2021-11-02
CN113592870B true CN113592870B (en) 2021-12-24

Family

ID=78242894

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111167099.0A Active CN113592870B (en) 2021-10-02 2021-10-02 Printing defect detection method based on self-adaptive focal length

Country Status (1)

Country Link
CN (1) CN113592870B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115131354B (en) * 2022-08-31 2022-11-25 江苏森信达生物科技有限公司 Laboratory plastic film defect detection method based on optical means

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008089379A (en) * 2006-09-29 2008-04-17 Hitachi Information & Control Solutions Ltd Printing inspection device
CN103954634A (en) * 2014-05-08 2014-07-30 昆明瑞丰印刷有限公司 Online quality detection system for printed matter
CN107948464A (en) * 2017-09-15 2018-04-20 兰州交通大学 A kind of geometric correction method and system of the laterally offset of printed matter detection image
CN112884768A (en) * 2021-03-30 2021-06-01 中国科学院自动化研究所 Neural network-based 3D printing online quality monitoring method, system and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9132665B2 (en) * 2013-08-22 2015-09-15 Ricoh Company, Ltd. Substrate defect detection mechanism

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008089379A (en) * 2006-09-29 2008-04-17 Hitachi Information & Control Solutions Ltd Printing inspection device
CN103954634A (en) * 2014-05-08 2014-07-30 昆明瑞丰印刷有限公司 Online quality detection system for printed matter
CN107948464A (en) * 2017-09-15 2018-04-20 兰州交通大学 A kind of geometric correction method and system of the laterally offset of printed matter detection image
CN112884768A (en) * 2021-03-30 2021-06-01 中国科学院自动化研究所 Neural network-based 3D printing online quality monitoring method, system and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
《A real-time print-defect detection system for web offset printing》;N.G.Shankar,et al;《Measurement》;20081212;第645-652页 *
《基于嵌入式GPU的数码印花缺陷检测客户端软件设计》;曾贝;《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》;20190115(第12期);第I138-216页 *
《彩色印刷品图像缺陷自动检测系统算法的研究》;钟辉;《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》;20070915(第3期);第I140-434页 *

Also Published As

Publication number Publication date
CN113592870A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
CN115082467B (en) Building material welding surface defect detection method based on computer vision
JP6598790B2 (en) Wafer and lot-based tiering methods that combine customized metrics with global classification methods to monitor process tool status with extreme throughput
CN113592870B (en) Printing defect detection method based on self-adaptive focal length
CN102680481B (en) Detection method for cotton fiber impurities
CN105991997B (en) A kind of method that condenser type imaging sensor bad point positions in real time
CN115187602A (en) Injection molding part defect detection method and system based on image processing
CN116277973A (en) 3D prints detecting system
CN114693659B (en) Copper pipe surface cleaning effect evaluation method and system based on image processing
CN115100208B (en) Film surface defect evaluation method based on histogram and dynamic light source
CN108896550A (en) Facial mask print quality inspection method and system
CN115100206A (en) Printing defect identification method for textile with periodic pattern
CN113077392A (en) High-accuracy automatic reading method for fuzzy photos of pointer table
CN114332091A (en) Printed matter defect detection method based on artificial intelligence
CN117232396B (en) Visual detection system and method for product quality of high-speed production line
CN107563266A (en) Fingerprint image detection device and method thereof
CN116523913B (en) Intelligent detection method for quality of screw rod
CN106096713A (en) A kind of based on space with coarse-fine two grades of paper counting methods of gray feature
CN109297979B (en) Raw silk quality detection device and detection method
CN109461123B (en) A kind of geometric distortion automatic analysis method for picture quality objective evaluating point diagram
CN111626946B (en) Motion blur kernel measuring method for high-speed material transmission visual detection system
CN115194323A (en) Positioning welding method of laser welding machine
CN107437256B (en) Automatic dividing method and system applied to tire X-ray image channel
CN109409402A (en) A kind of image contamination detection method and system based on dark channel prior histogram
CN104866837A (en) Collector of calligraphy and painting micro-texture image and collection method therefor
CN109461155B (en) Raw silk quality detection method

Legal Events

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

Effective date of registration: 20230726

Address after: No. 1-8, Building 1, Zhonghao Industrial Park, Xinanbao Village, Zhashan Street, Caidian District, Wuhan City, 430000 Hubei Province

Patentee after: Wuhan Zhuoyuan Printing Co.,Ltd.

Address before: 430000 Dongfeng Village, Qiaokou District, Wuhan City, Hubei Province (b-1-2, Changfeng 1st Road)

Patentee before: Wuhan Haichuan Color Printing Co.,Ltd.