An image detection system based on computer vision

By using smart devices and color space library processing in the image detection system, the problem of inefficient detection caused by RGB information loss is solved, and efficient information recovery and detection in the case of loss is achieved.

CN118505593BActive Publication Date: 2025-01-14YONGZHOU VOCATIONAL & TECH COLLEGE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410180058.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-18
Publication Date
2025-01-14
Estimated Expiration
2044-02-18

AI Technical Summary

Technical Problem

When the prior art encounters RGB information loss during image detection, it is necessary to rely on external devices to restore information, resulting in insufficiency of detection.

Method used

By introducing an image acquisition module and a database construction module in the image detection system, using intelligent devices to obtain image data for pre-processing, and establishing a color space library through gradient conversion to determine whether RGB information is obtained. If it is lost, the image is divided into detection sub-images Merge and restore RGB information using the color space library.

Benefits of technology

When RGB information is lost, information can be restored without external devices, which improves image detection efficiency and reduces detection time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118505593B_ABST
    Figure CN118505593B_ABST
Patent Text Reader

Abstract

The invention discloses an image detection system based on computer vision, relates to the technical field of image detection, and solves the technical problem that in the prior art, when detecting an image lacking RGB information, external equipment is needed to be relied upon, which affects the image processing efficiency. The invention judges whether the RGB information of a target image can be obtained. When the RGB information cannot be obtained, the target image is divided into a plurality of detection sub-images, and the plurality of detection sub-images are merged according to color features to obtain a graphic area. When the RGB information of the target image is lost, the invention can restore its RBG information through an established color space library, without relying on external equipment to restore the RGB information. The invention establishes a color space library through a gradient conversion method. When the received image is encrypted or hidden, so that the RGB value cannot be directly obtained, the RGB information is accurately matched through the gradient conversion and the color space library, so that the image detection time can be effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of image detection, and in particular to an image detection system based on computer vision. Background Art

[0002] With the development of computer vision, the ability to process and analyze images using computers has been continuously improved. Image detection technology, which can perceive and understand images and detect, identify and classify target objects in images by analyzing visual features in images, has been widely used and studied.

[0003] However, the image transmission process is susceptible to interference, resulting in the loss of RGB information. General image detection is performed through the computer's built-in detection program. When encountering an image with lost RGB information, it is necessary to call an external device to restore the RGB information before continuing the image detection. This requires a long waiting time for detection, making it difficult for the image detection system to efficiently identify the visual features of the image. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art; to this end, the present invention proposes an image detection system based on computer vision, which is used to solve the technical problem that when the prior art detects images with missing RGB information, it needs to rely on external devices, which affects the image processing efficiency.

[0005] To achieve the above object, the first aspect of the present invention provides an image detection system based on computer vision, comprising: an image detection module, and an image acquisition module and a database construction module connected to the image detection module;

[0006] The image acquisition module is used to acquire image data through a smart device, pre-process the acquired image data, and obtain a target image; wherein the pre-processing is to ensure that the target image can be subsequently processed, and the smart device includes a high-definition camera and a smart phone;

[0007] The database construction module is used to process the RGB color model by gradient conversion to establish a color space library;

[0008] The image detection module is used to determine whether the RGB information of the target image can be obtained; if yes, cluster analysis is performed based on the RGB values ​​of all pixels in the target image to extract similar graphic areas; if no, the target image is divided into several detection sub-images, and several detection sub-images are merged according to color features to obtain the graphic area, and the detection result of the target image is output based on the combination of the graphic area and the color space library.

[0009] Preferably, the preprocessing of the acquired image data includes:

[0010] Preprocessing the image data to obtain a predetermined image; wherein the preprocessing includes rotation, proportional reduction and cropping;

[0011] The predetermined image is subjected to Gaussian filtering, Canny edge detection and image normalization in sequence to obtain a target image; wherein the image normalization is achieved by linear transformation or Z-score normalization.

[0012] Preferably, the processing of the RGB color model by gradient conversion includes:

[0013] Constructing a basic color library according to the sorting rule of the RGB color model; wherein the sorting rule of the RGB color model is to sort from large to small according to hexadecimal notation;

[0014] Gradual conversion is performed on basic colors in the basic color library to obtain corresponding digital color values; and a color space library is constructed according to the color values.

[0015] Preferably, the step of performing a gradient conversion on the basic colors in the basic color library includes:

[0016] Retrieving basic colors from the basic color library in sequence; wherein the basic colors are colors included in the RGB color model;

[0017] The basic colors are uniformly gradiented to the gradient step according to the gradient parameters to obtain the color values ​​corresponding to each basic color in digital form; wherein the gradient parameters include the final target color and the number of gradients, and the final target color is black; the color value in digital form is the value of the gradient step.

[0018] Preferably, the image detection module is used to determine whether the RGB information of the target image can be obtained, including:

[0019] Determine whether the RGB values ​​of all pixels in the target image can be obtained; if yes, perform cluster analysis based on the RGB values ​​of all pixels in the target image to extract similar graphic areas; if no, divide the detection sub-images according to the color values ​​of each pixel in the target image.

[0020] Preferably, dividing the detection sub-images by the color value of each pixel in the target image includes:

[0021] Extracting the aspect ratio of the target image; dividing the target image into a number of detection sub-images under the constraints of minimum aspect ratio and area;

[0022] Extract the color value of each pixel in all the detection sub-images, and obtain the mode of the color values ​​of each detection sub-image, and judge whether the color values ​​in each detection sub-image are all within the interval fluctuation range of the mode of the color value of its detection sub-image; if yes, enlarge the detection sub-image according to the aspect ratio, and perform fluctuation judgment; if no, take the number of detection sub-images divided at the previous level as the final number of detection sub-images.

[0023] Preferably, the merging of the plurality of detection sub-images according to color features comprises:

[0024] Obtaining characteristic color values ​​of several detection sub-images;

[0025] The characteristic color value of the detection sub-image is combined with the region growing method, and the detection sub-images around the detection sub-image are merged to obtain a graphic region.

[0026] Preferably, the step of obtaining characteristic color values ​​of the plurality of detection sub-images includes:

[0027] Get the color value of each pixel in the detection sub-image; sort the color values ​​from small to large and mark them as A i ; Where i is the number of the color value, and 1≤i≤n; n is the number of color values;

[0028] Count the color value of the detected sub-image A i The number of pixels, marked as B i ;

[0029] Based on the formula The characteristic color value T of the detection sub-image is calculated; wherein i is the number of the color value, and 1≤i≤n; and n is the number of color values.

[0030] Preferably, the step of merging the detection sub-images around the detection sub-image comprises:

[0031] Marking the detected sub-image with a first seed point;

[0032] Determine whether the difference between the color feature value T of the first seed point and the adjacent detection sub-image is less than the set threshold; if yes, mark the adjacent detection sub-image as a similar sub-image, and then continue to determine whether the difference between the color feature value T of the adjacent detection sub-image corresponding to the similar sub-image and the first seed point is less than the set threshold; if no, mark the adjacent detection sub-image as a seed point to be selected;

[0033] Merging the first seed point with the corresponding similar sub-image to obtain a first graphic region;

[0034] Determine a second seed point in the previous level of candidate seed points in the order of marking, and obtain a graphic area of ​​the second seed point; merge the second seed point with the corresponding similar sub-image to obtain a second graphic area;

[0035] An mth seed point is determined from the seed points to be selected at the previous level, and a graphic region of the mth seed point is obtained; and the mth seed point is merged with a corresponding similar sub-image to obtain an mth graphic region.

[0036] Preferably, the step of outputting the detection result of the target image based on the combination of the graphic region and the color space library includes:

[0037] Match the color value of the graphic area with the color space library to obtain the RGB value corresponding to the graphic area; add the RGB value to the graphic area, and integrate the graphic area to output the detection result.

[0038] Compared with the prior art, the present invention has the following beneficial effects:

[0039] 1. The present invention determines whether the RGB information of the target image can be obtained; when the RGB information cannot be obtained, the target image is divided into a number of detection sub-images, and the plurality of detection sub-images are merged according to color features to obtain a graphic area; when the RGB information of the target image is lost, the present invention can restore its RBG information through the established color space library, without relying on external devices to restore the RGB information, thereby improving the image detection efficiency.

[0040] 2. The present invention processes the RGB color model by means of gradient conversion and establishes a color space library; when the received image is encrypted or hidden and the RGB value cannot be directly obtained, its RGB information can be accurately matched through gradient conversion and the color space library, without calling external equipment, which can effectively reduce the image detection time. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 It is a schematic diagram of the system module of the present invention;

[0043] Figure 2 It is a schematic diagram of the steps of the present invention. DETAILED DESCRIPTION

[0044] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] See also Figure 1-Figure 2 , the first aspect of the present invention provides an image detection system based on computer vision, including: an image detection module, and an image acquisition module and a database construction module connected to the image detection module;

[0046] The image acquisition module is used to acquire image data through a smart device, pre-process the acquired image data, and obtain a target image; wherein the pre-processing is to ensure that the target image can be subsequently processed, and the smart device includes a high-definition camera and a smart phone;

[0047] The database construction module is used to process the RGB color model by gradient conversion to establish a color space library;

[0048] The image detection module is used to determine whether the RGB information of the target image can be obtained; if yes, cluster analysis is performed based on the RGB values ​​of all pixels in the target image to extract similar graphic areas; if no, the target image is divided into several detection sub-images, and several detection sub-images are merged according to color features to obtain the graphic area, and the detection result of the target image is output based on the combination of the graphic area and the color space library.

[0049] The preprocessing of the acquired image data described in this application includes:

[0050] Preprocessing the image data to obtain a predetermined image; wherein the preprocessing includes rotation, proportional reduction and cropping;

[0051] The predetermined image is subjected to Gaussian filtering, Canny edge detection and image normalization in sequence to obtain a target image; wherein the image normalization is achieved by linear transformation or Z-score normalization.

[0052] It is worth noting that in the preprocessing, when the length and width of the received image are not greater than the width of the preset range, the image is adjusted by rotation first; when the length or width of the received image exceeds the preset range and does not exceed 1 times the preset range, the image is adjusted by proportional reduction; when the length, width or area of ​​the received image exceeds 1 times the preset range, the image is cut into k+1 images in proportion to the length, width or area ratio. Among them, k is the ratio of the length, width and area of ​​the received image to the preset range, the largest ratio is selected, the ratio is rounded according to the rounding method, and is set to k. For example: when the length and width of the received image are not greater than the width of the preset range, a rotation operation is performed to obtain an image suitable for the system; if the length of the received image exceeds 0.3 times of the preset range, and the width exceeds 0.2 times of the preset range, the received image is proportionally reduced to an image length equal to the preset length; when the length of the received image exceeds 0.3 times of the preset range, and the width exceeds 1.4 times of the preset range, the area exceeds 2.12 times of the preset range, then k is taken as 3, and the image is cut into 4 target images in equal proportion.

[0053] The RGB color model is processed by gradient conversion in this application, including:

[0054] Constructing a basic color library according to the sorting rule of the RGB color model; wherein the sorting rule of the RGB color model is to sort from large to small according to hexadecimal notation;

[0055] Gradual conversion is performed on basic colors in the basic color library to obtain corresponding digital color values; and a color space library is constructed according to the color values.

[0056] It should be noted that the sorting rule of the RGB color model is to sort from large to small according to the hexadecimal notation. First, sort according to the value of the red channel. If the red channel values ​​are the same, sort according to the value of the green channel, and finally sort according to the value of the blue channel.

[0057] It is worth noting that the purpose of establishing the color space library is to enable the system to detect received images, including some images whose RGB values ​​cannot be directly obtained. For example, when the image is stored in a file format that does not support RGB information, or when the image is encrypted or hidden, the RGB value may not be directly obtained.

[0058] The gradient conversion of the basic colors in the basic color library described in this application includes:

[0059] Retrieving basic colors from the basic color library in sequence; wherein the basic colors are colors included in the RGB color model;

[0060] The basic colors are uniformly gradiented to the gradient step according to the gradient parameters to obtain the color values ​​corresponding to each basic color in digital form; wherein the gradient parameters include the final target color and the number of gradients, and the final target color is black; the color value in digital form is the value of the gradient step.

[0061] It should be noted that the gradient parameter setting includes setting the gradient times to be fixed at 256 times.

[0062] It should be noted that in the RGB model, the color gradually becomes darker by gradually reducing the color intensity. The RGB model uses three channels, red R, green G, and blue B, to represent the color. Gradually reducing the color intensity will make the color gradually darker until it eventually becomes black.

[0063] The image detection module in this application is used to determine whether the RGB information of the target image can be obtained, including:

[0064] Determine whether the RGB values ​​of all pixels in the target image can be obtained; if yes, perform cluster analysis based on the RGB values ​​of all pixels in the target image to extract similar graphic areas; if no, divide the detection sub-images according to the color values ​​of each pixel in the target image.

[0065] It should be noted that the clustering algorithm can classify similar data samples into one category based on the internal relationship and feature structure of the data without labels, and divide the RGB values ​​of each pixel of the target image into detection sub-images.

[0066] The color value of each pixel in the target image described in this application is divided into detection sub-images, including:

[0067] Extracting the aspect ratio of the target image; dividing the target image into a number of detection sub-images under the constraints of minimum aspect ratio and area;

[0068] Extract the color value of each pixel in all the detection sub-images, and obtain the mode of the color values ​​of each detection sub-image, and judge whether the color values ​​in each detection sub-image are all within the interval fluctuation range of the mode of the color value of its detection sub-image; if yes, enlarge the detection sub-image according to the aspect ratio, and perform fluctuation judgment; if no, take the number of detection sub-images divided at the previous level as the final number of detection sub-images.

[0069] It should be noted that the color value of each pixel in all the detection sub-images is extracted by uniformly fading to black with each pixel in the target image as the interval, and obtaining the corresponding gradient step length, so as to obtain the color value in digital form; after obtaining the color value in digital form, the RGB value corresponding to the color value can be found through the color space library; for example: the color of a certain pixel is H, and the pixel is uniformly gradiented 256 times to black, and the uniform gradient step length is obtained through this process, and the step length is compared with the step length of each color value in the color space library. If they are consistent, the color value corresponding to color H can be determined, and then the RGB value of color H can be determined. For example, after color H is gradiented to black 256 times, the gradient step length obtained is 0.1s; if the corresponding step length of color X in the color space library is 0.1s when it is gradiented to black 256 times, then color H is color X.

[0070] The above-mentioned step length or gradient step length can be the duration, that is, the time required for each gradient; or it can be brightness, that is, the amount of brightness change for each gradient. It should be noted that in order to ensure the accuracy of the detection result, when the step length is the duration, it is necessary to ensure that the performance of the processor meets the requirements, and the time required for each gradient will not be affected by the processor performance. There is a certain correlation between the brightness information of the pixel and the RGB information. The brightness information refers to the brightness of the pixel, which is usually expressed in grayscale values. RGB information refers to the color information of the pixel, which is composed of the intensity values ​​of the three channels of red, green and blue. Although brightness information and RGB information are two different concepts, there is a certain correlation between them. Generally speaking, the higher the RGB value of a pixel, the higher its brightness value. This is because the higher the RGB value, the higher the intensity value of the pixel in the three channels of red, green and blue, which makes the pixel look brighter. If the RGB value of a pixel is very low (close to black), its brightness value will also be very low.

[0071] It should be noted that, it is empirically found that the appropriate range of fluctuation is that the range does not exceed ±5% of the mode of the color values ​​of the pixels in the detection sub-image.

[0072] It is worth noting that the ratio of the length to the width of the detection sub-image is set according to the ratio of the length to the width of the target image. This allows the detection sub-image to completely cover the target image, thereby ensuring that there will be no areas of missing detection or excessive detection.

[0073] It is worth noting that when dividing the detection sub-images, dividing the target image into several detection sub-images based on the minimum area of ​​the detection sub-images can divide the number of detection sub-images from large to small, and the most appropriate number of detection sub-images can be found more quickly, thereby improving the detection efficiency of the system.

[0074] It should be noted that when the color values ​​of all pixels in the obtained detection sub-image do not conform to the interval fluctuation range and the previous level has not divided the detection sub-image, a single pixel is detected as the detection sub-image.

[0075] The method of merging the plurality of detection sub-images according to color features described in the present application includes:

[0076] Obtaining characteristic color values ​​of several detection sub-images;

[0077] The characteristic color value of the detection sub-image is combined with the region growing method, and the detection sub-images around the detection sub-image are merged to obtain a graphic region.

[0078] The method of obtaining characteristic color values ​​of the detection sub-images described in the present application includes:

[0079] Get the color value of each pixel in the detection sub-image; sort the color values ​​from small to large and mark them as A i ; Where i is the number of the color value, and 1≤i≤n; n is the number of color values;

[0080] Count the color value of the detected sub-image A i The number of pixels, marked as B i ;

[0081] Based on the formula The characteristic color value T of the detection sub-image is calculated; wherein i is the number of the color value, and 1≤i≤n; and n is the number of color values.

[0082] It should be noted that the purpose of obtaining the characteristic color value T of the detection sub-image is to obtain a value that can represent the detection sub-image without affecting the clarity, which can make the system respond faster in the subsequent detection sub-image merging and improve the system's operating efficiency.

[0083] The method of merging the detection sub-images around the detection sub-image in the present application includes:

[0084] Marking the detected sub-image with a first seed point;

[0085] Determine whether the difference between the color feature value T of the first seed point and the adjacent detection sub-image is less than the set threshold; if yes, mark the adjacent detection sub-image as a similar sub-image, and then continue to determine whether the difference between the color feature value T of the adjacent detection sub-image corresponding to the similar sub-image and the first seed point is less than the set threshold; if no, mark the adjacent detection sub-image as a seed point to be selected;

[0086] Merging the first seed point with the corresponding similar sub-image to obtain a first graphic region;

[0087] Determine a second seed point in the previous level of candidate seed points in the order of marking, and obtain a graphic area of ​​the second seed point; merge the second seed point with the corresponding similar sub-image to obtain a second graphic area;

[0088] An mth seed point is determined from the seed points to be selected at the previous level, and a graphic region of the mth seed point is obtained; and the mth seed point is merged with a corresponding similar sub-image to obtain an mth graphic region.

[0089] It should be noted that, it is empirically obtained that the threshold is set to be no greater than 5% of the color feature value T of the first seed point.

[0090] It should be noted that when the m-1th seed point does not generate a candidate seed point, the mth seed point is determined in the order of marking among the candidate seed points generated by the first seed point; if the candidate seed points generated by the first seed point are used up, the mth seed point is determined among the candidate seed points of the next level generated by the first seed point; among which, the candidate seed point selected as the seed point cannot be selected a second time.

[0091] In another preferred embodiment, the first seed point and subsequent seed points to be selected may be determined by setting a two-dimensional rectangular coordinate system, as follows:

[0092] A two-dimensional rectangular coordinate system is established with the detection sub-image at the four corners of the target image as the zero point and the length of the detection sub-image as the step length;

[0093] Set the zero point of the two-dimensional rectangular coordinate system as the first seed point;

[0094] Determine whether the difference between the color feature value T of the first seed point and the adjacent coordinate point is less than a set threshold; if yes, mark the adjacent coordinate point as a similar sub-image, and then continue to determine whether the difference between the color feature value T of the adjacent coordinate point corresponding to the similar sub-image and the first seed point is less than the set threshold; if no, mark the corresponding coordinate point as a dissimilar coordinate point of the first seed point;

[0095] Merging the first seed point with the corresponding similar sub-image to obtain a first graphic region;

[0096] The next seed point is obtained by searching based on the coordinate step-by-step search method, and the graphic area of ​​the next seed point is searched.

[0097] It should be noted that in the step-by-step coordinate search method, it is necessary to first determine the coordinate point orientation of the detection sub-image in the four coordinate points of the first seed point, and then search the horizontal and vertical coordinates step by step according to the coordinate point orientation containing the detection sub-image. Among them, the horizontal coordinate is searched step by step first. When all the horizontal coordinate points of the same vertical coordinate y=n are searched, the horizontal coordinate points that are not marked as graphic areas in the y=n±1 level vertical coordinates are searched.

[0098] It should be noted that when searching for the horizontal coordinate point of level y=n±1, the search starts with the orientation of the horizontal coordinate point containing the detection sub-image, and the graphic area is skipped during the search process. The horizontal coordinate point of level y=n±1 that is not marked as a graphic area point is taken as the next seed point and the threshold setting judgment of this point is started. If the seed point is surrounded by graphic areas of other seeds, the threshold setting judgment is stopped and the point is marked as the graphic area of ​​this seed point.

[0099] For example: when the detection sub-image at the lower left of the four corner points of the target image is taken as the zero point, it is first determined that there are coordinate points containing the detection sub-image above and to the right of the first seed point, so the next seed point is searched with gradually increasing horizontal coordinates. When all horizontal coordinates of y=0 are searched, the horizontal coordinate search of y=1 level is performed.

[0100] Working principle of the present invention:

[0101] Acquire image data through a smart device, pre-process the acquired image data, and obtain a target image;

[0102] The RGB color model is processed by gradient conversion to establish a color space library;

[0103] Determine whether the RGB information of the target image can be obtained; if yes, perform cluster analysis based on the RGB values ​​of all pixels in the target image to extract similar graphic areas; if no, divide the target image into several detection sub-images, merge several detection sub-images according to color features to obtain the graphic area, and output the detection result of the target image based on the combination of the graphic area and the color space library.

[0104] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.

Claims

1. An image detection system based on computer vision, characterized in that: It includes: an image detection module, an image acquisition module and a database construction module connected to the image detection module; The image acquisition module is used to acquire image data through a smart device, pre-process the acquired image data, and obtain a target image; wherein the pre-processing is to ensure that the target image can be subsequently processed, and the smart device includes a high-definition camera and a smart phone; The database construction module is used to process the RGB color model by gradient conversion to establish a color space library; The image detection module is used to determine whether the RGB information of the target image can be obtained; if not, the target image is divided into a number of detection sub-images, and the plurality of detection sub-images are merged according to color features to obtain a graphic area; based on the combination of the graphic area and the color space library, the detection result of the target image is output; The RGB color model is processed by gradient conversion, including: Constructing a basic color library according to the sorting rules of the RGB color model; Performing a gradient conversion on the basic colors in the basic color library to obtain corresponding digital color values; and constructing a color space library according to the color values; The step of performing a gradient conversion on the basic colors in the basic color library includes: Retrieving basic colors from the basic color library in sequence; wherein the basic colors are colors included in the RGB color model; The basic colors are uniformly gradiented to the gradient step length according to the gradient parameters to obtain the color values ​​corresponding to the basic colors in digital form; wherein the gradient parameters include the final target color and the number of gradients, and the final target color is black; The image detection module is used to determine whether the RGB information of the target image can be obtained, including: Determine whether the RGB values ​​of all pixels in the target image can be obtained; if yes, perform cluster analysis based on the RGB values ​​of all pixels in the target image to extract similar graphic areas; if no, divide the detection sub-images according to the color values ​​of each pixel in the target image; Dividing the detection sub-image according to the color value of each pixel in the target image includes: Extracting the aspect ratio of the target image; dividing the target image into a number of detection sub-images under the constraints of minimum aspect ratio and area; Extract the color value of each pixel in all the detection sub-images, and obtain the mode of the color values ​​of each detection sub-image, and judge whether all the color values ​​in each detection sub-image are within the interval fluctuation range of the mode of the color value of the detection sub-image; if yes, enlarge the detection sub-image according to the aspect ratio, and perform fluctuation judgment; if no, take the number of detection sub-images divided in the previous level as the final number of detection sub-images; Merging the plurality of detection sub-images according to color features includes: Obtaining characteristic color values ​​of several detection sub-images; Combining the characteristic color value of the detection sub-image with the region growing method, merging the detection sub-images around the detection sub-image, and obtaining a graphic region; Acquiring characteristic color values ​​of several detection sub-images, including: Get the color value of each pixel in the detection sub-image; sort the color values ​​from small to large and mark them as ; Where i is the number of the color value, and 1≤i≤n; n is the number of color values; Count the color values ​​in the detected sub-image The number of pixels, marked as ; Based on the formula Calculate and obtain the characteristic color value T of the detected sub-image; wherein i is the number of the color value, and 1≤i≤n; n is the number of color values; The step of merging detection sub-images around the detection sub-image comprises: Marking the detected sub-image with a first seed point; Determine whether the difference between the color feature value T of the first seed point and the adjacent detection sub-image is less than the set threshold; if yes, mark the adjacent detection sub-image as a similar sub-image, and then continue to determine whether the difference between the color feature value T of the adjacent detection sub-image corresponding to the similar sub-image and the first seed point is less than the set threshold; if no, mark the adjacent detection sub-image as a seed point to be selected; The first seed point is combined with the corresponding similar sub-image to obtain a graphic region; a second seed point is determined from the seed points to be selected, and the graphic region of the second seed point is obtained, and the graphic regions are obtained in sequence; The step of outputting the detection result of the target image based on the combination of the graphic region and the color space library includes: Match the color value of the graphic area with the color space library to obtain the RGB value corresponding to the graphic area; add the RGB value to the graphic area, and integrate the graphic area to output the detection result.

2. The computer vision-based image detection system according to claim 1, characterized in that: The preprocessing of the acquired image data comprises: Preprocessing the image data to obtain a predetermined image; wherein the preprocessing includes rotation, proportional reduction and cropping; The predetermined image is subjected to Gaussian filtering, Canny edge detection and image normalization in sequence to obtain a target image; wherein the image normalization is achieved by linear transformation or Z-score normalization.

Citation Information

Patent Citations

  • Color feature extraction method based on machine vision and application thereof

    CN111626304A

  • Image processing method and device, equipment and storage medium

    CN114092576A