Image processing-based target classification method, device, medium, and apparatus

By segmenting water chestnut images and extracting texture features using the LBP algorithm, combined with a target object classification model, the problem of environmental factors affecting water chestnut quality inspection was solved, enabling accurate identification and efficient sorting of good and bad water chestnuts.

CN120599374BActive Publication Date: 2026-05-12HUBEI TIANJINGHU AGRI TECH SERVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUBEI TIANJINGHU AGRI TECH SERVICE CO LTD
Filing Date
2025-07-07
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In the current technology for quality inspection of water chestnuts, the image acquisition process is easily affected by external environmental factors, resulting in large errors in color analysis methods and an inability to accurately identify the subtle local features of water chestnuts, thus affecting the sorting accuracy.

Method used

采用基于LBP(局部二值模式)算法对菱角图像进行分块处理,获取纹理特征向量,结合目标物分类模型,识别菱角的好坏果。

Benefits of technology

提高了菱角品质检测的准确率,有效避免了外部环境因素对图像特征提取的影响,精准识别局部细微特征,提升了分拣的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120599374B_ABST
    Figure CN120599374B_ABST
Patent Text Reader

Abstract

The application provides a target classification method and device based on image processing, a medium and equipment, relates to the technical field of image processing, and comprises the following steps: acquiring a target image to be processed; performing horizontal and vertical sliding segmentation on the target image to be processed according to a b-pixel * b-pixel sliding window and at a c-pixel step to obtain a plurality of pixel blocks to be processed; performing LBP processing on each pixel block to be processed to obtain a texture feature vector T of the target; and inputting T into a target classification model to obtain a classification result. The application can make a judgment according to more accurate feature information, thereby greatly improving the accuracy of good and bad fruit area differentiation of water caltrop, and meeting the actual needs of water caltrop quality detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and in particular to a method, apparatus, medium and device for object classification based on image processing. Background Technology

[0002] In the field of water chestnut quality inspection and sorting, quickly and accurately distinguishing between good and bad fruit is of great significance for improving product quality and reducing labor costs. Currently, most mainstream methods for distinguishing between good and bad water chestnuts are based on image color analysis technology. This involves acquiring images of water chestnuts and using image processing algorithms to extract color features from the images, thereby determining the quality of the water chestnuts.

[0003] However, this method has significant technical drawbacks. First, the image acquisition process is highly susceptible to external environmental factors, such as light intensity, shooting angle, and ambient reflection. These factors can cause color deviations in the acquired water chestnut images, leading to significant errors in the judgment of good and bad fruit based on color features. Second, water chestnut quality defects often exhibit localized and subtle characteristics, such as localized mold or insect damage. Existing global color-based analysis methods can only obtain overall color distribution information of the water chestnut, failing to accurately capture these subtle local features. This results in some water chestnuts with local defects being misjudged as good fruit, severely impacting sorting accuracy and product quality. Therefore, there is an urgent need for a technology that can overcome external environmental interference while accurately identifying subtle local features of water chestnuts to distinguish between good and bad fruit, meeting the practical needs of water chestnut quality inspection. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides a target object classification method, apparatus, medium, and device based on image processing, which at least partially solves the problems existing in the prior art.

[0005] In a first aspect of this application, an image processing-based object classification method is provided, the method comprising:

[0006] S100, acquire the image of the target object to be processed; wherein the size of the image of the target object to be processed is a pixels × a pixels.

[0007] S200, based on a sliding window of b pixels × b pixels, the image of the target object to be processed is divided into horizontal and vertical sliding blocks with a step size of c pixels to obtain several pixel blocks to be processed; where b < a.

[0008] S300, perform LBP processing on each pixel block to be processed to obtain the target object texture feature vector T = (T1, T2, ..., T...). i ,…,T n ); i = 1, 2, ..., n; where n is the number of pixel blocks to be processed; n = a / b; T iThe texture feature corresponding to the i-th pixel block to be processed; each pixel in each pixel block to be processed has a corresponding LBP value; T i = (T i,1 T i,2 ,…,T i,j ,…,T i,m j = 1, 2, ..., m; m is the number of possible LBP values ​​for each pixel in the pixel block to be processed; T i,j The number of pixels corresponding to the possible values ​​of the j-th LBP value in the i-th pixel block to be processed.

[0009] S400, input T into the target object classification model to obtain the classification result; wherein, the classification result is either the target object in the target object image to be processed is a good result or the target object in the target object image to be processed is a bad result.

[0010] In a second aspect of this application, an object classification device based on image processing is provided, the device comprising:

[0011] The image acquisition unit is used to acquire an image of the target object to be processed; wherein the size of the image of the target object to be processed is a pixels × a pixels.

[0012] The block unit is used to slide the image of the target object to be processed into blocks horizontally and vertically according to a sliding window of b pixels × b pixels with a step size of c pixels, so as to obtain a number of pixel blocks to be processed; where b < a.

[0013] The processing unit is used to perform LBP processing on each pixel block to be processed to obtain the target object texture feature vector T = (T1, T2, ..., T...). i ,…,T n ); i = 1, 2, ..., n; where n is the number of pixel blocks to be processed; n = a / b; T i The texture feature corresponding to the i-th pixel block to be processed; each pixel in each pixel block to be processed has a corresponding LBP value; T i = (T i,1 T i,2 ,…,T i,j ,…,T i,m j = 1, 2, ..., m; m is the number of possible LBP values ​​for each pixel in the pixel block to be processed; T i,j The number of pixels corresponding to the possible values ​​of the j-th LBP value in the i-th pixel block to be processed.

[0014] The classification unit is used to input T into the target object classification model to obtain the classification result; wherein the classification result is either the target object in the image to be processed is a good result or the target object in the image to be processed is a bad result.

[0015] In a third aspect of this application, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored in the storage medium, and the at least one instruction or at least one program is loaded and executed by a processor to implement the aforementioned target object classification method based on image processing.

[0016] In a fourth aspect of this application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0017] This application has at least the following beneficial effects:

[0018] The object classification method based on image processing provided in this application first obtains a fixed-size (a pixels × a pixels) image of the object to be processed, providing a standardized data foundation for subsequent processing. Then, a sliding window of b pixels × b pixels is used to divide the object image into blocks with a step size of c pixels, resulting in several pixel blocks to be processed. This allows for the subdivision of a diamond-shaped image into multiple local regions. Since the quality defects of diamonds are mostly small local features, block processing allows for the individual extraction and analysis of these local defect features, effectively avoiding the problem of missing local defects due to global analysis. Furthermore, each pixel block is processed using LBP (Local Binary Pattern) to obtain the object texture feature vector T. The LBP algorithm is robust to changes in illumination, effectively eliminating the influence of external environmental factors such as light intensity and ambient reflection on image feature extraction. It can extract stable texture features, reducing the impact of image color deviation caused by changes in the external environment on the judgment results, and improving the accuracy and reliability of feature extraction. Finally, the extracted texture feature vector T is input into the object classification model to obtain the classification result. Because it has effectively extracted stable texture information containing subtle local features, compared to the misjudgment problem caused by global color analysis in the background technology, this classification model can make judgments based on more accurate feature information, thereby greatly improving the accuracy of distinguishing good and bad water chestnuts and meeting the actual needs of water chestnut quality inspection. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A flowchart of an image processing-based target object classification method provided in this application embodiment;

[0021] Figure 2This is a structural block diagram of an image processing-based object classification device provided in an embodiment of this application. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0024] It should be noted that the following description covers various aspects of embodiments within the scope of the appended claims. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this application, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0025] Please refer to Figure 1 As shown, embodiments of this application provide a target object classification method based on image processing, the method comprising:

[0026] S100, acquire the image of the target object to be processed; wherein the size of the image of the target object to be processed is a pixels × a pixels.

[0027] Specifically, the image of the target object to be processed is an image containing the target object. In one embodiment, the target object to be processed is a rhombus, and the image of the target object to be processed is an image containing the rhombus. The image of the target object to be processed can be an image containing one rhombus to be processed, which is cropped from an image containing several rhombuses. As an example, a pixel × a pixel can be 256 pixels × 256 pixels.

[0028] S200, based on a sliding window of b pixels × b pixels, the image of the target object to be processed is divided into horizontal and vertical sliding blocks with a step size of c pixels to obtain several pixel blocks to be processed; where b < a.

[0029] Specifically, as an example: b pixels × b pixels can be 16 pixels × 16 pixels, with a step size of 8 pixels. That is, in this embodiment, a sliding window of 16 pixels × 16 pixels with a step size of 8 pixels is used to slide and divide the 256 pixel × 256 pixel diamond-shaped image into horizontal and vertical blocks to obtain multiple pixel blocks to be processed.

[0030] S300, perform LBP processing on each pixel block to be processed to obtain the target texture feature vector T = (T1, T2, ..., Ti, ..., Tn); i = 1, 2, ..., n; where n is the number of pixel blocks to be processed; n = a / b; Ti is the texture feature corresponding to the i-th pixel block to be processed; each pixel in each pixel block to be processed has a corresponding LBP value; Ti = (Ti, 1, Ti, 2, ..., Ti, j, ..., Ti, m) j = 1, 2, ..., m; m is the number of possible LBP values ​​for each pixel in the pixel block to be processed; Ti, j is the number of pixels corresponding to the possible LBP values ​​of the j-th pixel in the i-th pixel block to be processed.

[0031] Specifically, LBP (Local Binary Pattern) is an operator used to describe local texture features of an image. Its basic principle is to select a fixed-size neighborhood (e.g., a 3×3 neighborhood) around each pixel in the image, and use the gray value of the center pixel of this neighborhood as a threshold, comparing it with the gray values ​​of other pixels within the neighborhood. If the gray value of a neighboring pixel is greater than or equal to the gray value of the center pixel, it is marked as 1; if it is less than the gray value of the center pixel, it is marked as 0. In this way, the pixel gray-level relationships within the neighborhood are converted into a binary code, which corresponds to the LBP value of the center pixel. For example, in a 3×3 neighborhood, comparing the gray values ​​of neighboring pixels with the center pixel in a clockwise direction yields an 8-bit binary number, which, when converted to decimal, is the LBP value of that pixel. Therefore, the LBP value of each pixel within each pixel block to be processed is obtained. At this time, there are 2α modes of LBP value; α=8 (9-1); that is, the neighborhood is 3×3 and the sampling point is 8, so there are 256 (28) modes of LBP (represented by 0-255). At this time, within each pixel block to be processed, the occurrence frequency of LBP value of all pixels is counted, that is, the number of pixels corresponding to each mode is obtained, so as to obtain the texture feature vector corresponding to the pixel block to be processed, that is, m=256 at this time. In another embodiment, if the neighborhood is 5×5 and the sampling point is 16, then there are 216 modes of LBP, that is, m=216 at this time.

[0032] This embodiment transforms image texture features into quantized codes through local pixel grayscale comparison and block statistics. This not only accurately describes local texture details but also adapts to multi-scale texture analysis. Furthermore, it has low computational complexity and allows for flexible control of feature dimensions by adjusting neighborhood and block parameters. It also possesses grayscale invariance and noise resistance, exhibiting strong robustness to changes in illumination and image noise.

[0033] S400, input T into the target object classification model to obtain the classification result; wherein, the classification result is either the target object in the target object image to be processed is a good result or the target object in the target object image to be processed is a bad result.

[0034] Specifically, the extracted texture feature vector T is input into the target object classification model to obtain the classification result. Since stable texture information containing subtle local features has been effectively extracted, compared with the misjudgment problem caused by global color analysis in the background technology, this classification model can make judgments based on more accurate feature information, thereby significantly improving the accuracy of distinguishing between good and bad water chestnuts and meeting the actual needs of water chestnut quality inspection.

[0035] In this embodiment, a fixed-size (a pixel × a pixel) image of the target object to be processed is first obtained, providing a standardized data foundation for subsequent processing. Then, a sliding window of b pixels × b pixels is used to divide the target object image into blocks with a step size of c pixels, resulting in several pixel blocks to be processed. This allows the diamond-shaped image to be subdivided into multiple local regions. Since the quality defects of diamonds are mostly small local features, block processing allows these local defect features to be extracted and analyzed separately, effectively avoiding the problem of missing local defects due to global analysis. Furthermore, LBP (Local Binary Pattern) processing is performed on each pixel block to obtain the target object texture feature vector T. The LBP algorithm has strong robustness to changes in illumination, and can, to some extent, eliminate the influence of external environmental factors such as light intensity and ambient reflection on image feature extraction. It can extract stable texture features, reduce the impact of image color deviation caused by changes in the external environment on the judgment results, and improve the accuracy and reliability of feature extraction. Finally, the extracted texture feature vector T is input into the target object classification model to obtain the classification result. Because it has effectively extracted stable texture information containing subtle local features, compared to the misjudgment problem caused by global color analysis in the background technology, this classification model can make judgments based on more accurate feature information, thereby greatly improving the accuracy of distinguishing good and bad water chestnuts and meeting the actual needs of water chestnut quality inspection.

[0036] In one exemplary embodiment of this application, step S300 includes:

[0037] S310, Perform a Fourier transform on each pixel block to be processed to obtain a list of high-frequency component proportions G = (G1, G2, ..., Gi, ..., Gn); where Gi is the proportion of high-frequency components in the image corresponding to the i-th pixel block after Fourier transform; the proportion of high-frequency components is the ratio of high-frequency region energy to total energy.

[0038] Specifically, a Fourier transform is performed on each pixel block to be processed. The Fourier transform decomposes the image into sine and cosine components of different frequencies. Low-frequency components correspond to smooth regions in the image (such as large color blocks and the background). High-frequency components correspond to rapidly changing regions in the image, such as edges, texture details, and noise. The proportion of high-frequency components is the ratio of the energy of the high-frequency region to the total energy. The total energy is the sum of the energy of all frequency components in the frequency domain, and the energy of the high-frequency region is the sum of the energy of all frequency components within the high-frequency region (corresponding to rapidly changing parts of the image, such as edges, texture details, and noise). A larger proportion of high-frequency components indicates a more complex texture in the region (such as edges and fine textures), while a smaller proportion indicates a smoother region (such as the background or textureless areas).

[0039] S320, if Gi is greater than the preset high-frequency component proportion threshold, then the LBP value of each pixel in Gi is obtained according to the first neighborhood radius.

[0040] Specifically, if Gi is greater than the preset high-frequency component proportion threshold, meaning the high-frequency component proportion is large, it indicates that the area of ​​the more complex texture (such as edges or fine textures) is larger. In this case, the LBP value is obtained based on the first neighborhood radius. As an example: the first neighborhood radius is 1, that is, the LBP value of each pixel is obtained based on a 3×3 neighborhood.

[0041] S330, obtain the number of pixels corresponding to each possible value of LBP obtained based on the first neighborhood radius, so as to obtain T=(T1, T2, ..., Ti, ..., Tn).

[0042] Specifically, as an example: for each pixel in each pixel block to be processed, in a 3×3 neighborhood, the gray values ​​of the neighboring pixels are compared with those of the center pixel in a clockwise direction to obtain an 8-bit binary number, which is then converted into a decimal number, which is the LBP value of that pixel. At this time, there are 2α modes of LBP value; α=8 (9-1); that is, the neighborhood is 3×3 and the sampling point is 8, so there are 256 (28) modes of LBP (represented by 0-255). At this time, in each pixel block to be processed, the frequency of occurrence of LBP values ​​of all pixels is counted, that is, the number of pixels corresponding to each mode is obtained, and the texture feature vector T corresponding to the pixel block to be processed is obtained.

[0043] In this embodiment, when Gi is greater than the preset high-frequency component proportion threshold, i.e., when the high-frequency component proportion is large, since the area of ​​more complex textures (such as edges, fine textures) is larger, a correspondingly smaller neighborhood radius is selected to accurately capture micro-texture features. If a large neighborhood (such as 5×5, 7×7) is used, the neighborhood may contain multiple different high-frequency features, causing the grayscale comparison result to be averaged and unable to accurately reflect local details. A small neighborhood (such as 3×3) only covers the local area of ​​a single high-frequency feature, and can more accurately capture its grayscale change pattern. LBP generates binary codes by comparing the grayscale of pixels in the neighborhood with the center pixel. The 8 sampling points of the small neighborhood (such as 3×3) are closer to the center pixel and are more sensitive to the response of local microstructures (such as single edge points, spots). In addition, when the high-frequency component proportion is large, there may be dense high-frequency features (such as fine textures) in the region. A large neighborhood will superimpose the grayscale changes of multiple features, making LBP encoding unable to distinguish different texture primitives, ultimately leading to a decrease in the discriminative power of the feature vector.

[0044] In one exemplary embodiment of this application, after step S310, the method further includes:

[0045] S340, if Gi is equal to or less than the preset high-frequency component proportion threshold, then the LBP value of each pixel in Gi is obtained according to the second neighborhood radius; wherein, the number of sampling points corresponding to the second neighborhood radius is greater than the number of sampling points corresponding to the first neighborhood radius.

[0046] S350, based on the number of pixels corresponding to each possible value of LBP obtained from the second neighborhood radius, to obtain T = (T1, T2, ..., Ti, ..., Tn).

[0047] In this embodiment, as an example: the grayscale values ​​of neighboring pixels are compared sequentially with the center pixel in a clockwise direction to obtain a 16-bit binary number. This number is then converted to decimal, which is the LBP value of that pixel. There are 2α patterns for the LBP value; α = 16; that is, the neighborhood is 5×5, and the sampling points are 16, resulting in 2¹⁶ patterns for the LBP. Within each pixel block to be processed, the frequency of occurrence of the LBP values ​​of all pixels is counted, i.e., the number of pixels corresponding to each pattern is obtained, thus yielding the texture feature vector T corresponding to that pixel block. Here, the sampling points are 16 points distributed in a circle.

[0048] In this embodiment, when Gi is equal to or less than a preset high-frequency component proportion threshold, i.e., when the proportion of high-frequency components is small, it indicates that the texture changes in the local area of ​​the image are more gradual (such as large smooth areas, background, etc.). At this time, because the grayscale changes are slow in areas dominated by low frequencies (such as fruit surfaces, uniform backgrounds), there is a lack of obvious edges or details. If a small neighborhood (such as 3×3) is used, the LBP encoding may be concentrated in a few modes (such as all 0s or all 1s) due to the high similarity of pixel values ​​within the neighborhood, resulting in extremely weak feature representation ability. Expanding the neighborhood radius can introduce more pixels to participate in the comparison, artificially creating grayscale differences and making the LBP encoding richer. For example, in a 5×5 neighborhood, even if the central area is smooth, small changes in edge pixels may be captured, generating more discriminative LBP patterns.

[0049] In one exemplary embodiment of this application, the classification result obtained according to the target object classification model has a corresponding first confidence level YZ; YZ > 50%; after step S400, the method further includes:

[0050] S500, obtain the shadow ratio P of the target object in the image of the target object to be processed; where P meets the following condition: P=S_shadow / S_integer; where S_shadow is the number of pixels contained in the shadow of the target object in the image of the target object to be processed; S_integer is the number of pixels contained in the target object in the image of the target object to be processed.

[0051] Specifically, shadows can cause localized grayscale anomalies in images, which may be misclassified as texture defects (such as rotten areas on spoiled fruit). By calculating the shadow proportion, the impact of lighting interference and shooting angle interference on classification results can be assessed. Furthermore, a mapping relationship between shadow proportion and classification confidence can be established to quantify the impact of shadows on the reliability of classification results.

[0052] The shadow index (Sshadow) can be determined using a color space conversion and thresholding method. Specifically, the target image is converted from the common RGB color space to a more suitable color space for shadow analysis, such as HSI (Hue, Saturation, Intensity). This is because shadow areas generally have lower intensity values ​​in the HSI space, while hue and saturation are relatively stable. The shadow index is calculated based on each component in the HSI space. Adaptive thresholding methods such as Otsu's method (OTSU) are used, or a threshold is manually set based on experience, to perform thresholding of the image index. Finally, logical judgments are made on the corresponding image indexes based on the thresholds, and shadow areas are extracted using masking operations. The number of pixels within the shadow area is then counted.

[0053] S600, based on P and the preset shadow ratio mapping table, obtain the second confidence level EZ corresponding to P; wherein, the preset shadow ratio mapping table includes several shadow ratios and the second confidence level corresponding to each shadow ratio; EZ∈[0,1]; P is any one of the several shadow ratios; P is inversely proportional to EZ.

[0054] S700, based on YZ and EZ, obtain the updated classification result; where, if the confidence SZ of the updated classification result is greater than the preset confidence threshold, then the updated classification result is the same as the classification result obtained by the target object classification model; SZ=YZ×EZ.

[0055] Specifically, P is inversely proportional to EZ. That is, the higher the proportion of shadow on the target object, the greater the probability of misclassification due to lighting interference. Therefore, the lower the EZ, the less likely the shadow will mislead the classification results. By quantifying the shadow proportion and correcting the confidence level, the system can identify false defects caused by uneven lighting (such as shadows being misclassified as bad results) and avoid good results being misclassified as bad results.

[0056] This embodiment no longer relies on the output of a single classification model, but dynamically adjusts the confidence level by incorporating shadow interference factors, making the results more consistent with real-world scenarios (such as natural light and shadow during outdoor harvesting, strong light reflection from production lines, etc.). This improves the accuracy of the result judgment.

[0057] In another embodiment, if the model outputs a "good" result (i.e., the first confidence level of the model output is greater than 50%), and the confidence level SZ of the last updated classification result is equal to or less than the preset confidence threshold, it indicates that the target object may have a high shadow ratio, leading to a higher probability of misclassification due to lighting interference, i.e., misclassifying it as a "good" result. In this case, the updated classification result can be a pending result, which can be manually processed to reduce the misclassification rate. For example: if the model outputs a "good" result, the corresponding first confidence level YZ is 80%, and the second confidence level EZ is 0.9, then SZ = 72%, and the preset confidence threshold is 75%. Therefore, the last updated classification result is a pending result.

[0058] Please refer to Figure 2 As shown, an embodiment of this application provides an image processing-based target object classification device 100, the device comprising:

[0059] Image acquisition unit 110 is used to acquire an image of the target object to be processed; wherein the size of the image of the target object to be processed is a pixels × a pixels.

[0060] The segmentation unit 120 is used to perform horizontal and vertical sliding segmentation of the target image to be processed according to a sliding window of b pixels × b pixels with a step size of c pixels, so as to obtain a number of pixel blocks to be processed; where b < a.

[0061] The processing unit 130 is used to perform LBP processing on each pixel block to be processed to obtain the target texture feature vector T = (T1, T2, ..., Ti, ..., Tn); i = 1, 2, ..., n; where n is the number of pixel blocks to be processed; n = a / b; Ti is the texture feature corresponding to the i-th pixel block to be processed; each pixel in each pixel block to be processed has a corresponding LBP value; Ti = (Ti, 1, Ti, 2, ..., Ti, j, ..., Ti, m) j = 1, 2, ..., m; m is the number of possible LBP values ​​for each pixel in the pixel block to be processed; Ti, j is the number of pixels corresponding to the possible LBP values ​​of the j-th pixel in the i-th pixel block to be processed.

[0062] The classification unit 140 is used to input T into the target object classification model to obtain the classification result; wherein the classification result is that the target object in the target object image to be processed is a good result or the target object in the target object image to be processed is a bad result.

[0063] Embodiments of this application also provide a computer program product including program code that, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described above according to various exemplary embodiments of this application.

[0064] Furthermore, although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0065] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this application.

[0066] In an exemplary embodiment of this application, an electronic device capable of implementing the above-described method is also provided.

[0067] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."

[0068] An electronic device according to this embodiment of the present application. The electronic device is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of this application.

[0069] Electronic devices are manifested in the form of general-purpose computing devices. Components of an electronic device may include, but are not limited to: at least one processor, at least one memory, and buses connecting different system components (including memory and processor).

[0070] The memory stores program code that can be executed by a processor, causing the processor to perform the steps described in the "Exemplary Methods" section above, according to various exemplary embodiments of this application.

[0071] The storage may include readable media in the form of volatile storage, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).

[0072] The storage may also include programs / utilities having a set (at least one) of program modules, including but not limited to: an operating system, one or more applications, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0073] A bus can represent one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus that uses any of the various bus architectures.

[0074] The electronic device can also communicate with one or more external devices (such as keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (such as routers, modems, etc.). This communication can be performed via input / output (I / O) interfaces. Furthermore, the electronic device can communicate with one or more networks (such as local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter. As shown in the figure, the network adapter communicates with other modules of the electronic device via a bus. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0075] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this application.

[0076] In exemplary embodiments of this application, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible implementations, various aspects of this application may also be implemented as a program product including program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of this application described in the "Exemplary Methods" section above.

[0077] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0078] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0079] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0080] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0081] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this application, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0082] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0083] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A target object classification method based on image processing, characterized in that, The method includes: S100, acquire the image of the target object to be processed; wherein the size of the image of the target object to be processed is a pixels × a pixels; S200, based on a sliding window of b pixels × b pixels, the image of the target object to be processed is divided into horizontal and vertical sliding blocks with a step size of c pixels to obtain several pixel blocks to be processed; where b < a. S300, perform LBP processing on each pixel block to be processed to obtain the target object texture feature vector T = (T1, T2, ..., T...). i ,…,T n ); i = 1, 2, ..., n; where n is the number of pixel blocks to be processed; n = a / b; T i The texture feature corresponding to the i-th pixel block to be processed; each pixel in each pixel block to be processed has a corresponding LBP value; T i = (T i,1 T i,2 ,…,T i,j ,…,T i,m j = 1, 2, ..., m; m is the number of possible LBP values ​​for each pixel in the pixel block to be processed; T i,j The number of pixels corresponding to the j-th LBP value in the i-th pixel block to be processed; step S300 includes: S310, Perform a Fourier transform on each pixel block to be processed to obtain a list of high-frequency component proportions G = (G1, G2, ..., G...). i , ..., G n ); where G i The proportion of high-frequency components after Fourier transform of the image corresponding to the i-th pixel block to be processed; the proportion of high-frequency components is the ratio of the energy in the high-frequency region to the total energy. S320, if G i If the proportion of high-frequency components is greater than the preset threshold, then G is obtained based on the radius of the first neighborhood. i The LBP value of each pixel in the image; S330, obtain the number of pixels corresponding to each possible value of LBP obtained based on the first neighborhood radius, so as to obtain T = (T1, T2, ..., T...). i ,…,T n ); S340, if G i If the proportion of high-frequency components is equal to or less than the preset threshold, then G is obtained based on the second neighborhood radius. i The LBP value of each pixel; where the number of sampling points corresponding to the second neighborhood radius is greater than the number of sampling points corresponding to the first neighborhood radius; S350, based on the number of pixels corresponding to each possible value of LBP obtained from the second neighborhood radius, to obtain T = (T1, T2, ..., T... i ,…,T n ); S400, input T into the target object classification model to obtain the classification result; wherein, the classification result is either the target object in the target object image to be processed is a good result or the target object in the target object image to be processed is a bad result.

2. The object classification method based on image processing according to claim 1, characterized in that, The target object classification model includes a first target classification model and a second target classification model. The first target classification model is applicable to target object texture feature vectors obtained from a first neighborhood, and the second target classification model is applicable to target object texture feature vectors obtained from a second neighborhood. Step S400 includes: S410, input T into the first target classification model or the second target classification model to obtain the classification result; wherein, if T is obtained based on the first neighborhood, then input T into the first target classification model; if T is obtained based on the second neighborhood, then input T into the second target classification model.

3. The object classification method based on image processing according to claim 2, characterized in that, The classification result obtained from the target object classification model has a corresponding first confidence level YZ; YZ > 50%; after step S400, the method further includes: S500, obtain the shadow ratio P of the target object in the image of the target object to be processed; where P satisfies the following condition: P=S 阴 / S 整 Among them, S 阴 S represents the number of pixels contained in the shadow of the target object in the image to be processed; 整 This represents the number of pixels contained in the target object in the image to be processed. S600, according to P and the preset shadow ratio mapping table, obtain the second confidence level EZ corresponding to P; wherein, the preset shadow ratio mapping table includes several shadow ratios and the second confidence level corresponding to each shadow ratio; EZ∈[0,1]; P is any one of the several shadow ratios; S700, based on YZ and EZ, obtain the updated classification result; where, if the confidence SZ of the updated classification result is greater than the preset confidence threshold, then the updated classification result is the same as the classification result obtained by the target object classification model; SZ=YZ×EZ.

4. A target object classification device based on image processing, characterized in that, The device includes: The image acquisition unit is used to acquire an image of the target object to be processed; wherein the size of the image of the target object to be processed is a pixels × a pixels; The block unit is used to slide the image of the target object to be processed horizontally and vertically according to the sliding window of b pixels × b pixels with a step size of c pixels to obtain a number of pixel blocks to be processed; where b < a. The processing unit is used to perform LBP processing on each pixel block to be processed to obtain the target object texture feature vector T = (T1, T2, ..., T...). i ,…,T n ); i = 1, 2, ..., n; where n is the number of pixel blocks to be processed; n = a / b; T i The texture feature corresponding to the i-th pixel block to be processed; each pixel in each pixel block to be processed has a corresponding LBP value; T i = (T i,1 T i,2 ,…,T i,j ,…,T i,m j = 1, 2, ..., m; m is the number of possible LBP values ​​for each pixel in the pixel block to be processed; T i,j Let be the number of pixels corresponding to the j-th possible LBP values ​​in the i-th pixel block to be processed; perform LBP processing on each pixel block to be processed to obtain the target texture feature vector T = (T1, T2, ..., Tj). i ,…,T n )include: S310, Perform a Fourier transform on each pixel block to be processed to obtain a list of high-frequency component proportions G = (G1, G2, ..., G...). i , ..., G n ); where G i The proportion of high-frequency components after Fourier transform of the image corresponding to the i-th pixel block to be processed; the proportion of high-frequency components is the ratio of the energy in the high-frequency region to the total energy. S320, if G i If the proportion of high-frequency components is greater than the preset threshold, then G is obtained based on the radius of the first neighborhood. i The LBP value of each pixel in the image; S330, obtain the number of pixels corresponding to each possible value of LBP obtained based on the first neighborhood radius, so as to obtain T = (T1, T2, ..., T...). i ,…,T n ); S340, if G i If the proportion of high-frequency components is equal to or less than the preset threshold, then G is obtained based on the second neighborhood radius. i The LBP value of each pixel; where the number of sampling points corresponding to the second neighborhood radius is greater than the number of sampling points corresponding to the first neighborhood radius; S350, based on the number of pixels corresponding to each possible value of LBP obtained from the second neighborhood radius, to obtain T = (T1, T2, ..., T... i ,…,T n ); The classification unit is used to input T into the target object classification model to obtain the classification result; wherein the classification result is either the target object in the image to be processed is a good result or the target object in the image to be processed is a bad result.

5. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the image processing-based target classification method as described in any one of claims 1-3.

6. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 5.