CN115861135B - Image enhancement and recognition method applied to panoramic detection of box body - Google Patents
Image enhancement and recognition method applied to panoramic detection of box body Download PDFInfo
- Publication number
- CN115861135B CN115861135B CN202310179040.6A CN202310179040A CN115861135B CN 115861135 B CN115861135 B CN 115861135B CN 202310179040 A CN202310179040 A CN 202310179040A CN 115861135 B CN115861135 B CN 115861135B
- Authority
- CN
- China
- Prior art keywords
- gray
- pixel
- pixel point
- index
- panoramic
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Abstract
The invention relates to the technical field of image data processing, in particular to an image enhancement and identification method applied to box panoramic detection. The method comprises the steps of obtaining local gray indexes according to gray levels in a preset neighborhood of pixel points in a panoramic image, obtaining a spatial distribution index based on gray levels of pixel points at the edge of a scale window, obtaining a structural distribution index according to gray values of the pixel points in the preset neighborhood of the pixel points, and obtaining a characteristic index by combining the three indexes; and enhancing the panoramic image based on the characteristic index to obtain a panoramic enhanced image, acquiring characteristic similarity according to the gray value and gray entropy of pixel points in a super pixel block in the panoramic enhanced image, and dividing the panoramic enhanced image into areas according to the characteristic similarity. According to the invention, the characteristic information of the pixel points is analyzed from the aspects of gray distribution, spatial distribution and structural distribution to obtain the characteristic index of the pixel points, and the panoramic image is subjected to self-adaptive enhancement processing based on the characteristic index, so that the enhancement effect of the panoramic image is improved.
Description
Technical Field
The invention relates to the technical field of image data processing, in particular to an image enhancement and identification method applied to box panoramic detection.
Background
When detecting the box body condition based on the image, in order to improve the box body condition detection precision and the accuracy of effective information in the image, the image is generally enhanced before the detection based on the image, and the image edge detail information enhancement effect is not obvious enough easily due to improper enhancement processing, so that the problems of poor enhancement effect, loss of the image detail information and the like are solved.
When the image is enhanced, the contrast of the image can be improved by a proper enhancement method, and detailed information in the image can be better saved, and the existing image enhancement method comprises the following steps: obtaining fuzzy images with different fuzzy degrees under different scale spaces by performing scale transformation on the original RGB images, calculating the weight of each fuzzy image under different scale spaces, obtaining local features and global features of each fuzzy image, fusing the local features and the global features to obtain feature matrixes corresponding to each fuzzy image, fusing the feature matrixes to obtain fused feature matrixes of the original RGB images by the weight, extracting each key point in the original RGB images, taking the information entropy of a pixel point in the neighborhood range of the key point as the key point weight of each key point, and reinforcing the key point according to the key point weight and the fused feature matrixes to obtain an enhanced image corresponding to the original RGB images; the method directly enhances the corresponding key points according to the key point weights, and gray level distribution, spatial distribution and structural distribution of each pixel point in a specific image are not considered, so that the accuracy of the key point weights representing the enhancement indexes cannot be effectively ensured, and therefore, a method for realizing accurate image enhancement and identification applied to box panoramic detection is needed.
Disclosure of Invention
In order to solve the problems that the existing image enhancement method is insufficient in analysis of each pixel point of an image to cause inaccurate enhancement indexes and poor image enhancement effect, the invention aims to provide an image enhancement and identification method applied to panoramic detection of a box body, and the adopted technical scheme is as follows:
the invention provides an image enhancement and identification method applied to panoramic detection of a box body, which comprises the following steps:
acquiring a panoramic image of the box body;
obtaining a local gray index of each pixel point according to gray value distribution characteristics of each pixel point in the panoramic image in a preset neighborhood range; dividing at least two scale windows in a preset neighborhood range of each pixel point, and acquiring a spatial distribution index of the corresponding pixel point according to gray level distribution of the pixel points at the edge of the scale window in each scale window; acquiring a structural distribution index of each pixel point based on the gray level difference of the pixel point and the neighborhood pixel point in a preset neighborhood range;
combining the local gray scale index, the spatial distribution index and the structural distribution index to obtain a characteristic index of each pixel point; enhancing the panoramic image based on the characteristic index to obtain a panoramic enhanced image;
dividing the panoramic enhanced image into at least two super-pixel blocks, classifying the super-pixel blocks according to the feature similarity of gray distribution features among the super-pixel blocks, and identifying each sub-region according to the classification result.
Further, the method for obtaining the spatial distribution index comprises the following steps:
for any gray level in a preset neighborhood range of each pixel point, respectively counting the number of edge pixel points corresponding to the gray level in each scale window as a first number, and counting the number of pixel points corresponding to the gray level in the preset neighborhood range as a second number; taking the ratio of the first quantity to the second quantity as the occurrence probability of gray scales in each scale window; for any scale window of gray level, taking the logarithm of the occurrence probability taking the natural constant e as a base as a first logarithmic value, and taking the product of the occurrence probability and the first logarithmic value as a second logarithmic value; taking the opposite number of the sum of the second pair of numerical values corresponding to all scale windows as a gray level distribution index of gray level; and taking the sum of the gray level distribution indexes of each gray level in the preset neighborhood range of each pixel point as the spatial distribution index of the corresponding pixel point.
Further, the method for obtaining the structural distribution index comprises the following steps:
the gray level difference between each pixel point and each corresponding neighborhood pixel point is respectively obtained, the square of each gray level difference is taken as a first difference value, the evolution of the mean value of the first difference value is calculated as a second difference value, and the mean value of the second difference values of all pixel points in the preset neighborhood range of each pixel point is taken as a structural distribution index of the corresponding pixel point.
Further, the method for acquiring the characteristic index comprises the following steps:
taking a value obtained by setting a first constant as a base and taking a spatial distribution index as an index as a first result; taking the local gray index as a numerator, and taking the ratio obtained by taking the first result as a denominator as a second result; and taking the product of the structural distribution index and the second result as the characteristic index of the pixel point.
Further, the method for enhancing the panoramic image based on the characteristic index to obtain the panoramic enhanced image comprises the following steps:
carrying out normalization processing on the characteristic index of each pixel point in the panoramic image to obtain a normalized characteristic index corresponding to each pixel point;
setting a first threshold value and a second threshold value, enabling the first threshold value to be smaller than the second threshold value, and taking the product of the gray value of the pixel point and the normalized characteristic index as the enhanced gray value of the corresponding pixel point when the normalized characteristic index of the pixel point is smaller than or equal to the first threshold value;
when the normalized characteristic index of the pixel point is larger than the first threshold value and smaller than the second threshold value, the gray value of the corresponding pixel point is kept unchanged;
when the normalized characteristic index of the pixel point is larger than or equal to a second threshold value, calculating and setting the sum of the second constant and the normalized characteristic index as a third result, and taking the product of the gray value of the pixel point and the third result as an enhanced gray value of the corresponding pixel point;
the image formed by the enhanced gray value of each pixel point in the panoramic image is a panoramic enhanced image.
Further, the method for acquiring the gray distribution characteristics comprises the following steps:
for any super pixel block, filtering the super pixel block to obtain a texture extraction gray scale map, and obtaining the image entropy of the texture extraction gray scale map;
for any super-pixel block, a Gaussian model is built according to gray values of pixel points in the super-pixel block, the mean value and the variance of the Gaussian model are obtained, the gray entropy and the mean value and the variance of the Gaussian model form a feature vector of the super-pixel block, and the feature vector is used as the gray distribution feature.
Further, the method for acquiring the feature similarity comprises the following steps:
and calculating Euclidean distance between gray level distribution characteristics of any two super pixel blocks as characteristic distance, and taking a result obtained by performing negative correlation mapping on the characteristic distance as characteristic similarity between the two corresponding super pixel blocks.
Further, the method for classifying the super pixel blocks according to the feature similarity of the gray distribution features among the super pixel blocks comprises the following steps:
and setting an aggregation threshold, and classifying the two super-pixel blocks into one category when the feature similarity between the two super-pixel blocks is larger than the aggregation threshold to obtain at least two categories, wherein each category corresponds to one sub-region.
Further, the method for obtaining the local gray index comprises the following steps:
and counting the gray level of the pixel in a preset neighborhood range of each pixel, calculating information entropy based on each gray level in the preset neighborhood range, and taking the information entropy as a local gray index of the corresponding pixel.
The invention has the following beneficial effects:
in the embodiment of the invention, in the process of acquiring the characteristic index of each pixel point in the panoramic image, each pixel point in the preset neighborhood range of each pixel point is analyzed in detail from three aspects of gray level distribution, spatial distribution and structural distribution, so that the accuracy of the characteristic index of each pixel point is effectively improved; because the correlation between each pixel point in the preset neighborhood range of the set size of the pixel point and the corresponding pixel point is larger, the information of the corresponding pixel point can be better represented, so that when the characteristic index of the pixel point is acquired, each pixel point in the preset neighborhood range of the pixel point is taken as a target for analysis, the local gray index representing the disordered degree of the gray distribution of each pixel point in the preset neighborhood range of the pixel point is acquired through analysis from the gray distribution aspect, the preset neighborhood range of the pixel point is divided into a plurality of scale windows with different scale spans, the spatial distribution index representing the gray level in each scale window can be accurately acquired, the spatial distribution index representing the aggregation degree of the gray level in the preset neighborhood range of the pixel point is further acquired, the structural distribution index representing the detail change of the image information is acquired through analysis from the structural distribution, and the characteristic index representing the gray distribution, the gray level, the spatial distribution index and the structural distribution index of the pixel point can be combined to obtain the characteristic index of the pixel point to reflect the required gray level more accurately, the full-scale information can be better, the full-scale image enhancement effect is realized based on the required full-scale image enhancement effect is realized, and the full-scale image enhancement effect is realized; the panoramic enhancement image is initially divided into a plurality of super-pixel blocks, so that the characteristic similarity of the super-pixel blocks is conveniently obtained by carrying out finer segmentation on the panoramic enhancement image, the panoramic enhancement image is divided into areas according to the characteristic similarity, and the accuracy of accurately identifying the panoramic image is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of steps of an image enhancement and recognition method applied to panoramic detection of a box according to an embodiment of the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following is a detailed description of specific implementation, structure, characteristics and effects thereof for an image enhancement and recognition method applied to panoramic detection of a box according to the invention, with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
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 specifically describes a specific scheme of the image enhancement and recognition method applied to the panoramic detection of the box body.
Referring to fig. 1, a flowchart of steps of an image enhancement and recognition method applied to panoramic detection of a box according to an embodiment of the present invention is shown, where the method includes:
step S1: and obtaining a panoramic image of the box body.
And acquiring the panoramic image of the box body through image acquisition equipment of the panoramic detection system to obtain the panoramic image. In order to avoid the influence of noise data on the quality of the panoramic image, the panoramic image is subjected to filtering operation through a Gaussian filtering algorithm, so that the purpose of reducing noise in the panoramic image is achieved, and the influence of the noise data on effective information in the panoramic image is prevented. The gaussian filtering algorithm is a well-known technique, and a specific method is not described herein.
It should be noted that, in order to facilitate analysis of a subsequent algorithm, the embodiment of the present invention obtains a panoramic image and converts the panoramic image into a gray image, and the method for converting the gray image is a technical means well known to those skilled in the art, which is not described herein.
Step S2: obtaining a local gray index of each pixel point according to gray value distribution characteristics of each pixel point in the panoramic image in a preset neighborhood range; dividing at least two scale windows in a preset neighborhood range of each pixel point, and acquiring a spatial distribution index of the corresponding pixel point according to gray level distribution of the pixel points at the edge of the scale window in each scale window; and acquiring a structural distribution index of each pixel point based on the gray level difference of the pixel point and the neighborhood pixel point in a preset neighborhood range.
In order to acquire the characteristic information of each pixel point in the panoramic image, the pixel points are analyzed sequentially from three aspects of gray level distribution, spatial distribution and structural distribution, and the local gray level index, spatial distribution index and structural distribution index of each pixel point are acquired sequentially, and the specific method for acquiring the three indexes is as follows:
(1) And analyzing from the gray distribution aspect to obtain the local gray index of the pixel point. The gray level of each pixel in a preset neighborhood range of the pixel is analyzed, and local gray indexes used for representing the information quantity in the preset neighborhood range of the pixel and the gray distribution disorder degree of the pixel are obtained according to the number of the pixel corresponding to each gray level in the preset neighborhood range. The method for calculating the local gray index of the pixel point comprises the following steps: and counting the gray level of the pixel in a preset neighborhood range of each pixel, calculating information entropy based on each gray level in the preset neighborhood range, and taking the information entropy as a local gray index of the corresponding pixel.
As an example, in order to improve the feature analysis precision of the pixel points, the embodiment of the invention extracts feature information of the pixel points based on a preset neighborhood range, selects any one pixel point from the panoramic image, takes the pixel point k as an example, takes the pixel point k as a center point, and obtains the set size thereof as the set sizeThe acquisition of the preset neighborhood range of the pixel point k is realized.
Counting the gray level of the pixel in the preset neighborhood range of the pixel k, recording the total number of the gray levels as U, taking the gray level U of the pixel in the preset neighborhood range of the pixel k as an example, and taking the ratio of the number of the pixel corresponding to the gray level U in the preset neighborhood range to the total number of the pixel in the preset neighborhood range as the occurrence probability of the gray level UCalculating the occurrence probability of each gray level in a preset neighborhood range of the pixel point k, and taking the occurrence probability of each gray level in the preset neighborhood range as a parameter of an information entropy formula to obtain the local gray index of the pixel point k, so that the local gray index of the pixel point k is obtainedThe calculation formula of (2) is as follows:
in the method, in the process of the invention,is a local gray scale index of the pixel point k,for the total number of gray levels of pixel points within the preset neighborhood of pixel point k,the occurrence probability of gray level u in a preset neighborhood range of the pixel point k is obtained;is a logarithmic function based on a constant 2.
The probability of occurrenceThe calculation method of (1) is as follows: the ratio of the number of pixels corresponding to the gray level u in the preset neighborhood range of the pixel k to the total number of pixels in the preset neighborhood range is taken as the occurrence probability of the gray level u in the preset neighborhood range of the pixel kWhen the number of the pixel points corresponding to the gray level u in the preset neighborhood range of the pixel point k is larger, the probability of occurrenceThe larger the pixel point k, the larger the local gray index of the pixel point k isThe larger the pixel point k, the more disordered the gray distribution in the preset neighborhood range of the pixel point k is indicated, the larger the amount of information contained is, and the more enhancement processing is needed to be carried out on the pixel point k.
(2) Analyzing from the aspect of spatial distribution to obtain the spatial distribution index of the pixel points: for any gray level in a preset neighborhood range of each pixel point, respectively counting the number of edge pixel points corresponding to the gray level in each scale window as a first number, and counting the number of pixel points corresponding to the gray level in the preset neighborhood range as a second number; taking the ratio of the first quantity to the second quantity as the occurrence probability of gray scales in each scale window; for any scale window of gray level, taking the logarithm of the occurrence probability taking the natural constant e as a base as a first logarithmic value, and taking the product of the occurrence probability and the first logarithmic value as a second logarithmic value; taking the opposite number of the sum of the second pair of numerical values corresponding to all scale windows as a gray level distribution index of gray level; and taking the sum of the gray level distribution indexes of each gray level in the preset neighborhood range of each pixel point as the spatial distribution index of the corresponding pixel point.
As an example, from the visual feature, if the distribution of a certain gray level is more concentrated in a preset neighborhood, the visual impact is larger, so the invention extracts the spatial distribution index of the pixel points in the preset neighborhood.
The size of the pixel point k is as followsThe preset neighborhood range of the pixel point k can be divided into a plurality of scale spans, the number of the scale windows is T, the number T of the scale windows in the invention takes the checked value of 5, the preset neighborhood range of the pixel point k can obtain 5 scale windows, the T scale window has a corresponding scale span,the sizes of the 5 scale windows are in turnAnd the 5 scale windows all take the pixel point k as a center point.
Taking gray level u of a preset neighborhood range of a pixel point k as an example, counting the gray level u pairs in a t scale window of the pixel point kNumber of pixels to be appliedAnd counting the number of pixel points corresponding to the gray level u in the preset neighborhood range of the pixel point kWill beThe occurrence probability of the gray level u in the t-th scale window of the pixel point k is represented, the occurrence probability of the gray level u in each scale window of the pixel point k is obtained, and the occurrence probability of the gray level u in each scale window of the pixel point k is taken as a parameter to obtain a gray level distribution index of the gray level u.
Gray level distribution index of gray level u in preset neighborhood range of pixel point kThe calculation formula of (2) is as follows:
in the method, in the process of the invention,is a gray level distribution index of gray level u in a preset neighborhood range of the pixel point k,for the number of scale windows within a preset neighborhood of pixel k,for the number of pixels corresponding to gray level u in the t-th scale window of pixel k,the number of the pixel points corresponding to the gray level u in the preset neighborhood range of the pixel point k is set;based on natural constant eA logarithmic function.
It should be noted that the number of the substrates,the occurrence probability of the gray level u in the t scale window of the pixel point k is represented, and the calculation method of the occurrence probability is as follows: the number of pixel points corresponding to gray level u in the t scale window of pixel point kNumber of pixels corresponding to gray level u in preset neighborhoodWhen the number of the pixel points corresponding to the gray scale in each scale window of the pixel point k is larger, the probability of occurrenceThe larger the gray level distribution index of the gray level u in the preset neighborhood range of the pixel point k is, the moreThe larger the gray level u is, the more scattered the gray level u is in a preset neighborhood range; gray level distribution index of gray level u in preset neighborhood range of pixel point kThe larger the gray level u is, the higher the aggregation degree of the spatial distribution of the gray level u in the preset neighborhood range is, the larger the visual influence is, and the higher the saliency is.
According to the gray level distribution index of each gray level in the preset neighborhood range of the pixel point k, acquiring the space distribution index of the pixel point k, namely respectively calculating the gray level distribution index of each gray level in the preset neighborhood range of the pixel point kThe sum of the gray level distribution indexes of all gray levels in the preset neighborhood range of the pixel point k is recorded asWill beAs an index of the spatial distribution of pixel k.
(3) Analyzing from the aspect of structural distribution to obtain structural distribution indexes of the pixel points: the gray level difference between each pixel point and each corresponding neighborhood pixel point is respectively obtained, the square of each gray level difference is taken as a first difference value, the evolution of the mean value of the first difference value is calculated as a second difference value, and the mean value of the second difference values of all pixel points in the preset neighborhood range of each pixel point is taken as a structural distribution index of the corresponding pixel point.
As an example, to further improve the extraction accuracy of the pixel feature, a structural distribution index representing the local detail change condition of the pixel is obtained based on the gray value of the neighboring pixel of each pixel in the preset neighboring region.
Taking any one pixel point in a preset neighborhood range of the pixel point k, taking the pixel point c as an example, respectively obtaining gray level difference values between each four-neighborhood pixel point of the pixel point c and the pixel point c, and sequentially marking as followsWherein, the method comprises the steps of, wherein,is the first gray level difference value between the first four adjacent pixel points of the pixel point c and the pixel point c,is the second gray level difference between the second four-adjacent pixel point of the pixel point c and the pixel point c,is the third gray level difference value between the third four adjacent domain pixel point of the pixel point c and the pixel point c,a fourth gray level difference value between a fourth four-adjacent-domain pixel point of the pixel point c and the pixel point c; according to the first gray difference value, the second gray difference value and the third gray of the pixel point cAcquiring a first gray difference value, a second gray difference value, a third gray difference value and a fourth gray difference value of each pixel point in a preset neighborhood range of the pixel point k, and acquiring a structural distribution index of the pixel point k by combining the first gray difference value, the second gray difference value, the third gray difference value and the fourth gray difference value of each pixel point in the preset neighborhood range of the pixel point kThe calculation formula of (2) is as follows:
in the method, in the process of the invention,is the structural distribution index of the pixel point k,is the first gray level difference value of pixel c,is the second gray level difference of pixel c,is the third gray level difference value of pixel c,a fourth gray difference value for pixel c,the size of the pixel point k isThe number of pixels within the preset neighborhood of (a) is set.
It should be noted that, when the gray difference between each four neighboring pixel points of the pixel point c and the pixel point c in the preset neighborhood range of the pixel point k is larger, that isThe larger the pixel points are, the more obvious the detail change at the pixel point c in the preset neighborhood range is, because the structural distribution index of the pixel point k is the second difference value of all the pixel pointsThe more the image detail information at the pixel point k, the larger the structural distribution index of the pixel point k.
Step S3: combining the local gray scale index, the spatial distribution index and the structural distribution index to obtain a characteristic index of each pixel point; and enhancing the panoramic image based on the characteristic index to obtain a panoramic enhanced image.
The method and the device mainly carry out self-adaptive enhancement on the corresponding pixel points based on the characteristic indexes of the pixel points, do not need to carry out special enhancement on the areas which are uniformly distributed and contain less information, and do not need to carry out corresponding enhancement treatment on the areas which contain more image detail information, so that different enhancement treatment effects of different pixel points are realized, and further the enhancement effect of the panoramic image is improved. The specific method of the characteristic index of the pixel point is as follows: taking a value obtained by setting a first constant as a base and taking a spatial distribution index as an index as a first result; taking the local gray index as a numerator, and taking the ratio obtained by taking the first result as a denominator as a second result; and taking the product of the structural distribution index and the second result as the characteristic index of the pixel point.
As an example, the local gray indexes of the pixel points k are respectively obtained by the above methodIndex of spatial distributionStructural distribution indexBased on the three indexes of the pixel point k, acquiring a characteristic index for representing the characteristic significance of the pixel point k, and then obtaining the characteristic index of the pixel point kThe calculation formula of (2) is as follows:
in the method, in the process of the invention,is a characteristic index of the pixel point k,is a local gray scale index of the pixel point k,is an index of the spatial distribution of the pixel point k,is the structural distribution index of the pixel point k;is an exponential function based on a natural constant e.
Note that, when the local gray index of the pixel point k isThe larger the pixel point k is, the more uneven the gray distribution in the preset neighborhood range of the pixel point k is, the larger the information quantity contained in the pixel point k is, the more enhancement processing is needed to be carried out on the pixel point k, and the larger the characteristic index of the pixel point k is; index of spatial distribution of pixel point kThe smaller the gray level of the pixel point k is, the higher the aggregation degree of the spatial distribution of the gray level in a preset neighborhood range is, the larger the visual influence is, and the larger the enhancement degree of the pixel point k is required, the larger the characteristic index of the pixel point k is; structural distribution index of pixel point kThe larger the pixel point k, the more obvious the detail change of each pixel point in the preset neighborhood range of the pixel point k is, so that the more the image detail information of the pixel point k is, the more important the pixel point k is, and the more the pixel point k needs to be enhanced, the larger the characteristic index of the pixel point k is.
The characteristics of each pixel point in the panoramic image can be analyzed based on the characteristic indexes, the pixel points with large information content and high importance degree are subjected to remarkable treatment, and the pixel points with larger characteristic indexes are enhanced; and for the pixel points with smaller characteristic indexes and lower importance, the gray value of the pixel point is subjected to inhibition treatment so as to improve the contrast of the panoramic image and realize the self-adaptive enhancement effect of the panoramic image.
The method for enhancing the panoramic image based on the characteristic index to obtain the panoramic enhanced image comprises the following steps: carrying out normalization processing on the characteristic index of each pixel point in the panoramic image to obtain a normalized characteristic index corresponding to each pixel point; setting a first threshold value and a second threshold value, enabling the first threshold value to be smaller than the second threshold value, and taking the product of the gray value of the pixel point and the normalized characteristic index as the enhanced gray value of the corresponding pixel point when the normalized characteristic index of the pixel point is smaller than or equal to the first threshold value; when the normalized characteristic index of the pixel point is larger than the first threshold value and smaller than the second threshold value, the gray value of the corresponding pixel point is kept unchanged; when the normalized characteristic index of the pixel point is larger than or equal to a second threshold value, calculating and setting the sum of the second constant and the normalized characteristic index as a third result, and taking the product of the gray value of the pixel point and the third result as an enhanced gray value of the corresponding pixel point; the image formed by the enhanced gray value of each pixel point in the panoramic image is a panoramic enhanced image.
As an example, the feature index of each pixel in the panoramic image is obtained, the feature index of the pixel is normalized for facilitating the subsequent visual analysis, the normalized feature index corresponding to each pixel is obtained, and the normalized feature index of each pixel is ensured to be in. The process of adaptively enhancing each pixel point in the panoramic image is as follows:
in the method, in the process of the invention,is given by the coordinatesThe gray value before the self-adaptive enhancement is carried out on the pixel points of the (C),is given by the coordinatesThe pixel points of the (1) are subjected to self-adaptive enhancement to enhance gray values,is given by the coordinatesNormalized feature indexes of pixel points of (a);taking the checked value as 0.3 for the first threshold value;for the second threshold, the checked value is 0.6.
When the coordinates areNormalized feature index of pixel points of (a)The smaller the pixel point is, the lower the importance degree of the pixel point is, and in order to improve the contrast of the image, the gray value of the pixel point needs to be suppressed, so that the enhancement gray value of the pixel point after self-adaptive enhancement is smaller; when sittingMarked asNormalized feature index of pixel points of (a)The larger the pixel point is, the higher the importance degree of the pixel point is, the larger the information content is, and the enhancement processing is required to be carried out on the gray value of the pixel point, so that the enhancement gray value of the pixel point after self-adaptive enhancement is larger.
The method carries out self-adaptive enhancement on each pixel point of the panoramic image, acquires the enhancement gray value of each pixel point after self-adaptive enhancement processing, and takes the image formed by the enhancement gray value of each pixel point in the panoramic image as the panoramic enhancement image.
Step S4: dividing the panoramic enhanced image into at least two super-pixel blocks, classifying the super-pixel blocks according to the feature similarity of gray distribution features among the super-pixel blocks, and identifying each sub-region according to the classification result.
The panoramic enhancement image subjected to the self-adaptive enhancement processing increases the contrast of the image, improves the feature definition of each pixel point in the panoramic enhancement image, and is convenient for the subsequent more accurate segmentation of the panoramic enhancement image.
Firstly, performing super-pixel segmentation on a panoramic enhanced image preliminarily to obtain a plurality of super-pixel blocks, segmenting the panoramic enhanced image so as to identify each region of the panoramic enhanced image, achieving the purpose of improving the segmentation accuracy of the panoramic enhanced image, and setting the number of segmented super-pixel blocks as N.
The number N of superpixel blocks in the embodiment of the present invention takes the checked value 300.
It should be noted that, in the present invention, the super-pixel segmentation technique is selected to segment the panoramic enhanced image, and a specific method is not described herein, which is a technical means known to those skilled in the art.
Secondly, considering that in the process of segmenting the super-pixel blocks, the panoramic enhanced image can be segmented more finely by setting a larger number of the super-pixel blocks, but the problem of over-segmentation exists, and in order to improve the box segmentation precision, the super-pixel blocks obtained by primarily segmenting the super-pixel blocks of the panoramic enhanced image are further analyzed.
Taking any super-pixel block in the panoramic enhanced image, taking the super-pixel block n as an example, and constructing a Gaussian model based on gray values of all pixel points in the super-pixel block nAcquiring a Gaussian model corresponding to the super pixel block nMean of (2)Sum of variances. It should be noted that the construction technology of the gaussian model is a well-known technology, and is not specifically described herein.
In order to improve the dividing precision of the super pixel blocks, the characteristics of the super pixel blocks are further extracted, and the gray entropy of each super pixel block is obtained. The method for acquiring the gray distribution characteristics of the super pixel block comprises the following steps: for any super pixel block, filtering the super pixel block to obtain a texture extraction gray scale map, and obtaining the image entropy of the texture extraction gray scale map; for any super-pixel block, a Gaussian model is built according to gray values of pixel points in the super-pixel block, the mean value and the variance of the Gaussian model are obtained, the gray entropy and the mean value and the variance of the Gaussian model form a feature vector of the super-pixel block, and the feature vector is used as the gray distribution feature.
As an example, filtering the super-pixel block n by a Gabor filter to obtain a texture extraction gray scale image corresponding to the super-pixel block n, obtaining entropy of the corresponding texture extraction gray scale image by image entropy, and taking the corresponding entropy as gray scale entropy of the super-pixel block nThe method comprises the steps of carrying out a first treatment on the surface of the When the gray entropy of the super pixel block nThe larger the texture distribution within the superpixel block n, the more chaotic it is shown; when the gray entropy of the super pixel block nThe smaller indicates a more uniform texture distribution within the superpixel block n. Taking the sum of the super pixel blocks n as an example, forming a feature vector of the corresponding super pixel block based on the mean and variance of the Gaussian model corresponding to the super pixel block and the image entropy, wherein the feature vector of the super pixel block n isI.e. feature vector isIs a gray scale distribution characteristic of the super pixel block n. It should be noted that, the image entropy is a known technique, and is not specifically described herein.
And acquiring the characteristic similarity between the super pixel blocks based on the gray distribution characteristics of any two super pixel blocks. The method for acquiring the characteristic similarity between the super pixel blocks comprises the following steps: and calculating Euclidean distance between gray level distribution characteristics of any two super pixel blocks as characteristic distance, and taking a result obtained by performing negative correlation mapping on the characteristic distance as characteristic similarity between the two corresponding super pixel blocks.
Taking any two super pixel blocks in the panorama enhancement map as an example, taking the super pixel block n and the super pixel block s as examples, and obtaining the gray distribution characteristic of the super pixel block n as followsAnd the gray scale distribution of the super pixel block s is characterized byCalculating gray scale distribution characteristics of super pixel block nGray scale distribution characteristics with super pixel block sEuclidean distance between. Taking the integer 2 as a molecule, taking the natural constant e as a base and Euclidean distanceThe sum of the value obtained for the exponential function of the index added to the integer 1 is used as the denominator, and the obtained ratio is used as the characteristic similarity between the super pixel block n and the super pixel block s. Feature similarity between superpixel block n and superpixel block sThe calculation formula of (2) is as follows:
in the method, in the process of the invention,for the feature similarity between the super pixel block n and the super pixel block s,is a feature vectorAnd feature vectorEuclidean distance between;Is a natural constant.
When the feature vector isAnd feature vectorEuclidean distance betweenSmaller, indicating a higher degree of similarity between superpixel block n and superpixel block s, the feature similarity between superpixel block n and superpixel block sThe larger; when the feature vectorAnd feature vectorEuclidean distance betweenThe larger the difference between the super pixel block n and the super pixel block s is, the feature similarity between the super pixel block n and the super pixel block s is indicatedThe smaller; the value range of the characteristic similarity of any two super pixel blocks is。
Based on the feature similarity between any two super pixel blocks, classifying the super pixel blocks to realize the division of the panoramic enhanced image. The specific method for classifying the super pixel blocks comprises the following steps: and setting an aggregation threshold, and classifying the two super-pixel blocks into one category when the feature similarity between the two super-pixel blocks is larger than the aggregation threshold to obtain at least two categories, wherein each category corresponds to one sub-region. The super pixel blocks with higher similarity are classified into one category, so that the segmentation precision of the panoramic enhanced image can be improved, and the problem of over segmentation is effectively avoided.
In the embodiment of the invention, the aggregation threshold takes an empirical value of 0.75.
So far, the self-adaptive enhancement processing of the panoramic image is completed, the panoramic enhancement image obtained after the enhancement processing is subjected to the segmentation processing, and each subarea of the panoramic enhancement image is accurately obtained.
In summary, in the embodiment of the present invention, local gray indexes are obtained according to gray levels in a preset neighborhood of pixel points in a panoramic image, spatial distribution indexes are obtained based on gray levels of pixel points at edges of a scale window, structural distribution indexes are obtained according to gray values of pixel points in the preset neighborhood of pixel points, and feature indexes are obtained by combining the three indexes; and enhancing the panoramic image based on the characteristic index to obtain a panoramic enhanced image, acquiring characteristic similarity according to the gray value and gray entropy of pixel points in a super pixel block in the panoramic enhanced image, and dividing the panoramic enhanced image into areas according to the characteristic similarity. According to the invention, the characteristic information of the pixel points is analyzed from the aspects of gray distribution, spatial distribution and structural distribution to obtain the characteristic index of the pixel points, and the panoramic image is subjected to self-adaptive enhancement processing based on the characteristic index, so that the enhancement effect of the panoramic image is improved.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
The foregoing description of the preferred embodiments of the present invention is not intended to be limiting, but rather, any modifications, equivalents, improvements, etc. that fall within the principles of the present invention are intended to be included within the scope of the present invention.
Claims (6)
1. An image enhancement and recognition method applied to panoramic detection of a box body is characterized by comprising the following steps:
acquiring a panoramic image of the box body;
obtaining a local gray index of each pixel point according to gray value distribution characteristics of each pixel point in the panoramic image in a preset neighborhood range; dividing at least two scale windows in a preset neighborhood range of each pixel point, and obtaining a spatial distribution index of the corresponding pixel point according to gray level distribution of the pixel point in each scale window; acquiring a structural distribution index of each pixel point based on the gray level difference of the pixel point and the neighborhood pixel point in a preset neighborhood range;
combining the local gray scale index, the spatial distribution index and the structural distribution index to obtain a characteristic index of each pixel point; enhancing the panoramic image based on the characteristic index to obtain a panoramic enhanced image;
dividing the panoramic enhanced image into at least two super-pixel blocks, classifying the super-pixel blocks according to the feature similarity of gray distribution features among the super-pixel blocks, and identifying each sub-region according to the classification result;
the method for acquiring the local gray index comprises the following steps:
counting the gray level of the pixel in a preset neighborhood range of each pixel, calculating information entropy based on each gray level in the preset neighborhood range, and taking the information entropy as a local gray index of the corresponding pixel;
the method for acquiring the spatial distribution index comprises the following steps:
for any gray level in a preset neighborhood range of each pixel, respectively counting the number of the pixels corresponding to the gray level in each scale window as a first number, and counting the number of the pixels corresponding to the gray level in the preset neighborhood range as a second number; taking the ratio of the first quantity to the second quantity as the occurrence probability of gray scales in each scale window; for any scale window of gray level, taking the logarithm of the occurrence probability taking the natural constant e as a base as a first logarithmic value, and taking the product of the occurrence probability and the first logarithmic value as a second logarithmic value; taking the opposite number of the sum of the second pair of numerical values corresponding to all scale windows as a gray level distribution index of gray level; taking the sum of the gray level distribution indexes of each gray level in the preset neighborhood range of each pixel point as the spatial distribution index of the corresponding pixel point;
the method for acquiring the structural distribution index comprises the following steps:
the gray level difference between each pixel point and each corresponding neighborhood pixel point is respectively obtained, the square of each gray level difference is taken as a first difference value, the evolution of the mean value of the first difference value is calculated as a second difference value, and the mean value of the second difference values of all pixel points in the preset neighborhood range of each pixel point is taken as a structural distribution index of the corresponding pixel point.
2. The method for enhancing and identifying an image applied to panoramic detection of a box according to claim 1, wherein the method for obtaining the characteristic index comprises the following steps:
taking a value obtained by setting a first constant as a base and taking a spatial distribution index as an index as a first result; taking the local gray index as a numerator, and taking the ratio obtained by taking the first result as a denominator as a second result; and taking the product of the structural distribution index and the second result as the characteristic index of the pixel point.
3. The method for enhancing and identifying the image applied to the panoramic detection of the box according to claim 1, wherein the method for enhancing the panoramic image based on the characteristic index to obtain the panoramic enhanced image comprises the following steps:
carrying out normalization processing on the characteristic index of each pixel point in the panoramic image to obtain a normalized characteristic index corresponding to each pixel point;
setting a first threshold value and a second threshold value, enabling the first threshold value to be smaller than the second threshold value, and taking the product of the gray value of the pixel point and the normalized characteristic index as the enhanced gray value of the corresponding pixel point when the normalized characteristic index of the pixel point is smaller than or equal to the first threshold value;
when the normalized characteristic index of the pixel point is larger than the first threshold value and smaller than the second threshold value, the gray value of the corresponding pixel point is kept unchanged;
when the normalized characteristic index of the pixel point is larger than or equal to a second threshold value, calculating and setting the sum of the second constant and the normalized characteristic index as a third result, and taking the product of the gray value of the pixel point and the third result as an enhanced gray value of the corresponding pixel point;
the image formed by the enhanced gray value of each pixel point in the panoramic image is a panoramic enhanced image.
4. The method for enhancing and identifying an image applied to panoramic detection of a box according to claim 1, wherein the method for acquiring the gray distribution characteristics comprises the following steps:
for any super pixel block, filtering the super pixel block to obtain a texture extraction gray scale map, and obtaining the gray entropy of the texture extraction gray scale map;
for any super-pixel block, a Gaussian model is built according to gray values of pixel points in the super-pixel block, the mean value and the variance of the Gaussian model are obtained, the gray entropy and the mean value and the variance of the Gaussian model form a feature vector of the super-pixel block, and the feature vector is used as the gray distribution feature.
5. The method for enhancing and identifying images for panoramic detection of a container according to claim 4, wherein the method for obtaining feature similarity comprises the steps of:
and calculating Euclidean distance between gray level distribution characteristics of any two super pixel blocks as characteristic distance, and taking a result obtained by performing negative correlation mapping on the characteristic distance as characteristic similarity between the two corresponding super pixel blocks.
6. The method for enhancing and identifying images for panoramic detection of a container according to claim 1, wherein said method for classifying super pixel blocks according to the feature similarity of gray scale distribution features between super pixel blocks comprises:
and setting an aggregation threshold, and classifying the two super-pixel blocks into one category when the feature similarity between the two super-pixel blocks is larger than the aggregation threshold to obtain at least two categories, wherein each category corresponds to one sub-region.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310179040.6A CN115861135B (en) | 2023-03-01 | 2023-03-01 | Image enhancement and recognition method applied to panoramic detection of box body |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310179040.6A CN115861135B (en) | 2023-03-01 | 2023-03-01 | Image enhancement and recognition method applied to panoramic detection of box body |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115861135A CN115861135A (en) | 2023-03-28 |
CN115861135B true CN115861135B (en) | 2023-05-23 |
Family
ID=85659409
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310179040.6A Active CN115861135B (en) | 2023-03-01 | 2023-03-01 | Image enhancement and recognition method applied to panoramic detection of box body |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115861135B (en) |
Families Citing this family (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116109658B (en) * | 2023-04-07 | 2023-06-20 | 山东金大丰机械有限公司 | Harvester control data processing method based on 5G technology |
CN116188465B (en) * | 2023-04-26 | 2023-07-04 | 济宁市保田农机技术推广专业合作社 | Crop growth state detection method based on image processing technology |
CN116233479B (en) * | 2023-04-28 | 2023-07-21 | 中译文娱科技(青岛)有限公司 | Live broadcast information content auditing system and method based on data processing |
CN116342588B (en) * | 2023-05-22 | 2023-08-11 | 徕兄健康科技(威海)有限责任公司 | Cerebrovascular image enhancement method |
CN116309609B (en) * | 2023-05-25 | 2023-08-04 | 山东曙岳车辆有限公司 | Intelligent detection method for welding corrugated plates of container door panels |
CN116385436B (en) * | 2023-06-02 | 2023-08-15 | 胜利油田中心医院 | Cholelithiasis auxiliary detection system based on CT image |
CN116452464B (en) * | 2023-06-09 | 2023-08-22 | 天津市肿瘤医院(天津医科大学肿瘤医院) | Chest image enhancement processing method based on deep learning |
CN116596806B (en) * | 2023-07-14 | 2023-09-19 | 山东绿洲智能科技有限公司 | Combined stacking regulation and control method for vision stacking robot |
CN116665137B (en) * | 2023-08-01 | 2023-10-10 | 聊城市彩烁农业科技有限公司 | Livestock breeding wastewater treatment method based on machine vision |
CN116704516B (en) * | 2023-08-07 | 2023-10-24 | 山东禾之源现代农业发展有限公司 | Visual inspection method for water-soluble fertilizer package |
CN117036347B (en) * | 2023-10-08 | 2024-02-02 | 山东柯林瑞尔管道工程有限公司 | Visual detection method and system for pipeline lining leakage based on image enhancement |
CN117115468B (en) * | 2023-10-19 | 2024-01-26 | 齐鲁工业大学(山东省科学院) | Image recognition method and system based on artificial intelligence |
CN117409373B (en) * | 2023-12-14 | 2024-02-09 | 艾信智慧医疗科技发展(苏州)有限公司 | Medical logistics box full-period intelligent monitoring system |
CN117455779B (en) * | 2023-12-22 | 2024-03-26 | 天津市胸科医院 | Auxiliary enhancement system of medical ultrasonic imaging instrument |
CN117475157B (en) * | 2023-12-25 | 2024-03-15 | 浙江大学山东(临沂)现代农业研究院 | Agricultural planting enhancement monitoring method based on unmanned aerial vehicle remote sensing |
CN117541484A (en) * | 2024-01-09 | 2024-02-09 | 巨野县龙祥面粉有限公司 | Image enhancement method for detecting bran star of flour |
CN117689590B (en) * | 2024-01-31 | 2024-04-16 | 天津灵境智游科技有限公司 | AR object interactive display method based on AI technology |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115294338A (en) * | 2022-09-29 | 2022-11-04 | 中威泵业(江苏)有限公司 | Impeller surface defect identification method |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100576246C (en) * | 2007-05-23 | 2009-12-30 | 华中科技大学 | A kind of image partition method based on attribute histogram |
CN106960427A (en) * | 2016-01-11 | 2017-07-18 | 中兴通讯股份有限公司 | The method and apparatus of image in 2 D code processing |
CN107666606B (en) * | 2016-07-29 | 2019-07-12 | 东南大学 | Binocular panoramic picture acquisition methods and device |
CN107730530A (en) * | 2017-10-31 | 2018-02-23 | 西华大学 | A kind of remote emergency management control method based on smart city |
CN108681737B (en) * | 2018-05-25 | 2022-06-07 | 长安大学 | Method for extracting image features under complex illumination |
CN115100201B (en) * | 2022-08-25 | 2022-11-11 | 淄博齐华制衣有限公司 | Blending defect detection method of flame-retardant fiber material |
CN115170572B (en) * | 2022-09-08 | 2022-11-08 | 山东瑞峰新材料科技有限公司 | BOPP composite film surface gluing quality monitoring method |
CN115512231B (en) * | 2022-11-15 | 2023-02-28 | 山东省国土空间数据和遥感技术研究院(山东省海域动态监视监测中心) | Remote sensing interpretation method suitable for homeland space ecological restoration |
-
2023
- 2023-03-01 CN CN202310179040.6A patent/CN115861135B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115294338A (en) * | 2022-09-29 | 2022-11-04 | 中威泵业(江苏)有限公司 | Impeller surface defect identification method |
Also Published As
Publication number | Publication date |
---|---|
CN115861135A (en) | 2023-03-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115861135B (en) | Image enhancement and recognition method applied to panoramic detection of box body | |
CN109522908B (en) | Image significance detection method based on region label fusion | |
CN110443128B (en) | Finger vein identification method based on SURF feature point accurate matching | |
CN110781885A (en) | Text detection method, device, medium and electronic equipment based on image processing | |
CN111340824B (en) | Image feature segmentation method based on data mining | |
CN108197644A (en) | A kind of image-recognizing method and device | |
CN109635733B (en) | Parking lot and vehicle target detection method based on visual saliency and queue correction | |
CN109035196B (en) | Saliency-based image local blur detection method | |
CN108829711B (en) | Image retrieval method based on multi-feature fusion | |
CN116664559B (en) | Machine vision-based memory bank damage rapid detection method | |
CN110415208A (en) | A kind of adaptive targets detection method and its device, equipment, storage medium | |
CN113609984A (en) | Pointer instrument reading identification method and device and electronic equipment | |
CN110852327A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN111199197A (en) | Image extraction method and processing equipment for face recognition | |
CN114444565A (en) | Image tampering detection method, terminal device and storage medium | |
CN117115117B (en) | Pathological image recognition method based on small sample, electronic equipment and storage medium | |
CN111612099B (en) | Texture image classification method and system based on local sorting difference refinement mode | |
CN107704864B (en) | Salient object detection method based on image object semantic detection | |
CN112633070A (en) | High-resolution remote sensing image building extraction method and system | |
CN115797607A (en) | Image optimization processing method for enhancing VR real effect | |
Dhar et al. | Interval type-2 fuzzy set and human vision based multi-scale geometric analysis for text-graphics segmentation | |
CN115033721A (en) | Image retrieval method based on big data | |
CN113744241A (en) | Cell image segmentation method based on improved SLIC algorithm | |
CN110276260B (en) | Commodity detection method based on depth camera | |
CN108154107B (en) | Method for determining scene category to which remote sensing image belongs |
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 |