Image processing method and apparatus, storage medium, and electronic device

By combining convolutional neural networks and generative adversarial networks, accurate detection and repair of filamentous occlusions are achieved, solving the problem of inaccurate detection in traditional methods and improving the user experience.

WO2026242875A1PCT designated stage Publication Date: 2026-11-26TCL COMMUNICATION TECHNOLOGY (NINGBO) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/096517
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-23
Filing Date
2026-05-12
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

Traditional pixel color detection methods struggle to accurately detect filamentous occlusions in images, resulting in poor restoration effects and a subpar user experience.

Method used

A semantic segmentation model based on convolutional neural networks is used for the detection and segmentation of filamentous occlusions. Multimodal feature extraction and fusion are performed by combining auxiliary processed images to generate an initial mask image. Finally, filamentous occlusions are repaired by generative adversarial networks.

Benefits of technology

It improves the detection and repair of filamentous obstructions, enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026096517_26112026_PF_FP_ABST
    Figure CN2026096517_26112026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image processing, and discloses an image processing method and apparatus, a storage medium, and an electronic device. The method comprises: using a semantic segmentation model based on a convolutional neural network to perform detection and segmentation processing of a filamentous occluding object on an image to be processed, so as to obtain an initial mask image comprising a filamentous occlusion region; and on the basis of the initial mask image, performing inpainting processing of the filamentous occluding object on the image to be processed. The present application improves the detection and inpainting effect of the filamentous occluding object in the image.
Need to check novelty before this filing date? Find Prior Art

Description

Image processing methods, apparatuses, storage media and electronic devices

[0001] This application claims priority to Chinese Patent Application No. 202510671976.X, filed on May 23, 2025, entitled "Image Processing Method, Apparatus, Storage Medium, Electronic Device and AR Glasses", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of image processing technology, specifically to an image processing method, apparatus, storage medium, and electronic device. Background Technology

[0003] Taking AR glasses and mobile phones as examples, when users take photos with these devices, there is a high probability that filamentous occlusions such as hair strands will appear in the captured images, affecting the image quality. The detection and repair of these filamentous occlusions is therefore of great importance. However, unlike some other types of occlusions, filamentous occlusions are characterized by their curvature, irregularity, and elongation. Traditional methods such as pixel color detection are easily affected by background and lighting conditions in the image, making accurate detection difficult. This further leads to poor repair results for filamentous occlusions in the image and a poor user experience. Technical issues

[0004] Because filamentous occlusions are characterized by their curvature, irregularity, and slenderness, traditional methods such as pixel color detection are easily affected by background and lighting conditions in the image, making it difficult to accurately detect them. This results in poor restoration of filamentous occlusions in the image and a poor user experience. Technical solutions

[0005] This application provides a solution that can effectively improve the detection and repair of filamentous occlusions in images, thereby enhancing the user experience.

[0006] The embodiments of this application provide the following technical solutions:

[0007] According to one embodiment of this application, an image processing method includes: acquiring an image to be processed; using a semantic segmentation model based on a convolutional neural network to perform filamentous occlusion detection and segmentation processing on the image to be processed to obtain an initial mask image containing filamentous occlusion regions; and performing filamentous occlusion repair processing on the image to be processed based on the initial mask image to obtain a repaired image.

[0008] In one embodiment, the step of using a semantic segmentation model based on a convolutional neural network to perform filamentous occlusion detection and segmentation processing on the image to be processed to obtain an initial mask image containing filamentous occlusion regions includes one of the following methods: using the semantic segmentation model to perform filamentous occlusion detection and segmentation processing on the image to be processed to obtain an initial mask image containing filamentous occlusion regions; obtaining an auxiliary processing image of the image to be processed, and using the semantic segmentation model to perform filamentous occlusion detection and segmentation processing on the image to be processed and the auxiliary processing image to obtain an initial mask image containing filamentous occlusion regions.

[0009] In one embodiment, obtaining the auxiliary processing image of the image to be processed includes: obtaining at least one of a depth image, an infrared image, a previous frame image, and a subsequent frame image corresponding to the image to be processed, to obtain the auxiliary processing image.

[0010] In one embodiment, the step of performing filamentous occlusion detection and segmentation processing based on the image to be processed to obtain an initial mask image containing filamentous occlusion regions includes:

[0011] The image to be processed is sequentially downsampled through multiple coding layers to obtain hierarchical feature maps in each coding layer and the coded feature map output by the last coding layer. The hierarchical feature maps in each coding layer are then transmitted to the corresponding decoding layers via skip connections. The coded feature maps are convolved to obtain a global feature map. The global feature map is sequentially upsampled through multiple decoding layers in combination with the hierarchical feature maps to obtain a decoded feature map. The decoded feature map is then transformed to obtain an initial mask image containing the filamentary occlusion region.

[0012] In one embodiment, the step of performing filamentary occlusion detection and segmentation processing on the image to be processed to obtain an initial mask image containing filamentary occlusion regions includes: using a backbone network to extract multi-scale features from the image to be processed to obtain a high-level feature map and a low-level feature map; performing dilated spatial pyramid pooling processing on the high-level feature map to obtain a fused feature map; concatenating the low-level feature map and the fused feature map to obtain a concatenated feature map; performing convolution, upsampling, and convolution processing on the concatenated feature map to obtain a prediction map; and performing transformation processing on the prediction map to obtain the initial mask image containing filamentary occlusion regions.

[0013] In one embodiment, the step of performing filamentary occlusion detection and segmentation processing based on the image to be processed and the auxiliary processing image to obtain an initial mask image containing filamentary occlusion regions includes: concatenating the image to be processed and the auxiliary processing image into a multimodal input image; sequentially downsampling the multimodal input image through multiple coding layers to obtain multimodal hierarchical feature maps in each coding layer and a multimodal coded feature map output by the last coding layer; transmitting the multimodal hierarchical feature maps in each coding layer to the corresponding decoding layers through skip connections; performing convolution processing on the multimodal coded feature maps to obtain a multimodal global feature map; sequentially upsampling the multimodal global feature map in multiple decoding layers in combination with the multimodal hierarchical feature maps to obtain a multimodal decoded feature map; and performing fusion and transformation processing on the multimodal decoded feature maps to obtain the initial mask image containing filamentary occlusion regions.

[0014] In one embodiment, the step of performing filamentary occlusion detection and segmentation processing based on the image to be processed and the auxiliary processing image to obtain an initial mask image containing filamentary occlusion regions includes: concatenating the image to be processed and the auxiliary processing image into a multimodal input image; using a backbone network to perform multimodal multi-scale feature extraction on the multimodal input image to obtain multimodal high-level feature maps and multimodal low-level feature maps; performing dilated spatial pyramid pooling processing on the multimodal high-level feature maps to obtain a fused multimodal feature map; concatenating the multimodal low-level feature maps and the fused multimodal feature maps to obtain a concatenated feature map; performing convolution, upsampling, and convolution processing on the concatenated feature map to obtain a prediction map; and performing transformation processing on the prediction map to obtain the initial mask image containing filamentary occlusion regions.

[0015] In one embodiment, the step of performing filamentous occlusion repair processing on the image to be processed based on the initial mask image to obtain a repaired image includes: performing detection and optimization processing on the filamentous occlusion regions in the initial mask image to obtain an optimized mask image; and performing filamentous occlusion repair processing on the image to be processed based on the optimized mask image to obtain a repaired image.

[0016] In one embodiment, the step of detecting and optimizing the filamentary occlusion region in the initial mask image to obtain an optimized mask image includes: detecting the filamentary occlusion region in the initial mask image to obtain the region edge of the filamentary occlusion region; expanding the filamentary occlusion region in the initial mask image based on the region edge of the filamentary occlusion region to obtain a region-expanded mask image; and performing edge smoothing processing on the region-expanded mask image to obtain the optimized mask image.

[0017] In one embodiment, detecting the filamentary occlusion region in the initial mask image to obtain the region edge of the filamentary occlusion region includes: performing color feature detection on the mask image to obtain the region edge of the filamentary occlusion region in the mask image; or, performing edge feature detection on the mask image to obtain the region edge of the filamentary occlusion region in the mask image.

[0018] In one embodiment, the step of performing filamentous occlusion repair processing on the image to be processed based on the optimized mask image to obtain a repaired image includes: using a generative adversarial network to perform filamentous occlusion repair processing using the optimized mask image and the image to be processed to obtain a repaired image with the filamentous occlusions removed.

[0019] In one embodiment, the use of a generative adversarial network (GAN) to perform filamentary occlusion repair processing using the optimized mask image and the image to be processed to obtain a repaired image with the filamentary occlusions removed includes: concatenating the optimized mask image and the image to be processed along the channel dimension to obtain a concatenated image; sequentially downsampling the concatenated image through multiple coding layers to obtain hierarchical feature maps in each coding layer and a coding feature map output by the last coding layer; transmitting the hierarchical feature maps in each coding layer to the corresponding decoding layers via skip connections; aggregating the coding feature maps to obtain aggregated feature maps; superimposing the optimized mask image and the aggregated feature map to obtain a repair guidance feature map; sequentially upsampling the repair guidance feature map in multiple decoding layers in conjunction with the hierarchical feature maps to obtain a decoded feature map; converting the decoded feature map to obtain a decoded output image; and fusing the masked region of the decoded output image and the non-masked region of the image to be processed to obtain the repaired image with the filamentary occlusions removed.

[0020] In one embodiment, the step of performing filamentary occlusion repair processing on the image to be processed based on the optimized mask image to obtain a repaired image includes: determining occluded image regions and non-occluded image regions in the image to be processed based on the optimized mask image; assigning a candidate patch block located in the non-occluded image region to each occluded pixel in the occluded image region; iteratively optimizing the candidate patch blocks assigned to each occluded pixel to obtain a matching patch block corresponding to each occluded pixel; and copying the pixels in the matching patch block corresponding to each occluded pixel to each occluded pixel to obtain the repaired image.

[0021] In one embodiment, acquiring the image to be processed includes one of the following methods: acquiring an original image and determining the original image as the image to be processed; acquiring the original image and normalizing the original image to obtain a normalized image; and performing Gaussian blur processing or histogram equalization processing on the normalized image to obtain the image to be processed.

[0022] According to one embodiment of this application, an image processing apparatus includes: an acquisition module for acquiring an image to be processed; a segmentation module for performing filamentous occlusion detection and segmentation processing on the image to be processed using a semantic segmentation model based on a convolutional neural network to obtain an initial mask image containing filamentous occlusion regions; and a repair module for performing filamentous occlusion repair processing on the image to be processed based on the initial mask image to obtain a repaired image.

[0023] According to another embodiment of this application, a storage medium stores a computer program thereon, which, when executed by a computer's processor, causes the computer to perform the methods described in the embodiments of this application.

[0024] According to another embodiment of this application, an electronic device may include: a memory storing a computer program; and a processor reading the computer program stored in the memory to execute the methods described in the embodiments of this application.

[0025] According to another embodiment of this application, an AR glasses may include: a memory storing a computer program; and a processor reading the computer program stored in the memory to execute the methods described in the embodiments of this application.

[0026] According to another embodiment of this application, a computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of the device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the device to perform the methods provided in the various optional implementations described in the embodiments of this application. Beneficial effects

[0027] In this embodiment, an image to be processed is obtained; a semantic segmentation model based on a convolutional neural network is used to perform filamentous occlusion detection and segmentation processing on the image to be processed to obtain an initial mask image containing filamentous occlusion regions; based on the initial mask image, filamentous occlusion repair processing is performed on the image to be processed to obtain a repaired image.

[0028] In the embodiments of this application, for the image to be processed, a semantic segmentation model based on a convolutional neural network is used to perform filamentous occlusion detection and segmentation processing on the image to be processed. This can accurately detect and segment an initial mask image containing filamentous occlusion regions. Based on this mask image, filamentous occlusion repair processing is performed on the image to be processed, which can effectively improve the detection and repair effect of filamentous occlusions in the image and enhance the user experience. Attached Figure Description

[0029] 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.

[0030] Figure 1 shows a flowchart of an image processing method according to an embodiment of this application.

[0031] Figure 2 shows a flowchart of image detection and segmentation according to an embodiment of this application.

[0032] Figure 3 shows a flowchart of image detection and segmentation according to another embodiment of this application.

[0033] Figure 4 shows a flowchart of image detection and segmentation according to another embodiment of this application.

[0034] Figure 5 shows a block diagram of an image processing apparatus according to an embodiment of the present application.

[0035] Figure 6 shows a block diagram of an electronic device according to an embodiment of this application.

[0036] Implementation methods of this application

[0037] The present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments provided herein are merely illustrative of the present disclosure and are not intended to limit the present disclosure. Furthermore, the embodiments provided below are some embodiments for implementing the present disclosure, and not all embodiments for implementing the present disclosure. Unless otherwise specified, the technical solutions described in the embodiments of the present disclosure can be implemented in any combination.

[0038] It should be noted that, in the embodiments of this disclosure, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other related elements (e.g., steps in the method or units in the apparatus, such as portions of circuitry, processors, programs, or software, etc.) in the method or apparatus that includes that element.

[0039] For example, the image processing method provided in this disclosure includes a series of steps, but the image processing method provided in this disclosure is not limited to the steps described. Similarly, the image processing apparatus provided in this disclosure includes a series of units, but the apparatus provided in this disclosure is not limited to the units explicitly described, but may also include units that need to be set up for obtaining relevant information or processing based on information.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of this disclosure.

[0041] It is understood that in the specific implementation of this application, relevant data is involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards.

[0042] Figure 1 schematically illustrates a flowchart of an image processing method according to an embodiment of this application. The entity executing the image processing method may be a device and / or a server with processing capabilities, wherein the device may include, but is not limited to, AR glasses, mobile phones, smartwatches, computers, cameras, or door locks, etc., and the server may include, but is not limited to, cloud servers or physical servers.

[0043] In one specific embodiment of this application, the image processing method is specifically implemented by AR glasses. Images taken by users wearing AR glasses are often easily obscured by strands of hair. By applying the method of the embodiment of this application, AR glasses can perfectly repair the strands of hair in the captured image (that is, seamlessly remove the strands of hair in the image) and display the repaired image in real time on the display screen of AR glasses or save the repaired image to a predetermined location.

[0044] As shown in Figure 1, the image processing method may include steps S110 to S130.

[0045] Step S110: Obtain the image to be processed;

[0046] Step S120: Using a semantic segmentation model based on a convolutional neural network, perform filamentous occlusion detection and segmentation processing on the image to be processed to obtain an initial mask image containing filamentous occlusion regions.

[0047] Step S130: Based on the initial mask image, perform filamentous occlusion repair processing on the image to be processed to obtain the repaired image.

[0048] The image to be processed is the image that needs image restoration. The image to be processed contains filamentous occlusions (filamentous occlusions are the parts of the image covered by filamentous objects), which can include, but are not limited to, hair strands, fine lines, etc. For example, the original image taken by AR glasses can be used as the image to be processed, or the original image can be preprocessed and then used as the image to be processed.

[0049] In the embodiments of this application, a semantic segmentation model based on a convolutional neural network (e.g., U-Net model or DeepLabv3+ model, etc.) is pre-trained for "filamentous occlusion detection and segmentation processing". By training the semantic segmentation model, filamentous occlusions with characteristics such as curvature, irregularity and elongation can be accurately detected and segmented, and an initial mask image containing the filamentous occlusion region (i.e. the region corresponding to the filamentous occlusion, which is filamentous) is output.

[0050] The training method for the semantic segmentation model based on convolutional neural networks can be as follows: A training set is obtained, which includes multiple image samples and corresponding mask image samples for each image sample. The multiple image samples contain different filamentous occlusions, and the mask image samples contain filamentous occlusion regions. Then, the "initial semantic segmentation model based on convolutional neural networks" is used to perform filamentous occlusion detection and segmentation processing on each image sample, and the semantic segmentation model outputs the predicted mask image corresponding to each image sample. The mask image samples and predicted mask images corresponding to each image sample are compared respectively, and the parameters of the "initial semantic segmentation model based on convolutional neural networks" are adjusted according to the comparison results until the predetermined end-of-training conditions are met (e.g., reaching a predetermined number of training iterations or achieving an accuracy higher than a predetermined value, etc.), resulting in the "trained semantic segmentation model based on convolutional neural networks."

[0051] The initial mask image is a binary image. It can display the filamentary occlusion area and other non-filamentary occlusion areas through binarization. For example, pixels in the filamentary occlusion area of ​​the initial mask image can be represented by 1, and pixels in other non-filamentary occlusion areas of the initial mask image can be represented by 0.

[0052] By using a semantic segmentation model, the image to be processed can be accurately detected and segmented to obtain an initial mask image that accurately represents the filamentous occlusion region. Then, based on this initial mask image, the image to be processed can be repaired to remove the filamentous occlusion, resulting in a repaired image with good repair effect.

[0053] In summary, in accordance with the embodiments of this application, for the image to be processed, a semantic segmentation model based on a convolutional neural network is used to perform filamentous occlusion detection and segmentation processing on the image to be processed. This can accurately detect and segment an initial mask image containing filamentous occlusion regions. Based on this mask image, filamentous occlusion repair processing is performed on the image to be processed, which can effectively improve the detection and repair effect of filamentous occlusions in the image and enhance the user experience.

[0054] The following describes further optional embodiments of the steps performed during image processing in the embodiment shown in Figure 1.

[0055] In one embodiment, step S110, acquiring the image to be processed, may include one of the following methods:

[0056] The first method involves acquiring the original image and determining the original image as the image to be processed.

[0057] The second method involves acquiring the original image, normalizing the original image to obtain a normalized image, and then performing Gaussian blurring or histogram equalization on the normalized image to obtain the image to be processed.

[0058] In the first method, the original image is used directly as the image to be processed. For example, the original image captured by AR glasses is used as the image to be processed.

[0059] In the second method, the original image is preprocessed by normalizing the pixel values ​​in the original image to the [0, 1] interval to obtain a normalized image. The normalized image is then further subjected to Gaussian blurring or histogram equalization to obtain a processed image with enhanced image quality and reduced noise. This processed image is used for subsequent detection and segmentation processing, which can further improve the accuracy of detection and segmentation, that is, improve the effect of the mask image.

[0060] In one embodiment, step S120, where a semantic segmentation model based on a convolutional neural network is used to perform filamentous occlusion detection and segmentation processing on the image to be processed to obtain an initial mask image containing the filamentous occlusion region, may include one of the following methods:

[0061] The first detection and segmentation method uses the semantic segmentation model to perform filamentous occlusion detection and segmentation on the image to be processed, and obtains an initial mask image containing the filamentous occlusion region.

[0062] The second detection and segmentation processing method is shown in Figure 2. In step S210, an auxiliary processing image of the image to be processed is obtained; in step S220, the semantic segmentation model is used to perform filamentous occlusion detection and segmentation processing based on the image to be processed and the auxiliary processing image to obtain an initial mask image containing the filamentous occlusion region.

[0063] In the first detection and segmentation processing method, the image to be processed is input into the semantic segmentation model. The semantic segmentation model performs filamentous occlusion detection and segmentation processing based on the input image to obtain an initial mask image containing the filamentous occlusion region.

[0064] In the second detection and segmentation method, an auxiliary processing image of the image to be processed is further obtained, and the image to be processed and the auxiliary processing image are jointly input into the semantic segmentation model. The semantic segmentation model performs filamentous occlusion detection and segmentation processing based on the input image to be processed and the auxiliary processing image to obtain an initial mask image containing the filamentous occlusion region. With the help of the auxiliary processing image, the segmentation accuracy of the mask image can be further improved.

[0065] Furthermore, in one embodiment of the first detection and segmentation processing method, referring to Figure 3, the step of performing filamentous occlusion detection and segmentation processing based on the image to be processed to obtain an initial mask image containing the filamentous occlusion region may include:

[0066] Step S310: The image to be processed is sequentially downsampled in multiple coding layers to obtain hierarchical feature maps in each coding layer and the coding feature map output by the last coding layer; Step S320: The hierarchical feature maps in each coding layer are transmitted to the corresponding decoding layers through skip connections; Step S330: The coding feature maps are convolved to obtain a global feature map; Step S340: The global feature map is sequentially upsampled in multiple decoding layers in combination with the hierarchical feature maps to obtain a decoded feature map; Step S350: The decoded feature map is transformed to obtain an initial mask image containing the filamentary occlusion region.

[0067] Taking the U-Net semantic segmentation model as an example, the U-Net model can include an encoder, a decoder, a bottleneck layer, and an output layer. The encoder includes multiple encoding layers, and the decoder includes multiple decoding layers. Skip connections are established between encoding and decoding layers of the same resolution.

[0068] The encoder can sequentially downsample the image to be processed across multiple coding layers. Each coding layer can output a feature map as a hierarchical feature map, which is then shared with the decoding layer. The feature map output by the last coding layer after the sequential downsampling process is used as the encoded feature map. The hierarchical feature maps in each coding layer can be transmitted to the decoding layer, which has established skip connections with each coding layer, through skip connections.

[0069] The bottleneck layer can be used to perform convolution on the encoded feature map, and the global features can be extracted through convolution to obtain the global feature map. Then, the decoder can sequentially upsample this global feature map in multiple decoding layers, combining it with the hierarchical feature maps, and the feature map output by the last decoding layer after the sequential upsampling process is used as the decoded feature map.

[0070] Finally, the output layer can be used to transform the decoded feature map to obtain a mask image containing the filamentary occlusion region. This transformation process can include: converting the decoded feature map into a probability map through an activation function, and then further converting the probability map into the initial mask image.

[0071] Based on this embodiment, through serial downsampling, convolution, skip connections to share feature maps, and serial upsampling, a mask image containing filamentous occlusion regions can be accurately detected and segmented. In particular, it can accurately detect and segment an initial mask image containing filamentous occlusion regions for images to be processed taken in natural environments.

[0072] Furthermore, in another embodiment of the first detection and segmentation processing method, the step of performing filamentous occlusion detection and segmentation processing based on the image to be processed to obtain an initial mask image containing the filamentous occlusion region may include:

[0073] A backbone network is used to extract multi-scale features from the image to be processed, resulting in high-level feature maps and low-level feature maps. The high-level feature maps are then subjected to dilated spatial pyramid pooling to obtain a fused feature map. The low-level feature maps and the fused feature maps are concatenated to obtain a spliced ​​feature map. The spliced ​​feature map is then upsampled and convolved to obtain a prediction map. Finally, the prediction map is transformed to obtain an initial mask image containing filamentary occlusion regions.

[0074] Taking the DeepLabv3+ semantic segmentation model as an example, the DeepLabv3+ model can include an encoder, a decoder, and an output layer. The encoder can include a backbone network and a dilated spatial pyramid pooling (ASPP) module. A pre-trained convolutional neural network (such as ResNet, Xception, etc.) can be used as the backbone network. The ASPP module can include dilated convolutional layers, global average pooling, and feature fusion layers. The decoder can include a feature concatenation layer, an upsampling layer, and convolutional layers.

[0075] By employing a backbone network to perform multi-scale feature extraction on the image to be processed, high-level feature maps and low-level feature maps can be obtained. For example, when performing multi-scale feature extraction in the backbone network, the image to be processed is sequentially passed through the initial convolutional layer, residual block 1, residual block 2, residual block 3, and residual block 4. The high-level feature map can be the feature map finally output by residual block 4, and the low-level feature map can be the feature map output by residual block 1 during the multi-scale feature extraction process.

[0076] The Spatial Pyramid Pooling (ASPP) module can be used to process high-level feature maps to obtain fused feature maps. Specifically, the Spatial Pyramid Pooling (ASPP) module can sequentially process high-level feature maps through dilated convolution layers, global average pooling, and feature fusion layers to obtain the fused feature maps.

[0077] The feature concatenation layer in the decoder can concatenate the low-level feature map and the fused feature map to obtain a concatenated feature map. The upsampling layer and convolutional layer in the decoder can upsample and convolve the concatenated feature map to obtain a prediction map (i.e., a probability map). Finally, the output layer can transform the prediction map to obtain an initial mask image containing the filamentary occlusion region.

[0078] Based on this embodiment, through the above-mentioned multi-scale feature extraction, hollow space pyramid pooling processing, feature map stitching and convolution, upsampling and convolution processing, the mask image containing filamentous occlusion regions can also be accurately detected and segmented. In particular, for images to be processed taken in urban and other architectural environments, the initial mask image containing filamentous occlusion regions can be accurately detected and segmented.

[0079] Furthermore, in the second detection and segmentation processing method, obtaining the auxiliary processing image of the image to be processed may specifically include: obtaining at least one of the depth image, infrared image, previous frame image and next frame image corresponding to the image to be processed, to obtain the auxiliary processing image.

[0080] A depth image is an image that uses the distance (depth) values ​​of points in a scene captured by an image acquisition device (such as a camera or AR glasses) as pixel values. For example, AR glasses can acquire a depth image while capturing the original image. An infrared image is an image formed by capturing radiation using an infrared remote sensor. For example, AR glasses can acquire an infrared image while capturing the original image. A previous frame image is one or more frames preceding the current original image. For example, one or more frames captured by AR glasses before capturing the original image are called previous frame images. A subsequent frame image is one or more frames following the current original image. For example, one or more frames captured by AR glasses after capturing the original image are called subsequent frame images.

[0081] That is, in this embodiment, the auxiliary processing image may include one or more of depth images, infrared images, previous frame images, and subsequent frame images. For example, in one approach, the auxiliary processing image may include four types: depth images, infrared images, previous frame images, and subsequent frame images. In this case, the depth image, infrared image, previous frame image, subsequent frame image, and the image to be processed are input together into the semantic segmentation model. In another approach, the auxiliary processing image may only include depth images. In this case, the depth image and the image to be processed are input together into the semantic segmentation model. In yet another approach, the auxiliary processing image may include both depth images and infrared images. In this case, the depth image, infrared image, and the image to be processed are input together into the semantic segmentation model. In yet another approach, the auxiliary processing image may include only the previous frame image. In this case, the previous frame image and the image to be processed are input together into the semantic segmentation model.

[0082] Furthermore, in one embodiment of the second detection and segmentation processing method, referring to Figure 4, the filamentous occlusion detection and segmentation processing based on the image to be processed and the auxiliary processing image to obtain an initial mask image containing the filamentous occlusion region may include:

[0083] Step S410: Concatenate the image to be processed and the auxiliary processing image into a multimodal input image; Step S420: Perform serial downsampling processing on the multimodal input image in multiple coding layers to obtain multimodal hierarchical feature maps in each coding layer and multimodal coded feature maps output by the last coding layer; Step S430: Transmit the multimodal hierarchical feature maps in each coding layer to the corresponding decoding layers through skip connections; Step S440: Perform convolution processing on the multimodal coded feature maps to obtain a multimodal global feature map; Step S450: Perform serial upsampling processing on the multimodal global feature map in multiple decoding layers in conjunction with the multimodal hierarchical feature maps to obtain a multimodal decoded feature map; Step S460: Perform fusion and transformation processing on the multimodal decoded feature map to obtain an initial mask image containing filamentary occlusion regions.

[0084] Taking the U-Net semantic segmentation model as an example, the U-Net model can include an encoder, a decoder, a bottleneck layer, and an output layer. The encoder includes multiple encoding layers, and the decoder includes multiple decoding layers. Skip connections are established between encoding and decoding layers of the same resolution. Furthermore, in this embodiment, a multimodal stitching layer can be added, which can align the image to be processed and the auxiliary processing image and stitch them together from the channel dimension to form a multimodal input image. The multimodal input image refers to the multi-channel image obtained by stitching the image to be processed and the auxiliary processing image from the channel dimension.

[0085] The encoder can sequentially downsample a multimodal input image across multiple coding layers. Each coding layer outputs a multimodal feature map, which is then shared with the decoding layer, as a multimodal hierarchical feature map. The multimodal feature map output by the last coding layer after the sequential downsampling process is used as the multimodal coded feature map. The multimodal hierarchical feature maps of each coding layer can be transmitted to the decoding layer, which has established skip connections with each coding layer, through skip connections.

[0086] The bottleneck layer can be used to perform convolution processing on the multimodal encoded feature map, and global features can be extracted through convolution processing to obtain the multimodal global feature map. Then, the decoder can sequentially upsample the multimodal global feature map and the multimodal hierarchical feature map in multiple decoding layers. The multimodal feature map output by the last decoding layer after the sequential upsampling process is obtained as the multimodal decoded feature map.

[0087] Finally, the output layer can perform a fusion transformation on the multimodal decoded feature map to obtain a mask image containing the filamentary occlusion region. The fusion transformation process can include: processing the multimodal decoded feature map using an attention mechanism to obtain a fused feature map; then, using an activation function to classify the fused feature map into a probability map; and finally, further converting the probability map into the initial mask image.

[0088] Based on this embodiment, through the above-mentioned multimodal fusion, multimodal serial downsampling processing, multimodal convolution processing, skip connection sharing of multimodal feature maps, and multimodal serial upsampling processing, the mask image containing filamentous occlusion regions can be further accurately detected and segmented. In particular, for images to be processed taken in natural environments, the initial mask image containing filamentous occlusion regions can be further accurately detected and segmented.

[0089] Furthermore, in another embodiment of the second detection and segmentation processing method, the step of performing filamentous occlusion detection and segmentation processing based on the image to be processed and the auxiliary processing image to obtain an initial mask image containing the filamentous occlusion region may include:

[0090] The image to be processed and the auxiliary processing image are concatenated to form a multimodal input image. A backbone network is used to extract multimodal, multi-scale features from the multimodal input image, resulting in high-level and low-level multimodal feature maps. The high-level multimodal feature maps are then subjected to dilated spatial pyramid pooling to obtain a fused multimodal feature map. The low-level multimodal feature map and the fused multimodal feature map are concatenated to obtain a spliced ​​feature map. The spliced ​​feature map is then subjected to convolution, upsampling, and further convolution processing to obtain a prediction map. Finally, the prediction map is transformed to obtain an initial mask image containing filamentary occlusion regions.

[0091] Taking the DeepLabv3+ semantic segmentation model as an example, the DeepLabv3+ model can include an encoder, a decoder, and an output layer. The encoder can include a backbone network and a dilated spatial pyramid pooling (ASPP) module. A pre-trained convolutional neural network (such as ResNet, Xception, etc.) can be used as the backbone network. The ASPP module can include dilated convolutional layers, global average pooling, and feature fusion layers. The decoder can include a feature concatenation layer, an upsampling layer, and convolutional layers. Furthermore, in this embodiment, a multimodal concatenation layer can be added, which can align the image to be processed and the auxiliary processing image and concatenate them along the channel dimension to obtain a multimodal input image. The multimodal input image refers to the multi-channel image obtained by concatenating the image to be processed and the auxiliary processing image along the channel dimension.

[0092] By employing a backbone network to perform multi-scale feature extraction on multimodal input images, both high-level and low-level multimodal feature maps can be obtained. For example, during multi-scale feature extraction in the backbone network, the multimodal input image is processed sequentially through an initial convolutional layer, residual block 1, residual block 2, residual block 3, and residual block 4. The high-level multimodal feature map can be the multimodal feature map finally output by residual block 4, while the low-level multimodal feature map can be the multimodal feature map output by residual block 1 during the multi-scale feature extraction process.

[0093] The Spatial Pyramid Pooling (ASPP) module can be used to process high-level feature maps of multiple modalities to obtain fused multimodal feature maps. The ASPP module can sequentially process the high-level feature maps of multiple modalities through dilated convolutional layers, global average pooling, and feature fusion layers. The feature fusion process can fuse the multiple modalities into a single modality fused multimodal feature map.

[0094] The feature concatenation layer in the decoder can concatenate the low-level feature maps of the multimodal and the fused multimodal feature maps along the channel dimension to obtain a concatenated feature map. The upsampling layer and convolutional layer in the decoder can upsample and convolve the concatenated feature map to obtain a prediction map (i.e., a probability map). Finally, the output layer can transform the prediction map to obtain an initial mask image containing the filamentary occlusion region.

[0095] Based on this embodiment, through the above-mentioned multimodal stitching, multimodal multi-scale feature extraction, multimodal hollow space pyramid pooling processing, feature map stitching and convolution, upsampling and convolution processing, the mask image containing filamentous occlusion regions can be further accurately detected and segmented. In particular, for images to be processed taken in urban and other architectural environments, the initial mask image containing filamentous occlusion regions can be further accurately detected and segmented.

[0096] In one embodiment, step S130, which involves performing filamentous occlusion repair processing on the image to be processed based on the initial mask image to obtain a repaired image, may include: performing detection and optimization processing on the filamentous occlusion regions in the initial mask image to obtain an optimized mask image; and performing filamentous occlusion repair processing on the image to be processed based on the optimized mask image to obtain a repaired image.

[0097] In this embodiment, the filamentous occlusion regions in the initial mask image are first further detected and optimized to obtain an optimized mask image. Then, based on the optimized mask image, filamentous occlusion repair processing is performed on the image to be processed to obtain a repaired image. Optionally, in other embodiments, performing filamentous occlusion repair processing on the image to be processed based on the initial mask image to obtain a repaired image may include: directly performing filamentous occlusion repair processing on the image to be processed based on the initial mask image. This embodiment, by first detecting and optimizing the filamentous occlusion regions and then performing further repair processing, can further improve the filamentous occlusion repair effect.

[0098] Furthermore, in one embodiment, the step of detecting and optimizing the filamentary occlusion regions in the initial mask image to obtain an optimized mask image may include:

[0099] The filamentary occlusion region in the initial mask image is detected to obtain the region edge of the filamentary occlusion region; based on the region edge of the filamentary occlusion region, the filamentary occlusion region is expanded in the initial mask image to obtain a region-expanded mask image; the edge smoothing processing of the region-expanded mask image is performed to obtain the optimized mask image.

[0100] First, the edges of the filamentous occlusion region in the mask image are detected. Then, based on the detected edges, the filamentous occlusion region in the mask image is expanded (i.e., edge expansion). The expanded mask image is the region-expanded mask image. The expanded filamentous occlusion region in the region-expanded mask image can further ensure the coverage of the area where the filamentous occlusion is located. Then, the edges of the expanded filamentous occlusion region in the region-expanded mask image are smoothed to obtain an optimized mask image. Based on this optimized mask image, the subsequent filamentous occlusion repair effect can be further guaranteed.

[0101] The step of detecting the filamentous occlusion region in the mask image to obtain the region edge of the filamentous occlusion region may include: performing color feature detection on the mask image to obtain the region edge of the filamentous occlusion region in the mask image; or performing edge feature detection on the mask image to obtain the region edge of the filamentous occlusion region in the mask image.

[0102] Color feature detection on a mask image can detect color features such as black or dark stripes, thereby detecting filamentous occlusion regions and determining their edges. When performing edge feature detection on a mask image, Canny edge detection or Hough transform can be used to detect and identify the edges of filamentous occlusion regions.

[0103] In one embodiment, the step of performing filamentous occlusion repair processing on the image to be processed based on the optimized mask image to obtain a repaired image may include: using a generative adversarial network to perform filamentous occlusion repair processing on the optimized mask image and the image to be processed to obtain a repaired image with the filamentous occlusions removed.

[0104] Generative Adversarial Networks (GANs) can use an adversarial generation method between the generator and the discriminator to repair filamentous occlusions using an optimized mask image and the image to be processed, achieving good results in obtaining repaired images with the filamentous occlusions removed.

[0105] Specifically, the use of a generative adversarial network (GAN) to repair filamentous occlusions using the optimized mask image and the image to be processed, resulting in a repaired image with the filamentous occlusions removed, may include:

[0106] The optimized mask image and the image to be processed are concatenated along the channel dimension to obtain a concatenated image. The concatenated image is then serially downsampled across multiple coding layers to obtain hierarchical feature maps in each coding layer and the encoded feature map output by the last coding layer. The hierarchical feature maps in each coding layer are then transmitted to the corresponding decoding layers via skip connections. The encoded feature maps are then aggregated to obtain an aggregated feature map. The optimized mask image is then superimposed on the aggregated feature map to obtain a repair guidance feature map. The repair guidance feature map is then serially upsampled across multiple decoding layers in conjunction with the hierarchical feature maps to obtain a decoded feature map. The decoded feature map is then transformed to obtain a decoded output image. The masked region of the decoded output image and the non-masked region of the image to be processed are then fused to obtain the repaired image with the filamentous occlusions removed.

[0107] In a generative adversarial network, the generator can perform the steps described in this embodiment to obtain a restored image with the filamentary occlusions perfectly removed. The generator may include a feature stitching layer, an encoder, a decoder, a context aggregation module, and an output layer; the encoder includes multiple encoding layers, and the decoder includes multiple decoding layers, with skip connections established between encoding and decoding layers of the same resolution.

[0108] The feature concatenation layer concatenates the optimized mask image and the image to be processed along the channel dimension to obtain a concatenated image. In the encoder, the concatenated image is first serially downsampled across multiple coding layers. Each coding layer outputs a feature map as a hierarchical feature map to be shared with the decoding layer, and the feature map output by the last coding layer after the serial downsampling process is used as the encoded feature map. The hierarchical feature maps from each coding layer can be transmitted to the decoding layer, which has established skip connections with each coding layer, through skip connections.

[0109] The context aggregation module can include an aggregation module and a mask guidance module. First, the encoded feature map can be aggregated using aggregation modules such as self-attention or non-local blocks to obtain an aggregated feature map. Then, the optimized mask image is superimposed on the aggregated feature map by the mask guidance module (e.g., embedding the optimized mask image into the aggregated feature map) to obtain a repair guidance feature map. This can better guide the decoder to process according to the mask information in subsequent steps, further ensuring the image repair effect.

[0110] In the decoder, the repair guide feature map is first combined with the hierarchical feature maps received through skip connections in multiple decoding layers for serial upsampling to obtain the decoded feature map output by the last decoding layer; then, the decoded feature map is transformed by an activation function to obtain the decoded output image.

[0111] Finally, the masked region of the decoded output image and the non-masked region of the image to be processed can be fused through the output layer to obtain the restored image with the filamentous occlusions removed. Based on this embodiment, through serial downsampling, skip connection sharing of feature maps, feature map aggregation, mask information superposition, and serial upsampling, the optimized mask image and the image to be processed can be used effectively to restore the filamentous occlusions, resulting in a restored image with the filamentous occlusions removed. In the restored image, the restored area (i.e., the filamentous occlusion area) can be seamlessly connected with the surrounding area, and the texture and color of the restored area can be consistent with the background.

[0112] Furthermore, in one embodiment, the step of performing filamentary occlusion repair processing on the image to be processed based on the optimized mask image to obtain a repaired image may include: determining occluded image regions and non-occluded image regions in the image to be processed based on the optimized mask image; assigning a candidate patch block located in the non-occluded image region to each occluded pixel in the occluded image region; iteratively optimizing the candidate patch blocks assigned to each occluded pixel to obtain a matching patch block corresponding to each occluded pixel; and copying the pixels in the matching patch block corresponding to each occluded pixel to each occluded pixel to obtain the repaired image.

[0113] Taking the PatchMatch algorithm as an example, by initializing the Nearest-Neighbor Field (NNF), a candidate patch block located in the unoccluded image region can be assigned to each occluded pixel in the occluded image region. Then, through iterative optimization (including propagation and random search), the candidate patch blocks assigned to each occluded pixel are iteratively optimized to obtain the best-matching patch block for each occluded pixel, which is also located in the unoccluded image region. Finally, the pixels in the matching patch block corresponding to each occluded pixel are copied to each occluded pixel, thereby repairing the occluded image region in the image to be processed, resulting in a repaired image with the filamentous occlusion removed. This repair method can also achieve a certain degree of natural visual effect in the repaired image and seamless integration of the occluded image region with the background.

[0114] Furthermore, in one embodiment of this application, after performing filamentous occlusion repair processing on the image to be processed based on the initial mask image to obtain the repaired image, the repaired image can be further improved through post-processing (such as sharpening, color adjustment, texture optimization, etc.) to further enhance the visual effect.

[0115] Furthermore, in the embodiments of this application, the semantic segmentation model can be pre-pruned and quantized for optimization, thereby compressing the semantic segmentation model and enabling it to be deployed in products such as AR glasses for the scheme of this application. Additionally, a smaller deep learning model (such as MobileNet or Tiny-YOLO) can also be selected as the semantic segmentation model.

[0116] To facilitate better implementation of the image processing method provided in the embodiments of this application, the embodiments of this application also provide an image processing apparatus based on the above-described image processing method. The meanings of the terms used are the same as in the above-described image processing method, and specific implementation details can be found in the descriptions in the method embodiments. Figure 5 shows a block diagram of an image processing apparatus according to an embodiment of this application.

[0117] As shown in Figure 5, the image processing device 500 may include: an acquisition module 510 for acquiring an image to be processed; a segmentation module 520 for performing filamentous occlusion detection and segmentation processing on the image to be processed using a semantic segmentation model based on a convolutional neural network to obtain an initial mask image containing filamentous occlusion regions; and a repair module 530 for performing filamentous occlusion repair processing on the image to be processed based on the initial mask image to obtain a repaired image.

[0118] In one embodiment, the segmentation module can be used to implement one of the following methods: using the semantic segmentation model, performing filamentous occlusion detection and segmentation processing on the image to be processed to obtain an initial mask image containing filamentous occlusion regions; obtaining an auxiliary processing image of the image to be processed, and using the semantic segmentation model, performing filamentous occlusion detection and segmentation processing on the image to be processed and the auxiliary processing image to obtain an initial mask image containing filamentous occlusion regions.

[0119] In one embodiment, the segmentation module can be used to obtain an auxiliary processing image of the image to be processed, including: obtaining at least one of a depth image, an infrared image, a previous frame image, and a subsequent frame image corresponding to the image to be processed, to obtain the auxiliary processing image.

[0120] In one embodiment, the segmentation module can be used to: sequentially downsample the image to be processed through multiple coding layers to obtain hierarchical feature maps in each coding layer and the coding feature map output by the last coding layer; transmit the hierarchical feature maps in each coding layer to the corresponding decoding layers through skip connections; perform convolution processing on the coding feature maps to obtain a global feature map; sequentially upsample the global feature map in multiple decoding layers in combination with the hierarchical feature maps to obtain a decoded feature map; and perform transformation processing on the decoded feature map to obtain an initial mask image containing filamentary occlusion regions.

[0121] In one embodiment, the segmentation module can be used to: extract multi-scale features from the image to be processed using a backbone network to obtain a high-level feature map and a low-level feature map; perform dilated spatial pyramid pooling on the high-level feature map to obtain a fused feature map; concatenate the low-level feature map and the fused feature map to obtain a concatenated feature map; perform convolution, upsampling, and convolution processing on the concatenated feature map to obtain a prediction map; and perform transformation processing on the prediction map to obtain an initial mask image containing filamentary occlusion regions.

[0122] In one embodiment, the segmentation module can be used to: concatenate the image to be processed and the auxiliary processing image into a multimodal input image; sequentially downsample the multimodal input image through multiple coding layers to obtain multimodal hierarchical feature maps in each coding layer and a multimodal coded feature map output by the last coding layer; transmit the multimodal hierarchical feature maps in each coding layer to the corresponding decoding layers through skip connections; perform convolution processing on the multimodal coded feature maps to obtain a multimodal global feature map; sequentially upsample the multimodal global feature map in multiple decoding layers in combination with the multimodal hierarchical feature maps to obtain a multimodal decoded feature map; and perform fusion and transformation processing on the multimodal decoded feature map to obtain an initial mask image containing filamentary occlusion regions.

[0123] In one embodiment, the segmentation module can be used to: concatenate the image to be processed and the auxiliary processing image into a multimodal input image; use a backbone network to perform multimodal multi-scale feature extraction on the multimodal input image to obtain a high-level feature map and a low-level feature map of the multimodality; perform dilated spatial pyramid pooling on the high-level feature map of the multimodality to obtain a fused multimodal feature map; concatenate the low-level feature map of the multimodality and the fused multimodal feature map to obtain a concatenated feature map; perform convolution, upsampling, and convolution processing on the concatenated feature map to obtain a prediction map; and perform transformation processing on the prediction map to obtain an initial mask image containing filamentary occlusion regions.

[0124] In one embodiment, the repair module can be used to: perform detection and optimization processing on the filamentous occlusion region in the initial mask image to obtain an optimized mask image; and perform filamentous occlusion repair processing on the image to be processed based on the optimized mask image to obtain a repaired image.

[0125] In one embodiment, the repair module can be used to: perform detection and optimization processing on the filamentary occlusion region in the initial mask image to obtain an optimized mask image, including: detecting the filamentary occlusion region in the initial mask image to obtain the region edge of the filamentary occlusion region; expanding the filamentary occlusion region in the initial mask image according to the region edge of the filamentary occlusion region to obtain a region-expanded mask image; and performing edge smoothing processing on the region-expanded mask image to obtain the optimized mask image.

[0126] In one embodiment, the repair module can be used to: perform color feature detection on the mask image to obtain the region edge of the filamentous occlusion area in the mask image; or, perform edge feature detection on the mask image to obtain the region edge of the filamentous occlusion area in the mask image.

[0127] In one embodiment, the repair module can be used to: employ a generative adversarial network to perform filamentous occlusion repair processing using the optimized mask image and the image to be processed, thereby obtaining a repaired image with the filamentous occlusions removed.

[0128] In one embodiment, the repair module can be used to: stitch the optimized mask image and the image to be processed along the channel dimension to obtain a stitched image; sequentially downsample the stitched image through multiple coding layers to obtain hierarchical feature maps in each coding layer and the coding feature map output by the last coding layer; transmit the hierarchical feature maps in each coding layer to the corresponding decoding layers through skip connections; aggregate the coding feature maps to obtain an aggregated feature map; superimpose the optimized mask image and the aggregated feature map to obtain a repair guidance feature map; sequentially upsample the repair guidance feature map in multiple decoding layers in combination with the hierarchical feature maps to obtain a decoded feature map; convert the decoded feature map to obtain a decoded output image; and fuse the masked region of the decoded output image and the non-masked region of the image to be processed to obtain the repaired image with the filamentous occlusions removed.

[0129] In one embodiment, the repair module can be used to: determine occluded image regions and non-occluded image regions in the image to be processed based on the optimized mask image; assign a candidate patch block located in the non-occluded image region to each occluded pixel in the occluded image region; iteratively optimize the candidate patch blocks assigned to each occluded pixel to obtain a matching patch block corresponding to each occluded pixel; copy the pixels in the matching patch block corresponding to each occluded pixel to each occluded pixel to obtain the repaired image.

[0130] In one embodiment, the acquisition module can be used to implement one of the following methods: acquiring an original image and determining the original image as the image to be processed; or, acquiring an original image, normalizing the original image to obtain a normalized image, and performing Gaussian blur processing or histogram equalization processing on the normalized image to obtain the image to be processed.

[0131] 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.

[0132] Furthermore, this application also provides an electronic device, as shown in FIG6. FIG6 shows a block diagram of an electronic device according to an embodiment of this application, specifically:

[0133] The electronic device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will understand that the electronic device structure shown in FIG6 does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0134] The processor 601 is the control center of the electronic device. It connects to various parts of the computer device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 602, and by calling data stored in the memory 602, it performs various functions of the computer device and processes data, thereby providing overall monitoring of the electronic device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user page, and application programs, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601.

[0135] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.

[0136] The electronic device also includes a power supply 603 that supplies power to the various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 603 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0137] The electronic device may also include an input unit 604, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0138] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the electronic device loads the executable files corresponding to the processes of one or more computer programs into the memory 602 according to the following instructions, and the processor 601 runs the computer programs stored in the memory 602, thereby realizing the various functions in the foregoing embodiments of this application. For example, the processor 601 can perform the following steps:

[0139] A filamentary occlusion detection and segmentation process is performed on the image to be processed using a semantic segmentation model based on a convolutional neural network to obtain an initial mask image containing filamentary occlusion regions. Based on the initial mask image, the filamentary occlusion repair process is performed on the image to be processed to obtain a repaired image.

[0140] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0141] Therefore, embodiments of this application also provide a storage medium storing a computer program that can be loaded by a processor to execute the steps in any of the methods provided in embodiments of this application.

[0142] The storage medium can be a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0143] Since the computer program stored in the storage medium can execute the steps of any of the methods provided in the embodiments of this application, the beneficial effects that the methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0144] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.

[0145] It should be understood that this application is not limited to the embodiments described above and shown in the accompanying drawings, but various modifications and changes can be made without departing from its scope.

Claims

1. An image processing method, wherein, include: Obtain the image to be processed; A semantic segmentation model based on a convolutional neural network is used to perform filamentous occlusion detection and segmentation on the image to be processed, resulting in an initial mask image containing filamentous occlusion regions. Based on the initial mask image, the image to be processed is subjected to filamentous occlusion repair processing to obtain the repaired image.

2. The method according to claim 1, wherein, The semantic segmentation model based on convolutional neural networks is used to perform filamentous occlusion detection and segmentation on the image to be processed, obtaining an initial mask image containing the filamentous occlusion region, including one of the following methods: Using the semantic segmentation model, filamentous occlusion detection and segmentation are performed on the image to be processed to obtain an initial mask image containing filamentous occlusion regions; An auxiliary processing image is obtained for the image to be processed, and the semantic segmentation model is used to perform filamentous occlusion detection and segmentation processing based on the image to be processed and the auxiliary processing image to obtain an initial mask image containing filamentous occlusion regions.

3. The method according to claim 2, wherein, The step of obtaining the auxiliary processing image of the image to be processed includes: The auxiliary processing image is obtained by acquiring at least one of the depth image, infrared image, previous frame image, and next frame image corresponding to the image to be processed.

4. The method according to claim 2, wherein, The step of performing filamentous occlusion detection and segmentation processing based on the image to be processed to obtain an initial mask image containing filamentous occlusion regions includes: The image to be processed is sequentially downsampled in multiple coding layers to obtain the hierarchical feature map in each coding layer and the coding feature map output by the last coding layer. The hierarchical feature maps in each of the coding layers are transmitted to the corresponding decoding layers via skip connections. The encoded feature map is convolved to obtain a global feature map; The global feature map is sequentially upsampled in multiple decoding layers in combination with the hierarchical feature map to obtain the decoded feature map. The decoded feature map is transformed to obtain an initial mask image containing the filamentous occlusion region.

5. The method according to claim 2, wherein, The step of performing filamentous occlusion detection and segmentation processing based on the image to be processed to obtain an initial mask image containing filamentous occlusion regions includes: A backbone network is used to extract multi-scale features from the image to be processed, resulting in high-level feature maps and low-level feature maps. The high-level feature map is subjected to hollow space pyramid pooling processing to obtain a fused feature map; The low-level feature map and the fused feature map are concatenated to obtain a concatenated feature map; The spliced ​​feature map is subjected to convolution, upsampling, and convolution processing to obtain the prediction map; The predicted image is transformed to obtain an initial mask image containing the filamentous occlusion region.

6. The method according to claim 2, wherein, The step of performing filamentous occlusion detection and segmentation based on the image to be processed and the auxiliary processing image to obtain an initial mask image containing the filamentous occlusion region includes: The image to be processed and the auxiliary processing image are stitched together to form a multimodal input image; The multimodal input image is sequentially downsampled in multiple coding layers to obtain multimodal hierarchical feature maps in each coding layer and multimodal coding feature maps output by the last coding layer. The multimodal hierarchical feature maps in each of the coding layers are transmitted to the corresponding decoding layers via skip connections. The multimodal encoded feature map is convolved to obtain a multimodal global feature map; The multimodal global feature map is sequentially upsampled in multiple decoding layers in conjunction with the multimodal hierarchical feature map to obtain the multimodal decoding feature map. The multimodal decoding feature map is fused and transformed to obtain an initial mask image containing the filamentary occlusion region.

7. The method according to claim 2, wherein, The step of performing filamentous occlusion detection and segmentation based on the image to be processed and the auxiliary processing image to obtain an initial mask image containing the filamentous occlusion region includes: The image to be processed and the auxiliary processing image are stitched together to form a multimodal input image; A backbone network is used to extract multimodal and multi-scale features from the multimodal input image to obtain high-level feature maps and low-level feature maps of the multimodality. The high-level feature map of the multimodal features is subjected to hollow spatial pyramid pooling to obtain a fused multimodal feature map. The low-level feature map of the multimodal and the fused multimodal feature map are concatenated to obtain a concatenated feature map; The spliced ​​feature map is subjected to convolution, upsampling, and convolution processing to obtain the prediction map; The predicted image is transformed to obtain an initial mask image containing the filamentous occlusion region.

8. The method according to claim 1, wherein, The process of repairing filamentous occlusions in the image to be processed based on the initial mask image to obtain the repaired image includes: The filamentary occlusion regions in the initial mask image are detected and optimized to obtain an optimized mask image. Based on the optimized mask image, the image to be processed is subjected to filamentous occlusion repair processing to obtain the repaired image.

9. The method according to claim 8, wherein, The step of detecting and optimizing the filamentary occlusion regions in the initial mask image to obtain an optimized mask image includes: The filamentary occlusion region in the initial mask image is detected to obtain the region edge of the filamentary occlusion region; Based on the region edge of the filamentous masking region, the filamentous masking region is expanded in the initial mask image to obtain a region-expanded mask image. The edge smoothing process is applied to the extended mask image of the region to obtain the optimized mask image.

10. The method according to claim 9, wherein, The step of detecting the filamentary occlusion region in the initial mask image to obtain the region edge of the filamentary occlusion region includes: Color feature detection is performed on the mask image to obtain the region edges of the filamentous occlusion area in the mask image; Alternatively, edge feature detection can be performed on the mask image to obtain the region edges of the filamentous occlusion area in the mask image.

11. The method according to claim 8, wherein, The process of repairing filamentous occlusions in the image to be processed based on the optimized mask image to obtain the repaired image includes: A generative adversarial network is used to repair filamentous occlusions using the optimized mask image and the image to be processed, resulting in a repaired image with the filamentous occlusions removed.

12. The method according to claim 11, wherein, The process employs a generative adversarial network (GAN) to perform filamentary occlusion repair using the optimized mask image and the image to be processed, resulting in a repaired image with the filamentary occlusions removed. This includes: The optimized mask image and the image to be processed are stitched together along the channel dimension to obtain a stitched image; The stitched image is sequentially downsampled in multiple coding layers to obtain the hierarchical feature map in each coding layer and the coding feature map output by the last coding layer. The hierarchical feature maps in each of the coding layers are transmitted to the corresponding decoding layers via skip connections. The encoded feature map is aggregated to obtain an aggregated feature map; The optimized mask image is superimposed with the aggregated feature map to obtain the repair guidance feature map; The repair guide feature map is sequentially upsampled in multiple decoding layers in combination with the hierarchical feature map to obtain the decoding feature map; The decoded feature map is transformed to obtain the decoded output image; The masked region of the decoded output image and the non-masked region of the image to be processed are fused to obtain the restored image with the filamentous occlusions removed.

13. The method according to claim 8, wherein, The process of repairing filamentous occlusions in the image to be processed based on the optimized mask image to obtain the repaired image includes: Based on the optimized mask image, determine the occluded and non-occluded image regions in the image to be processed; For each occluded pixel in the occluded image region, assign a candidate patch block located in the unoccluded image region; The candidate patch blocks allocated to each occluded pixel are iteratively optimized to obtain the matching patch block corresponding to each occluded pixel; The pixels in the matching patch block corresponding to each occluded pixel are copied to each occluded pixel to obtain the repaired image.

14. The method according to claim 1, wherein, The acquisition of the image to be processed includes one of the following methods: Acquire the original image and determine the original image as the image to be processed; The original image is acquired, and the original image is normalized to obtain a normalized image. Then, the normalized image is subjected to Gaussian blurring or histogram equalization to obtain the image to be processed.

15. The method according to claim 1, wherein, After performing filamentary occlusion repair processing on the image to be processed based on the initial mask image to obtain the repaired image, the method further includes: performing post-processing on the repaired image.

16. An image processing apparatus, wherein, include: The acquisition module is used to: acquire the image to be processed; The segmentation module is used to: employ a semantic segmentation model based on a convolutional neural network to perform filamentous occlusion detection and segmentation processing on the image to be processed, and obtain an initial mask image containing filamentous occlusion regions; The repair module is used to: perform filamentous occlusion repair processing on the image to be processed based on the initial mask image to obtain the repaired image.

17. The apparatus according to claim 16, wherein, The segmentation module is used to: employ the semantic segmentation model to perform filamentous occlusion detection and segmentation processing on the image to be processed, and obtain an initial mask image containing the filamentous occlusion region; or, acquire an auxiliary processing image of the image to be processed, and employ the semantic segmentation model to perform filamentous occlusion detection and segmentation processing on the image to be processed and the auxiliary processing image, and obtain an initial mask image containing the filamentous occlusion region.

18. The apparatus according to claim 17, wherein, The segmentation module is used to: acquire at least one of the depth image, infrared image, previous frame image and next frame image corresponding to the image to be processed, to obtain the auxiliary processing image.

19. A storage medium, wherein, It stores a computer program that, when executed by the computer's processor, causes the computer to perform the method described in any one of claims 1 to 15.

20. An electronic device, wherein, include: Memory, which stores computer programs; A processor reads a computer program stored in memory to perform the method according to any one of claims 1 to 15.