CN115063605A - Method for identifying color printing package by using electronic equipment - Google Patents
Method for identifying color printing package by using electronic equipment Download PDFInfo
- Publication number
- CN115063605A CN115063605A CN202210980250.0A CN202210980250A CN115063605A CN 115063605 A CN115063605 A CN 115063605A CN 202210980250 A CN202210980250 A CN 202210980250A CN 115063605 A CN115063605 A CN 115063605A
- Authority
- CN
- China
- Prior art keywords
- information
- gray
- gradient
- image
- feature
- 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.)
- Granted
Links
- 238000007639 printing Methods 0.000 title claims abstract description 59
- 238000000034 method Methods 0.000 title claims abstract description 28
- 230000014759 maintenance of location Effects 0.000 claims abstract description 78
- 238000006243 chemical reaction Methods 0.000 claims abstract description 36
- 238000004806 packaging method and process Methods 0.000 claims abstract description 30
- 238000005070 sampling Methods 0.000 claims abstract description 6
- 239000011159 matrix material Substances 0.000 claims description 3
- 238000001514 detection method Methods 0.000 abstract description 22
- 238000004519 manufacturing process Methods 0.000 abstract description 13
- 238000012545 processing Methods 0.000 abstract description 9
- 238000013473 artificial intelligence Methods 0.000 abstract description 8
- 238000005457 optimization Methods 0.000 abstract description 3
- 238000003384 imaging method Methods 0.000 description 7
- 238000004458 analytical method Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006698 induction Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000008034 disappearance Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012856 packing Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/46—Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
- G06V10/462—Salient features, e.g. scale invariant feature transforms [SIFT]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/56—Extraction of image or video features relating to colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/75—Organisation 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/751—Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to the technical field of artificial intelligence, in particular to a method for identifying color printing packages by utilizing electronic equipment. The method obtains the retention degree of the edge information of the current gray level image through the difference of the gradient information in the HIS image and the gray level image. And analyzing the first feature descriptors of the key points in the gray-scale image to obtain the feature information retention degree of each first feature descriptor. And obtaining recommendation degree according to the marginal information retention degree and the characteristic information retention degree. And further selecting an optimal standard gray scale conversion formula for processing the color printing packaging image to be detected and the template color printing packaging image, and realizing efficient matching identification. The embodiment of the invention optimizes the detection algorithm of the sampling package by the artificial intelligence optimization operation system under the artificial intelligence system in the production field, increases the identification detection efficiency and the identification detection precision of the color printing package product, and realizes the identification detection of the mass products under the color printing template by using a standard gray scale conversion formula and computer vision software.
Description
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a method for identifying color printing packages by utilizing electronic equipment.
Background
With the development of the technology in the production field, people have higher requirements on the quality of the produced products. The packaging of the product is an important component of the product, and the quality of the product is also important for detection in the production field. The color printing package directly influences the impression and purchasing power of a consumer on the product, and after the color printing template is determined, the color printing package product is ensured to be matched with the color printing template in the production process of the package.
In the color printing packaging quality detection, the manual detection has low precision and low efficiency, and is not suitable for the development of the automatic production field. Therefore, in the field of automatic production, it is necessary to extract the features of the color printing package image by computer vision technology and match the features with the color printing template. A commonly used matching algorithm is a feature detection algorithm (SIFT algorithm) for interest points, and the SIFT algorithm performs matching according to feature information of key points by searching the key points in different scale spaces. The color-rich SIFT algorithm in the color printing package has large calculation amount, so that the color printing package image can be converted into a gray image, the calculation load of the SIFT algorithm is simplified, but the gray image can cause the loss of edge information of a color image and influence the subsequent matching result.
Disclosure of Invention
In order to solve the above technical problems, an object of the present invention is to provide a method for identifying a color-printed package by using an electronic device, which adopts the following technical solutions:
the invention provides a method for identifying color printing packages by using electronic equipment, which comprises the following steps:
obtaining a color printing package image; converting the sampling package image into an HIS color space to obtain an HIS image; obtaining a gray level image of the color printing packaging image according to a preset gray level conversion formula; obtaining gray gradient information in the gray image; acquiring HIS gradient information according to the difference of color difference, the difference of saturation and the difference of brightness among the pixel points in the HIS image; obtaining the retention degree of the edge information of the gray level image according to the difference between the HIS gradient information and the gray level gradient information;
extracting a plurality of first feature descriptors in the gray image according to an SIFT algorithm; obtaining a plurality of second feature descriptors according to the projection of each first feature descriptor in a plurality of principal component directions; obtaining the feature information retention degree of the corresponding first feature descriptor according to the plurality of second feature descriptors;
obtaining the recommendation degree of the gray level image according to the retention degree of the edge information and the retention degree of the feature information; changing parameters in the gray scale conversion formula to obtain a plurality of recommendation degrees, and taking the gray scale conversion formula corresponding to the maximum recommendation degree as a standard gray scale conversion formula;
acquiring a color printing package image to be detected; obtaining a to-be-detected gray level image of the to-be-detected color printing packaging image according to the standard gray level conversion formula; obtaining a template gray level image of the template color printing packaging image according to the standard gray level conversion formula; and acquiring and matching the characteristic points of the gray image to be detected and the template gray image according to an SIFT algorithm, and identifying the color printing packaging image to be detected according to a matching result.
Further, the obtaining gray gradient information in the gray image comprises:
calculating the transverse gray gradient and the longitudinal gray gradient of each pixel point in the gray image according to a Soble operator, and specifically comprising the following steps:
wherein,is a pixel pointIs determined by the lateral gray scale gradient of (a),is a pixel pointThe longitudinal gray scale gradient is set to be,、、、、、、andis a pixel pointEight neighborhood pixel values of;
and obtaining a gray gradient amplitude and a gray gradient direction according to the transverse gray gradient and the longitudinal gray gradient of each pixel point, and taking the gray gradient amplitude and the gray gradient direction as gray gradient information.
Further, the obtaining of the HIS gradient information according to the difference in color difference, the difference in saturation, and the difference in brightness between the pixels in the HIS image includes:
replacing the difference of pixel values in the transverse gray gradient and the longitudinal gray gradient with HIS difference to obtain transverse HIS difference and longitudinal HIS difference; the HIS differences include:
wherein,is as followsPixel point and the secondThe HIS differences of the individual pixels are,is as followsThe hue information of each pixel point is calculated,is as followsThe hue information of each pixel point is obtained,is as followsThe information of the saturation of each pixel point,is as followsThe saturation information for each pixel point is determined,is as followsThe brightness information of each pixel point is obtained,is as followsThe brightness information of each pixel point;
and obtaining an HIS gradient amplitude and an HIS gradient direction according to the transverse HIS gradient and the longitudinal HIS gradient of each pixel point, and taking the HIS gradient amplitude and the HIS gradient direction as HIS gradient information.
Further, the obtaining of the retention degree of the edge information of the gray scale image according to the difference between the HIS gradient information and the gray scale gradient information includes:
obtaining the edge information retention degree according to an edge information retention degree formula, wherein the edge information retention degree formula comprises:
wherein,for the degree of retention of the edge information,the size of the color-printed package image,is a coordinate ofThe HIS gradient magnitude of the pixel point of (a),is a coordinate ofThe gray scale gradient magnitude of the pixel point of (a),is as a coordinate ofThe direction of the HIS gradient of the pixel points of (a),is a coordinate ofThe gray scale gradient direction of the pixel point of (1).
Further, the obtaining a plurality of second feature descriptors according to the projection of each first feature descriptor in a plurality of principal component directions includes:
acquiring a plurality of eigenvalues of the covariance matrix of the first characteristic descriptor, and arranging the eigenvalues from large to small to obtain an eigenvalue sequence; according to a preset selection quantity, a plurality of front characteristic values in the characteristic value sequence are used as reference characteristic values;
and acquiring a reference feature vector corresponding to a reference feature value, and multiplying the first feature descriptor and the reference feature vector to obtain a plurality of second feature descriptors.
Further, the obtaining the feature information retention of the corresponding first feature descriptor according to the plurality of second feature descriptors includes
Obtaining the feature information retention degree according to a feature information retention degree formula, wherein the feature information retention degree formula comprises:
wherein,for the degree of retention of the characteristic information,is a natural constant and is a natural constant,for the purpose of said selection of the number,is as followsA second set of said second feature descriptors,is as followsThe feature values corresponding to the second feature descriptors, U is the number of the feature values,is as followsAnd (c) the characteristic value.
Further, the obtaining of the recommendation degree of the grayscale image according to the edge information retention degree and the feature information retention degree includes:
obtaining the recommendation degree according to a recommendation degree formula, wherein the recommendation degree formula comprises:
wherein,in order to be the degree of recommendation,for the degree of retention of the edge information,is as followsA first characteristicThe degree of retention of said characteristic information of the descriptor,is the number of the first feature descriptors.
The invention has the following beneficial effects:
according to the embodiment of the invention, HIS gradient information and gray scale gradient information of the color printing packaging image are obtained at the same time, and the edge information retention degree of the gray scale image under the current gray scale conversion formula is obtained according to the difference of the two gradient information. And further extracting a first feature descriptor of the gray image by utilizing a SIFT algorithm, and obtaining the feature information retention of the first feature descriptor of the gray image under the current gray conversion formula through the projection information of the first feature descriptor in a plurality of principal component directions. And obtaining the recommendation degree of the gray level image under the current gray level conversion formula according to the edge information retention degree and the characteristic information retention degree. And selecting the parameters of the gray level conversion formula according to the recommendation degree, and finally obtaining a gray level image with clear edge information and clear feature information, so that the gray level image is convenient to match with the template gray level image. The embodiment of the invention optimizes the detection algorithm of the sampling package by the artificial intelligence optimization operation system under the artificial intelligence system in the production field, increases the identification detection efficiency and the identification detection precision of the color printing package product, and realizes the identification detection of the mass products under the color printing template by using a standard gray scale conversion formula and computer vision software.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a method for identifying a color-printed package by an electronic device according to an embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of the method for identifying color-printed packages by electronic devices according to the present invention with reference to the accompanying drawings and preferred embodiments shows the following detailed descriptions of the specific implementation, structure, features and effects thereof. In the following description, the different references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following describes a specific scheme of the method for identifying color-printed packages by using electronic equipment in detail with reference to the accompanying drawings.
Referring to fig. 1, a flow chart of a method for identifying a color-printed package by an electronic device according to an embodiment of the present invention is shown, the method including:
step S1: obtaining a color printing package image; converting the sampling package image into an HIS color space to obtain an HIS image; obtaining a gray level image of the color printing package image according to a preset gray level conversion formula; obtaining gray gradient information in a gray image; acquiring HIS gradient information according to color difference, saturation difference and brightness difference among pixel points in the HIS image; and obtaining the retention degree of the edge information of the gray level image according to the difference between the HIS gradient information and the gray level gradient information.
In the embodiment of the invention, the product conveyor belt is arranged in the production scene of the color printing package, the produced color printing package product is placed on the conveyor belt, and the electronic equipment is arranged above the conveyor belt and comprises the detection device and the rack for fixing the detection device. The detection device comprises: an imaging device, such as an industrial camera, for imaging and imaging data output of the color-printed packaged product in the region of the conveyor belt; a light source device for performing brightness compensation on the imaging device; the sensing device is used for sensing the detected color printing package and outputting a sensing signal; and the central processing unit is used for receiving the induction signals, realizing corresponding data processing and is electrically connected with the imaging equipment and the induction device.
When the sensing device senses that the color-printed packaging products on the conveyor belt are conveyed to the lower part of the electronic equipment, the sensing signal is transmitted to the central processing unit, the central processing unit controls the light source equipment and the imaging equipment to acquire image data of the color-printed packaging products, and the imaging equipment transmits the image data to the central processing unit for corresponding data processing.
It should be noted that, in the production field, the color-printed packaging products are usually produced in large quantities, that is, the color-printed packaging products for quality inspection are all in a color-printed style, corresponding to a color-printed template.
And acquiring a color printing package image. The color printed package image is converted into the HIS color space. It should be noted that the color printing package image collected by the electronic device is usually an RGB image, and the conversion of the RGB image into the HIS color space is well known in the art and will not be described herein.
Obtaining a gray level image of the color printing packaging image according to a preset gray level conversion formula, wherein the gray level conversion formula comprises the following steps:
wherein,is a gray value in a gray-scale image,for the channel value of the red channel in the color printed package image,for the channel value of the green channel in the color printed package image,for packing blue channels in images for colour printingThe value of the channel is used to determine,、andfor the weight parameter of the corresponding channel, in the conventional gradation conversion,,,。
when a color printed packaging image is converted into a gray image, information in the gray image is incomplete and edge information is lost due to disappearance of hue information. The HIS image comprises information of hue, saturation and brightness, and the retention degree of the edge information of the current gray level image can be obtained by comparing the information in the HIS image with the information of the current gray level image.
In order to obtain the edge information retention degree, it is first necessary to acquire edge gradient information of the HIS image and the grayscale image. Preferably, calculating the horizontal gray gradient and the vertical gray gradient of each pixel point in the gray image by using a Soble operator, and specifically comprises:
wherein,is a pixel pointThe lateral gray scale gradient of (a) is,is a pixel pointThe longitudinal gradient of the gray scale is provided,、、、、、、andis a pixel pointEight neighborhood pixel values.
In the gray scale gradient information calculation process, the difference of pixel values of other pixel points in the neighborhood of a target pixel point is reflected in the transverse gray scale gradient and the longitudinal gray scale gradient, and when HIS gradient information is analyzed, the hue difference, the saturation difference and the brightness difference need to be considered at the same time, and the method specifically comprises the following steps:
replacing the pixel value difference in the transverse gray gradient and the longitudinal gray gradient with an HIS difference to obtain the transverse HIS difference and the longitudinal HIS difference, wherein the HIS difference comprises:
wherein,is as followsPixel point and the secondThe HIS difference of the individual pixel points,is as followsThe hue information of each pixel point is obtained,is as followsThe hue information of each pixel point is obtained,is as followsThe information of the saturation of each pixel point,is as followsA pixelThe information of the degree of saturation of a point,is a firstThe luminance information of each pixel point is calculated,the luminance information of the first pixel point.
The HIS difference is adjusted by a plurality of constants in consideration of the difference in the range of hue, saturation, and brightness. Since hue information and saturation information need to be analyzed together in the HIS space, it is necessary to perform a joint analysisCan be expressed in terms of a difference in chromaticity,expressed as brightness variability. To be provided withAnd as the weight of the brightness difference, when the chromaticity difference is large, the data of the brightness difference is reduced, and the joint analysis of the three data is realized.
And obtaining a gray gradient amplitude and a gray gradient direction according to the transverse gray gradient and the longitudinal gray gradient of each pixel point, and taking the gray gradient amplitude and the gray gradient direction as gray gradient information. And obtaining an HIS gradient amplitude and an HIS gradient direction according to the transverse HIS gradient and the longitudinal HIS gradient of each pixel point, and taking the HIS gradient amplitude and the HIS gradient direction as HIS gradient information. The gray scale gradient information is the same as the acquisition method of the HIS gradient information, and only the gray scale gradient information is taken as an example:
wherein,in order to be the gray scale gradient magnitude,in order to be a lateral gray scale gradient,in order to be a longitudinal gray scale gradient,is the gray gradient direction.
The obtaining of the retention degree of the edge information of the gray level image according to the difference between the HIS gradient information and the gray level gradient information specifically includes:
obtaining the retention degree of the edge information according to an edge information retention degree formula, wherein the edge information retention degree formula comprises the following steps:
wherein,for the degree of retention of the edge information,in order to color print the size of the package image,is a coordinate ofThe HIS gradient magnitude of the pixel point of (a),is a coordinate ofThe gray scale gradient amplitude of the pixel point of (1),is a coordinate ofThe direction of the HIS gradient of the pixel point of (a),is a coordinate ofThe gray gradient direction of the pixel point.
Because a great amount of edge information caused by color difference exists in the HIS image, the smaller the difference between the gray scale gradient information and the HIS gradient information is, the more the edge information in the current gray scale image is, i.e. the greater the retention degree of the edge information is.
Step S2: extracting a plurality of first feature descriptors in the gray level image according to an SIFT algorithm; obtaining a plurality of second feature descriptors according to projection of each first feature descriptor in a plurality of principal component directions; and obtaining the feature information retention degree of the corresponding first feature descriptor according to the plurality of second feature descriptors.
In the feature matching process, the judgment is carried out according to the Euclidean distance of the features of the key points of the two images, so that the stronger the feature information in one key point is, the larger the difference between the key point and other unmatched key points in the subsequent matching process is, the faster the matching speed is, and the more accurate the result is.
And extracting a plurality of first feature descriptors in the gray-scale image according to a SIFT algorithm. It should be noted that the SIFT algorithm is well known in the prior art, and the process thereof is only briefly described herein, and is not described in detail, and specifically includes:
(1) and generating a Gaussian difference pyramid and finishing the construction of the scale space.
(2) And the preliminary detection of key points in the gray image is realized through the detection of the spatial extreme points.
(3) And removing noise points in the primary probing process, and realizing accurate positioning of stable key points.
(4) And calculating 4-4 block gradient direction histograms around the key point, counting gradient amplitudes of 8 directions in each histogram, and acquiring a 128-dimensional feature descriptor of the key point as a first feature descriptor. That is, a key point corresponds to a first feature descriptor, and a first feature descriptor has 128-dimensional data.
Obtaining a plurality of second feature descriptors according to the projection of each first feature descriptor in a plurality of principal component directions, specifically comprising:
and acquiring a plurality of eigenvalues of the covariance matrix of the first characteristic descriptor, and arranging the eigenvalues from large to small to obtain an eigenvalue sequence. And a plurality of characteristic values in front of the characteristic value sequence are used as reference characteristic values according to a preset selection quantity.
And acquiring a reference feature vector corresponding to the reference feature value, and multiplying the first feature descriptor by the reference feature vector to obtain a plurality of second feature descriptors. Each reference feature vector corresponds to a principal component direction, and the larger the second feature descriptor is, the larger the divergence of the first feature descriptor in the corresponding principal component direction is, which means more information is retained.
Obtaining the feature information retention degree corresponding to the first feature descriptor according to the size of the second feature descriptor, specifically including:
obtaining the retention degree of the feature information according to a feature information retention degree formula, wherein the feature information retention degree formula comprises:
wherein,in order to preserve the degree of the characteristic information,is a natural constant and is a natural constant,in order to select the number of the components,is as followsA second set of characteristics describing the characteristics of the device,is as followsThe feature value corresponding to each second feature descriptor,in order to be able to determine the number of characteristic values,is a firstAnd (4) the characteristic value. In the embodiment of the present invention, the number of choices is set to 30, i.e., the number of choices is set to 30Since the first feature descriptor is 128-dimensional data, it is therefore。
In the feature information retention formula, the feature value ratio corresponding to each second feature descriptor is used as a weight, and the features of the second feature descriptors are amplified, namely the greater the feature value is, the greater the second feature descriptor is, the greater the feature information retention is.
And analyzing the retention degree of the feature information of the first feature descriptor of each key point in the gray level image, accumulating the retention degrees of the feature information, and obtaining the overall retention degree of the feature information of the current gray level image in the feature point analysis.
Step S3: obtaining the recommendation degree of the gray level image according to the retention degree of the edge information and the retention degree of the feature information; and changing parameters in the gray scale conversion formula to obtain a plurality of recommendation degrees, and taking the gray scale conversion formula corresponding to the maximum recommendation degree as a standard gray scale conversion formula.
Jointly analyzing the retention degree of the edge information and the retention degree of the feature information to obtain the recommendation degree of the current gray level image, specifically comprising the following steps:
obtaining the recommendation degree according to a recommendation degree formula, wherein the recommendation degree formula comprises:
wherein, T is the recommendation degree,for the degree of retention of the edge information,is as followsThe degree of retention of feature information of the first feature descriptor,is the number of first feature descriptors.
In the recommendation degree formula, toAs the weight of the retention degree of the global feature information, when the retention degree of the edge information is less than 0.5, the weight is less than 1, and the retention degree of the global feature information is affected, so that the retention degree of the edge information is more focused in the recommendation degree analysis.
By changing the parameters in the gray level conversion formula, the recommendation degree corresponding to each parameter combination can be obtained. Because the color printing packaging products in the whole production batch are the same product, namely correspond to the same color printing template, the detection of the products corresponding to the color printing template can be realized only by obtaining a group of optimal parameter combinations. Therefore, a large number of parameter combinations can be selected, and the combination corresponding to the maximum recommendation degree is selected from the parameter combinations to obtain the standard gray level conversion formula. It should be noted that the number of parameter combinations may be specifically set according to a specific production environment, and is not limited herein.
Step S4: acquiring a color printing package image to be detected; obtaining a gray level image to be detected of the color printing packaging image to be detected according to a standard gray level conversion formula; obtaining a template gray level image of the template color printing packaging image according to a standard gray level conversion formula; and acquiring and matching the characteristic points of the gray image to be detected and the template gray image according to an SIFT algorithm, and identifying the color printing packaging image to be detected according to a matching result.
So far, the standard gray scale conversion formula corresponding to the color printing product can be obtained by only collecting one color printing package image. For the color printing packaging product to be detected, the gray level image to be detected of the color printing packaging image to be detected can be obtained by directly utilizing a standard gray level conversion formula. And obtaining a template gray level image of the template color printing packaging image by using a standard gray level conversion formula. And acquiring the characteristic points of the gray image to be detected and the template gray image according to an SIFT algorithm and performing template matching. If the matching result is successful, the current color printing packaging product to be detected is successfully identified, and the product is qualified; if the matching fails or the matching results are different, the defect of the current color printing packaging product to be detected is indicated, and the product is unqualified and needs further judgment or discarding by a worker.
It should be noted that the specific qualified matching result definition standard may be set according to the required precision of the production environment, and is not limited herein.
In summary, in the embodiments of the present invention, the edge information retention of the current grayscale image is obtained through the difference between the gradient information in the HIS image and the gradient information in the grayscale image. And analyzing the first feature descriptors of the key points in the gray-scale image to obtain the feature information retention degree of each first feature descriptor. And obtaining recommendation degree according to the retention degree of the edge information and the retention degree of the feature information. And further selecting an optimal standard gray scale conversion formula for processing the color printing packaging image to be detected and the template color printing packaging image, and realizing efficient matching identification. The embodiment of the invention optimizes the detection algorithm of the sampling package by the artificial intelligence optimization operation system under the artificial intelligence system in the production field, increases the identification detection efficiency and the identification detection precision of the color printing package product, and realizes the identification detection of the mass products under the color printing template by using a standard gray scale conversion formula and computer vision software.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. The processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (7)
1. A method of identifying a color printed package using an electronic device, the method comprising:
obtaining a color printing package image; converting the sampling package image into an HIS color space to obtain an HIS image; obtaining a gray level image of the color printing packaging image according to a preset gray level conversion formula; obtaining gray gradient information in the gray image; acquiring HIS gradient information according to the difference of color difference, the difference of saturation and the difference of brightness among the pixel points in the HIS image; obtaining the retention degree of the edge information of the gray level image according to the difference between the HIS gradient information and the gray level gradient information;
extracting a plurality of first feature descriptors in the gray image according to an SIFT algorithm; obtaining a plurality of second feature descriptors according to the projection of each first feature descriptor in a plurality of principal component directions; obtaining the feature information retention degree of the corresponding first feature descriptor according to the plurality of second feature descriptors;
obtaining the recommendation degree of the gray level image according to the retention degree of the edge information and the retention degree of the feature information; changing parameters in the gray scale conversion formula to obtain a plurality of recommendation degrees, and taking the gray scale conversion formula corresponding to the maximum recommendation degree as a standard gray scale conversion formula;
acquiring a color printing package image to be detected; obtaining a to-be-detected gray level image of the to-be-detected color printing packaging image according to the standard gray level conversion formula; obtaining a template gray level image of the template color printing packaging image according to the standard gray level conversion formula; and acquiring and matching the characteristic points of the gray image to be detected and the template gray image according to an SIFT algorithm, and identifying the color printing packaging image to be detected according to a matching result.
2. The method of claim 1, wherein obtaining gray scale gradient information in the gray scale image comprises:
calculating the transverse gray gradient and the longitudinal gray gradient of each pixel point in the gray image according to a Soble operator, and specifically comprising the following steps:
wherein,is a pixel pointIs determined by the lateral gray scale gradient of (a),is a pixel pointThe longitudinal gray scale gradient is set to be,、、、、、、andis a pixel pointEight neighborhood pixel values of;
and obtaining a gray gradient amplitude and a gray gradient direction according to the transverse gray gradient and the longitudinal gray gradient of each pixel point, and taking the gray gradient amplitude and the gray gradient direction as gray gradient information.
3. The method of claim 2, wherein the obtaining of the HIS gradient information according to the difference in color, the difference in saturation, and the difference in brightness between the pixels in the HIS image comprises:
replacing the difference of pixel values in the transverse gray gradient and the longitudinal gray gradient with HIS difference to obtain transverse HIS difference and longitudinal HIS difference; the HIS differences include:
wherein,is as followsPixel point and the secondThe HIS differences of the individual pixels are,is as followsThe hue information of each pixel point is obtained,is as followsThe hue information of each pixel point is obtained,is as followsThe information of the saturation of each pixel point,is as followsThe saturation information for each pixel point is determined,is as followsThe brightness information of each pixel point is obtained,is as followsThe brightness information of each pixel point;
and obtaining an HIS gradient amplitude and an HIS gradient direction according to the transverse HIS gradient and the longitudinal HIS gradient of each pixel point, and taking the HIS gradient amplitude and the HIS gradient direction as HIS gradient information.
4. The method for identifying color-printed packages by using electronic equipment according to claim 3, wherein the obtaining the retention degree of the edge information of the gray-scale image according to the difference between the HIS gradient information and the gray-scale gradient information comprises:
obtaining the edge information retention degree according to an edge information retention degree formula, wherein the edge information retention degree formula comprises:
wherein,for the degree of retention of the edge information,for the size of the color-printed package image,is a coordinate ofThe HIS gradient magnitude of the pixel point of (a),is a coordinate ofThe gray scale gradient magnitude of the pixel point of (a),is a coordinate ofThe direction of the HIS gradient of the pixel points of (a),is a coordinate ofThe gray scale gradient direction of the pixel point of (1).
5. The method of claim 1, wherein obtaining a plurality of second feature descriptors from projections of each of the first feature descriptors in a plurality of principal component directions comprises:
acquiring a plurality of eigenvalues of the covariance matrix of the first characteristic descriptor, and arranging the eigenvalues from large to small to obtain an eigenvalue sequence; according to a preset selection quantity, a plurality of front characteristic values in the characteristic value sequence are used as reference characteristic values;
and acquiring a reference feature vector corresponding to a reference feature value, and multiplying the first feature descriptor and the reference feature vector to obtain a plurality of second feature descriptors.
6. The method of claim 5, wherein said obtaining the retention of the feature information of the corresponding first feature descriptor according to the plurality of second feature descriptors comprises obtaining the retention of the feature information of the corresponding first feature descriptor
Obtaining the feature information retention degree according to a feature information retention degree formula, wherein the feature information retention degree formula comprises:
wherein,for the degree of retention of said characteristic information,is a natural constant and is a natural constant,for the purpose of said selected number of bits,is as followsA second set of said second feature descriptors,is as followsThe feature values corresponding to the second feature descriptors,is the number of the characteristic values that are,is as followsAnd (c) the characteristic value.
7. The method of claim 1, wherein obtaining the recommendation of the grayscale image according to the retention of the edge information and the retention of the feature information comprises:
obtaining the recommendation degree according to a recommendation degree formula, wherein the recommendation degree formula comprises:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210980250.0A CN115063605B (en) | 2022-08-16 | 2022-08-16 | Method for identifying color printing package by using electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210980250.0A CN115063605B (en) | 2022-08-16 | 2022-08-16 | Method for identifying color printing package by using electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115063605A true CN115063605A (en) | 2022-09-16 |
CN115063605B CN115063605B (en) | 2022-12-13 |
Family
ID=83207635
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210980250.0A Active CN115063605B (en) | 2022-08-16 | 2022-08-16 | Method for identifying color printing package by using electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115063605B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108596197A (en) * | 2018-05-15 | 2018-09-28 | 汉王科技股份有限公司 | A kind of seal matching process and device |
US20200192389A1 (en) * | 2018-12-14 | 2020-06-18 | The Boeing Company | Building an artificial-intelligence system for an autonomous vehicle |
CN114494265A (en) * | 2022-04-19 | 2022-05-13 | 南通宝田包装科技有限公司 | Method for identifying packaging printing quality in cosmetic production field and artificial intelligence system |
CN114648594A (en) * | 2022-05-19 | 2022-06-21 | 南通恒强家纺有限公司 | Textile color detection method and system based on image recognition |
-
2022
- 2022-08-16 CN CN202210980250.0A patent/CN115063605B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108596197A (en) * | 2018-05-15 | 2018-09-28 | 汉王科技股份有限公司 | A kind of seal matching process and device |
US20200192389A1 (en) * | 2018-12-14 | 2020-06-18 | The Boeing Company | Building an artificial-intelligence system for an autonomous vehicle |
CN114494265A (en) * | 2022-04-19 | 2022-05-13 | 南通宝田包装科技有限公司 | Method for identifying packaging printing quality in cosmetic production field and artificial intelligence system |
CN114648594A (en) * | 2022-05-19 | 2022-06-21 | 南通恒强家纺有限公司 | Textile color detection method and system based on image recognition |
Also Published As
Publication number | Publication date |
---|---|
CN115063605B (en) | 2022-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9721532B2 (en) | Color chart detection apparatus, color chart detection method, and color chart detection computer program | |
CN103424409B (en) | Vision detecting system based on DSP | |
CN112534243B (en) | Inspection apparatus and method, and computer-readable non-transitory recording medium | |
CN103914708B (en) | Food kind detection method based on machine vision and system | |
CN114648594B (en) | Textile color detection method and system based on image recognition | |
US8879849B2 (en) | System and method for digital image signal compression using intrinsic images | |
EP2638508B1 (en) | System and method for identifying complex tokens in an image | |
CN108279238A (en) | A kind of fruit maturity judgment method and device | |
CN112446864A (en) | Flaw detection method, flaw detection device, flaw detection equipment and storage medium | |
Banić et al. | Using the red chromaticity for illumination estimation | |
CN109284759A (en) | One kind being based on the magic square color identification method of support vector machines (svm) | |
CN114926661B (en) | Textile surface color data processing and identifying method and system | |
CN106951863A (en) | A kind of substation equipment infrared image change detecting method based on random forest | |
CN115984210A (en) | Vehicle real-time detection method and system for remote sensing multispectral image of unmanned aerial vehicle | |
CN112819017B (en) | High-precision color cast image identification method based on histogram | |
CN115063605B (en) | Method for identifying color printing package by using electronic equipment | |
CN113132693B (en) | Color correction method | |
US8437545B1 (en) | System and method for digital image signal compression using intrinsic images | |
CN210377552U (en) | Fruit is multiaspect image acquisition device for classification | |
CN113340816B (en) | Light source spectrum and multispectral reflectivity image acquisition method and device and electronic equipment | |
CN114486895A (en) | Method for detecting sample substance concentration based on pushing of urine drying test strip to identification | |
KR20030091471A (en) | YCrCb color based human face location detection method | |
CN111179256A (en) | Method and device for determining authenticity of ceramic tile | |
CN111325209A (en) | License plate recognition method and system | |
CN112926689B (en) | Target positioning 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 |