CN115439675A - Complex feature target identification and classification method based on machine vision - Google Patents
Complex feature target identification and classification method based on machine vision Download PDFInfo
- Publication number
- CN115439675A CN115439675A CN202210935073.4A CN202210935073A CN115439675A CN 115439675 A CN115439675 A CN 115439675A CN 202210935073 A CN202210935073 A CN 202210935073A CN 115439675 A CN115439675 A CN 115439675A
- Authority
- CN
- China
- Prior art keywords
- image
- pixel
- identifying
- loss
- machine vision
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 239000002131 composite material Substances 0.000 claims abstract description 9
- 238000001514 detection method Methods 0.000 claims abstract description 9
- 230000006870 function Effects 0.000 claims description 24
- 238000001914 filtration Methods 0.000 claims description 12
- 238000005286 illumination Methods 0.000 claims description 12
- 239000011159 matrix material Substances 0.000 claims description 12
- 238000007781 pre-processing Methods 0.000 claims description 7
- 238000009499 grossing Methods 0.000 claims description 6
- 230000011218 segmentation Effects 0.000 claims description 6
- 238000013528 artificial neural network Methods 0.000 claims description 5
- 230000002401 inhibitory effect Effects 0.000 claims description 3
- 230000000717 retained effect Effects 0.000 claims description 3
- 230000009466 transformation Effects 0.000 claims description 3
- 238000013527 convolutional neural network Methods 0.000 abstract description 2
- 238000013135 deep learning Methods 0.000 abstract description 2
- 238000010801 machine learning Methods 0.000 abstract description 2
- 230000008569 process Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000001537 neural effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/762—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
- G06V10/763—Non-hierarchical techniques, e.g. based on statistics of modelling distributions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/30—Noise filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/34—Smoothing or thinning of the pattern; Morphological operations; Skeletonisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/36—Applying a local operator, i.e. means to operate on image points situated in the vicinity of a given point; Non-linear local filtering operations, e.g. median filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/07—Target detection
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Software Systems (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Databases & Information Systems (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Health & Medical Sciences (AREA)
- Probability & Statistics with Applications (AREA)
- Nonlinear Science (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to a method for identifying and classifying complex characteristic targets based on machine vision, which adopts a method of combining a target identification algorithm based on composite characteristics with a convolutional neural network to realize rapid identification and classification of the complex characteristic targets in a complex background, has good universality, introduces a machine learning and deep learning algorithm in the process of target detection and classification, improves the accuracy rate of target identification as much as possible, and greatly improves the efficiency of the algorithm.
Description
Technical Field
The invention relates to the technical field of industrial intelligent detection, in particular to a complex characteristic target identification and classification method based on machine vision.
Background
With the progress of related technologies such as computer science and image processing, image detection methods based on machine vision are increasingly used in the field of industrial surface detection applications. However, in complex image information, especially in detection targets with complex feature information, the accuracy and efficiency of the current algorithm for identifying and classifying such image targets are not ideal, and the application of artificial intelligence technology in related fields is greatly restricted.
Aiming at the problems, the invention provides a method for identifying and classifying complex characteristic targets based on machine vision, which realizes the rapid identification and classification of the complex characteristic targets in a complex background, has good universality, improves the target identification accuracy as much as possible, and greatly improves the efficiency of an algorithm.
Disclosure of Invention
The invention aims to overcome the problems in the prior art and provides a method for identifying and classifying complex characteristic targets based on machine vision.
In order to achieve the technical purpose and achieve the technical effect, the invention is realized by the following technical scheme:
a method for identifying and classifying complex feature targets based on machine vision comprises the following steps:
step S1: preprocessing an image, denoising and performing brightness compensation on the image with uneven illumination;
step S2: performing image threshold segmentation by adopting a target identification algorithm based on composite characteristics, forming a region corresponding to a live-action target by using the obtained subsets through division, reducing or eliminating image noise pollution, removing a non-edge pixel point set, only reserving part of candidate edges, and performing threshold lag by adopting high and low thresholds;
and step S3: carrying out image clustering to realize efficient marking on the characteristics;
and step S4: and identifying and classifying the features to achieve the aim of target detection.
Further, in step S1, the image preprocessing method includes: firstly, carrying out Gaussian filtering denoising on an image, and carrying out local processing on the processed image to carry out uneven illumination compensation; wherein,
the Gaussian filtering denoising adopts a two-dimensional zero-mean discrete Gaussian function as a smoothing filter, and sets cubic Gaussian filtering, wherein the two-dimensional Gaussian function is as follows:
after the image is denoised by Gaussian filtering for three times, locally processing the processed image to perform uneven illumination compensation, dividing the source image into NxM subblock regions, calculating the average gray value of each subblock to obtain a subblock brightness matrix of the source image, amplifying the subblock brightness difference matrix to the size of the source image by adopting a cubic interpolation method to obtain a brightness distribution matrix of the original image, and finally subtracting the original image from the brightness distribution matrix to obtain the image without uneven illumination.
Further, in step S2, the target identification algorithm based on the composite feature includes the following steps:
step S201: and (2) performing threshold segmentation on the image, namely dividing a pixel set in the image according to the gray level, wherein the divided subsets form areas corresponding to the real scene target:in the formula, T is a set gray value threshold value;
step S202: adopting a Gaussian smoothing filter to reduce or eliminate image noise pollution, wherein f (x, y) is an input image, and a Gaussian function is defined as:in formula, σ is a numerical variance, and a gaussian smooth output image is: f. of s (x,y)=G(x,y)*f(x,y);
Step S203: calculating gradient amplitude and direction, inhibiting non-maximum values, removing non-edge pixel point sets and only reserving partial candidate edges;
step S204: threshold hysteresis is carried out by adopting high and low thresholds, and the specific method comprises the following steps: if the amplitude of a certain pixel position in the image is larger than a set high threshold value, the pixel is reserved as an edge pixel; if the magnitude of the pixel location is less than the set low threshold, then the pixel is not identified as an edge pixel; if the magnitude of a pixel location is between the high and low thresholds, the pixel can only be retained as an edge pixel if it has connections to a pixel that is greater than the high threshold.
Further, in step S3, the method for clustering images includes the following steps:
step S301: randomly selecting K central points;
step S302: assigning each data point to its nearest center point;
step S303: recalculating the average value of the distances from the points in each class to the central point of the class;
step S304: assigning each data to its nearest center point;
step S305: step S303 and step S304 are repeated until all observations are no longer assigned or a maximum number of iterations is reached.
Further, in step S3, the method for clustering images includes the following steps:
step S301: randomly selecting K central points;
step S302: assigning each data point to its nearest center point;
step S303: recalculating the average value of the distances from the points in each class to the center point of the class;
step S304: assigning each data to its nearest central point;
step S305: step S303 and step S304 are repeated until all observations are no longer assigned or a maximum number of iterations is reached.
5. The method for identifying and classifying complex-feature targets based on machine vision according to claim 4, wherein in the step S3, the algorithm for identifying the targets comprises the following steps:
step S401: presetting anchor frames with different lengths and widths, and simultaneously using t x ,t y To represent the predicted object position, using t w ,t h To represent the predicted object dimensions;
step S402: finding the transformation of the anchor frame which is closest to the detected object shape and the object surrounding rectangle;
step S403: calculating loss by adopting a cross entropy function, and assuming that the object class label is y and the neural network output value isThen there are:
step S404: calculating the loss by using a mean square error function, assuming the marked position as t * The output of the neural network isThen there are:
in the formula, t *x 、t *y As a position parameter, t *w 、t *h As a dimensional parameter, L xy For loss of position parameter, L wh Loss of dimensional parameters;
step S405: and multiplying each loss function by corresponding weight respectively and adding the loss functions to obtain a cost function of the network:in the formula, λ is a weight parameter.
The beneficial effects of the invention are:
the method combines the target recognition algorithm based on the composite features with the convolutional neural network, realizes the rapid recognition and classification of the complex feature targets in the complex background, has good universality, introduces the machine learning and deep learning algorithm in the target detection and classification process, improves the target recognition accuracy as much as possible, and greatly improves the efficiency of the algorithm.
Drawings
FIG. 1 is a block flow diagram of the present invention;
FIG. 2 is a block flow diagram of image pre-processing in an embodiment of the invention;
FIG. 3 is a block diagram of a target recognition algorithm based on composite features according to an embodiment of the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
As shown in fig. 1, a method for identifying and classifying complex feature targets based on machine vision includes the following steps:
step S1: preprocessing an image, denoising and performing brightness compensation on the image with uneven illumination;
step S2: performing image threshold segmentation by adopting a target identification algorithm based on composite characteristics, forming a region corresponding to a live-action target by using the obtained subsets through division, reducing or eliminating image noise pollution, removing a non-edge pixel point set, only reserving part of candidate edges, and performing threshold lag by adopting high and low thresholds;
and step S3: carrying out image clustering to realize efficient marking on the characteristics;
and step S4: and identifying and classifying the features to achieve the aim of target detection.
As shown in fig. 2, in step S1, the image preprocessing method includes: firstly, carrying out Gaussian filtering denoising on an image, and carrying out local processing on the processed image to carry out uneven illumination compensation; wherein,
the Gaussian filtering denoising adopts a two-dimensional zero-mean discrete Gaussian function as a smoothing filter, and sets cubic Gaussian filtering, wherein the two-dimensional Gaussian function is as follows:
after the image is denoised by Gaussian filtering for three times, locally processing the processed image to perform uneven illumination compensation, dividing the source image into NxM subblock regions, calculating the average gray value of each subblock to obtain a subblock brightness matrix of the source image, amplifying the subblock brightness difference matrix to the size of the source image by adopting a cubic interpolation method to obtain a brightness distribution matrix of the original image, and finally subtracting the original image from the brightness distribution matrix to obtain the image without uneven illumination.
As shown in fig. 3, in step S2, the target identification algorithm based on the composite feature includes the following steps:
step S201: and (2) image threshold segmentation, namely dividing a pixel set in an image according to gray levels, wherein the divided subsets form areas corresponding to the real scene target:in the formula, T is a set gray value threshold;
step S202: adopting a Gaussian smoothing filter to reduce or eliminate image noise pollution, wherein f (x, y) is an input image, and a Gaussian function is defined as:in the formula, sigma is a numerical formulaPoor, gaussian smoothed output image is: f. of s (x,y)=G(x,y)*f(x,y);
Step S203: calculating gradient amplitude and direction, inhibiting non-maximum values, removing non-edge pixel point sets and only reserving partial candidate edges;
step S204: threshold hysteresis is carried out by adopting high and low thresholds, and the specific method comprises the following steps: if the amplitude of a certain pixel position in the image is larger than a set high threshold value, the pixel is reserved as an edge pixel; if the magnitude of the pixel location is less than the set low threshold, then the pixel is not identified as an edge pixel; if the magnitude of a pixel location is between the high and low thresholds, the pixel can only be retained as an edge pixel if it has connections to a pixel that is greater than the high threshold.
In step S3, the image clustering method includes the following steps:
step S301: randomly selecting K central points;
step S302: assigning each data point to its nearest center point;
step S303: recalculating the average value of the distances from the points in each class to the center point of the class;
step S304: assigning each data to its nearest central point;
step S305: step S303 and step S304 are repeated until all observations are no longer assigned or the maximum number of iterations is reached.
5. The method for identifying and classifying complex-feature targets based on machine vision according to claim 4, wherein in the step S3, the algorithm for identifying the targets comprises the following steps:
step S401: presetting anchor frames with different lengths and widths, and using t x ,t y To represent the predicted object position, using t w ,t h To represent the predicted object dimensions;
step S402: finding the transformation of the anchor frame which is closest to the detected object shape and the object surrounding rectangle;
step S403: calculating loss by adopting a cross entropy function, and assuming that the object class label is y, outputting a value by a neural networkIs composed ofThen there are:
step S404: calculating the loss by using a mean square error function, assuming the marked position as t * The output of the neural network isThen there are:
in the formula, t *x 、t *y As a position parameter, t *w 、t *h As a dimensional parameter, L xy For loss of position parameter, L wh Loss of dimensional parameters;
step S405: and multiplying each loss function by corresponding weight respectively and adding the loss functions to obtain a cost function of the network:in the formula, λ is a weight parameter.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (5)
1. A method for identifying and classifying complex feature targets based on machine vision is characterized by comprising the following steps:
step S1: preprocessing an image, denoising and performing brightness compensation on the image with uneven illumination;
step S2: performing image threshold segmentation by adopting a target identification algorithm based on composite characteristics, forming a region corresponding to a live-action target by using the obtained subsets through division, reducing or eliminating image noise pollution, removing a non-edge pixel point set, only reserving part of candidate edges, and performing threshold lag by adopting high and low thresholds;
and step S3: carrying out image clustering to realize efficient marking on the characteristics;
and step S4: and identifying and classifying the features to achieve the aim of target detection.
2. The method for identifying and classifying a complex-feature target based on machine vision according to claim 1, wherein in step S1, the image preprocessing method is: firstly, carrying out Gaussian filtering denoising on an image, and carrying out local processing on the processed image to carry out uneven illumination compensation; wherein,
the Gaussian filtering denoising adopts a two-dimensional zero-mean discrete Gaussian function as a smoothing filter, and sets cubic Gaussian filtering, wherein the two-dimensional Gaussian function is as follows:in the formula (I), wherein,is a numerical variance;
after the image is denoised by Gaussian filtering for three times, locally processing the processed image to perform uneven illumination compensation, dividing the source image into N x M subblock areas, calculating the average gray value of each subblock to obtain a subblock brightness matrix of the source image, amplifying the subblock brightness difference matrix to the size of the source image by adopting a cubic interpolation method to obtain a brightness distribution matrix of the source image, and finally subtracting the source image from the brightness distribution matrix to obtain the image without uneven illumination.
3. The method for identifying and classifying complex-feature objects based on machine vision according to claim 2, wherein in the step S2, the object identification algorithm based on composite features comprises the following steps:
step S201: and (2) performing threshold segmentation on the image, namely dividing a pixel set in the image according to the gray level, wherein the divided subsets form areas corresponding to the real scene target:wherein T is a set gray value threshold;
step S202: reducing or eliminating image noise pollution by using Gaussian smoothing filterFor an input image, the gaussian function is defined as:in the formula of ChineseFor the numerical variance, the gaussian smoothed output image is:;
step S203: calculating gradient amplitude and direction, inhibiting non-maximum values, removing non-edge pixel point sets, and only reserving partial candidate edges;
step S204: threshold hysteresis is carried out by adopting high and low thresholds, and the specific method comprises the following steps: if the amplitude of a certain pixel position in the image is larger than a set high threshold value, the pixel is reserved as an edge pixel; if the magnitude of the pixel location is less than the set low threshold, then the pixel is not identified as an edge pixel; if the magnitude of a pixel location is between the high and low thresholds, the pixel can only be retained as an edge pixel if it has connections to a pixel that is greater than the high threshold.
4. The method for identifying and classifying complex-feature targets based on machine vision according to claim 3, wherein in the step S3, the method for clustering images comprises the following steps:
step S301: randomly selecting K central points;
step S302: assigning each data point to its nearest center point;
step S303: recalculating the average value of the distances from the points in each class to the central point of the class;
step S304: assigning each data to its nearest central point;
step S305: step S303 and step S304 are repeated until all observations are no longer assigned or the maximum number of iterations is reached.
5. The method for identifying and classifying complex-feature targets based on machine vision according to claim 4, wherein in the step S3, the algorithm for identifying the targets comprises the following steps:
step S401: presetting anchor frames with different lengths and widths, and simultaneously using t x ,t y To represent the predicted object position, using t w ,t h To represent the predicted object size;
step S402: finding the transformation of the anchor frame closest to the shape of the detected object and the object enclosing rectangle;
step S403: calculating loss by adopting a cross entropy function, and assuming that the object class label is y and the neural network output value isThen, there are:in the formula (I), wherein,is a loss value;
step S404: the loss is calculated using the mean square error function, assuming the annotated position isThe output of the neural network isThen, there are:in the formula, t *x 、t *y As a position parameter, t *w 、t *h As a dimensional parameter, L xy For loss of position parameter, L wh Loss of dimensional parameters;
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210935073.4A CN115439675A (en) | 2022-08-05 | 2022-08-05 | Complex feature target identification and classification method based on machine vision |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210935073.4A CN115439675A (en) | 2022-08-05 | 2022-08-05 | Complex feature target identification and classification method based on machine vision |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115439675A true CN115439675A (en) | 2022-12-06 |
Family
ID=84242679
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210935073.4A Pending CN115439675A (en) | 2022-08-05 | 2022-08-05 | Complex feature target identification and classification method based on machine vision |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115439675A (en) |
-
2022
- 2022-08-05 CN CN202210935073.4A patent/CN115439675A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112819772B (en) | High-precision rapid pattern detection and recognition method | |
CN109035274B (en) | Document image binarization method based on background estimation and U-shaped convolution neural network | |
CN1885317A (en) | Adaptive edge detection method based on morphology and information entropy | |
CN103996209A (en) | Infrared vessel object segmentation method based on salient region detection | |
CN108537816B (en) | Salient object segmentation method based on superpixel and background connection prior | |
CN111583279A (en) | Super-pixel image segmentation method based on PCBA | |
CN116071374B (en) | Lane line instance segmentation method and system | |
CN112686248A (en) | Certificate increase and decrease type detection method and device, readable storage medium and terminal | |
CN110634142B (en) | Complex vehicle road image boundary optimization method | |
CN109308709B (en) | Vibe moving target detection algorithm based on image segmentation | |
CN111027564A (en) | Low-illumination imaging license plate recognition method and device based on deep learning integration | |
CN113205494B (en) | Infrared small target detection method and system based on adaptive scale image block weighting difference measurement | |
CN109636822A (en) | A kind of improvement Canny adaptive edge extracting method based on new building subordinating degree function | |
CN111914749A (en) | Lane line recognition method and system based on neural network | |
CN115439675A (en) | Complex feature target identification and classification method based on machine vision | |
CN113284232B (en) | Optical flow tracking method based on quadtree | |
Aung et al. | Study for license plate detection | |
CN114549649A (en) | Feature matching-based rapid identification method for scanned map point symbols | |
Kumar et al. | Pixel-based skin color classifier: A review | |
CN112419337A (en) | Detection method for robot grabbing position under complex background | |
CN113378876B (en) | Method for self-adaptively determining size of target and size of receptive field | |
Nair et al. | A survey of techniques for license plate detection and recognition | |
Yuan et al. | Single Image Defogging Method based on Deep Learning | |
Kumar et al. | Computationally Efficient Scaled Clustering for Perceptually Invisible Image Intensity Tuning | |
Xiao et al. | Road detection based on superpixels and anisotropic heat diffusion |
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 |