Fusion feature-based cigar tobacco alcoholization stage defect identification method and system
By merging feature extraction and Hadamard product operation, combined with brightness and rebound coefficient, the problem of insufficient accuracy in cigar detection in the existing technology is solved, efficient and accurate detection of surface defects of cigars is achieved, and the reliability of the detection results is improved. sex.
Patent Information
- Application Number
- CN202410847589.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-10
AI Technical Summary
The existing cigar defect detection technology only targets a single feature and ignores the inherent relationship between surface texture, smoothness and brightness. It is also affected by the degree of dryness and moisture, resulting in insufficient accuracy and stability in detection.
Using a method based on fusion features, the global texture and local shape feature maps are obtained through a dual-path feature extraction network. Combined with the brightness change area and rebound coefficient, Hadamard product and pixel product operations are performed, and defect detection frames are merged to achieve detection of the cigar surface. Efficient and accurate detection of defects.
It improves the accuracy and reliability of cigar defect detection, maintains consistency with manual experience detection, and enhances the stability of detection results.
Smart Images

Figure CN118628469A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of video image processing, and in particular relates to a method and system for identifying defects in a cigar tobacco aging stage based on fusion features. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Cigars are a high-end tobacco product that is widely popular around the world. Due to the complex production process, high cost, and strict quality requirements of consumers, the quality control of cigars is particularly important. The production of cigars involves delicate craftsmanship and strict quality control, including tobacco selection, aging, rolling, storage and other links. In these links, the existence of defects may have a negative impact on the smoking quality, appearance and shelf life of cigars.
[0004] Traditional cigar defect detection mainly relies on human vision and experience judgment, which is not only inefficient but also susceptible to fatigue, subjective bias and experience level of inspectors. With the development of computer vision and image processing technology, automated defect detection methods have gradually become a hot topic in research and application. These technologies can quickly and accurately identify and classify various defects such as cracks, holes, uneven color and irregular shapes.
[0005] However, the application of existing automated defect detection technology in the cigar field still faces some challenges. In fact, high-quality cigars are smooth overall, have a uniform texture and are oily when exposed to light. However, the existing cigar defect detection technology only targets a single feature, ignoring the intrinsic relationship between surface texture, smoothness and brightness. At the same time, since the surface defects of cigars are often affected by their own dryness and humidity, simply using image features to identify defects still lacks sufficient accuracy and stability. Summary of the invention
[0006] In order to solve the above problems, the present invention proposes a method and system for identifying defects in the aging stage of cigar tobacco based on fusion features. The present invention can achieve efficient and accurate cigar defect detection, which is of great value for improving the automation level of cigar production and ensuring product quality.
[0007] According to some embodiments, the first solution of the present invention provides a method for identifying defects in cigar tobacco aging stage based on fusion features, using the following technical solution:
[0008] The defect recognition method of cigar tobacco aging stage based on fusion features includes:
[0009] Acquire a first video image and a second video image of the cigar tobacco to be detected and perform preprocessing to obtain a first panoramic image, a second panoramic image and a rebound image set;
[0010] Based on the first panoramic image, a dual-path feature extraction network is used to perform feature extraction to obtain a global texture feature map and a local shape feature map;
[0011] Detecting the brightness change area in the second panoramic image to generate a first weight feature map; calculating the rebound coefficients at different positions in the rebound image set to generate a second weight vector;
[0012] Defect detection is performed using the Hadamard product of the first weight feature map and the global texture feature map to obtain a first defect detection frame; defect detection is performed using the product of the weights in the second weight vector and the pixels of the local shape feature map to obtain a second defect detection frame; the two types of defect detection frames are merged to obtain a final defect detection result.
[0013] According to some embodiments, the second solution of the present invention provides a cigar tobacco aging stage defect recognition system based on fusion features, which adopts the following technical solutions:
[0014] Cigar tobacco aging stage defect recognition system based on fusion features, including:
[0015] A video image acquisition and processing module is configured to acquire a first video image and a second video image of the cigar tobacco to be detected and perform preprocessing to obtain a first panoramic image, a second panoramic image and a rebound image set;
[0016] A feature extraction module is configured to extract features based on the first panoramic image using a dual-path feature extraction network to obtain a global texture feature map and a local shape feature map;
[0017] The weight generation module is configured to detect the brightness change area in the second panoramic image to generate a first weight feature map; calculate the rebound coefficients at different positions in the rebound image set to generate a second weight vector;
[0018] The defect detection module is configured to perform defect detection by using the Hadamard product of the first weight feature map and the global texture feature map to obtain a first defect detection frame; perform defect detection by using the product of the weights in the second weight vector and the pixels of the local shape feature map to obtain a second defect detection frame; and merge the two types of defect detection frames to obtain a final defect detection result.
[0019] According to some embodiments, a third aspect of the present invention provides a computer-readable storage medium.
[0020] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for identifying defects in cigar tobacco aging stage based on fusion features as described in the first aspect above.
[0021] According to some embodiments, a fourth aspect of the present invention provides a computer device.
[0022] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for identifying defects in cigar tobacco aging stage based on fusion features as described in the first aspect above are implemented.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] The present invention aims to solve the problem that the existing technology only detects the unreliability of a single feature of cigar tobacco defects and ignores the factors that the dryness and moisture level of cigar tobacco affects the surface defects. The present invention provides a defect recognition method for cigar tobacco in the aging stage based on fusion features, combines brightness features with texture features, comprehensively considers surface texture, texture and smoothness as factors for defect detection, and improves detection accuracy. At the same time, the rebound coefficient is used to determine the dryness and moisture level of each part of the cigar, and the surface defect detection is guided by combining the dryness and moisture characteristics of the cigar's interior, so that the detection result is more reliable and can be consistent with the artificial experience detection method. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0026] Figure 1 is a model structure diagram of defect detection in an embodiment of the present invention;
[0027] Figure 2 is a side view of a video acquisition device in an embodiment of the present invention;
[0028] Figure 3 It is a front view of the video acquisition device in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0030] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0031] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0032] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0033] Embodiment 1
[0034] like Figure 1 As shown, this embodiment provides a method for identifying defects in cigar tobacco aging stage based on fusion features, and the method includes the following steps:
[0035] Acquire a first video image and a second video image of the cigar tobacco to be detected and perform preprocessing to obtain a first panoramic image, a second panoramic image and a rebound image set;
[0036] Based on the first panoramic image, a dual-path feature extraction network is used to perform feature extraction to obtain a global texture feature map and a local shape feature map;
[0037] Detecting the brightness change area in the second panoramic image to generate a first weight feature map; calculating the rebound coefficients at different positions in the rebound image set to generate a second weight vector;
[0038] Defect detection is performed using the Hadamard product of the first weight feature map and the global texture feature map to obtain a first defect detection frame; defect detection is performed using the product of the weights in the second weight vector and the pixels of the local shape feature map to obtain a second defect detection frame; the two types of defect detection frames are merged to obtain a final defect detection result.
[0039] This embodiment proposes a method for identifying defects in the aging stage of cigar tobacco based on fusion features: Figure 2 As shown, this is a side view of the video acquisition device of this embodiment, wherein the cigar tobacco to be tested is placed on a testing table, a guide rail is arranged above the testing table, and a shooting device is arranged on the guide rail. The shooting device can move along the guide rail and can be fixed at a specific position.
[0040] like Figure 3 As shown, this is a front view of the video acquisition device of this embodiment, wherein the cigar tobacco to be tested is placed on the testing table, and a plurality of pressing devices are arranged above the testing table. The pressing devices are located directly above the cigar tobacco to be tested, and the shooting device is fixed at the lowest position of the guide rail at this time. Figure 3 The current capture device is not shown.
[0041] like Figure 1 As shown, the embodiment of this specification provides a method for identifying defects in cigar tobacco aging stage based on fusion features, which may include:
[0042] Step S1: capturing a first video image of a cigar tobacco to be detected.
[0043] In the present application, the cigar tobacco to be tested is placed on a testing table, and the cigar tobacco to be tested is clamped and fixed by a fixing device on the testing table, the fixing devices are arranged at both ends of the storage area of the testing table, and multiple light source devices can be arranged around the testing table for illuminating the detection area. The multiple light source devices can ensure that the brightness of the storage area of the testing table is uniform, and a camera device is arranged above the testing table for taking video images of the tobacco to be tested.
[0044] The camera device can be set on the slide rail above the detection platform, and the camera device can be moved to capture video of less than 180 degrees around the cigar tobacco to be detected as a first video image. The first video image includes the entire cigar tobacco to be detected. The camera device can also capture images around the cigar tobacco to be detected at a specific angle.
[0045] Step S2: Acquire a second video image of the cigar tobacco to be detected.
[0046] Specifically, after the first video image around the cigar tobacco is captured, the shooting device in step S1 is moved and fixed to one side of the detection platform, and the cigar tobacco to be detected is pressed down at multiple points using multiple pressing devices arranged above the detection platform, and the pressing distance is adjustable. After pressing down, the pressing device is immediately retracted, and the shooting device is used to capture the rebound video of the pressed parts at multiple points of the cigar tobacco to be detected as the second video image. The second video captured by the device includes all pressing devices.
[0047] Step S3: pre-processing the collected first video image and second video image of the cigar tobacco to be detected to obtain a first panoramic image, a second panoramic image and a rebound image set.
[0048] In this embodiment, the preprocessing of the acquired first video image and the second video image may include:
[0049] Step S31: extracting multiple frames from the first video image acquired in step S1, and splicing the extracted multiple frames to generate a first panoramic image and a second panoramic image of the cigar tobacco to be detected.
[0050] The process of stitching together the first panoramic image and the second panoramic image of the cigar tobacco to be detected comprises:
[0051] Step S311: extracting multiple frames of the first video image acquired in step S1, and converting the multiple frames of images into multiple frames of grayscale images;
[0052] Step S312: Segmenting the mirror reflection region of each frame in the multiple grayscale images according to a preset brightness threshold, wherein the average brightness of the mirror reflection region is much higher than that of other regions;
[0053] Step S313: stitching frames of images one by one using images of the area where no specular reflection occurs, to obtain a first panoramic image, wherein the first panoramic image does not contain a bright area where specular reflection occurs;
[0054] Step S314: using the segmented mirror reflection area images to perform frame-by-frame image stitching to obtain a second panoramic image.
[0055] Step S32: extracting important frames of the second video image collected in step S2. Specifically, a frame image extraction cycle can be set, and the collected second video image is extracted according to the set extraction cycle to obtain a rebound image set to be analyzed.
[0056] Step S4: inputting the first panoramic image obtained in step S3 into a two-way feature extraction network, wherein the two-way feature extraction network may be configured to extract a global texture feature map and a local shape feature map of the first panoramic image.
[0057] This embodiment sets up a dual-path feature extraction network for extracting global features and local features of the cigar tobacco surface, wherein the global texture feature is used to represent the roughness of the cigar tobacco surface. During the production process of cigar tobacco, the surface of the tobacco is prone to defects such as bumps, scratches, and protrusions. At the same time, during the aging process of cigar tobacco, cracks of varying degrees will appear on the tobacco surface according to the humidity of the environment in which the tobacco is located. Therefore, this embodiment extracts the texture features of the tobacco surface as one of the judgment factors for cigar tobacco surface defect detection. It can be understood that the extraction of global texture features here can be performed using a feature extraction network in the prior art, which is not limited in this embodiment. This is a conventional technical means of those skilled in the art, and the specific content will not be repeated.
[0058] This embodiment uses the local feature extraction branch of the dual-path feature extraction network to extract the local shape features of the cigar tobacco surface, that is, the circular shape features. When the cigar tobacco is wet, circular mold spots will appear on the cigar tobacco surface. Therefore, this embodiment extracts the circular shape features of the tobacco surface as one of the judgment factors for cigar tobacco surface defect detection. For the local feature extraction branch, as long as the feature extraction can be performed according to the contents of steps S41-S43, the specific existing feature extraction network used is not limited in this embodiment.
[0059] The local feature extraction branch of the dual-path feature extraction is used to extract the local shape feature map of the cigar tobacco surface, including:
[0060] Step S41: Segment the first panoramic image along the vertical axis of the cigar tobacco to obtain a plurality of sub-images; the number of the plurality of sub-images is consistent with the number of multi-point depressions set in step S2;
[0061] Step S42: inputting the multiple sub-images into the shape feature network of the dual-path feature extraction network to extract local shape features;
[0062] Step S43: splicing the multiple sub-image local shape feature maps extracted in step S42 according to the segmentation method to obtain a local shape feature map.
[0063] Step S5: input the second panoramic image obtained in step S3 into a smoothness detection network to obtain a first weighted feature map.
[0064] The smoothness detection network is used to detect the brightness change area in the second panoramic image, that is, the defective area in the area where the mirror reflection occurs when shooting the video. The second panoramic image is input into the smoothness detection network to obtain the first weight feature map including:
[0065] The second panoramic image is converted into a grayscale image, and the brightness mean of the grayscale image is calculated. The difference between each pixel in the grayscale image and the brightness mean is obtained to obtain the absolute value of the difference, and the difference is normalized to obtain a grayscale change image of the second panoramic image, and the grayscale change image is used as the first weight feature map.
[0066] Here, the first weight vector feature map generated by the smoothness detection network is used to characterize the smoothness of the cigar tobacco surface, that is, each pixel value in the weight vector feature map represents the change in the brightness of the corresponding pixel in the second panoramic image relative to the brightness mean of the second panoramic feature map, wherein the pixel point with a large weight value represents that the brightness of the cigar tobacco at the position corresponding to the pixel point is obviously different from that of other areas, that is, the area corresponding to the position has a different degree of smoothness from other areas, that is, in the first weight feature map, the smaller the weight value of the area, the smoother the corresponding cigar tobacco surface. For the smoothness detection network, as long as the second panoramic image can be processed according to the above content, the specific existing network structure to be used is not limited in this embodiment.
[0067] Step S6: input the rebound image set obtained in step S3 into the boundary detection model, and output a second weight vector.
[0068] The boundary detection model is used to detect the boundary of the depressed part of the cigar tobacco. During the rebound process of the cigar tobacco surface, the position of the depressed part boundary rebounding at different times is obtained by detecting the depressed part boundary, and the boundary rebound time and boundary rebound degree are calculated according to the position change, and the rebound coefficient is obtained according to the boundary rebound degree and boundary rebound time. The rebound coefficient is used to characterize the dryness and moisture degree of the cigar tobacco at this point. The more moist the cigar tobacco is, the softer the tobacco is, the longer the rebound time is, the lower the rebound degree is, and the smaller the rebound coefficient is. In this embodiment, by testing the depression of multiple points of the cigar tobacco and photographing the rebound images of multiple points, multiple rebound coefficients can be obtained according to the above method, and the multiple rebound coefficients are composed of a rebound coefficient vector as the second weight vector, and each bit in the rebound coefficient vector corresponds to multiple depressed points in the vertical axis direction of the cigar tobacco.
[0069] Specifically, the boundary detection model can be implemented using a boundary detection network model such as Richer Convolutional Features for Edge Detection (RCF) and DeepEdge, or can be implemented using a traditional edge detection algorithm such as a Canny operator and a Sobel operator, which is not limited in this embodiment.
[0070] The rebound image set is input to the boundary detection model, and the output second weight vector includes:
[0071] Step S61: inputting multiple frames of images in the rebound image set into a boundary detection model respectively, and the boundary detection model outputs multiple edge feature maps;
[0072] Step S62: Find the lowest point of the upper edge of the cigar in each edge feature map, and determine the rebound degree of multiple pressed positions;
[0073] Step S63: Calculate a plurality of rebound speeds according to the rebound degrees corresponding to the previous and next frames, wherein the rebound speed is the ratio of the rebound degree distance difference between the previous and next frames to the previous and next frame time;
[0074] Step S64: Calculate the rebound speed of each pressed position frame by frame, and use the reciprocal of the average of multiple rebound speeds of each pressed position as the rebound coefficient of the current position;
[0075] Step S65: normalizing multiple rebound coefficients at different positions to form a second weight vector.
[0076] Here, each bit in the second weight vector is a coefficient of resilience at a different position, which corresponds one-to-one to different regions along the vertical axis of the cigar tobacco to be tested, and each coefficient of resilience corresponds to the dryness and moisture level of the corresponding position of the cigar tobacco to be tested.
[0077] Step S7: Use the first feature weight map obtained in step S5 to guide the global texture feature image obtained in step S3 to generate a first defect detection frame, use the second weight vector obtained in step S6 to guide the local shape feature obtained in step S4 to generate a second defect detection frame, merge the two types of defect detection frames, and obtain the final detection result.
[0078] Wherein, using the first weight feature map to guide the global texture feature image to generate a first defect detection frame and using the second weight vector to guide the local shape feature to generate a second defect detection frame includes:
[0079] Step S71: Calculate the Hadamard product of the global texture feature map and the first weight feature map, and use the calculation result as the first fusion feature map;
[0080] Step S72: inputting the first fused feature map into the first defect detection network, and outputting a first defect detection frame;
[0081] Step S73: multiply each weight in the second weight vector by each pixel in the local shape feature map of the sub-image corresponding to the weight to obtain a second fused feature map;
[0082] Step S74: input the second fused feature map into the second defect detection network to generate a second defect detection frame.
[0083] The first defect detection network and the second defect detection network can be a two-stage target detection network without the feature extraction part, such as R-CNN, Fast-RCNN, Yolo series network, which is not limited in this embodiment.
[0084] Specifically, the use of the first weight feature map to guide the global texture feature image to generate the first defect frame includes using the brightness change factor as the attention weight to perform weighted fusion on the global texture feature map, so that the brightness change area is larger, that is, the image position corresponding to the area with abnormal smoothness on the surface of the cigar tobacco to be detected is emphasized, and the area with uniform brightness is suppressed. Similarly, the rebound coefficient in the second weight vector is used as the attention weight to perform weighted fusion on the local shape feature map, so that the dryness and humidity factors of different parts are introduced in the process of mold defect detection.
[0085] Specifically, the first weighted feature map counts the grayscale changes of cigar tobacco. The global feature is combined with the global texture feature in the first panoramic image, so that during the defect detection process, the defect monitoring network pays more attention to areas with large changes in brightness, thereby improving the detection accuracy of texture defects. At the same time, this embodiment obtains the rebound coefficients of multiple points to characterize the dryness and wetness of different positions of cigar tobacco, and uses multiple local rebound coefficients combined with local shape features to improve the detection accuracy of mold spots.
[0086] Before the model training process of this embodiment, the surrounding video images and the pressing video images of cigar tobacco at different aging stages are collected, and the video frames in the two video images are sampled. The sampled video frames of the surrounding video are automatically stitched with the feature matching algorithm to obtain a panoramic image containing a complete cigar tobacco. The matching features can be used, such as SIFT, SURF, ORB features, etc. The area with a brightness area greater than the set threshold is automatically stitched with the panoramic image and the panoramic brightness image of each surrounding video image is calculated. The sampled video frames of the pressing video are input into the pre-trained edge detection network and the weight vector composed of the corresponding rebound coefficient of each pressing video sample is calculated. The panoramic image is manually labeled for defects to construct a sample set. Each sample data part includes: panoramic image, panoramic brightness image, weight vector, and the cigar tobacco defect data set is obtained by combining the manually labeled defect frame. The global texture feature and local shape feature branch network are pre-trained using the public COCO, ImageNet and other data sets, and then the model is fine-tuned using the training set in the cigar tobacco defect data set, and the model training is completed on the test set under the condition that the detection accuracy is met or the number of iterative training is greater than the preset threshold.
[0087] Embodiment 2
[0088] This embodiment provides a cigar tobacco aging stage defect recognition system based on fusion features, including:
[0089] A video image acquisition and processing module is configured to acquire a first video image and a second video image of the cigar tobacco to be detected and perform preprocessing to obtain a first panoramic image, a second panoramic image and a rebound image set;
[0090] A feature extraction module is configured to extract features based on the first panoramic image using a dual-path feature extraction network to obtain a global texture feature map and a local shape feature map;
[0091] The weight generation module is configured to detect the brightness change area in the second panoramic image to generate a first weight feature map; calculate the rebound coefficients at different positions in the rebound image set to generate a second weight vector;
[0092] The defect detection module is configured to perform defect detection by using the Hadamard product of the first weight feature map and the global texture feature map to obtain a first defect detection frame; perform defect detection by using the product of the weights in the second weight vector and the pixels of the local shape feature map to obtain a second defect detection frame; and merge the two types of defect detection frames to obtain a final defect detection result.
[0093] The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment 1. It should be noted that the above modules as part of the system can be executed in a computer system such as a set of computer executable instructions.
[0094] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0095] The proposed system can be implemented in other ways. For example, the system embodiment described above is only illustrative, and the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0096] Embodiment 3
[0097] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method for identifying defects in cigar tobacco aging stage based on fusion features as described in the first embodiment above are implemented.
[0098] Embodiment 4
[0099] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method for identifying defects in cigar tobacco aging stage based on fusion features as described in the first embodiment are implemented.
[0100] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0101] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0102] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A method for identifying defects in cigar tobacco aging stage based on fusion features. It is characterized in that include: Acquire a first video image and a second video image of the cigar tobacco to be detected and perform preprocessing to obtain a first panoramic image, a second panoramic image and a rebound image set; Based on the first panoramic image, a dual-path feature extraction network is used to perform feature extraction to obtain a global texture feature map and a local shape feature map; Detecting the brightness change area in the second panoramic image to generate a first weight feature map; calculating the rebound coefficients at different positions in the rebound image set to generate a second weight vector; Defect detection is performed using the Hadamard product of the first weighted feature map and the global texture feature map to obtain a first defect detection frame; Defect detection is performed using the product of the weights in the second weight vector and the pixels of the local shape feature map to obtain a second defect detection frame; the two types of defect detection frames are merged to obtain a final defect detection result.
2. The method for identifying defects in cigar tobacco aging stage based on fusion features according to claim 1, It is characterized in that The first video image and the second video image of the cigar tobacco to be detected are obtained and preprocessed, specifically: Extracting multiple frames from the first video image and converting the multiple frames into multiple frames of grayscale images; According to a preset brightness threshold, the mirror reflection area of each frame in the multiple grayscale images is segmented; Using images of the area where no specular reflection occurs to perform frame-by-frame image stitching, a first panoramic image is obtained, wherein the first panoramic image does not include a bright area where specular reflection occurs; Using the segmented mirror reflection area images to perform frame-by-frame image stitching to obtain a second panoramic image; The second video image is extracted according to a set extraction cycle to obtain a rebound image set.
3. The method for identifying defects in cigar tobacco aging stage based on fusion features according to claim 1, It is characterized in that Based on the first panoramic image, a dual-path feature extraction network is used to extract features to obtain a local shape feature map, specifically: Segmenting the first panoramic image along the vertical axis of the cigar tobacco to obtain a plurality of sub-images; Inputting a plurality of sub-images into the shape feature network of the dual-path feature extraction network to extract local shape features; The local shape feature map of the multiple sub-images extracted is spliced according to the segmentation method to obtain a local shape feature map.
4. The method for identifying defects in cigar tobacco aging stage based on fusion features according to claim 1, It is characterized in that The step of detecting the brightness change area in the second panoramic image to generate the first weight feature map is specifically as follows: Convert the second panoramic image into a grayscale image, and calculate the brightness mean of the grayscale image; Subtract each pixel in the grayscale image from the brightness mean to obtain the absolute value of the difference and normalize it; A grayscale change image of the second panoramic image is obtained, and the grayscale change image is used as the first weight feature map.
5. The method for identifying defects in cigar tobacco aging stage based on fusion features according to claim 1, It is characterized in that The calculation of the rebound coefficients at different positions in the rebound image set to generate the second weight vector is specifically: Inputting multiple frames of images in the rebound image set into a boundary detection model respectively, and the boundary detection model outputs multiple edge feature maps; Find the lowest point of the upper edge of the cigar in each edge feature map and determine the degree of rebound at multiple pressing positions; According to the rebound degrees corresponding to the previous and next frames, a plurality of rebound speeds are calculated, wherein the rebound speed is the ratio of the rebound degree distance difference between the previous and next frames to the previous and next frame time; The rebound speed of each pressing position is calculated frame by frame, and the reciprocal of the average of multiple rebound speeds of each pressing position is used as the rebound coefficient of the current position; A plurality of rebound coefficients at different positions are normalized to form a second weight vector.
6. The method for identifying defects in cigar tobacco aging stage based on fusion features according to claim 1, It is characterized in that The defect detection is performed by using the Hadamard product of the first weight feature map and the global texture feature map to obtain a first defect detection frame; and the defect detection is performed by using the product of the weight in the second weight vector and the pixel of the local shape feature map to obtain a second defect detection frame, specifically: Calculating the Hadamard product of the global texture feature map and the first weight feature map, and using the calculation result as the first fusion feature map; Inputting the first fused feature map into a first defect detection network, and outputting a first defect detection frame; Multiply each weight in the second weight vector by each pixel in the local shape feature map of the sub-image corresponding to the weight in the local shape feature map to obtain a second fused feature map; The second fused feature map is input into the second defect detection network to generate a second defect detection frame.
7. The method for identifying defects in cigar tobacco aging stage based on fusion features according to claim 1, It is characterized in that The first video image is a video image containing the entire cigar tobacco to be tested; The second video image is a video of the rebound of the pressed parts at multiple points of the cigar tobacco to be tested.
8. Cigar tobacco aging stage defect recognition system based on fusion features, It is characterized in that include: A video image acquisition and processing module is configured to acquire a first video image and a second video image of the cigar tobacco to be detected and perform preprocessing to obtain a first panoramic image, a second panoramic image and a rebound image set; A feature extraction module is configured to extract features based on the first panoramic image using a dual-path feature extraction network to obtain a global texture feature map and a local shape feature map; A weight generation module is configured to detect the brightness change area in the second panoramic image and generate a first weight feature map; Calculating the rebound coefficients at different positions in the rebound image set to generate a second weight vector; A defect detection module is configured to perform defect detection using a Hadamard product of a first weight feature map and a global texture feature map to obtain a first defect detection frame; Defect detection is performed using the product of the weights in the second weight vector and the pixels of the local shape feature map to obtain a second defect detection frame; the two types of defect detection frames are merged to obtain a final defect detection result.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the steps of the method for identifying defects in the cigar tobacco aging stage based on fusion features as described in any one of claims 1 to 7 are implemented.
10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps of the method for identifying defects in the cigar tobacco aging stage based on fusion features as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Defect candidate area enhanced image detection method and system
CN122573944A
