Region selection method, electronic device, and computer readable storage medium

By combining the first and second region mask generation models to optimize image features and interaction information, the problems of inaccurate region selection and rough edges caused by the connected domain algorithm are solved, thereby improving the user experience.

WO2025200671A1PCT designated stage Publication Date: 2025-10-02HUAWEI TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/143922
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-29
Filing Date
2024-12-30
Publication Date
2025-10-02

AI Technical Summary

Technical Problem

The existing method of determining the user-selected area based on the connected domain algorithm is prone to omission or multiple selection of areas, and the edges of the determined areas are rough or jagged, resulting in a poor user experience.

Method used

By obtaining the first image features and interaction information of the target image, processing is performed using the first region mask generation model and the second region mask generation model, and the mask result is optimized to accurately determine the target region that the user wants to select and ensure smooth edges.

Benefits of technology

Improves the accuracy of area selection and user experience, ensures smooth edges, and reduces operational complexity and latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024143922_02102025_PF_FP_ABST
    Figure CN2024143922_02102025_PF_FP_ABST
Patent Text Reader

Abstract

The present application is applicable to the technical field of terminals, and in particular relates to a region selection method, an electronic device, and a computer readable storage medium. The method comprises: acquiring a first image feature of a target image, and interaction information for the target image; inputting the first image feature and the interaction information into a first region mask generation model for processing, obtaining a first mask result corresponding to the interaction information; inputting the target image and the first mask result into a second region mask generation model for processing, obtaining a second mask result corresponding to the interaction information, so as to determine a target region corresponding to the interaction information on the basis of the second mask result. The second region mask generation model enables optimization of the first mask result based on the target image, to refine a contour of the first mask result and / or a missing region in the first mask result, making it possible to accurately determine a target region that a user intends to select on the basis of the second mask result, and making a contour of the determined target region smooth.
Need to check novelty before this filing date? Find Prior Art

Description

Area selection method, electronic device, and computer-readable storage medium

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 29, 2024, with application number 202410381454.1 and application name “Region selection method, electronic device and computer-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application belongs to the field of terminal technology, and in particular relates to a region selection method, an electronic device, and a computer-readable storage medium. Background Art

[0003] In image processing or image rendering, when a user wants to select a region of an image for processing, the user can perform a selection operation such as clicking or selecting a frame within the image. Electronic devices can determine the connected region corresponding to the selection operation based on a connected domain algorithm, thereby determining the region selected by the user based on the connected region. Currently, the method of determining the region selected by the user based on the connected domain algorithm can result in missed or multiple selections of regions, and the determined region can have problems such as rough or jagged edges, resulting in a poor user experience. Summary of the Invention

[0004] The embodiments of the present application provide a region selection method, an electronic device, and a computer-readable storage medium, which can accurately determine the target region that the user wants to select, and can make the edges of the target region finally determined smooth, thereby improving the user experience.

[0005] In a first aspect, an embodiment of the present application provides a region selection method, which may include:

[0006] Acquiring a first image feature of a target image and interaction information for the target image;

[0007] Inputting the first image feature and the interaction information into a first region mask generation model for processing, to obtain a first mask result corresponding to the interaction information output by the first region mask generation model;

[0008] Inputting the target image and the first mask result into a second region mask generation model for processing to obtain a second mask result corresponding to the interaction information output by the second region mask generation model, wherein the second region mask generation model has a function of optimizing the first mask result output by the first region mask generation model;

[0009] A target area corresponding to the interactive information is determined according to the second mask result, where the target area is an image area in the target image.

[0010] In the region selection method provided above, when the user selects a region of a target image, the electronic device can obtain the first image feature of the target image and the interactive information for the target image, and input the first image feature and the interactive information into the first region mask generation model for processing, thereby obtaining a first mask result corresponding to the interactive information output by the first region mask generation model. In addition, the electronic device can input the target image and the first mask result into the second region mask generation model for processing, thereby obtaining a second mask result corresponding to the interactive information output by the second region mask generation model, so as to determine the target region corresponding to the interactive information based on the second mask result. The second region mask generation model has the function of optimizing the first mask result output by the first region mask generation model. That is, the second region mask generation model can optimize the first mask result based on the target image to improve the edges of the first mask result and / or improve the missing or redundant areas in the first mask result, so that the target region that the user wants to select can be accurately determined based on the second mask result, and the edges of the target region finally determined can be smoothed, thereby improving the user experience.

[0011] Exemplarily, the first image feature may be a high-dimensional image feature. That is, when determining the target area in the target image based on the interaction information, the electronic device may obtain the high-dimensional image features of the target image and determine the target area based on the high-dimensional image features and the interaction information, thereby enabling accurate determination of the target area in high-resolution images. Specifically, when the content of the area the user wishes to select is complex, the electronic device may accurately determine the area the user wishes to select based on the high-dimensional image features, thereby accurately determining the content the user wishes to select and improving the user experience.

[0012] In a possible implementation of the first aspect, acquiring the first image feature of the target image may include:

[0013] The target image is input into a trained image feature extraction model for processing to obtain the first image feature output by the image feature extraction model.

[0014] In the region selection method provided by this implementation, the first image feature of the target image can be obtained through a pre-trained image feature extraction model, and the first image feature can be extracted efficiently and accurately, thereby increasing the speed of region selection and improving user experience.

[0015] Exemplarily, the image feature extraction model includes M feature extraction modules and N feature fusion modules, the M feature extraction modules are used to extract candidate image features of different dimensions corresponding to the target image, and the N feature fusion modules are used to determine the first image feature based on the candidate image features of different dimensions extracted by the M feature extraction modules, where M≥2 and N≥1.

[0016] It should be understood that M can be greater than or equal to 2. N can be greater than or equal to 1. The specific values ​​of M and N can be determined based on the actual application scenario, and the embodiments of the present application do not impose any restrictions on this. In addition, the dimensions of the candidate image features extracted by each feature extraction module can be determined based on the actual application scenario.

[0017] Each feature extraction module may include one or more convolutional neural networks (CNNs), or may include one or more codec networks (e.g., transformers), or may include one or more CNNs and one or more codec networks. Each feature fusion module may include one or more CNNs, or may include one or more codec networks, or may include one or more CNNs and one or more codec networks.

[0018] In some embodiments, after obtaining the first image feature output by the image feature extraction model, the method may include:

[0019] The target image and the first image feature are associated and saved, or the identifier of the target image and the first image feature are associated and saved.

[0020] In the region selection method provided in this embodiment, for each target image, the first image feature can be extracted only once by the image feature extraction model. For example, when the target area in the target image is determined for the first time, the first image feature of the target image can be extracted by the image feature extraction model, and the extracted first image feature and the target image can be associated and saved, or the extracted first image feature and the identifier of the target image can be associated and saved. The identifier of the target image can be a unique identifier such as the name or number of the target image. Therefore, when the target area in the target image is determined again (for example, the second or third time) subsequently, the target area can be determined directly based on the saved first image feature, so that when the target area in the target image is determined again subsequently, the first image feature does not need to be extracted, and the delay of the first image feature extraction can be reduced, thereby reducing the delay of the target area determination, improving the efficiency of the subsequent re-determination of the target area, and making it possible to quickly determine the target area and improve the user experience.

[0021] In a possible implementation of the first aspect, the first region mask generation model may include a coding module and a convolution module;

[0022] Inputting the first image feature and the interaction information into a first region mask generation model for processing to obtain a first mask result corresponding to the interaction information output by the first region mask generation model may include:

[0023] Inputting the first image feature and the interaction information into the first region mask generation model, and processing the first image feature and the interaction information by the encoding and decoding module to obtain a second image feature;

[0024] A third image feature is determined from the second image feature through the convolution module, and the first mask result corresponding to the interaction information is determined based on the third image feature, where the third image feature is an image feature belonging to the same object as the image feature corresponding to the interaction information.

[0025] In the region selection method provided by this implementation, the first region mask generation model can accurately determine, through the encoding and decoding module and the convolution module, that the image features corresponding to the interactive information belong to the image features of the same object, thereby accurately determining the object the user wants to select, and accurately determining the first mask result corresponding to the interactive information, so that the region the user wants to select can be accurately obtained, improving the user experience. In addition, the first image feature can be a high-dimensional image feature. Therefore, when the content of the region the user needs to determine is relatively complex, the first region mask generation model can also accurately determine the region the user wants to select based on the high-dimensional first image feature and the interactive information, thereby accurately determining the content the user wants to select and improving the user experience.

[0026] It should be understood that the objects in the embodiments of the present application can be specifically determined according to the actual application scenario, and the embodiments of the present application are not limited to this. For example, for a person, the head can be determined as an object, the upper limbs can be determined as an object, the lower limbs can be determined as an object, the shoulders can be determined as an object, the abdomen can be determined as an object, and so on. Alternatively, the hair can be determined as an object, the face can be determined as an object, the upper limbs can be determined as an object, the lower limbs can be determined as an object, the shoulders can be determined as an object, the abdomen can be determined as an object, and so on.

[0027] Exemplarily, the interaction information may include position information of the interaction operation corresponding to the interaction information in the target image.

[0028] Exemplarily, the image feature corresponding to the interaction information may be determined from the first image feature according to the position information.

[0029] Exemplarily, the codec module may include one or more codec networks, such as one or more transformers. The convolution module may include one or more CNNs, or one or more transformers, or one or more CNNs and one or more transformers.

[0030] In a possible implementation manner of the first aspect, the interaction information may include first interaction information and second interaction information;

[0031] Inputting the first image feature and the interaction information into a first region mask generation model for processing to obtain a first mask result corresponding to the interaction information output by the first region mask generation model includes:

[0032] The image features, the first interaction information, and the second interaction information are input into the first region mask generation model for processing to obtain the first mask result output by the first region mask generation model, where the first mask result corresponds to the first interaction information and the second interaction information.

[0033] In the region selection method provided by this implementation, the user can select one or more regions in the target image based on multiple interactive operations, that is, the user can perform multiple interactive operations to accurately select the region they want. When the user selects one or more regions in the target image based on multiple interactive operations, the electronic device can respectively determine the interactive information corresponding to each interactive operation, and can input the interactive information corresponding to each interactive operation into the first region mask generation model. The first region mask generation model can determine the first mask result corresponding to each interactive information based on the first image feature of the target image and each interactive information, so that the region the user wants to select can be accurately determined based on the user's multiple interactive operations, thereby improving the user experience.

[0034] In a possible implementation of the first aspect, the second region mask generation model may include a first sampling module and a second sampling module;

[0035] Inputting the target image and the first mask result into a second region mask generation model for processing to obtain a second mask result corresponding to the interaction information output by the second region mask generation model may include:

[0036] Inputting the target image and the first mask result into the second region mask generation model, downsampling the target image and the first mask result respectively by the first sampling module to obtain a first sampling feature corresponding to the target image and a second sampling feature corresponding to the first mask result;

[0037] The first sampling feature and the second sampling feature are respectively upsampled by the second sampling module to obtain a third sampling feature corresponding to the first sampling feature and a fourth sampling feature corresponding to the second sampling feature, and a second mask result corresponding to the interactive information is determined based on the third sampling feature and the fourth sampling feature.

[0038] In the region selection method provided by this implementation, the second region mask generation model can downsample and upsample the target image and the first mask result respectively through the first sampling module and the second sampling module to optimize the first mask result according to the final sampling characteristics. For example, the edge of the area corresponding to the interaction information in the first mask result can be optimized to obtain a second mask result to reduce problems such as edge roughness and / or edge jaggedness, so that the edge of the area corresponding to the interaction information in the second mask result is smoother, thereby making the edge of the target area finally determined smoother. For example, the missing area in the first mask result can be determined based on the sampling characteristics corresponding to the target image, and the missing area can be supplemented to obtain a second mask result to improve the missing area, so that the content of the second mask result is more complete, thereby making the content of the target area finally determined more complete, so as to accurately determine the area that the user wants to select. For example, redundant areas in the first mask result can be determined based on the sampling features corresponding to the target image, and the redundant areas can be deleted to obtain a second mask result to improve the redundant areas so that the second mask result accurately corresponds to the interactive information. The interactive information input by the user can be accurately understood, thereby accurately determining the target area that the user wants to select and improving the user experience.

[0039] Exemplarily, the first sampling module may include one or more CNNs, or may include one or more transformers, or may include one or more CNNs and one or more transformers. The second sampling module may include one or more CNNs, or may include one or more transformers, or may include one or more CNNs and one or more transformers.

[0040] In a second aspect, an embodiment of the present application provides a region selection device, which may include:

[0041] An interactive information acquisition module, configured to acquire a first image feature of a target image and interactive information for the target image;

[0042] a first mask acquisition module, configured to input the first image feature and the interaction information into a first region mask generation model for processing, and obtain a first mask result corresponding to the interaction information output by the first region mask generation model;

[0043] a second mask acquisition module, configured to input the target image and the first mask result into a second region mask generation model for processing, to obtain a second mask result corresponding to the interactive information output by the second region mask generation model, wherein the second region mask generation model has a function of optimizing the first mask result output by the first region mask generation model;

[0044] A target region determining module is configured to determine a target region corresponding to the interactive information according to the second mask result, where the target region is an image region in the target image.

[0045] In a possible implementation of the second aspect, the interactive information acquisition module is further used to input the target image into a trained image feature extraction model for processing to obtain the first image feature output by the image feature extraction model.

[0046] Exemplarily, the image feature extraction model includes M feature extraction modules and N feature fusion modules, the M feature extraction modules are used to extract candidate image features of different dimensions corresponding to the target image, and the N feature fusion modules are used to determine the first image feature based on the candidate image features of different dimensions extracted by the M feature extraction modules, where M≥2 and N≥1.

[0047] In some embodiments, the apparatus may include:

[0048] The image feature saving module is used to associate and save the target image with the first image feature, or associate and save the identifier of the target image with the first image feature.

[0049] In a possible implementation of the second aspect, the first region mask generation model includes a coding module and a convolution module;

[0050] The first mask acquisition module is specifically used to input the first image feature and the interaction information into the first area mask generation model, process the first image feature and the interaction information through the encoding and decoding module to obtain a second image feature; determine a third image feature from the second image feature through the convolution module, and determine the first mask result corresponding to the interaction information based on the third image feature, where the third image feature is an image feature that belongs to the same object as the image feature corresponding to the interaction information.

[0051] Exemplarily, the interaction information includes position information of the interaction operation corresponding to the interaction information in the target image.

[0052] Exemplarily, the image feature corresponding to the interaction information is determined from the first image feature according to the position information.

[0053] In a possible implementation manner of the second aspect, the interaction information includes first interaction information and second interaction information;

[0054] The first mask acquisition module is further used to input the image features, the first interaction information and the second interaction information into the first area mask generation model for processing to obtain the first mask result output by the first area mask generation model, and the first mask result corresponds to the first interaction information and the second interaction information.

[0055] In a possible implementation of the second aspect, the second region mask generation model includes a first sampling module and a second sampling module;

[0056] The second mask acquisition module is specifically configured to input the target image and the first mask result into the second region mask generation model, downsample the target image and the first mask result respectively through the first sampling module to obtain a first sampling feature corresponding to the target image and a second sampling feature corresponding to the first mask result; upsample the first sampling feature and the second sampling feature respectively through the second sampling module to obtain a third sampling feature corresponding to the first sampling feature and a fourth sampling feature corresponding to the second sampling feature, and determine the second mask result corresponding to the interaction information based on the third sampling feature and the fourth sampling feature.

[0057] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the area selection method described in any one of the first aspects above.

[0058] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, the computer implements the area selection method described in any one of the first aspects above.

[0059] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the area selection method described in any one of the first aspects above.

[0060] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] FIG1 is a schematic diagram of an application scenario of region selection based on reddish filling;

[0062] FIG2 is a schematic diagram of the structure of an electronic device to which the region selection method provided in an embodiment of the present application is applicable;

[0063] FIG3 is a schematic diagram of a software architecture to which the region selection method provided in an embodiment of the present application is applicable;

[0064] FIG4 is a flow chart of a region selection method according to an embodiment of the present application;

[0065] FIG5 is a schematic diagram of a process of extracting a first image feature by an image feature extraction model provided in an embodiment of the present application;

[0066] FIG6 is a schematic diagram of a process for obtaining a first mask result using a first region mask generation model provided in an embodiment of the present application;

[0067] FIG7 is a schematic diagram of a process of obtaining a second mask result using a second region mask generation model provided in an embodiment of the present application;

[0068] 8 and 9 are schematic diagrams of application scenarios provided by embodiments of the present application. DETAILED DESCRIPTION

[0069] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0070] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0071] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0072] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0073] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0074] In addition, the “plurality” mentioned in the embodiments of the present application should be interpreted as two or more.

[0075] The steps involved in the region selection method provided in the embodiments of this application are merely examples. Not all steps are mandatory, nor are all information or messages required. These steps can be added or removed as needed during use. The same step or steps or messages with the same function in different embodiments of this application can be referenced and used in conjunction with each other.

[0076] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field will know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0077] In image processing or image rendering, when a user wants to select an area of ​​an image for processing, they can manually draw the outline of the selected area, and the electronic device can determine the user-selected area based on the drawn outline. Alternatively, the user can perform a selection operation such as clicking or selecting a frame in the image, and the electronic device can determine the connected area corresponding to the selection operation based on a connected domain algorithm, thereby determining the user-selected area based on the connected domain.

[0078] Manually drawing an outline to select an area is inefficient, and when there are problems such as hand tremors, the final area determined may not be the area the user actually wants to select. The method of selecting an area based on the connected domain algorithm cannot accurately determine the area the user actually wants to select, which may cause problems such as missed or multiple selections of areas. In addition, the areas determined by manually drawing an outline or by the connected domain algorithm may have problems such as rough edges or jagged edges, resulting in a poor user experience.

[0079] When performing region selection based on the connected domain algorithm, region selection can be performed based on reddish fill. When performing region selection based on reddish fill, the user can click on the region they wish to select in the image. The electronic device can determine the region clicked by the user in the image as the starting point and, based on the starting point, select a region in the image with a color similar to that of the starting point as the region selected by the user. For example, regions with similar colors can be set to 1, and other regions can be set to 0, to obtain a mask result for the region selected by the user.

[0080] It should be understood that the electronic device can determine whether the colors are similar based on the difference between the RGB values ​​of the pixels. For example, when the difference between the RGB value of a certain pixel and the RGB value of the pixel corresponding to the starting point is less than or equal to a preset threshold (e.g., preset threshold A), the electronic device can determine that the color of the pixel is similar to the color of the starting point. Alternatively, when the ratio of the difference between the RGB value of a certain pixel and the RGB value of the pixel corresponding to the starting point to the RGB value of the pixel corresponding to the starting point is less than or equal to a preset threshold (e.g., preset threshold B), the electronic device can determine that the color of the pixel is similar to the color of the starting point. Among them, the preset threshold A and the preset threshold B can be set by default by the electronic device or can be customized by the user, and the user can modify the preset threshold A and the preset threshold B according to actual needs.

[0081] For example, refer to Figure 1, which illustrates an application scenario for region selection based on reddish fill. In this application scenario, when the ratio of the difference between the RGB value of a pixel and the RGB value of the pixel corresponding to the starting point to the RGB value of the pixel corresponding to the starting point is less than or equal to a preset threshold value B, the pixel's color is determined to be similar to the color of the starting point.

[0082] As shown in FIG1( a ), when a user wants to select a certain area in an image, the user can click on the area in the image.

[0083] When the preset threshold value B = 10%, the mask result obtained based on the red filling can be shown in Figure 1 (b). When the preset threshold value B = 25%, the mask result obtained based on the red filling can be shown in Figure 1 (c). When the preset threshold value B = 50%, the mask result obtained based on the red filling can be shown in Figure 1 (d). When the preset threshold value B = 90%, the mask result obtained based on the red filling can be shown in Figure 1 (e).

[0084] The above-mentioned connected domain algorithm-based region selection method determines the user's selected area based on color. This can lead to the determined area not being the area the user actually intended to select. For example, this can result in missing or redundant selected areas, as well as rough or jagged edges. Furthermore, when the user wants to select the desired area, they must repeatedly adjust the starting point and / or preset threshold, which is cumbersome. Furthermore, latency increases with image resolution, resulting in a poor user experience.

[0085] As can be seen from the above, general area selection methods may result in missed or multiple selections of areas, and the determined areas may have problems such as rough edges or jagged edges, resulting in a poor user experience.

[0086] To solve the above problems, embodiments of the present application provide a region selection method, an electronic device, and a computer-readable storage medium. In this method, when performing region selection on a target image, the electronic device can obtain a first image feature of the target image and interactive information for the target image, and input the first image feature and interactive information into a first region mask generation model for processing to obtain a first mask result corresponding to the interactive information output by the first region mask generation model. In addition, the electronic device can input the target image and the first mask result into a second region mask generation model for processing to obtain a second mask result corresponding to the interactive information output by the second region mask generation model, so as to determine the target region corresponding to the interactive information based on the second mask result. The second region mask generation model has the function of optimizing the first mask result output by the first region mask generation model. That is, the second region mask generation model can optimize the first mask result based on the target image to improve the edges of the first mask result and / or improve the missing areas or redundant areas in the first mask result, so that the target region that the user wants to select can be accurately determined based on the second mask result, and the edges of the target region finally determined can be smooth, thereby improving the user experience.

[0087] In the embodiments of the present application, the region selection method can be applied to electronic devices. The electronic devices can include mobile phones, tablet computers, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), desktop computers, and other electronic devices with display screens. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

[0088] The following first introduces the electronic device involved in the embodiment of the present application. Please refer to FIG2 , which shows a schematic structural diagram of an electronic device 200 .

[0089] The electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, an antenna 1, an antenna 2, a mobile communication module 240, a wireless communication module 250, a sensor module 260, a camera 270, and a display screen 280. The sensor module 260 may include a pressure sensor 260A, a gyroscope sensor 260B, a magnetic sensor 260C, an acceleration sensor 260D, a touch sensor 260E, and the like.

[0090] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0091] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0092] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0093] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.

[0094] In some embodiments, the processor 210 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0095] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 210 may include multiple I2C busses. The processor 210 may be coupled to the touch sensor 260E, the flash, the camera 270, and the like via different I2C bus interfaces. For example, the processor 210 may be coupled to the touch sensor 260E via the I2C interface, enabling communication between the processor 210 and the touch sensor 260E via the I2C bus interface, thereby implementing the touch function of the electronic device 200.

[0096] The MIPI interface can be used to connect the processor 210 to peripheral devices such as the display screen 280 and the camera 270. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 210 and the camera 270 communicate via the CSI interface to implement the camera function of the electronic device 200. The processor 210 and the display screen 280 communicate via the DSI interface to implement the display function of the electronic device 200.

[0097] The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 210 to the camera 270, the display 280, the wireless communication module 250, the sensor module 260, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0098] The USB interface 230 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 230 can be used to transfer data between the electronic device 200 and peripheral devices. The interface can also be used to connect other electronic devices, such as AR devices.

[0099] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may also adopt a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.

[0100] The wireless communication function of the electronic device 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 240, the wireless communication module 250, the modem processor and the baseband processor.

[0101] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0102] The mobile communication module 240 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 200. The mobile communication module 240 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 240 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 240 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 240 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 240 can be set in the same device as at least some of the modules of the processor 210.

[0103] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium- or high-frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor displays images or videos via the display screen 280. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be provided in the same device as the mobile communication module 240 or other functional modules.

[0104] The wireless communication module 250 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 200. The wireless communication module 250 can be one or more devices integrating at least one communication processing module. The wireless communication module 250 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 250 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0105] In some embodiments, antenna 1 of electronic device 200 is coupled to mobile communication module 240, and antenna 2 is coupled to wireless communication module 250, so that electronic device 200 can communicate with a network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0106] Electronic device 200 implements display functionality through a GPU, display screen 280, and an application processor. The GPU is a microprocessor for image processing that connects display screen 280 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or modify display information.

[0107] Display screen 280 is used to display images, videos, and the like. Display screen 280 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 (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 200 may include one or N display screens 280, where N is a positive integer greater than one.

[0108] The electronic device 200 can implement a shooting function through an ISP, a camera 270, a video codec, a GPU, a display screen 280, and an application processor.

[0109] The ISP processes data fed back by camera 270. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 270.

[0110] The camera 270 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 200 may include 1 or N cameras 270, where N is a positive integer greater than 1.

[0111] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 200 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0112] Video codecs are used to compress or decompress digital video. Electronic device 200 may support one or more video codecs. This allows electronic device 200 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0113] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 200, such as image recognition, face recognition, speech recognition, and text comprehension.

[0114] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 via the external memory interface 220 to implement data storage functions. For example, files such as videos can be stored in the external memory card.

[0115] The internal memory 221 can be used to store computer executable program codes, which include instructions. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 210 executes various functional applications and data processing of the electronic device 200 by running instructions stored in the internal memory 221 and / or instructions stored in a memory provided in the processor.

[0116] Pressure sensor 260A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 260A can be located on display screen 280. There are many types of pressure sensors 260A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 260A, the capacitance between the electrodes changes. Electronic device 200 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 280, electronic device 200 detects the touch intensity based on pressure sensor 260A. Electronic device 200 can also calculate the touch location based on the detection signal from pressure sensor 260A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0117] The gyroscope sensor 260B can be used to determine the motion posture of the electronic device 200. In some embodiments, the angular velocity of the electronic device 200 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 260B. The gyroscope sensor 260B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 260B detects the angle of the electronic device 200 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 200 through reverse movement to achieve anti-shake. The gyroscope sensor 260B can also be used for navigation and somatosensory game scenes.

[0118] The magnetic sensor 260C includes a Hall effect sensor. The electronic device 200 can use the magnetic sensor 260C to detect the opening and closing of the flip case. In some embodiments, when the electronic device 200 is a flip phone, the electronic device 200 can detect the opening and closing of the flip cover based on the magnetic sensor 260C. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.

[0119] Accelerometer 260D can detect the magnitude of acceleration of electronic device 200 in all directions (generally three axes). When electronic device 200 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0120] Touch sensor 260E, also known as a "touch device," can be disposed on display screen 280. The touch sensor 260E and display screen 280 form a touch screen, also known as a "touch screen." Touch sensor 260E is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided via display screen 280. In other embodiments, touch sensor 260E can also be disposed on the surface of electronic device 200, at a location different from that of display screen 280.

[0121] The software system of the electronic device 200 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. For example, the software system of the electronic device 200 can adopt an Android operating system (OS), a Harmony OS, or an IOS with a layered architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 200.

[0122] FIG3 is a software structure block diagram of the electronic device 200 according to an embodiment of the present application.

[0123] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0124] The application layer can include a series of application packages.

[0125] As shown in FIG3 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.

[0126] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0127] As shown in FIG3 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

[0128] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0129] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0130] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0131] The phone manager is used to provide communication functions of the electronic device 200, such as management of call status (including answering, hanging up, etc.).

[0132] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0133] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0134] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0135] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0136] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0137] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0138] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0139] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0140] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0141] A 2D graphics engine is a drawing engine for 2D drawings.

[0142] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0143] The region selection method provided in the embodiment of the present application is described in detail below with reference to specific application scenarios and accompanying drawings.

[0144] Please refer to Figure 4, which shows a schematic flow chart of a region selection method provided by an embodiment of the present application. The method can be applied to painting scenarios as well as image processing scenarios. For example, in a painting scenario, the method can be used to extract content or materials. For example, in an image processing scenario, the method can be used to determine the image content to be processed so as to modify or delete the determined image content. As shown in Figure 4, the method may include:

[0145] S401: Acquire a first image feature of a target image and interactive information for the target image.

[0146] S402: Input the first image feature and the interaction information into a first region mask generation model for processing to obtain a first mask result corresponding to the interaction information output by the first region mask generation model.

[0147] S403. Input the target image and the first mask result into the second region mask generation model for processing to obtain a second mask result corresponding to the interactive information output by the second region mask generation model. The second region mask generation model has the function of optimizing the first mask result output by the first region mask generation model.

[0148] S404: Determine a target region corresponding to the interactive information according to the second mask result, where the target region is an image region in the target image.

[0149] In an embodiment of the present application, when a user selects a region of a target image, the electronic device can obtain the first image features of the target image and the interactive information for the target image, and input the first image features and the interactive information into the first region mask generation model for processing, and obtain a first mask result corresponding to the interactive information output by the first region mask generation model. In addition, the electronic device can input the target image and the first mask result into the second region mask generation model for processing, and obtain a second mask result corresponding to the interactive information output by the second region mask generation model, so as to determine the target region corresponding to the interactive information based on the second mask result. Among them, the second region mask generation model has the function of optimizing the first mask result output by the first region mask generation model. That is, the second region mask generation model can optimize the first mask result according to the target image to improve the edge of the first mask result, and / or improve the missing area or redundant area in the first mask result, so that the target region that the user wants to select can be accurately determined based on the second mask result, and the edge of the target region finally determined can be smoothed, thereby improving the user experience.

[0150] Exemplarily, the first image feature may be a high-dimensional image feature. That is, when determining the target area in the target image based on the interaction information, the electronic device may obtain the high-dimensional image features of the target image and determine the target area based on the high-dimensional image features and the interaction information, thereby enabling accurate determination of the target area in high-resolution images. Specifically, when the content of the area the user wishes to select is complex, the electronic device may accurately determine the area the user wishes to select based on the high-dimensional image features, thereby accurately determining the content the user wishes to select and improving the user experience.

[0151] It should be noted that the dimensions of the first image feature can be determined based on the actual application scenario and are not limited in this embodiment of the present application. For example, the dimensions of the first image feature can be determined to be 64*64*256 (height*width*channels) based on the actual application scenario, that is, the height and width of the first image feature can both be 64, and the number of channels can be 256.

[0152] In one possible implementation, the electronic device may extract the first image feature of the target image through a pre-trained image feature extraction model. Exemplarily, the image feature extraction model may include M feature extraction modules and N feature fusion modules. The M feature extraction modules may be used to extract image features of different dimensions corresponding to the target image (hereinafter referred to as candidate image features). That is, the dimensions of the candidate image features extracted by each feature extraction module may be different. The N feature fusion modules may be used to determine the first image feature of the target image based on the candidate image features of different dimensions extracted by the M feature extraction modules. That is, the N feature fusion modules may fuse the candidate image features of different dimensions to obtain the first image feature of the target image.

[0153] It should be understood that M can be greater than or equal to 2. N can be greater than or equal to 1. The specific values ​​of M and N can be determined based on the actual application scenario, and the embodiments of the present application do not impose any restrictions on this. In addition, the dimensions of the candidate image features extracted by each feature extraction module can be determined based on the actual application scenario.

[0154] For example, when the M feature extraction modules include feature extraction module A, feature extraction module B, feature extraction module C, feature extraction module D and feature extraction module E, the dimension of the candidate image features extracted by feature extraction module A can be 128*128*128, the dimension of the candidate image features extracted by feature extraction module B can be 64*64*256, the dimension of the candidate image features extracted by feature extraction module C can be 32*32*512, the dimension of the candidate image features extracted by feature extraction module D can be 8*8*512, and the dimension of the candidate image features extracted by feature extraction module E can be 4*4*512. By downsampling the target image through M feature extraction modules, the subsequent calculation amount can be reduced. For example, the calculation amount of the first region mask generation model to determine the first mask result can be reduced, and the efficiency of determining the first mask result can be improved, thereby improving the efficiency of region selection and enhancing user experience.

[0155] In one example, each feature extraction module may include one or more convolutional neural networks (CNNs), or may include one or more codec networks (e.g., transformers), or may include one or more CNNs and one or more codec networks. It should be understood that the number of CNNs and / or the number of codec networks included in each feature extraction module may be the same or different. The number of CNNs and / or the number of codec networks included in each feature extraction module may be determined according to the actual application scenario. For example, each feature extraction module may include 2 CNNs. For example, each feature extraction module may include 2 transformers. For example, each feature extraction module may include 1 CNN and 1 transformer. For example, a part of the feature extraction modules may include 2 CNNs, another part of the feature extraction modules may include 2 transformers, and so on.

[0156] In another example, each feature fusion module may include one or more CNNs, or may include one or more codec networks, or may include one or more CNNs and one or more codec networks. It should be understood that the number of CNNs and / or the number of codec networks included in each feature fusion module may be the same or different. Among them, the number of CNNs and / or the number of codec networks included in each feature fusion module can be determined according to the actual application scenario. For example, each feature fusion module may include 2 CNNs. For example, each feature fusion module may include 2 transformers. For example, each feature fusion module may include 1 CNN and 1 transformer. For example, a part of the feature fusion modules may include 2 CNNs, another part of the feature fusion modules may include 2 transformers, and so on.

[0157] The following describes in detail the process of extracting the first image feature by the image feature extraction model with reference to the accompanying drawings.

[0158] Please refer to Figure 5, which shows a schematic diagram of a process for extracting a first image feature using an image feature extraction model provided in an embodiment of the present application. In Figure 5, an image feature extraction model 500 is illustrated as including five feature extraction modules and one feature fusion module, with each feature extraction module including two CNNs and the feature fusion module including two CNNs.

[0159] As shown in FIG5 , the image feature extraction model 500 may include a first feature extraction module 511, a second feature extraction module 512, a third feature extraction module 513, a fourth feature extraction module 514, a fifth feature extraction module 515, and a feature fusion module 521. Specifically, the first feature extraction module 511, the second feature extraction module 512, the third feature extraction module 513, the fourth feature extraction module 514, the fifth feature extraction module 515, and the feature fusion module 521 may each include two CNNs.

[0160] As shown in FIG. 5 , when it is necessary to determine the area selected by the user in the target image, the electronic device may input the target image into the image feature extraction model 500 .

[0161] After the image feature extraction model 500 acquires the target image, the first feature extraction module 511 may extract image features from the target image to obtain candidate image features (e.g., candidate image feature A). For example, the dimension of candidate image feature A may be 128*128*128. After the first feature extraction module 511 acquires candidate image feature A, it may input candidate image feature A into the second feature extraction module 512 and the feature fusion module 521, respectively.

[0162] After the second feature extraction module 512 obtains candidate image feature A, it may perform feature extraction on candidate image feature A to obtain a candidate image feature extracted by the second feature extraction module 512 (e.g., candidate image feature B). For example, the dimension of candidate image feature B may be 64*64*256. After the second feature extraction module 512 obtains candidate image feature B, it may input candidate image feature B into the third feature extraction module 513 and the feature fusion module 521, respectively.

[0163] After the third feature extraction module 513 obtains candidate image feature B, it may perform feature extraction on candidate image feature B to obtain a candidate image feature extracted by the third feature extraction module 513 (e.g., candidate image feature C). For example, the dimension of candidate image feature C may be 32*32*512. After the third feature extraction module 513 obtains candidate image feature C, it may input candidate image feature C into the fourth feature extraction module 514 and the feature fusion module 521, respectively.

[0164] After obtaining candidate image feature C, fourth feature extraction module 514 may perform feature extraction on candidate image feature C to obtain a candidate image feature extracted by fourth feature extraction module 514 (e.g., candidate image feature D). For example, the dimension of candidate image feature D may be 8*8*512. After obtaining candidate image feature D, fourth feature extraction module 514 may input candidate image feature D into fifth feature extraction module 515 and feature fusion module 521, respectively.

[0165] After the fifth feature extraction module 515 obtains the candidate image feature D, it may perform feature extraction on the candidate image feature D to obtain a candidate image feature extracted by the fifth feature extraction module 515 (e.g., candidate image feature E). For example, the dimension of the candidate image feature E may be 4*4*512. After the fifth feature extraction module 515 obtains the candidate image feature E, it may input the candidate image feature E into the feature fusion module 521.

[0166] After acquiring candidate image feature A, candidate image feature B, candidate image feature C, candidate image feature D, and candidate image feature E, feature fusion module 521 may process candidate image feature A, candidate image feature B, candidate image feature C, candidate image feature D, and candidate image feature E. For example, feature fusion module 521 may fuse candidate image feature A, candidate image feature B, candidate image feature C, candidate image feature D, and candidate image feature E to obtain a first image feature of the target image. For example, the dimension of the first image feature may be 64*64*256.

[0167] In an embodiment of the present application, for each target image, the first image feature can be extracted only once by the image feature extraction model 500. For example, when the target area in the target image is determined for the first time, the first image feature of the target image can be extracted by the image feature extraction model 500, and the extracted first image feature and the target image can be associated and saved, or the extracted first image feature and the identifier of the target image can be associated and saved. The identifier of the target image can be a unique identifier such as the name or number of the target image. Therefore, when the target area in the target image is determined again (for example, the second or third time, etc.), the target area can be determined directly based on the saved first image feature, so that when the target area in the target image is determined again later, the first image feature does not need to be extracted, the time delay of the first image feature extraction can be reduced, and thus the time delay of the target area determination can be reduced, thereby improving the efficiency of the subsequent re-determination of the target area, so that the target area can be quickly determined later, and the user experience is improved.

[0168] It should be understood that the image feature extraction model 500 can be pre-trained using training images. The present embodiment of the application does not limit the training process of the image feature extraction model 500. Furthermore, the training of the image feature extraction model 500 can be performed by an electronic device or other device, and the present embodiment of the application does not limit this.

[0169] In the embodiment of the present application, the image feature extraction model 500 is relatively lightweight in performance, so the image feature extraction model 500 can be set in an electronic device. Of course, the image feature extraction model 500 can also be set in other devices that are communicatively connected to the electronic device, for example, it can be set in the cloud that is communicatively connected to the electronic device to reduce the performance requirements of the electronic device. Similarly, the first image feature extracted by the image feature extraction model 500 can be associated with the target image (or the identification of the target image) and stored in the electronic device. Alternatively, it can be associated with the target image (or the identification of the target image) and stored in other devices that are communicatively connected to the electronic device, for example, it can be associated with the target image (or the identification of the target image) and stored in the cloud that is communicatively connected to the electronic device. Therefore, when the electronic device needs to determine the target area in the target image again, for example, when the user performs an interactive operation in the target image again to select an area in the target image, the electronic device can obtain the first image feature of the target image from the cloud based on the target image to determine the target area based on the obtained first image feature.

[0170] In one example, the interaction information for a target image may refer to information corresponding to an interaction operation performed in the target image. For example, the interaction information may refer to location information of the interaction operation in the target image. For example, the interaction information may include location information (e.g., coordinates) of one or more pixels corresponding to the interaction operation in the target image.

[0171] It should be understood that the interactive operation may refer to an operation performed by the user to select a certain area in the target image. The interactive operation can be determined according to the actual application scenario, and the embodiment of the present application does not impose any specific restrictions on this. For example, the interactive operation may be an operation of clicking on a certain area in the target image. In this case, the interactive information may include the position information of one or more pixels corresponding to the click operation in the target image. For example, the interactive operation may be an operation of framing out a certain area in the target image. In this case, the interactive information may include the position information of multiple pixels corresponding to the framing operation in the target image. Among them, the embodiment of the present application does not impose any specific restrictions on the shape of the framing operation, and it can be determined according to the actual application scenario. For example, according to the actual application scenario, it can be determined that the shape of the framing operation is any shape such as a rectangle, a circle or an ellipse.

[0172] In an embodiment of the present application, after obtaining the first image feature of the target image, for example, after extracting the first image feature of the target image using the image feature extraction model 500, or after obtaining the first image feature saved in advance based on the target image, the electronic device can input the first image feature into the first region mask generation model. Similarly, after obtaining the interaction information for the target image, the electronic device can input the interaction information into the first region mask generation model. The first region mask generation model can obtain a first mask result based on the first image feature and the interaction information.

[0173] The following describes in detail the process of the first region mask generation model obtaining the first mask result according to the first image feature and the interaction information.

[0174] Please refer to FIG. 6 , which shows a schematic flow chart of obtaining a first mask result using a first region mask generation model provided in an embodiment of the present application.

[0175] As shown in Figure 6, the first region mask generation model 600 may include a codec module 601 and a convolution module 602. Exemplarily, the codec module 601 may include one or more codec networks, such as one or more transformers. Figure 6 illustrates the example of the codec module 601 including a transformer. The convolution module 602 may include one or more CNNs, or one or more transformers, or one or more CNNs and one or more transformers. Figure 6 illustrates the example of the convolution module 602 including a CNN.

[0176] After the first area mask generation model 600 obtains the first image feature of the target image and the interactive information for the target image, the codec module (i.e., transformer) 601 can process the first image feature and the interactive information to obtain the second image feature. For example, the codec module 601 can use the interactive information as prompt information to process the first image feature to increase the weight of the image feature of the first image feature that corresponds to the interactive information and belongs to the same object, thereby obtaining the first image feature after the weight is increased (i.e., the second image feature). In other words, the second image feature may refer to the image feature obtained after processing the first image feature according to the interactive information. The dimension of the second image feature may be the same as the dimension of the first image feature. After obtaining the second image feature, the codec module 601 may output the second image feature to the convolution module 602.

[0177] After the convolution module 602 obtains the second image feature, it can sample the second image feature, for example, it can upsample the second image feature, and determine, based on the sampled image feature, that the image feature corresponding to the interaction information belongs to the same object (hereinafter referred to as the third image feature). Subsequently, the convolution module 602 can determine a first mask result based on the third image feature. The first mask result can be a mask result corresponding to the interaction information. For example, in the first mask result, the area corresponding to the third image feature can be set to white, while other areas can be set to black.

[0178] In other words, the first region mask generation model 600 can accurately understand the interactive information input by the user through the encoding and decoding module 601 and the convolution module 602, and can accurately determine the first mask result corresponding to the interactive information, thereby accurately obtaining the area the user wants to select, thereby improving the user experience. In addition, the first image feature can be a high-dimensional image feature. Therefore, when the content of the area that the user needs to determine is relatively complex, the first region mask generation model 600 can also accurately determine the area the user wants to select based on the high-dimensional first image feature and the interactive information, thereby accurately determining the content the user wants to select, thereby improving the user experience.

[0179] Exemplarily, the image feature corresponding to the interaction information may include image features of one or more pixels corresponding to the interaction operation. That is, the image feature corresponding to the interaction information (i.e., the first image feature corresponding to the position information) may be determined based on the first image feature and the position information of the one or more pixels corresponding to the interaction operation in the target image.

[0180] In an embodiment of the present application, the first region mask generation model 600 can be pre-trained using training images. The training images can include one or more objects, so that the first region mask generation model 600 can be trained using training images including one or more objects, allowing the first region mask generation model 600 to learn object recognition. Therefore, after the first image features and interaction information are input into the first region mask generation model 600, the first region mask generation model 600 can accurately identify which image features in the first image features and corresponding to the interaction information belong to the same object, thereby accurately determining the region the user intends to select.

[0181] It should be understood that the objects in the embodiments of the present application can be specifically determined according to the actual application scenario, and the embodiments of the present application are not limited to this. For example, for a person, the head can be determined as an object, the upper limbs can be determined as an object, the lower limbs can be determined as an object, the shoulders can be determined as an object, the abdomen can be determined as an object, and so on. Alternatively, the hair can be determined as an object, the face can be determined as an object, the upper limbs can be determined as an object, the lower limbs can be determined as an object, the shoulders can be determined as an object, the abdomen can be determined as an object, and so on.

[0182] It should be noted that the embodiment of the present application does not impose any specific restrictions on the training process of the first area mask generation model 600, and can be specifically determined according to the actual application scenario. Among them, the training of the first area mask generation model 600 can be performed by an electronic device or by other devices, and the embodiment of the present application does not limit this. In addition, the first area mask generation model 600 can be set in the electronic device or in other devices that are communicatively connected to the electronic device. For example, it can be set in the cloud that is communicatively connected to the electronic device to reduce the performance requirements of the electronic device.

[0183] In one possible implementation, a user can select one or more regions in a target image based on multiple interactive operations, that is, the user can perform multiple interactive operations to accurately select the desired region. When the user selects one or more regions in a target image based on multiple interactive operations, the electronic device can determine the interaction information corresponding to each interactive operation, and can input the interaction information corresponding to each interactive operation into the first region mask generation model 600. The first region mask generation model 600 can determine a first mask result corresponding to each interaction information based on the first image feature of the target image and each interaction information, so as to accurately determine the first mask result corresponding to the region selected by the user based on the multiple interaction information.

[0184] For example, when it is detected that the interaction operations on the target image include interaction operation A and interaction operation B, the electronic device can respectively determine the interaction information corresponding to interaction operation A and the interaction information corresponding to interaction operation B. Assume that the electronic device determines that the interaction information corresponding to interaction operation A is interaction information A, and the interaction information corresponding to interaction operation B is interaction information B. In this case, the electronic device can input both interaction information A and interaction information B into the first region mask generation model 600. The encoding and decoding module 601 in the first region mask generation model 600 can process the first image feature based on the interaction information A and the interaction information B to increase the weight of the image feature in the first image feature that belongs to the same object as the image feature corresponding to interaction information A, and increase the weight of the image feature in the first image feature that belongs to the same object as the image feature corresponding to interaction information B, to obtain a second image feature, and can output the second image feature to the convolution module 602.

[0185] After the convolution module 602 obtains the second image feature, it can sample the second image feature and, based on the sampled image features, determine that the image feature corresponding to the interaction information A belongs to the image feature of the same object (hereinafter referred to as the third image feature A), and determine that the image feature corresponding to the interaction information B belongs to the image feature of the same object (hereinafter referred to as the third image feature B). Subsequently, the convolution module 602 can determine a first mask result based on the third image feature A and the third image feature B. The first mask result is the mask result corresponding to the interaction information A and the interaction information B. For example, in the first mask result, the area corresponding to the third image feature A and the area corresponding to the third image feature B can both be set to white, and the other areas can be set to black.

[0186] In an embodiment of the present application, after the first region mask generation model 600 determines the first mask result, the first mask result can be output to the second region mask generation model. After the second region mask generation model obtains the first mask result and the target image, it can optimize the first mask result according to the target image to obtain a second mask result. Among them, the second region mask generation model has the function of optimizing the first mask result. For example, the second region mask generation model can optimize the edge of the area corresponding to the interaction information in the first mask result (for example, the white area in the first mask result) to obtain a second mask result to reduce problems such as edge roughness and / or edge jaggedness, so that the edge of the area corresponding to the interaction information in the second mask result is smoother, thereby making the edge of the target area finally determined smoother. For example, the second region mask generation model can determine the missing area in the first mask result according to the target image, and can supplement the missing area to obtain a second mask result to improve the missing area, so that the content of the second mask result is more complete, thereby making the content of the target area finally determined more complete, and can accurately determine the area that the user wants to select. For example, the second area mask generation model can determine the redundant areas in the first mask result based on the target image, and can delete the redundant areas to obtain the second mask result to improve the redundant areas, so that the second mask result accurately corresponds to the interactive information, and can accurately understand the interactive information input by the user, thereby accurately determining the target area that the user wants to select, thereby improving the user experience.

[0187] The following describes in detail the process of the second region mask generation model obtaining the second mask result according to the second image features and the target image.

[0188] Please refer to FIG. 7 , which shows a schematic flow chart of obtaining a second mask result using the second region mask generation model provided in an embodiment of the present application.

[0189] As shown in FIG7 , the second region mask generation model 700 may include a first sampling module 701 and a second sampling module 702. Exemplarily, the first sampling module 701 may include one or more CNNs, or may include one or more transformers, or may include one or more CNNs and one or more transformers. FIG7 takes the first sampling module 701 including one CNN as an example for illustrative purposes. Similarly, the second sampling module 702 may include one or more CNNs, or may include one or more transformers, or may include one or more CNNs and one or more transformers. FIG7 takes the second sampling module 702 including one CNN as an example for illustrative purposes.

[0190] After the second region mask generation model 700 obtains the target image and the first mask result input by the first region mask generation model 600, the first sampling module 701 (i.e., the downsampling CNN in FIG7 ) can downsample the target image to obtain sampling features corresponding to the target image (hereinafter referred to as the first sampling features), and can output the first sampling features to the second sampling module 702 (i.e., the upsampling CNN in FIG7 ). Similarly, the first sampling module 701 can also downsample the first mask result to obtain sampling features corresponding to the first mask result (hereinafter referred to as the second sampling features), and can output the second sampling features to the second sampling module 702.

[0191] After obtaining the first and second sampling features, the second sampling module 702 may upsample the first sampling feature to obtain a sampling feature corresponding to the first sampling feature (hereinafter referred to as the third sampling feature), and may also upsample the second sampling feature to obtain a sampling feature corresponding to the second sampling feature (hereinafter referred to as the fourth sampling feature). Subsequently, the second sampling module 702 may determine a second mask result corresponding to the interaction information based on the third and fourth sampling features. The second mask result may be a mask result that optimizes one or more of the edges, missing content, and redundant content of the first mask result.

[0192] That is to say, the second area mask generation model 700 can refine and improve the edges of the first mask result through the first sampling module 701 and the second sampling module 702, and / or refine and improve the missing or redundant areas in the first mask result, so that the final second mask result can accurately correspond to the interactive information input by the user, so that the area the user wants to select can be accurately determined according to the second mask result, thereby improving the user experience.

[0193] It should be noted that the second area mask generation model 700 can be obtained by training the training image in advance. The embodiment of the present application does not impose any specific restrictions on the training process of the second area mask generation model 700, and can be specifically determined according to the actual application scenario. Among them, the training of the second area mask generation model 700 can be performed by an electronic device or by other devices, and the embodiment of the present application does not limit this. In addition, the second area mask generation model 700 can be set in an electronic device, or it can be set in other devices that are communicatively connected to the electronic device, for example, it can be set in the cloud that is communicatively connected to the electronic device to reduce the performance requirements of the electronic device.

[0194] In an embodiment of the present application, after obtaining the second mask result, the electronic device can determine the target area corresponding to the interaction information based on the second mask result. For example, the electronic device can determine the target area corresponding to the interaction information based on the second mask result and the target image, that is, determine the area in the target image selected by the user's interactive operation, so that the user can accurately extract the content in the target area or accurately process the content in the target area.

[0195] For example, the electronic device may perform a calculation on the second mask result and the target image to obtain a target area in the target image. The target area may be the area in the second mask result corresponding to the interactive information, that is, the target area may be the area after the content of the white area in the second mask result is restored to its original content in the target image.

[0196] It should be understood that the embodiment of the present application does not limit the specific method of performing calculations on the second mask result and the target image to obtain the target area restored to the original content, and can be determined according to the actual application scenario.

[0197] The region selection method provided in the embodiment of the present application will be exemplified below with reference to specific application scenarios.

[0198] Please refer to Figures 8 and 9, which are schematic diagrams of application scenarios provided by embodiments of the present application. This application scenario is exemplified by taking the first region selection of a target image as an example.

[0199] When a user performs an interactive operation in the target image 801, for example, when a user performs a frame selection operation (the dotted line in FIG8 indicates the area framed by the frame selection operation in the target image) and a click operation in the target image 801, the electronic device can determine interaction information corresponding to the interactive operation and input the interaction information into the first region mask generation model 600. In addition, the electronic device can also input the target image 801 into the image feature extraction model 500 and the second region mask generation model 700, respectively.

[0200] After the image feature extraction model 500 obtains the target image 801, it can extract image features of the target image 801 to obtain the first image features of the target image 801, such as high-dimensional features of 64*64*256, and the first image features can be input into the first region mask generation model 600.

[0201] After obtaining the first image features and the interaction information, the first region mask generation model 600 can determine a first mask result 802 corresponding to the interaction information based on the interaction information and the first image features. For example, the first region mask generation model 600 can obtain the first mask result 802 shown in FIG8 based on the interaction information and the first image features. In the first mask result 802, the edges of the white areas are jagged, and there is a missing portion in the middle of the left lantern, namely, the black area 8021 shown in FIG8 .

[0202] After obtaining the first mask result 802 , the first region mask generation model 600 may output the first mask result 802 to the second region mask generation model 700 .

[0203] After the second region mask generation model 700 obtains the first mask result 802 and the target image 801, it can optimize the first mask result 802 according to the target image 801 to obtain an optimized second mask result 803. For example, the second region mask generation model 700 can obtain the second mask result 803 shown in Figure 8.

[0204] Among them, the second area mask generation model 700 can optimize the edge of the first mask result 802 according to the target image 801, and supplement the missing parts in the first mask result 802, so that the edge of the second mask result 803 is smooth and the content in the second mask result 803 is more complete.

[0205] For example, as shown in FIG9 , in the first mask result 802 , the right edge 8022 of the white area has jagged edges, while in the second mask result 803 processed by the second region mask generation model 700 , the right edge of the white area is relatively smooth. In addition, there are missing portions in the first mask result 802 , for example, there is a black area 8021 with missing content in the first mask result 802 , while the second mask result 803 processed by the second region mask generation model 700 supplements the missing portion (e.g., the black area 8021) in the first mask result 802 , thereby completing the missing content. In other words, the second mask result 803 obtained by the second region mask generation model 700 has smoother edges and more complete content, which can accurately correspond to the user's interactive information, so that the target area that the user wants to select can be accurately determined based on the second mask result, thereby improving the user experience.

[0206] In an embodiment of the present application, when a user selects a region of a target image, the electronic device can obtain the first image features of the target image and the interactive information for the target image, and input the first image features and the interactive information into the first region mask generation model for processing, and obtain a first mask result corresponding to the interactive information output by the first region mask generation model. In addition, the electronic device can input the target image and the first mask result into the second region mask generation model for processing, and obtain a second mask result corresponding to the interactive information output by the second region mask generation model, so as to determine the target region corresponding to the interactive information based on the second mask result. Among them, the second region mask generation model has the function of optimizing the first mask result output by the first region mask generation model. That is, the second region mask generation model can optimize the first mask result according to the target image to improve the edge of the first mask result, and / or improve the missing area or redundant area in the first mask result, so that the target region that the user wants to select can be accurately determined based on the second mask result, and the edge of the target region finally determined can be smoothed, thereby improving the user experience.

[0207] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0208] Corresponding to the region selection method described in the above embodiment, an embodiment of the present application further provides a region selection device, and each module of the device can correspondingly implement each step of the region selection method.

[0209] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0210] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0211] The present application also provides an electronic device comprising at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor. When the processor executes the computer program, the electronic device implements the steps of any of the aforementioned region selection method embodiments. For example, the structure of the electronic device may be as shown in Figure 2.

[0212] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a computer, the computer implements the steps in any of the above-mentioned embodiments of the region selection method.

[0213] An embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device implements the steps of any of the above-mentioned region selection method embodiments.

[0214] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may at least include: any entity or device that can carry the computer program code to the device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, a computer-readable storage medium cannot be an electric carrier signal or a telecommunication signal.

[0215] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0216] Those skilled 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 beyond the scope of this application.

[0217] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0218] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0219] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A region selection method, characterized in that: include: Acquiring a first image feature of a target image and interaction information for the target image; Inputting the first image feature and the interaction information into a first region mask generation model for processing, to obtain a first mask result corresponding to the interaction information output by the first region mask generation model; Inputting the target image and the first mask result into a second region mask generation model for processing to obtain a second mask result corresponding to the interaction information output by the second region mask generation model, wherein the second region mask generation model has a function of optimizing the first mask result output by the first region mask generation model; A target area corresponding to the interactive information is determined according to the second mask result, where the target area is an image area in the target image.

2. The method according to claim 1, characterized in that The acquiring the first image feature of the target image includes: The target image is input into a trained image feature extraction model for processing to obtain the first image feature output by the image feature extraction model.

3. The method according to claim 2, characterized in that The image feature extraction model includes M feature extraction modules and N feature fusion modules. The M feature extraction modules are used to extract candidate image features of different dimensions corresponding to the target image. The N feature fusion modules are used to determine the first image feature based on the candidate image features of different dimensions extracted by the M feature extraction modules. M≥2 and N≥1.

4. The method according to claim 2 or 3, characterized in that After obtaining the first image feature output by the image feature extraction model, the method includes: The target image and the first image feature are associated and saved, or the identifier of the target image and the first image feature are associated and saved.

5. The method according to any one of claims 1 to 4, characterized in that The first region mask generation model includes a coding module and a convolution module; Inputting the first image feature and the interaction information into a first region mask generation model for processing to obtain a first mask result corresponding to the interaction information output by the first region mask generation model includes: Inputting the first image feature and the interaction information into the first region mask generation model, and processing the first image feature and the interaction information by the encoding and decoding module to obtain a second image feature; A third image feature is determined from the second image feature through the convolution module, and the first mask result corresponding to the interaction information is determined based on the third image feature, where the third image feature is an image feature belonging to the same object as the image feature corresponding to the interaction information.

6. The method according to claim 5, characterized in that The interaction information includes position information of the interaction operation corresponding to the interaction information in the target image.

7. The method according to claim 6, characterized in that The image feature corresponding to the interaction information is determined from the first image feature according to the position information.

8. The method according to any one of claims 1 to 7, characterized in that The interaction information includes first interaction information and second interaction information; Inputting the first image feature and the interaction information into a first region mask generation model for processing to obtain a first mask result corresponding to the interaction information output by the first region mask generation model includes: The image features, the first interaction information, and the second interaction information are input into the first region mask generation model for processing to obtain the first mask result output by the first region mask generation model, where the first mask result corresponds to the first interaction information and the second interaction information.

9. The method according to any one of claims 1 to 8, characterized in that The second area mask generation model includes a first sampling module and a second sampling module; The step of inputting the target image and the first mask result into a second region mask generation model for processing to obtain a second mask result corresponding to the interaction information output by the second region mask generation model includes: Inputting the target image and the first mask result into the second region mask generation model, downsampling the target image and the first mask result respectively by the first sampling module to obtain a first sampling feature corresponding to the target image and a second sampling feature corresponding to the first mask result; The first sampling feature and the second sampling feature are respectively upsampled by the second sampling module to obtain a third sampling feature corresponding to the first sampling feature and a fourth sampling feature corresponding to the second sampling feature, and a second mask result corresponding to the interactive information is determined based on the third sampling feature and the fourth sampling feature.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the electronic device implements the area selection method according to any one of claims 1 to 9.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a computer, the computer is caused to implement the area selection method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Region selection method, electronic equipment and computer readable storage medium

    CN120726067A

  • Image processing method and device, computer device and storage medium

    CN110675385A

  • Image processing apparatus, image processing method, and machine-readable storage medium

    CN114862882A

  • Video matting method, electronic equipment, storage medium and program product

    CN116630354A

  • Image processing method and device, electronic equipment and storage medium

    CN117132608A