CN115578732A - Label identification method for fertilizer production line - Google Patents

Label identification method for fertilizer production line Download PDF

Info

Publication number
CN115578732A
CN115578732A CN202211452790.8A CN202211452790A CN115578732A CN 115578732 A CN115578732 A CN 115578732A CN 202211452790 A CN202211452790 A CN 202211452790A CN 115578732 A CN115578732 A CN 115578732A
Authority
CN
China
Prior art keywords
connected domain
edge
pixel
acquiring
pixel point
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
Application number
CN202211452790.8A
Other languages
Chinese (zh)
Other versions
CN115578732B (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.)
Shandong Aifudi Biology Holding Co ltd
Original Assignee
Shandong Aifudi Biology Holding 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 Shandong Aifudi Biology Holding Co ltd filed Critical Shandong Aifudi Biology Holding Co ltd
Priority to CN202211452790.8A priority Critical patent/CN115578732B/en
Publication of CN115578732A publication Critical patent/CN115578732A/en
Application granted granted Critical
Publication of CN115578732B publication Critical patent/CN115578732B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/15Cutting or merging image elements, e.g. region growing, watershed or clustering-based techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/16Image preprocessing
    • G06V30/168Smoothing or thinning of the pattern; Skeletonisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/18Extraction of features or characteristics of the image
    • G06V30/18105Extraction of features or characteristics of the image related to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/191Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
    • G06V30/19107Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/42Document-oriented image-based pattern recognition based on the type of document
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the field of image recognition, in particular to a label recognition method for a fertilizer production line. Acquiring a gray level image of a fertilizer label to be identified, carrying out image segmentation, acquiring a plurality of connected domains in a text region, and clustering; acquiring the pixel density of each clustering area; performing sliding window on each connected domain, determining a sudden change sliding window and marking pixel points in the sudden change sliding window; acquiring the edge probability of each marked pixel point, and acquiring edge pixel points; acquiring the fuzzy degree of each edge pixel point, acquiring the overall fuzzy degree of a connected domain where the edge pixel points are located, and acquiring the edge offset distance of the connected domain in the text region; and obtaining a corresponding clear connected domain for character recognition by obtaining the real edge of each connected domain. According to the method, the offset distance of the connected domains is obtained, so that the real edge of each connected domain is obtained through fitting, the influence of fuzzy characters on identification can be effectively reduced, and the accuracy of label identification is improved.

Description

Label identification method for fertilizer production line
Technical Field
The invention relates to the field of image recognition, in particular to a label recognition method for a fertilizer production line.
Background
The label of the fertilizer contains numerous key information of the fertilizer, such as: mark fertilizer registration certificate number, product standard number, active ingredient name and content, net weight, date of production and quality guarantee period etc. through discerning the label on the production line of fertilizer to classify and deposit it according to different fertilizer information, but because fertilizer in the motion process on the production line, the typeface appears the ghost image very easily in the image of gathering and leads to blurring, need carry out accurate discernment to the typeface that appears blurring this moment.
In the prior art, ghost edges are detected mainly by differentiating an image to be detected and a standard image and judging through a differential abnormal area, but due to the fact that pixel points of the standard image and the image to be detected are overlapped when the images are differentiated, the offset distance of ghosting cannot be obtained, and the detection result is inaccurate; in the method for acquiring the edge of the double image region through edge detection in the prior art, because the clear region and the fuzzy region of the characters in the image are overlapped, the edge detection technology cannot distinguish the edges in the whole character region, the detection effect on the double image region is poor, the accuracy of character recognition in the follow-up process is low, and the situation of recognition errors is easy to occur.
Disclosure of Invention
The invention provides a label identification method for a fertilizer production line, which aims to solve the problems that the edges in the whole character area cannot be distinguished in the prior art and the detection effect on a double image area is poor. Acquiring a gray level image of a fertilizer label to be identified, carrying out image segmentation, acquiring a plurality of connected domains in a text region, and clustering; acquiring the pixel density of each clustering area; performing sliding window on each connected domain, determining a sudden change sliding window and marking pixel points in the sudden change sliding window; acquiring the edge probability of each marked pixel point, and acquiring edge pixel points; acquiring the fuzzy degree of each edge pixel point, acquiring the overall fuzzy degree of a connected domain where the edge pixel points are located, and acquiring the edge offset distance of the connected domain in the text region; and obtaining a corresponding clear connected domain for character recognition by obtaining the real edge of each connected domain. According to the method, the offset distance of the connected domains is obtained, so that the real edge of each connected domain is obtained through fitting, the influence of fuzzy characters on identification can be effectively reduced, and the accuracy of label identification is improved.
The invention adopts the following technical scheme that the label identification method of the fertilizer production line comprises the following steps:
and acquiring a gray level image of the fertilizer label to be identified, and performing image segmentation to obtain a character area in the gray level image of the fertilizer label to be identified.
And clustering each connected domain in the character region respectively to obtain a plurality of clustering regions in each connected domain.
And acquiring the pixel density of a clustering area where each pixel point is located according to the number of neighborhood pixel points of each pixel point in each connected domain of the character area, wherein the number of the neighborhood pixel points is the same as the gray value.
Performing sliding window on each connected domain in the text region, determining a sudden change sliding window according to the gray average value of each sliding window, and marking pixel points in the sudden change sliding window; and acquiring a marking pixel point in each connected domain of the text region.
And obtaining the marginal probability of the marked pixel points in each connected domain according to the pixel density and the gray average value of the clustering region where the marked pixel points in each connected domain are located, and taking the marked pixel points with the marginal probability greater than a threshold value as marginal pixel points of the corresponding connected domain.
And acquiring the fuzzy degree of each edge pixel point in each connected domain according to the pixel density of the clustering region in which each edge pixel point in each connected domain is located, and acquiring the overall fuzzy degree of each connected domain according to the fuzzy degrees of all the edge pixel points in each connected domain.
And obtaining the edge offset distance of the connected domain in the text region according to the shortest horizontal distance from the edge pixel point with the minimum fuzzy degree in the connected domain with the minimum overall fuzzy degree to the corresponding connected domain boundary.
And acquiring the real edge of each connected domain according to the edge offset distance of the connected domains in the character region, enhancing the real edge of each connected domain to obtain a plurality of corresponding clear connected domains, and performing character recognition on each clear connected domain.
Further, a label identification method for a fertilizer production line, the method for obtaining the pixel density of the clustering area where each pixel point is located comprises the following steps:
acquiring the aggregation degree of each pixel point according to the number ratio of neighborhood pixel points with the same gray value as each pixel point in eight neighborhoods of each pixel point in each connected domain;
and obtaining the pixel density of the clustering region in which each pixel point is located in each connected domain according to the aggregation mean value of all the pixel points in each clustering region of each connected domain.
Further, a label identification method for a fertilizer production line, the method for determining the abrupt change sliding window according to the gray average value of each sliding window comprises the following steps:
acquiring a gray average value of pixel points in a gray image of a fertilizer label to be identified;
obtaining the average value of the gray average values between adjacent sliding windows;
acquiring two sliding windows corresponding to the gray mean value difference between the adjacent sliding windows, which is larger than the gray mean value of the gray image of the fertilizer label to be identified and smaller than the average value of the gray mean value between the adjacent sliding windows; the corresponding two sliding windows are taken as abrupt sliding windows.
Further, a label identification method for a fertilizer production line, the method for obtaining the edge probability of the marking pixel points in each connected domain comprises the following steps:
acquiring the product of the gray level mean value and the pixel density of the clustering area where the next pixel point in the horizontal direction of each marked pixel point is located;
and obtaining the edge probability of each marked pixel point according to the ratio of the product of the gray average value and the pixel density in the clustering region where the next pixel point in the horizontal direction of each marked pixel point is located to the product of the gray average value and the pixel density in the clustering region where the corresponding marked pixel point is located.
Further, a label identification method for a fertilizer production line, a method for obtaining the fuzzy degree of each edge pixel point in each connected domain, comprises the following steps:
and taking the reciprocal of the pixel density of the clustering region where each edge pixel point is located as an index of an index function with a natural constant e as a base to obtain the fuzzy degree of each edge pixel point.
Further, a label identification method for a fertilizer production line, a method for obtaining a real edge of each connected domain according to an edge offset distance of the connected domain in a text area comprises the following steps:
taking the edge point with the minimum fuzzy degree in each connected domain as a seed point, and performing edge fitting on the seed point by using a region growing method to obtain a plurality of fitting edge points;
judging whether the horizontal shortest distance from each fitting edge point in each connected domain to the boundary in the corresponding connected domain is equal to the edge offset distance of the connected domain;
if not, reselecting the seed points for region growth until the obtained horizontal shortest distance from each fitting edge point to the corresponding connected domain boundary is equal to the edge offset distance of the connected domain;
and if so, connecting the corresponding fitting edge points to obtain the real edge of each connected domain.
Further, a label identification method for a fertilizer production line, which is a method for enhancing the real edge of each connected domain, comprises the following steps:
and performing morphological corrosion operation on the real edge of each connected domain to obtain the enhanced real edge of each connected domain.
The invention has the beneficial effects that: after the character area in the gray level image of the fertilizer label is obtained, the connected domain in the character area is firstly determined, so that a targeted target can be achieved during subsequent analysis; the sliding window is carried out according to the gray value change when the characters are fuzzy, so that the area with the gray value change in the connected domain can be accurately determined; the pixel density and the gray average value of the clustering area where the pixel points are located are further selected as the basis of edge point screening, so that the distribution difference of the pixel points between the clear area and the fuzzy area of the connected area is reflected on one hand, and the gray value difference between the clear area and the fuzzy area of the connected area can be reflected on the other hand, the edge points are screened by taking the difference as the characteristic, and the edge pixel points with obvious characteristics in the part between the edges of the clear area and the fuzzy area can be distinguished; the edge pixel points with the minimum fuzzy degree are further screened out to calculate the deviation degree of the connected domain, the precision of calculating the deviation degree of the connected domain can be improved, the effect of label identification in the fertilizer image is better and the accuracy is higher when the real edge of the connected domain is obtained and then the identification is carried out.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a label identification method for a fertilizer production line according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, a label identification method for a fertilizer production line according to an embodiment of the present invention includes:
101. and acquiring a character area in the gray level image of the fertilizer label to be identified.
The present invention is directed to the following scenarios: the fertilizer images collected on the production line can generate double images due to the fact that the object is in a moving state, so that characters in double image areas need to be analyzed, and the obtained clear characters are identified and judged.
According to the method, the fertilizer label image to be identified is collected, illumination is required to be uniform when the image is collected, the label is prevented from being identified due to reflection influence, and the label image of the fertilizer is obtained and then subjected to graying processing to obtain a corresponding grayscale image.
The invention mainly aims to correct characters according to the offset degree and the fuzzy degree of the characters, so that a character area needs to be obtained firstly, in order to obtain the character area, an Otsu threshold segmentation algorithm is adopted to segment an acquired image, otsu is also called a maximum inter-class variance method, in the process of image segmentation, an image binaryzation segmentation threshold is determined to be not influenced by the brightness and the contrast of the image, an algorithm for automatically calculating an optimal global threshold distinguishes the foreground and the background of the image through a maximum inter-class square error method, the variance is a measure of the gray distribution uniformity, the larger the inter-class variance between the background and the foreground is, the larger the difference between two parts forming the image is, therefore, the segmentation with the maximum inter-class variance means the minimum probability of wrong segmentation, and the method is a known technology and is not repeated.
102. And clustering each connected domain in the character region to obtain the pixel density of the clustering region where each pixel point in each connected domain is located.
In order to obtain the edge of the clear area, the invention firstly obtains a complete text area by segmentation, the text area comprises a plurality of connected areas, each connected area is provided with the clear area and the fuzzy area, the right side edge line of the clear area is superposed with the fuzzy area on the assumption that the clear area is positioned at the left side of the area, and the fuzzy area is positioned at the right side of the area, and the gray value of the pixel point of the clear area is smaller than that of the fuzzy area, and the density of the same type of pixel point of the clear area is larger, so the initial distinction of the edge of the clear area and the fuzzy area is carried out by analyzing the gray change of the pixel point and the aggregation degree of the pixel point.
Furthermore, the invention classifies the pixels with the same gray level in each connected domain into one type through a clustering algorithm, and expresses the distribution of the pixels by calculating the density of the pixels in the same clustering region, because the change of the gray level value of the pixels in the clear region is small, and the density of the pixels of the same type is large; the gray value of the pixel points in the fuzzy area is changed greatly, and the density of the similar pixel points is small, so that the distribution of the pixel points in the clear area and the fuzzy area is expressed according to the density of the pixel points.
The method for acquiring the pixel density of the clustering area where each pixel point is located comprises the following steps:
acquiring the concentration of each pixel point according to the ratio of the number of the pixel points with the same gray value as each pixel point in the eight neighborhoods of each pixel point in each connected domain:
Figure 830287DEST_PATH_IMAGE002
in the formula (I), the compound is shown in the specification,
Figure DEST_PATH_IMAGE003
is shown as
Figure 825924DEST_PATH_IMAGE004
The concentration of each pixel point is determined,
Figure DEST_PATH_IMAGE005
the number of points with the same gray level in eight neighborhoods of the pixel point i is represented, the local aggregation coefficient of the pixel point is represented according to the number of the adjacent pixel points around each pixel point, and the more the number of the points with the same gray level in the neighborhood of one pixel point is, the larger the local density of the pixel point is.
Obtaining the pixel density of the clustering region where each pixel point is located in each connected domain according to the average value of the aggregation degrees of all the pixel points in each clustering region of each connected domain, and then obtaining the density of the pixel points of the same clustering block according to the local aggregation degree, wherein the calculation formula is as follows:
Figure DEST_PATH_IMAGE007
in the formula (I), the compound is shown in the specification,
Figure 324164DEST_PATH_IMAGE008
the pixel density of the clustering region where the ith pixel point is located is represented,
Figure 848686DEST_PATH_IMAGE003
is shown as
Figure 868595DEST_PATH_IMAGE004
The concentration of each pixel point is determined,
Figure DEST_PATH_IMAGE009
meaning that the sum is averaged.
The distribution condition of the pixel points with the same gray value can be obtained according to the density of the clustering blocks, because the pixel points with different densities in different areas can be clustered together through density clustering, and the pixel points in the clear areas and the pixel points in the fuzzy areas are distributed differently, the densities of the different clustering blocks represent different areas, and then the clear areas and the fuzzy areas can be distinguished through the change of the gray value.
103. And performing sliding window on each connected domain in the text area to obtain a marking pixel point in each connected domain of the text area.
Because the gray level of the pixel point in the clear area is smaller, the gray level of the pixel point in the fuzzy area is larger, and the gray level value changes at the boundary of the clear area and the fuzzy area, the invention sets a sliding window 3*3 to slide along the horizontal direction, because the direction of the double image is the horizontal direction, the average gray level value of the pixel point in the sliding window is calculated, and the gray level sequence is obtained according to the change of the average gray level value of the sliding window
Figure 402344DEST_PATH_IMAGE010
When the difference of the gray level mean values of two continuous sliding windows is greater than the gray level mean value of the whole image, the gray level is considered to have sudden change, and the gray level cannot be considered as the edge line of a clear area, so that the gray level mean values of two continuous sliding windows are required to be controlled to be smaller than the gray level mean value of the whole image;and when the difference of the gray average values of two continuous sliding windows is larger than the average value of the gray average values of the two sliding windows, the gray value is considered to be changed, and the mathematical expression is as follows:
Figure DEST_PATH_IMAGE011
and at the moment, taking the two sliding windows corresponding to the gray value change as the abrupt change sliding windows, and marking the pixel points in the abrupt change sliding windows.
The method for determining the abrupt change sliding window according to the gray average value of each sliding window comprises the following steps:
acquiring a gray average value of pixel points in a gray image of a fertilizer label to be identified;
obtaining the average value of the gray average values between adjacent sliding windows;
acquiring two sliding windows corresponding to the gray mean value difference between the adjacent sliding windows, which is larger than the gray mean value of the gray image of the fertilizer label to be identified and smaller than the average value of the gray mean value between the adjacent sliding windows; the corresponding two sliding windows are taken as abrupt sliding windows.
104. And acquiring the edge probability of the marking pixel points in each connected domain, and taking the marking pixel points with the edge probability greater than a threshold value as the edge pixel points of the corresponding connected domain.
Then, the judgment is carried out according to the clustering region where the marked pixel points are located, and the gray average value of the clustering region where the marked pixel points are located is calculated
Figure 722467DEST_PATH_IMAGE012
And obtaining the edge probability of the pixel point according to the gray average value and the pixel density of the clustering region where the marked pixel point is located.
The method for acquiring the edge probability of the marked pixel points in each connected domain comprises the following steps:
acquiring the product of the gray level mean value and the pixel density of the clustering area where the next pixel point in the horizontal direction of each marked pixel point is located;
obtaining the edge probability of each marked pixel point according to the ratio of the product of the gray average value and the pixel density in the clustering region where the next pixel point in the horizontal direction of each marked pixel point is located to the product of the gray average value and the pixel density in the clustering region where the corresponding marked pixel point is located, wherein the expression is as follows:
Figure 417891DEST_PATH_IMAGE014
in the formula (I), the compound is shown in the specification,
Figure DEST_PATH_IMAGE015
the gray level mean value of the clustering area where the next pixel point in the ith pixel point horizontal direction is located is represented,
Figure 721833DEST_PATH_IMAGE016
the pixel density of the clustering area where the next pixel point in the ith pixel point horizontal direction is located is represented,
Figure 262536DEST_PATH_IMAGE012
the gray average value of the clustering area where the ith pixel point is located is represented,
Figure 935701DEST_PATH_IMAGE008
and the pixel density of the clustering area where the ith pixel point is located is represented.
Because the judgment is carried out according to the gray level when the sliding window is carried out, if the gray level changes, the clustering areas where the front pixel point and the back pixel point in the sliding window are different, if the marked pixel point is a mutation point, the next pixel point of the marked pixel point is in a fuzzy subject area, the gray value of the next pixel point is larger, the density of the clustering block is smaller, the gray value of the marked pixel point is smaller, and the density of the pixel point is larger, the probability of judging whether the point is the edge point of the clear area or not is taken as the ratio of the product of the gray average value of the clustering area where the pixel point is located and the pixel density, and the edge probability is used in the invention
Figure DEST_PATH_IMAGE017
The marked pixel points are used as edge pixel points, and the threshold value is a reference value and can be modified according to actual conditions.
Therefore, a plurality of edge pixel points of each connected domain in the text area can be obtained.
105. And acquiring the edge offset distance of the connected domain in the text area.
Due to the fact that double images occur in the character areas, the obtained edge pixel points of each connected domain are only partial edge pixel points and cannot completely form the edge outline of the whole connected domain, and due to the fact that the characters are fixed to be deviated in a certain direction when the double images occur, clear areas and fuzzy areas can appear in the character connected domains, the fuzzy areas are the parts deviated out, and meanwhile the deviation distances of all the connected domains are the same.
It should be noted that the edge pixel points in the invention are edge pixel points between the clear area and the fuzzy area in each connected domain, and the area is a part where the pixels of the clear area and the fuzzy area are overlapped, so that the area where each edge pixel point is located has a certain fuzzy degree.
The method for acquiring the fuzzy degree of each edge pixel point in each connected domain comprises the following steps:
taking the reciprocal of the pixel density of the clustering region where each edge pixel point is as a natural constant
Figure 67605DEST_PATH_IMAGE018
The index of the exponential function of the base, the degree of blurring of each edge pixel point is obtained, i.e.
Figure DEST_PATH_IMAGE019
Wherein, in the step (A),
Figure 593264DEST_PATH_IMAGE020
representing edge pixels
Figure 203237DEST_PATH_IMAGE022
The degree of blurring of the image is determined,
Figure DEST_PATH_IMAGE023
representing edge pixels
Figure 763531DEST_PATH_IMAGE022
The pixel density of the cluster region where it is located,
Figure 800757DEST_PATH_IMAGE018
representing a natural constant.
According to the method, each connected domain is clustered through the gray value, the gray value of a clear region is lower and the number of pixels is larger for the connected domains with double images, the clustered regions are more and the number of pixels in each region is smaller because pixel shifting and superposition occur in fuzzy regions, namely, the fuzzy degree of each obtained edge pixel is calculated according to the clustering region where the edge pixel is located, the higher the pixel density of the clustering region where the edge pixel is located is, the lower the fuzzy degree is, the more the pixel belongs to the clear region, and the clearer the shifting condition of the edge pixel is.
The fuzzy degrees of all edge pixel points in each connected domain are synthesized, namely the overall fuzzy degree of each connected domain is obtained according to the sum of the fuzzy degrees of all edge pixel points in each connected domain, when the overall fuzzy degree of each connected domain is larger, the connected domain is considered to have partial clear edge pixel points, but the synthesis is fuzzy, and the accuracy possibly caused by calculating the offset distance of the connected domain is insufficient.
The method for acquiring the edge offset distance of the connected domain in the text area comprises the following steps:
acquiring the coordinate of the edge pixel point with the minimum fuzzy degree in the connected domain with the minimum overall fuzzy degree;
and acquiring the shortest horizontal distance from the edge pixel point with the minimum fuzzy degree in the connected domain with the minimum overall fuzzy degree to the boundary of the connected domain, and taking the distance as the offset distance of the connected domain in the text region.
The method takes the character right deviation as an example, after the coordinate of the edge pixel point with the minimum fuzzy degree is obtained, the coordinate position of the edge pixel point horizontally extends to the right until the boundary of the connected domain where the edge pixel point is located, the distance between two points is obtained at the moment, the distance is used as the deviation distance of the connected domain, and the method for specifically calculating the distance between the two points is the prior art, so that the method does not need to be explained too much.
106. And obtaining a plurality of corresponding clear connected domains according to the real edge of each connected domain, and performing character recognition on each clear connected domain.
The method for acquiring the real edge of each connected domain according to the edge offset distance of the connected domain in the text area comprises the following steps:
taking the edge point with the minimum fuzzy degree in each connected domain as a seed point, and performing edge fitting on the seed point by using a region growing method to obtain a plurality of fitting edge points;
judging whether the horizontal shortest distance from each fitting edge point in each connected domain to the boundary in the corresponding connected domain is equal to the edge offset distance of the connected domain;
if not, reselecting the region for region growth until the obtained horizontal shortest distance from each fitting edge point to the corresponding connected domain boundary is equal to the edge offset distance of the connected domain;
and if so, connecting the corresponding fitting edge points to obtain the real edge of each connected domain.
The method comprises the steps of selecting edge pixel points with the minimum fuzzy degree in each connected domain as seed pixel points, respectively growing the seed pixel points downwards or upwards to obtain edge pixel points of the same connected domain with large middle fuzzy degree, calculating the distance between the obtained edge pixel points and the boundary of the connected domain from the right to the horizontal direction, comparing the distance with an offset distance, and if the distance is the same, indicating that the obtained true edge is accurate; if the actual edge line is not equal to the edge line of the connected domain, the region is reselected to carry out region growth, the true edge line of each connected domain is obtained according to fitting of all the obtained edge pixel points, morphological corrosion operation is carried out on the obtained true edge, the outline of the true edge is extracted, and the clear connected domain is obtained, wherein the morphological corrosion is the prior art, and is not repeated in the invention.
Therefore, the real edge of each connected domain is obtained, so that the clear region in each connected domain is divided to obtain characters without double images, and at the moment, the identification of the fertilizer label image can be completed only by utilizing a machine to automatically identify and extract the characters without double images, and the character information in the fertilizer label is obtained.
After the character area in the gray level image of the fertilizer label is obtained, the connected domain in the character area is firstly determined, so that a targeted target can be achieved during subsequent analysis; the sliding window is carried out according to the gray value change when the characters are fuzzy, so that the area with the gray value change in the connected domain can be accurately determined; the pixel density and the gray average value of the clustering area where the pixel points are located are further selected as the basis of edge point screening, so that the distribution difference of the pixel points between the clear area and the fuzzy area of the connected area is reflected on one hand, and the gray value difference between the clear area and the fuzzy area of the connected area can be reflected on the other hand, the edge points are screened by taking the difference as the characteristic, and the edge pixel points with obvious characteristics in the part between the edges of the clear area and the fuzzy area can be distinguished; the edge pixel points with the minimum fuzzy degree are further screened out to calculate the deviation degree of the connected domain, the precision of calculating the deviation degree of the connected domain can be improved, the effect of label identification in the fertilizer image is better and the accuracy is higher when the real edge of the connected domain is obtained and then the identification is carried out.
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 label identification method for a fertilizer production line is characterized by comprising the following steps:
acquiring a fertilizer label gray level image to be identified, and performing image segmentation to obtain a character area in the fertilizer label gray level image to be identified;
clustering each connected domain in the character region respectively to obtain a plurality of clustering regions in each connected domain;
acquiring the pixel density of a clustering area where each pixel point is located according to the number of neighborhood pixel points of each pixel point in each connected domain of the character area, wherein the number of the neighborhood pixel points is the same as the gray value;
performing sliding window on each connected domain in the text region, determining a sudden change sliding window according to the gray average value of each sliding window, and marking pixel points in the sudden change sliding window; acquiring a marking pixel point in each connected domain of the character region;
acquiring the edge probability of the marked pixel points in each connected domain according to the pixel density and the gray average value of the clustering region where the marked pixel points in each connected domain are located, and taking the marked pixel points with the edge probability greater than a threshold value as the edge pixel points of the corresponding connected domain;
acquiring the fuzzy degree of each edge pixel point in each connected domain according to the pixel density of the clustering region in which each edge pixel point in each connected domain is located, and acquiring the overall fuzzy degree of each connected domain according to the fuzzy degrees of all the edge pixel points in each connected domain;
obtaining the edge offset distance of the connected domain in the text region according to the shortest horizontal distance from the edge pixel point with the minimum fuzzy degree in the connected domain with the minimum overall fuzzy degree to the corresponding connected domain boundary;
and acquiring the real edge of each connected domain according to the edge offset distance of the connected domains in the character region, enhancing the real edge of each connected domain to obtain a plurality of corresponding clear connected domains, and performing character recognition on each clear connected domain.
2. The label identification method of the fertilizer production line according to claim 1, wherein the method for obtaining the pixel density of the clustering area where each pixel point is located comprises the following steps:
acquiring the aggregation degree of each pixel point according to the number ratio of neighborhood pixel points with the same gray value as each pixel point in eight neighborhoods of each pixel point in each connected domain;
and obtaining the pixel density of the clustering region in which each pixel point is located in each connected domain according to the aggregation mean value of all the pixel points in each clustering region of each connected domain.
3. The label identification method of the fertilizer production line as claimed in claim 1, wherein the method for determining the abrupt change sliding window according to the gray average value of each sliding window is as follows:
acquiring a gray average value of pixel points in a gray image of a fertilizer label to be identified;
obtaining the average value of the gray average values between adjacent sliding windows;
acquiring two sliding windows corresponding to the gray mean value difference between the adjacent sliding windows, which is larger than the gray mean value of the gray image of the fertilizer label to be identified and smaller than the average value of the gray mean value between the adjacent sliding windows; the corresponding two sliding windows are taken as abrupt sliding windows.
4. The label identification method of the fertilizer production line according to claim 1, wherein the method for obtaining the marginal probability of the marking pixel points in each connected domain comprises the following steps:
acquiring the product of the gray level mean value and the pixel density of the clustering area where the next pixel point in the horizontal direction of each marked pixel point is located;
and obtaining the edge probability of each marked pixel point according to the ratio of the product of the gray average value and the pixel density in the clustering region where the next pixel point in the horizontal direction of each marked pixel point is located to the product of the gray average value and the pixel density in the clustering region where the corresponding marked pixel point is located.
5. The label identification method of the fertilizer production line according to claim 1, wherein the method for obtaining the fuzzy degree of each edge pixel point in each connected domain comprises the following steps:
and taking the reciprocal of the pixel density of the clustering region where each edge pixel point is located as an index of an index function with a natural constant e as a base to obtain the fuzzy degree of each edge pixel point.
6. The label identification method of the fertilizer production line as claimed in claim 1, wherein the method for obtaining the real edge of each connected domain according to the edge offset distance of the connected domain in the text area comprises the following steps:
taking the edge point with the minimum fuzzy degree in each connected domain as a seed point, and performing edge fitting on the seed point by using a region growing method to obtain a plurality of fitting edge points;
judging whether the horizontal shortest distance from each fitting edge point in each connected domain to the boundary in the corresponding connected domain is equal to the edge offset distance of the connected domain;
if not, reselecting the seed points for region growth until the obtained horizontal shortest distance from each fitting edge point to the corresponding connected domain boundary is equal to the edge offset distance of the connected domain;
and if so, connecting the corresponding fitting edge points to obtain the real edge of each connected domain.
7. The label identification method for fertilizer production lines as claimed in claim 1, wherein the method for enhancing the real edge of each connected domain comprises the following steps:
and performing morphological corrosion operation on the real edge of each connected domain to obtain the enhanced real edge of each connected domain.
CN202211452790.8A 2022-11-21 2022-11-21 Label identification method for fertilizer production line Active CN115578732B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211452790.8A CN115578732B (en) 2022-11-21 2022-11-21 Label identification method for fertilizer production line

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211452790.8A CN115578732B (en) 2022-11-21 2022-11-21 Label identification method for fertilizer production line

Publications (2)

Publication Number Publication Date
CN115578732A true CN115578732A (en) 2023-01-06
CN115578732B CN115578732B (en) 2023-03-28

Family

ID=84588099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211452790.8A Active CN115578732B (en) 2022-11-21 2022-11-21 Label identification method for fertilizer production line

Country Status (1)

Country Link
CN (1) CN115578732B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115797344A (en) * 2023-02-06 2023-03-14 智联信通科技股份有限公司 Machine room equipment identification management method based on image enhancement
CN116863249A (en) * 2023-09-01 2023-10-10 山东拓新电气有限公司 Coal mine conveyor belt deviation recognition method based on artificial intelligence
CN117274293A (en) * 2023-11-17 2023-12-22 广东省农业科学院动物科学研究所 Accurate bacterial colony dividing method based on image features

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019041590A1 (en) * 2017-08-31 2019-03-07 中国科学院微电子研究所 Edge detection method using arbitrary angle
US20210041588A1 (en) * 2019-08-09 2021-02-11 Petrochina Company Limited Method for identifying boundary of sedimentary facies, computer device and computer readable storage medium
CN114862862A (en) * 2022-07-11 2022-08-05 江苏大田阀门制造有限公司 Pump body cold shut defect identification method and system based on image processing
CN115294158A (en) * 2022-09-26 2022-11-04 江苏万森绿建装配式建筑有限公司 Hot continuous rolling strip steel image segmentation method based on machine vision
CN115311290A (en) * 2022-10-12 2022-11-08 南通市通州区精华电器有限公司 Method for detecting defects of metal parts of precision instrument
CN115345893A (en) * 2022-09-15 2022-11-15 吉林大学中日联谊医院 Ovarian tissue canceration region segmentation method based on image processing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019041590A1 (en) * 2017-08-31 2019-03-07 中国科学院微电子研究所 Edge detection method using arbitrary angle
US20210041588A1 (en) * 2019-08-09 2021-02-11 Petrochina Company Limited Method for identifying boundary of sedimentary facies, computer device and computer readable storage medium
CN114862862A (en) * 2022-07-11 2022-08-05 江苏大田阀门制造有限公司 Pump body cold shut defect identification method and system based on image processing
CN115345893A (en) * 2022-09-15 2022-11-15 吉林大学中日联谊医院 Ovarian tissue canceration region segmentation method based on image processing
CN115294158A (en) * 2022-09-26 2022-11-04 江苏万森绿建装配式建筑有限公司 Hot continuous rolling strip steel image segmentation method based on machine vision
CN115311290A (en) * 2022-10-12 2022-11-08 南通市通州区精华电器有限公司 Method for detecting defects of metal parts of precision instrument

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王卓等: "边缘细分的动态参数模糊C-均值图像分割算法", 《南京理工大学学报》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115797344A (en) * 2023-02-06 2023-03-14 智联信通科技股份有限公司 Machine room equipment identification management method based on image enhancement
CN116863249A (en) * 2023-09-01 2023-10-10 山东拓新电气有限公司 Coal mine conveyor belt deviation recognition method based on artificial intelligence
CN116863249B (en) * 2023-09-01 2023-11-21 山东拓新电气有限公司 Coal mine conveyor belt deviation recognition method based on artificial intelligence
CN117274293A (en) * 2023-11-17 2023-12-22 广东省农业科学院动物科学研究所 Accurate bacterial colony dividing method based on image features
CN117274293B (en) * 2023-11-17 2024-03-15 广东省农业科学院动物科学研究所 Accurate bacterial colony dividing method based on image features

Also Published As

Publication number Publication date
CN115578732B (en) 2023-03-28

Similar Documents

Publication Publication Date Title
CN115578732B (en) Label identification method for fertilizer production line
CN115018828B (en) Defect detection method for electronic component
CN109377485B (en) Machine vision detection method for instant noodle packaging defects
CN115311292B (en) Strip steel surface defect detection method and system based on image processing
CN111161243B (en) Industrial product surface defect detection method based on sample enhancement
CN113160192B (en) Visual sense-based snow pressing vehicle appearance defect detection method and device under complex background
CN109191459B (en) Automatic identification and rating method for continuous casting billet macrostructure center segregation defect
CN115082419B (en) Blow-molded luggage production defect detection method
CN115829883B (en) Surface image denoising method for special-shaped metal structural member
CN115082683A (en) Injection molding defect detection method based on image processing
CN103310211B (en) A kind ofly fill in mark recognition method based on image procossing
CN106991686B (en) A kind of level set contour tracing method based on super-pixel optical flow field
CN114972356B (en) Plastic product surface defect detection and identification method and system
CN115082466B (en) PCB surface welding spot defect detection method and system
CN114359288B (en) Medical image cerebral aneurysm detection and positioning method based on artificial intelligence
CN115311277A (en) Pit defect identification method for stainless steel product
CN117197140B (en) Irregular metal buckle forming detection method based on machine vision
CN109871900A (en) The recognition positioning method of apple under a kind of complex background based on image procossing
CN114820625A (en) Automobile top block defect detection method
CN114972272A (en) Grad-CAM-based segmentation method for new coronary pneumonia lesions
CN115841600B (en) Deep learning-based sweet potato appearance quality classification method
CN116258864B (en) Village planning construction big data management system
CN114742849B (en) Leveling instrument distance measuring method based on image enhancement
CN107704864A (en) Well-marked target detection method based on image object Semantic detection
CN112446894B (en) Image segmentation method based on direction space

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
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A Label Recognition Method for Fertilizer Production Line

Effective date of registration: 20230613

Granted publication date: 20230328

Pledgee: Bank of China Limited Jining Branch

Pledgor: SHANDONG AIFUDI BIOLOGY HOLDING Co.,Ltd.

Registration number: Y2023980043538

PE01 Entry into force of the registration of the contract for pledge of patent right