Image segmentation method and electronic equipment
By combining color and depth information in image segmentation and using convolutional neural networks for feature fusion and optimization, the problem of poor target and background segmentation in traditional technology is solved, and higher segmentation accuracy and three-dimensional reconstruction effects are achieved.
Patent Information
- Application Number
- CN202410895129.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-29
AI Technical Summary
Traditional image segmentation technology has poor saliency segmentation results in complex areas of targets and backgrounds, making it difficult to effectively distinguish targets and backgrounds, and the problem of target mis-segmentation caused by two-dimensional estimation is difficult to solve.
An image segmentation method based on color and depth fusion is adopted, color features and depth features are obtained through convolutional neural networks, and fusion and optimization are performed. Residual modules and bridge structures are used to improve segmentation accuracy, and three-dimensional information is combined for three-dimensional reconstruction.
It significantly improves the effect and accuracy of image segmentation, reduces computational overhead, overcomes the problem of target mis-segmentation caused by two-dimensional estimation deviations, and improves the effect of three-dimensional reconstruction.
Smart Images

Figure CN118864495A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image segmentation, and more specifically, to an image segmentation method and electronic device. Background Art
[0002] Image semantic segmentation is one of the most common tasks in image processing. Image segmentation technology can help users distinguish between targets and backgrounds. In traditional technology, image segmentation is usually performed using only color maps, which is not effective for image segmentation of salient objects where it is difficult to distinguish between targets and backgrounds. Summary of the invention
[0003] The present application provides an image segmentation method and an electronic device, which are helpful to improve the image segmentation effect.
[0004] In a first aspect, an image segmentation method is provided, the method comprising: obtaining a color map corresponding to a first image and a depth map corresponding to the first image; inputting the color map into a convolutional neural network to obtain color features and inputting the depth map into the convolutional neural network to obtain depth features; fusing the color features and the depth features to obtain fused features; and optimizing the fused features to obtain a segmentation result of the first image.
[0005] In combination with the first aspect, in some possible implementations of the first aspect, the method further includes: performing three-dimensional 3D reconstruction based on the segmentation result.
[0006] Exemplarily, the segmentation result includes a target and a background, and performing three-dimensional 3D reconstruction according to the segmentation result includes: performing 3D reconstruction on the target.
[0007] In combination with the first aspect, in some possible implementations of the first aspect, the convolutional neural network includes an encoder, which includes 1 input convolution layer and 6 residual modules; wherein the input convolution layer includes 64 filters, the size of the filter is 3×3 and the step size is 1; each of the first 4 residual modules of the 6 residual modules includes 64 filters, the size of the filter is 3×3 and the step size is 1; each of the last 2 residual modules of the 6 residual modules consists of 3 basic residual modules.
[0008] In some possible implementations, there is no pooling operation after the convolutional input layer.
[0009] In combination with the first aspect, in some possible implementations of the first aspect, the convolutional neural network also includes a decoder, and a bridge is included between the encoder and the decoder, wherein the bridge is composed of three convolutional layers, and each of the three convolutional layers is composed of 512 3×3 hole convolutions.
[0010] In combination with the first aspect, in some possible implementations of the first aspect, the color feature and the depth feature are fused to obtain a fused feature, including: pixel-by-pixel summing the color feature and the depth feature to obtain the fused feature.
[0011] In combination with the first aspect, in some possible implementations of the first aspect, the fused features are optimized to obtain a segmentation result of the first image, including: inputting the fused features into a residual refinement module to obtain a segmentation result of the first image; wherein the residual refinement module includes an input layer, an encoder, a bridge, a decoder and an output layer, the encoder and the decoder each include 4 stages, each of the 4 stages includes 1 convolution layer, the convolution layer includes 64 filters, and the filter size is 3×3.
[0012] In some possible implementations, the bridge includes 1 convolutional layer consisting of 64 3×3 filters.
[0013] In some possible implementations, a non-overlapping maximum pooling layer is used during the encoder downsampling process; and a bilinear interpolation method is used during the decoder upsampling process.
[0014] In a second aspect, an electronic device is provided, comprising: a memory for storing a computer program; and a processor for executing the computer program stored in the memory, so that the device performs the image segmentation method described in any one of the first aspects.
[0015] According to a third aspect, an electronic device is provided, comprising a unit or module for executing any one of the methods according to the first aspect.
[0016] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed on a computer, the computer executes the image segmentation method described in any one of the first aspects.
[0017] In a fifth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is run on a computer, the computer executes the image segmentation method described in any one of the first aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a schematic block diagram of an electronic device provided in an embodiment of the present application;
[0019] Figure 2 is a schematic flow chart of an image segmentation method provided in an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of a network architecture provided in an embodiment of the present application;
[0021] Figure 4 is a schematic diagram of the structure of the encoder and decoder in the prediction module provided in the embodiment of the present application;
[0022] Figure 5 is a schematic diagram of a fusion module provided in an embodiment of the present application;
[0023] Figure 6 It is a schematic diagram of the structure of the encoder and decoder in the optimization module provided in the embodiment of the present application;
[0024] Figure 7 is a schematic diagram of a segmentation result before optimization using an optimization module and a segmentation result after optimization using an optimization module provided in an embodiment of the present application;
[0025] Figure 8 It is a schematic diagram of the structure of VGG provided in the embodiment of the present application;
[0026] Fig. 9 It is a schematic block diagram of an image segmentation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. For example, "at least one of A and B" is similar to "A and / or B", describing the association relationship of associated objects, indicating that three relationships can exist, for example, at least one of A and B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0028] In the embodiments of the present application, prefixes such as "first" and "second" are used only to distinguish different description objects, and have no limiting effect on the position, order, priority, quantity or content of the described objects. The use of prefixes such as ordinal numbers to distinguish description objects in the embodiments of the present application does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the description in the context of the claims or embodiments, and no unnecessary limitation should be constituted due to the use of such prefixes. In addition, in the description of the present embodiment, unless otherwise specified, the meaning of "multiple" is two or more.
[0029] Figure 1 1 is a schematic block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may include a display screen 110 , a memory 120 , and a processor 130 .
[0030] The display screen 110 is used to display images, videos, a series of graphical user interfaces (GUIs), etc. The display screen 110 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), MiniLed, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or more display screens 110.
[0031] The memory 120 may include an external memory interface and an internal memory. The external memory interface may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 130 via the external memory interface to implement a data storage function. For example, files such as music and videos are stored in the external memory card.
[0032] The internal memory can be used to store one or more computer programs, which include instructions. The processor 130 can execute the above instructions stored in the internal memory, so that the electronic device 100 executes the image segmentation method provided in some embodiments of the present application, runs various applications and data processing, etc. The internal memory may include a program storage area and a data storage area. Among them, the program storage area can store an operating system; the program storage area can also store one or more applications, etc. The data storage area can store data created during the use of the electronic device 100. In addition, the internal memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disks (or disk storage components), a flash memory component, a universal flash storage (UFS), etc. In some embodiments, the processor 130 can execute the image segmentation method provided in the embodiment of the present application, and run various applications and data processing by running instructions stored in the internal memory and / or instructions stored in a memory provided in the processor 130.
[0033] The processor 130 may include one or more processing units, for example, the processor 130 may include one or more of an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, or a neural-network processing unit (NPU). Different processing units may be independent components or integrated into one or more processors.
[0034] The electronic device 100 includes but is not limited to Or other portable electronic devices with operating systems. Exemplarily, the electronic device 100 can be a mobile phone, a tablet computer, a notebook computer, etc.
[0035] Figure 2 A schematic flow chart of an image segmentation method 200 provided in an embodiment of the present application is shown. The method 200 may be executed by the electronic device 100, or may also be executed by the processor 130 in the electronic device 100. The method 200 includes:
[0036] S210, obtaining a color map corresponding to a first image and a depth map corresponding to the first image.
[0037] The above color map can also be called a red, green, blue (RGB) map.
[0038] For example, Figure 3 A schematic diagram of a network architecture provided by an embodiment of the present application is shown.
[0039] like Figure 3 As shown, the network structure includes a prediction module 310 and an optimization module 320, wherein the output of the prediction module 310 can be used as the input of the optimization module 320. The prediction module 310 includes two branches (RGB branch and depth branch). The color map (or RGB map) and the depth map corresponding to the color map are respectively sent to the encoder and decoder (En-De) for encoding and decoding, and color features (or RGB features) and depth features are obtained respectively. By fusing the color features and the depth features, and predicting the segmentation effect with the fused features, a coarse map can be obtained. By inputting the coarse map into the encoder and decoder (En-De) of the optimization module, a refined map can be obtained. In this way, the network architecture can simultaneously learn the three-dimensional information and appearance information in the image, and jointly predict the target segmentation result.
[0040] In order to solve the problem of poor salient target segmentation in complex background areas, the embodiment of the present application fully considers the three-dimensional information in the scene, introduces depth information into the framework of salient target segmentation, and designs a salient target segmentation method based on color and depth fusion, such as Figure 3 As shown in the figure. By using the depth difference between the foreground target and the background, the problem of target and background confusion can be effectively solved, and the segmentation effect and segmentation accuracy can be improved. In addition, the use of three-dimensional information is also conducive to overcoming the problem of target segmentation error caused by two-dimensional estimation deviation.
[0041] S220, input the color map into a convolutional neural network to obtain color features and input the depth map into the convolutional neural network to obtain depth features.
[0042] Optionally, the convolutional neural network includes an encoder, which includes 1 input convolution layer and 6 residual modules; wherein the input convolution layer includes 64 filters, the size of the filter is 3×3 and the step size is 1.
[0043] Optionally, each of the first four residual modules of the six residual modules includes 64 filters, the size of the filter is 3×3 and the step size is 1.
[0044] Optionally, each of the last two residual modules of the six residual modules consists of three basic residual modules.
[0045] By using residual modules in convolutional neural networks, the computational overhead of image segmentation can be reduced. At the same time, the semantic features learned by the network can be enriched.
[0046] Optionally, the convolutional neural network also includes a decoder, and a bridge is included between the encoder and the decoder, wherein the bridge is composed of 3 convolutional layers, and each of the 3 convolutional layers is composed of 512 3×3 hole convolutions.
[0047] For example, Figure 4 A schematic diagram of the structure of an encoder and a decoder in the prediction module 310 provided in an embodiment of the present application is shown.
[0048] The prediction module 310 includes a codec module that can simultaneously obtain high-level global information and low-level detail information. In order to reduce overfitting, the last layer of each decoder is supervised by ground truth. The encoder consists of 1 input convolution layer and 6 modules consisting of residual modules. The input convolution layer and the first 4 residual modules can directly utilize the layers in the deep residual network (ResNet-34). The difference is that the layer in the embodiment of the present application has 64 filters, the size is 3×3, and the step size is 1, while the filter size in ResNet-34 is 7×7 and the step size is 2.
[0049] In addition, there is no pooling operation after the input convolutional layer. That is, the feature map before the second module (the first of the six residual modules) has the same resolution as the input image. This is different from the original ResNet-34, which reduces the resolution of the first feature map to 1 / 4 of the size. This change enables the network to obtain higher resolution feature maps at an early stage and also reduces the overall receptive field. In order to obtain the same receptive field as ResNet-34, an embodiment of the present application adds two additional residual modules after the fourth residual module in ResNet-34. Both residual modules are composed of three basic residual modules, which have 512 filters after a non-overlapping maximum pooling layer of size 2.
[0050] In order to further obtain global information, a bridge is added between the encoder and the decoder in the embodiment of the present application. It consists of 3 convolutional layers, each of which consists of 512 3×3 dilated convolutions (dilation=2). Each convolutional layer is followed by a batch normalization (BN) layer and a rectified linear unit (ReLU) activation function layer.
[0051] The decoder is symmetrical with the encoder. Each stage consists of three convolutional layers, each followed by a BN and ReLU layer. The input of each stage is the upsampled feature map output by the previous stage and the corresponding encoder. In order to obtain the side-outut of the feature map, in the embodiment of the present application, the multi-channel output of each decoder and bridge is used as the input of a common 3×3 convolutional layer, followed by a bilinear upsampling and a sigmoid function. Therefore, given an input image, the prediction module 310 generates 7 feature maps during the training process. Although each feature map is upsampled to the size of the input image, the accuracy of the last feature map is the highest, so the last feature map can be used as the final output of the encoding and decoding module.
[0052] S230, fusing the color feature and the depth feature to obtain a fused feature.
[0053] Optionally, the fusing the color feature and the depth feature to obtain a fused feature includes: summing the color feature and the depth feature pixel by pixel to obtain the fused feature.
[0054] The enhanced features obtained by fusing the features of the two branches in the network architecture will be more conducive to the classification and inference of the target and background. Based on this, a feature fusion module of the two branch networks is designed in the embodiment of the present application. n The last feature map generated by the prediction module 310 is recorded as f n ; And the corresponding depth map D n The last feature map generated by the prediction module 310 is denoted as d n . For example, Figure 5 A schematic diagram of a fusion module provided in an embodiment of the present application is shown.
[0055] The feature map f output by the two network branches in the prediction module n and d n Perform pixel-by-pixel summation to obtain the fused feature y n , as shown in formula (1):
[0056] y n (i,j)=f n (i,j)+d n (i,j) (1)
[0057] After the features obtained by the RGB branch and the depth branch are fused, the fused features are used as the final output of the prediction module 310 and are sent to the optimization module 320.
[0058] In the embodiment of the present application, the depth features and color features are fused between the prediction module 310 and the optimization module 320. In this way, the amount of calculation in the image segmentation process can be reduced, and it can be ensured that the depth information and color information are used simultaneously in the optimization module 320. At the same time, in the embodiment of the present application, the depth features and color features are first fused and then optimized, so that the fused features (including the depth information) can be optimized as a whole, avoiding the problem of lack of some depth information caused by optimizing different features first and then fusing them. S240, optimize the fused features to obtain the segmentation result of the first image.
[0059] Optionally, the fused features are optimized to obtain a segmentation result of the first image, including: inputting the fused features into a residual refinement module (RRM) to obtain a segmentation result of the first image.
[0060] Optionally, the residual refinement module includes an input layer, an encoder, a bridge, a decoder and an output layer, the encoder and the decoder each include 4 stages, each of the 4 stages includes 1 convolution layer, the convolution layer includes 64 filters, and the filter size is 3×3.
[0061] Optionally, the bridge includes 1 convolutional layer consisting of 64 3×3 filters.
[0062] For example, Figure 6 A schematic diagram of the structure of the encoder and decoder in the optimization module 320 provided in an embodiment of the present application is shown.
[0063] In order to optimize the regional and boundary defects present in the rough image output by the prediction module 310. The optimization module 320 can utilize the residual codec architecture, which includes an input layer, encoder, bridge, decoder and output layer. Unlike the prediction module 310, the encoder and decoder may include 4 stages. Each stage has only 1 convolution layer, each layer has 64 filters, the size is 3×3, followed by a BN layer and a ReLU layer. The bridge stage has a convolution layer with 64 filters, the size is 3×3, followed by a BN layer and a ReLU layer. When downsampling, non-overlapping maximum pooling layers can be used in the encoder; in the upsampling decoder, bilinear interpolation can be used. The output of this RRM is the final feature map output of the network architecture (the above-mentioned fine map).
[0064] For example, Figure 7 The schematic diagram shows the segmentation result before and after optimization using the optimization module provided in the embodiment of the present application. Figure 7It can be seen from the comparison results that by using the optimization module 320 to optimize the rough map, the regional and boundary defect problems existing in the rough map can be solved.
[0065] Optionally, the method 200 further includes: performing 3D reconstruction according to the segmentation result. Exemplarily, the segmentation result includes a target and a background, and performing 3D reconstruction according to the segmentation result includes: performing 3D reconstruction on the target.
[0066] The image segmentation technology in the embodiments of the present application can be applied to three-dimensional (3D) reconstruction, in which spatial information is required. The addition of depth information during the image segmentation process can better capture spatial information during the 3D reconstruction process. Therefore, the fusion and optimization of depth features and color features during the image segmentation process can make the subsequent 3D reconstruction effect better.
[0067] The above is explained by taking the optimization of the fused features by the residual refinement module as an example, and the embodiments of the present application are not limited thereto. For example, the fused features can also be optimized by convolutional neural networks (CNN) or visual geometry group networks (VGG).
[0068] For example, Figure 8 A schematic diagram of the structure of the VGG-16 model provided in an embodiment of the present application is shown.
[0069] like Figure 8 As shown in the figure, the VGG-16 model includes 13 convolutional layers, 3 fully connected layers, 1 input layer, and 5 maximum pooling layers. The VGG-16 model can be divided into the following 6 blocks:
[0070] 1. The first block includes an input layer, two convolutional layers (ReLU activation is required after the convolutional layer), and a pooling layer.
[0071] First, do a pixel edge padding on the four sides. One-pixel edge padding is necessary before each convolution operation. This is to ensure that the length and width of the image after the convolution are consistent with those before the convolution.
[0072] The size of the input image is 224×224×3, and the image is convolved using 64 3×3×3 convolution kernels with a convolution step of 1. The size of the feature map obtained is 224×224×64. After obtaining the feature map, ReLU is used to activate the feature map.
[0073] After one pixel edge padding, the image is convolved with 64 3×3×64 convolution kernels, with a convolution step of 1. The size of the feature map obtained is 224×224×64. After obtaining the feature map, ReLU is used to activate the feature map.
[0074] Using a 2×2 maximum pooling layer with a pooling stride of 2, the size of the resulting feature map is 112×112×64.
[0075] 2. The second block: includes two convolutional layers (ReLU activation is required after the convolutional layer) and one pooling layer.
[0076] After one-pixel edge padding, the image is convolved using 128 3×3×64 convolution kernels with a convolution step of 1. The size of the feature map obtained is 112×112×128. After obtaining the feature map, ReLU is used to activate the feature map.
[0077] After one pixel edge padding, the image is convolved with 128 3×3×128 convolution kernels, and the convolution step is 1. The size of the feature map obtained is 112×112×128. After obtaining the feature map, ReLU is used to activate the feature map.
[0078] Using a 2×2 maximum pooling layer with a pooling stride of 2, the size of the resulting feature map is 56×56×128.
[0079] 3. The third block: includes three convolutional layers (ReLU activation is required after the convolutional layer) and one pooling layer.
[0080] After one-pixel edge padding, the image is convolved using 256 3×3×128 convolution kernels with a convolution step of 1. The size of the feature map obtained is 56×56×256. After obtaining the feature map, ReLU is used to activate the feature map.
[0081] After one-pixel edge padding, the image is convolved with 256 3×3×256 convolution kernels, with a convolution step of 1. The size of the feature map obtained is 56×56×256. After obtaining the feature map, ReLU is used to activate the feature map.
[0082] After one-pixel edge padding, the image is convolved with 256 3×3×256 convolution kernels, with a convolution step of 1. The size of the feature map obtained is 56×56×256. After obtaining the feature map, ReLU is used to activate the feature map.
[0083] Using a 2×2 maximum pooling layer with a pooling stride of 2, the size of the resulting feature map is 28×28×256.
[0084] 4. The fourth block: includes three convolutional layers (ReLU activation is required after the convolutional layer) and one pooling layer.
[0085] After one-pixel edge padding, the image is convolved using 512 3×3×256 convolution kernels with a convolution step of 1. The size of the feature map obtained is 28×28×512. After obtaining the feature map, ReLU is used to activate the feature map.
[0086] After one pixel edge padding, the image is convolved with 512 3×3×512 convolution kernels with a convolution step of 1. The size of the feature map obtained is 28×28×512. After obtaining the feature map, ReLU is used to activate the feature map.
[0087] After one pixel edge padding, the image is convolved with 512 3×3×512 convolution kernels with a convolution step of 1. The size of the feature map obtained is 28×28×512. After obtaining the feature map, ReLU is used to activate the feature map.
[0088] Using a 2×2 maximum pooling layer with a pooling stride of 2, the size of the resulting feature map is 14×14×512.
[0089] 5. The fifth block: includes three convolutional layers (ReLU activation is required after the convolutional layer) and one pooling layer.
[0090] After one pixel edge padding, the image is convolved using 512 3×3×512 convolution kernels with a convolution step of 1. The size of the feature map obtained is 14×14×512. After obtaining the feature map, ReLU is used to activate the feature map.
[0091] After one pixel edge padding, the image is convolved with 512 3×3×512 convolution kernels with a convolution step of 1. The size of the feature map obtained is 14×14×512. After obtaining the feature map, ReLU is used to activate the feature map.
[0092] After one pixel edge padding, the image is convolved with 512 3×3×512 convolution kernels with a convolution step of 1. The size of the feature map obtained is 14×14×512. After obtaining the feature map, ReLU is used to activate the feature map.
[0093] Using a 2×2 maximum pooling layer with a pooling stride of 2, the size of the resulting feature map is 7×7×512.
[0094] 6. The sixth block: includes three fully connected layers (requires ReLU activation) and one softmax layer.
[0095] ①Two fully connected layer fully connected operations
[0096] First, 4096 7×7×512 fully connected matrices are used to fully connect the feature map. Each fully connected matrix and feature map operation will obtain the data of one pixel, and 4096 fully connected matrices will obtain the data of 4096 pixels. These 4096 pixels of data are arranged in a row, so the size of the feature map obtained is 1×1×4096. After obtaining the feature map, ReLU is used to activate the feature map.
[0097] Then, 4096 1×1×4096 fully connected matrices are used to fully connect the feature map, and 4096 pixels of data are obtained. These 4096 pixels of data are arranged in a row, so the size of the feature map obtained is 1×1×4096. After obtaining the feature map, ReLU is used to activate the feature map.
[0098] ②Classification operation of a fully connected layer
[0099] The purpose of this full connection is classification. There are 1000 categories in total, so 1000 1×1×4096 full connection matrices are used to fully connect the feature map, which will get 1000 pixels of data. These 1000 pixels of data are arranged in a row, so the size of the feature map is 1×1×1000. After obtaining the feature map, ReLU is used to activate the feature map.
[0100] Softmax is used for regression and will get the confidence of the category.
[0101] Optionally, skip connections can be added to the VGG-16 model.
[0102] For example, Figure 8 As shown, the output of the second convolutional layer in the first block can be jump connected to the output of the third convolutional layer in the third block; the output of the second convolutional layer in the second block can be jump connected to the output of the third convolutional layer in the fourth block; the output of the third convolutional layer in the third block can be jump connected to the output of the third convolutional layer in the fifth block.
[0103] Exemplarily, the output of the second convolutional layer in the first block can be jump-connected to the output of the third convolutional layer in the fourth block; the output of the second convolutional layer in the second block can be jump-connected to the output of the third convolutional layer in the fifth block.
[0104] By adding skip connections to the VGG-16 model, the VGG-16 model can learn richer semantics, which helps to improve the optimization effect of the VGG-16 model.
[0105] Fig. 9A schematic block diagram of an image segmentation device 900 provided in an embodiment of the present application is shown. The image segmentation device 900 includes: an acquisition unit 910, which is used to acquire a color map corresponding to a first image and a depth map corresponding to the first image; a prediction unit 920, which is used to input the color map into a convolutional neural network to obtain a color feature and input the depth map into the convolutional neural network to obtain a depth feature; a fusion unit 930, which is used to fuse the color feature and the depth feature to obtain a fused feature; an optimization unit 940, which is used to optimize the fused feature to obtain a segmentation result of the first image.
[0106] The acquisition unit 910 , prediction unit 920 and fusion unit 930 may be located in the prediction module 310 , and the optimization unit 940 may be located in the optimization module 320 .
[0107] The above fusion unit 930 can be the above Figure 3 The fusion module shown in .
[0108] The embodiment of the present application further provides a computer program product, which includes: a computer program code, and when the computer program code is run on a computer, the computer executes the image segmentation method in the above embodiment.
[0109] The embodiment of the present application further provides a computer-readable medium, wherein the computer-readable medium stores a program code. When the computer program code is executed on a computer, the computer executes the image segmentation method in the above embodiment.
[0110] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0111] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0112] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0113] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0114] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0115] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0116] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An image segmentation method, characterized in that: include: Obtaining a color map corresponding to the first image and a depth map corresponding to the first image; Inputting the color map into a convolutional neural network to obtain color features and inputting the depth map into the convolutional neural network to obtain depth features; Fusing the color feature and the depth feature to obtain a fused feature; The fused features are optimized to obtain a segmentation result of the first image.
2. The method according to claim 1, characterized in that: The method further comprises: According to the segmentation result, three-dimensional 3D reconstruction is performed.
3. The method according to claim 1 or 2, characterized in that: The convolutional neural network includes an encoder, and the encoder includes 1 input convolution layer and 6 residual modules; The input convolution layer includes 64 filters, the size of the filters is 3×3 and the step size is 1; Each of the first four residual modules of the six residual modules includes 64 filters, and the size of the filter is 3×3 and the step size is 1; Each of the last two residual modules of the six residual modules is composed of three basic residual modules.
4. The method according to claim 3, characterized in that The convolutional neural network also includes a decoder, and a bridge is included between the encoder and the decoder, wherein: The bridge consists of three convolutional layers, and each of the three convolutional layers consists of 512 3×3 hole convolutions.
5. The method according to any one of claims 1 to 4, characterized in that The fusing the color feature and the depth feature to obtain a fused feature includes: The color feature and the depth feature are summed pixel by pixel to obtain the fused feature.
6. The method according to any one of claims 1 to 5, characterized in that The step of optimizing the fused features to obtain a segmentation result of the first image includes: Inputting the fused features into a residual refinement module to obtain a segmentation result of the first image; The residual refinement module includes an input layer, an encoder, a bridge, a decoder and an output layer. The encoder and the decoder each include 4 stages. Each of the 4 stages includes 1 convolutional layer. The convolutional layer includes 64 filters, and the size of the filter is 3×3.
7. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute a computer program stored in the memory so that the electronic device executes the method as claimed in any one of claims 1 to 6.
8. An electronic device, characterized in that: include: A unit for carrying out the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a computer, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the method according to any one of claims 1 to 6 is implemented.
