Drawing object processing method and apparatus, electronic device, and storage medium

By detecting the user's box selection operation on the drawing image interface, automatically identifying and matching the elements and layers that constitute the target painting object, the cumbersome problem of users selecting painting objects in a multi-layer environment is solved, and efficiency and accuracy are improved.

WO2025112901A1PCT designated stage expired Publication Date: 2025-06-05HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/122845
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-27
Filing Date
2024-09-30
Publication Date
2025-06-05

AI Technical Summary

Technical Problem

During the painting process, users need to search for multiple layers one by one to select the elements that make up the painting object, resulting in cumbersome operations, low efficiency and poor accuracy.

Method used

By detecting the user's box selection operation on the drawing image interface, the target painting object in the target area is identified, and the target painting element and the target layer are automatically matched in multiple layers.

Benefits of technology

It realizes the rapid and accurate selection of elements and layers that constitute the target painting object, which improves the user experience and reduces operational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024122845_05062025_PF_FP_ABST
    Figure CN2024122845_05062025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present description relate to the technical field of terminals, and provide a drawing object processing method and apparatus, an electronic device, and a storage medium, for use in quickly and accurately selecting a target drawing element forming a target drawing object in a drawing image interface and a layer where the target drawing element is located, thereby improving the user experience. The drawing object processing method comprises: displaying a drawing image interface, wherein the drawing image interface comprises a picture displayed by a combination of a plurality of layers; detecting a box selection operation of a user on a target region on the drawing image interface; in response to the box selection operation, identifying a target drawing object of the target region; and selecting, from among the plurality of layers, at least one target drawing element corresponding to the target drawing object and a target layer where the target drawing element is located.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, electronic device and storage medium for processing painting objects

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on November 27, 2023, with application number 202311604206.0 and application name “A method, device, electronic device and storage medium for processing painting objects”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of this specification relate to the field of terminal technology, and more particularly, to a method, device, electronic device, and storage medium for processing a drawing object. Background Art

[0003] Currently, users can implement various functions based on electronic devices. For example, users can implement painting functions based on electronic devices. Usually, the painting process often involves operating a certain painting object, for example, copying or moving a certain painting object. Before this, it is necessary to select the painting object. Selecting the painting object is essentially selecting multiple painting elements that constitute the painting object. The multiple painting elements that constitute the painting object are often distributed in multiple layers. This means that the user needs to find the layers where the above-mentioned multiple painting elements are located one by one, and then select the corresponding painting elements in the layer. The above-mentioned selection method has the following two problems: first, the selection operation process is relatively cumbersome, resulting in low selection efficiency of selecting painting objects; second, when there are a large number of layers, the selection process may fail to find the layers corresponding to all the elements that constitute the painting object, resulting in poor selection accuracy.

[0004] Summary of the Invention

[0005] The embodiments of this specification provide a method, device, electronic device, and storage medium for processing a painting object, which can quickly and accurately select the target painting elements and the layers in which they are located that constitute the target painting object in a painting image interface, thereby improving the user experience.

[0006] In a first aspect, an embodiment of this specification provides a method for processing a drawing object, the method comprising:

[0007] Displaying a painting image interface, wherein the painting image interface includes a picture displayed in combination of multiple layers;

[0008] Detecting a user's selection operation on a target area on the drawing image interface;

[0009] In response to the frame selection operation, identifying a target painting object in the target area;

[0010] At least one target painting element corresponding to the target painting object and the target layer where the element is located are selected from the multiple layers.

[0011] In the embodiments of this specification, the drawing image interface can be considered to include multiple drawing objects. Each drawing object may include multiple drawing elements, and these multiple drawing elements may be distributed across multiple layers. When it is detected that the user has selected a target area in the drawing image interface and a target drawing object is identified within that target area, it can be assumed that the user currently intends to select that target drawing object. Based on this, the multiple target drawing elements that constitute the target drawing object and their target layers can be automatically matched within the multiple existing layers. In other words, even when there are a large number of layers and the selected target drawing object is complex, this method can quickly and accurately match the target drawing elements that constitute the target drawing object and their layers, avoiding tedious user operations, improving the efficiency and accuracy of target drawing object selection, and providing a better user experience.

[0012] Optionally, after detecting that the user has performed a frame selection operation on the target area on the drawing image interface, the method further includes:

[0013] A frame selection operation identifier corresponding to the frame selection operation is displayed on the drawing image interface.

[0014] In an embodiment of the present specification, after detecting that a user performs a frame selection operation on a target area on a drawing image interface, a frame selection operation identifier corresponding to the above frame selection operation can be explicitly presented on the drawing image interface to facilitate the user to accurately judge whether the frame selection operation is successfully performed.

[0015] Optionally, the frame selection operation identifier is a frame selection track identifier corresponding to the frame selection operation.

[0016] In the embodiment of the present specification, the frame selection operation mark presented on the drawing image interface may be a frame selection track mark, so as to accurately determine whether the frame selection operation is successfully performed through the formed frame selection operation track.

[0017] Optionally, the frame selection track identifier includes any one of the following:

[0018] When the frame selection operation is a frame selection based on a rectangular frame, the frame selection track identifier is a rectangular track identifier;

[0019] When the frame selection operation is a frame selection based on a circular frame, the frame selection track identifier is a circular track identifier;

[0020] When the frame selection operation is a frame selection based on an elliptical frame, the frame selection track identifier is an elliptical track identifier;

[0021] When the frame selection operation is frame selection based on a triangular frame, the frame selection track identifier is a triangular track identifier.

[0022] In the embodiments of this specification, when a frame selection operation is performed using a frame of different shapes, a correspondingly shaped trajectory will appear on the drawing image interface. In other words, a variety of frame shapes are supported for selecting the target drawing object, and the shape of the trajectory displayed can be used to determine whether the frame selection operation has been successfully performed.

[0023] Optionally, the frame selection trajectory identifier is a contour identifier of the target painting object.

[0024] In the embodiment of the present specification, the frame selection trajectory mark may also be a contour mark of the target drawing object. By displaying the contour mark, the user can accurately determine whether the frame selection operation is successfully performed.

[0025] Optionally, after selecting at least one target painting element corresponding to the target painting object and the target layer in which it is located from the multiple layers, the method further includes:

[0026] The target layer and other layers in the multiple layers are displayed differently.

[0027] In the embodiments of the present specification, the existing multiple layers can be divided into target layers and other layers. The target layer is a layer containing target painting elements constituting a target painting object, and the other layers are layers that do not contain target painting elements constituting a target painting object. By displaying the target layer and the other layers differently, that is, presenting different display effects for the target image and the other layers, the user can effectively distinguish which are the target layers and which are the other layers when viewing.

[0028] Optionally, displaying the target layer differently from other layers in the multiple layers includes:

[0029] Adjusting the order of the target layer to the first M positions among the multiple layers, where M is equal to the number of the target layers;

[0030] The target layer located in the first M positions is displayed differently from the other layers.

[0031] In the embodiment of this specification, the arrangement order of the target layer is adjusted to the first M positions among multiple layers, and the target layer after the adjustment of the sorting order is displayed differently from other layers, so that the user can view the selected target layer more centrally.

[0032] Optionally, the method further includes:

[0033] In the target layer, the selected target drawing element is displayed.

[0034] In an embodiment of the present specification, for a selected target layer, the target painting elements selected in the target layer for constituting a target painting object may be displayed, so that a user can determine which target painting elements constituting the target painting object have been selected, and thereby promptly determine whether there are any unselected target painting elements.

[0035] Optionally, the target layer further includes other unselected drawing elements, and displaying the selected target drawing elements in the target layer includes:

[0036] In the target layer, the selected target painting element and the other unselected painting elements are displayed differently.

[0037] In an embodiment of the present specification, when a target painting element used to constitute a target painting object and other painting elements not used to constitute the target painting object exist in a target layer, the target painting element and the other painting elements are displayed differently, that is, the target painting element and the other painting elements present different display effects, so that the user can determine which target painting elements used to constitute the target painting object have been selected, and thus can promptly determine whether there are any unselected target painting elements.

[0038] Optionally, the method further includes:

[0039] Determining the drawing object operation corresponding to the frame selection operation based on the correspondence between the frame selection operation and the drawing object operation;

[0040] A drawing object operation corresponding to the frame selection operation is applied to the selected target drawing object.

[0041] In the embodiments of the present specification, when there are multiple types of frame selection operations performed on a target area, different types of frame selection operations can be associated with different drawing object operations that need to be performed after a target drawing object within the target area is selected. On this basis, once a specific type of frame selection operation is detected, the corresponding drawing object operation is automatically performed on the target drawing object after the target drawing object is selected. This eliminates the need for the user to manually select the relevant operation to be performed after the target drawing object is selected, thereby improving the efficiency of performing relevant operations on the target drawing object.

[0042] Optionally, in response to the frame selection operation, identifying a target painting object in the target area includes:

[0043] In response to the frame selection operation, generating an image sample to be identified corresponding to the target area;

[0044] The image sample to be identified is input into a painting object recognition model to identify the target painting object.

[0045] In the embodiments of the present specification, the target area selected by the user can be identified based on a pre-trained painting object recognition model, so as to more accurately identify the target painting object within the target area, thereby improving the accuracy of the subsequent selection of the target painting elements and the layers in which they are located that constitute the target painting object.

[0046] Optionally, selecting at least one target painting element corresponding to the target painting object and the target layer thereof from the multiple layers includes:

[0047] Obtaining an overall contour area of ​​the target painting object and a local contour area of ​​the painting elements contained in each of the multiple layers, wherein the overall contour area indicates a closed area formed by the edge of the target painting object, and the local contour area indicates a closed area formed by the edges of the painting elements;

[0048] In response to the overall contour area including at least one target local contour area among the plurality of local contour areas, the at least one target painting element and the target layer corresponding to the at least one target local contour area are selected from the plurality of layers.

[0049] In the embodiment of the present specification, by respectively obtaining the overall contour area of ​​the target painting object and the local contour areas of the painting elements contained in each of the multiple existing layers, that is, obtaining the overall contour area of ​​a specific position and the local contour areas of the multiple specific positions, if the overall contour area of ​​the specific position includes the target local contour area of ​​the specific position among the multiple local contour areas, that is, the target local contour area is part of the overall contour area, it is relatively simple to determine that the target painting element corresponding to the target local contour area is used to constitute the target painting object. On this basis, the target painting element and the target layer where it is located can be automatically selected, thereby omitting the tedious manual search process, improving the efficiency and accuracy of selecting the target painting object, and providing a better user experience.

[0050] Optionally, in response to the overall contour area including at least one target local contour area among the plurality of local contour areas, selecting the at least one target painting element corresponding to the at least one target local contour area and the target layer from the plurality of layers includes:

[0051] determining whether the overall contour area includes the at least one target local contour area among the plurality of local contour areas;

[0052] In response to the overall contour area including the at least one target local contour area, the at least one target painting element and the target layer corresponding to the at least one target local contour area are selected from the multiple layers.

[0053] In an embodiment of the present specification, after obtaining the overall contour area of ​​the target painting object and the local contour areas of the painting elements contained in each of the existing multiple layers, it can be determined whether the overall contour area includes each of the target local contours in the above-mentioned multiple local contour areas. Once it is determined that the overall contour area includes the target local contour area, the target painting element corresponding to the target local contour area and the target layer in which it is located are quickly and accurately selected, which not only improves the search efficiency but also avoids the omission of certain layers.

[0054] Optionally, obtaining the overall contour area of ​​the target painting object and the local contour area of ​​the painting elements contained in each of the multiple layers includes:

[0055] A binary image of the target painting object and a binary image of the painting elements contained in each layer are obtained, wherein the binary image of the target painting object is used to indicate the overall contour area of ​​the location of the target painting object, and the binary image of the painting elements contained in each layer is used to indicate the local contour area of ​​the corresponding painting element.

[0056] In the embodiments of the present specification, when a target painting object is identified in a target area of ​​a painting image interface, on the one hand, a binary image corresponding to the target painting object is generated. That is, in the binary image, different pixel values ​​(binary 0 and binary 1) are used to distinguish and represent the area where the target painting object is located from other areas in the painting image interface, thereby more accurately forming the overall contour area where the target painting object is located. On the other hand, a binary image corresponding to the painting elements contained in each layer can also be generated. That is, in the binary image, different pixel values ​​(binary 0 and binary 1) are used to distinguish and represent the area where the painting element is located from other areas in the layer, thereby more accurately forming the local contour area corresponding to the location of the painting element in the layer.

[0057] Optionally, the painting image interface has a transparency channel, and obtaining the overall contour area of ​​the target painting object and the local contour area of ​​the painting elements contained in each of the multiple layers includes:

[0058] Obtaining a binary mask corresponding to the transparency channel of the target painting object and a binary mask corresponding to the transparency channel of the painting elements contained in each layer, wherein the binary mask corresponding to the transparency channel of the target painting object is used to indicate the overall contour area of ​​the location of the target painting object, and the binary mask corresponding to the transparency channel of the painting elements contained in each layer is used to indicate the local contour area of ​​the location of the painting elements.

[0059] In an embodiment of the present specification, if a transparency channel exists in the painting image interface and a target painting object is identified in a target area in the painting image interface, a binary mask corresponding to the transparency channel of the target painting object can be obtained. That is, the binary mask uses different pixel values ​​(binary 0 and binary 1) to distinguish and represent the area in the painting image interface where the target painting object is located from other areas in the painting image interface, thereby more accurately forming the overall contour area of ​​the location where the target painting object is located. On the other hand, a binary mask corresponding to the transparency channel of the painting elements contained in each layer can also be obtained. The binary mask uses different pixel values ​​(binary 0 and binary 1) to distinguish and represent the area in the layer where the painting element is located from other areas in the layer, thereby more accurately forming the local contour area of ​​the location where the painting element is located in the layer.

[0060] Optionally, the binary image of the target painting object uses pixels with binary values ​​of 1 to represent the overall contour area at the location of the target painting object, and uses pixels with binary values ​​of 0 to represent other areas of the painting image interface except the overall contour area. In the binary image of the painting elements contained in each layer, the local contour area at the location of the painting elements is represented by pixels with binary values ​​of 1, and other areas of the layer except the local contour area are represented by pixels with binary values ​​of 0. Determining whether the overall contour area includes at least one target local contour area among the multiple local contour areas includes:

[0061] An AND operation is performed on the pixel values ​​of corresponding pixels in the binary image of the target painting object and the binary image of the painting elements included in the target layer among the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 1 in the operation result image, it is represented that the overall contour area includes the target local contour area corresponding to the target painting element; when all pixel points in the operation result image have binary values ​​of 0, it is represented that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0062] In the embodiment of the present specification, when the target painting object and the target painting element included in the binary image are represented by the pixel points with a pixel value of 1 in the binary image, the target area (i.e., the overall outline area where the target painting object is located and the local outline area where the painting element is located in the layer) and the background area (i.e., the area other than the overall outline area in the painting image interface and the area other than the local outline area in the layer) is represented by the pixel points with a pixel value of 0, the binary image corresponding to the target painting object and the binary image corresponding to the painting element included in the target layer can be ANDed pixel by pixel to obtain an operation result image. When there is a pixel point with a pixel value of 1 in the operation result image, it indicates that the binary image corresponding to the target painting object and the background area of ​​the painting element included in the target layer are ANDed. If there is a common part between the binary images corresponding to the pixels, it can be considered that the overall contour area represented by the binary image corresponding to the target painting object includes the target local contour area represented by the binary image corresponding to the painting elements contained in the target layer. On the contrary, when the pixel value in the calculation result image is all 0, it means that there is no common part between the binary image corresponding to the target painting object and the binary image corresponding to the painting elements contained in the target layer. At this time, it can be considered that the overall contour area represented by the binary image corresponding to the target painting object does not include the target local contour area represented by the binary image corresponding to the painting elements contained in the target layer, so as to accurately judge the overall contour area of ​​the target painting object, including the target local contour areas corresponding to the painting elements in which layers.

[0063] The binary image of the target painting object represents the overall contour area at the location of the target painting object by using pixel points with binary values ​​of 0, and represents other areas of the painting image interface except the overall contour area by using pixel points with binary values ​​of 1; in the binary image of the painting elements contained in each layer, the local contour area at the location of the painting elements is represented by using pixel points with binary values ​​of 0, and represents other areas of the layer except the local contour area by using pixel points with binary values ​​of 1; and determining whether the overall contour area includes at least one target local contour area among the multiple local contour areas includes:

[0064] An OR operation is performed on the pixel values ​​of corresponding pixels in the binary image of the target painting object and the binary image of the painting elements included in the target layer among the multiple layers to obtain a calculation result image, wherein when there are pixel points with binary values ​​of 0 in the calculation result image, it is represented that the overall contour area includes the target local contour area corresponding to the target painting element; when all pixel points in the calculation result image have binary values ​​of 1, it is represented that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0065] In the embodiment of the present specification, when the target painting object and the target painting element included in the binary image are represented by the pixel points with a pixel value of 0 to represent the target area (i.e., the overall outline area where the target painting object is located and the local outline area where the painting element is located in the layer), and the background area (i.e., the area other than the overall outline area in the painting image interface and the area other than the local outline area in the layer) is represented by the pixel points with a pixel value of 1, the binary image corresponding to the target painting object and the binary image corresponding to the painting element included in the target layer can be pixel-by-pixel ORed to obtain an operation result image. When there are pixel points with a pixel value of 0 in the operation result image, it indicates that the binary image corresponding to the target painting object and the background area of ​​the painting element included in the target layer are not equal. If there is a common part between the binary images corresponding to the elements, it can be considered that the overall contour area represented by the binary image corresponding to the target painting object includes the target local contour area represented by the binary image corresponding to the painting elements contained in the target layer. On the contrary, when the pixel value in the calculation result image is all 1, it means that there is no common part between the binary image corresponding to the target painting object and the binary image corresponding to the painting elements contained in the target layer. At this time, it can be considered that the overall contour area represented by the binary image corresponding to the target painting object does not include the target local contour area represented by the binary image corresponding to the painting elements contained in the target layer, so as to accurately judge the overall contour area of ​​the target painting object, including the target local contour areas corresponding to the painting elements in which layers.

[0066] Optionally, the binary mask of the transparency channel of the target painting object represents the overall contour area at the location of the target painting object using pixels with binary values ​​of 1, and represents other areas of the painting image interface other than the overall contour area using pixels with binary values ​​of 0. The binary mask of the painting elements contained in each layer represents the local contour area at the location of the painting elements using pixels with binary values ​​of 1, and represents other areas of the layer other than the local contour area using pixels with binary values ​​of 0. Determining whether the overall contour area includes at least one target local contour area among the multiple local contour areas includes:

[0067] An AND operation is performed on the pixel values ​​of corresponding pixels of the binary mask of the target painting object and the binary mask of the painting element included in the target layer among the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 1 in the operation result image, it is represented that the overall contour area includes the target local contour area corresponding to the target painting element; when all pixel points in the operation result image have binary values ​​of 0, it is represented that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0068] In an embodiment of the present specification, when the binary mask corresponding to the transparency channel of the target painting object and the binary mask corresponding to the painting elements contained in each layer both represent the target area (i.e., the overall outline area where the target painting object is located and the local outline area where the elements are located in the layer) based on pixel points with a pixel value of 1, and represent the background area (i.e., the area other than the overall outline area in the painting image interface and the area other than the local outline area in the layer) based on pixel points with a pixel value of 0, the binary mask corresponding to the transparency channel of the target painting object and the binary mask corresponding to the transparency channel of the painting elements contained in the target layer can be ANDed pixel by pixel to obtain a result image. When there is a pixel point with a pixel value of 1 in the result image, it indicates that the binary mask corresponding to the transparency channel of the target painting object and the binary mask corresponding to the transparency channel of the painting elements in the target layer are ANDed. If there is a common part between the binary images, it can be considered that the overall contour area represented by the binary mask corresponding to the transparency channel of the target painting object includes the target local contour area represented by the binary mask corresponding to the transparency channel of the painting elements contained in the target layer. Conversely, when the pixel value in the calculation result image is all 0, it means that there is no common part between the binary mask corresponding to the transparency channel of the target painting object and the binary mask corresponding to the transparency channel of the painting elements contained in the target layer. In this case, it can be considered that the overall contour area represented by the binary mask corresponding to the transparency channel of the target painting object does not include the target local contour area represented by the binary mask corresponding to the transparency channel of the painting elements contained in the target layer, thereby accurately judging the overall contour area of ​​the target painting object, including the target local contour areas corresponding to the painting elements in which layers.

[0069] Optionally, the binary mask of the transparency channel of the target painting object represents the overall contour area at the location of the target painting object using pixels with binary values ​​of 0, and represents other areas of the painting image interface except the overall contour area using pixels with binary values ​​of 1. In the binary image of the painting elements contained in each layer, the local contour area at the location of the painting elements is represented by pixels with binary values ​​of 0, and other areas of the layer except the local contour area are represented by pixels with binary values ​​of 1. Determining whether the overall contour area includes at least one target local contour area among the multiple local contour areas includes:

[0070] An OR operation is performed on the pixel values ​​of corresponding pixels of the binary mask of the transparency channel of the target painting object and the binary mask of the transparency channel of the painting element included in the target layer among the multiple layers to obtain a calculation result image, wherein when there are pixels with binary values ​​of 0 in the calculation result image, it is indicated that the overall contour area includes the target local contour area corresponding to the target painting element; when all pixels in the calculation result image have binary values ​​of 1, it is indicated that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0071] In an embodiment of the present specification, when the binary mask corresponding to the transparency channel of the target painting object and the binary mask corresponding to the painting elements contained in each layer both represent the target area (i.e., the overall outline area where the target painting object is located and the local outline area where the painting elements are located in the layer) based on pixel points with a pixel value of 0, and represent the background area (i.e., the area other than the overall outline area in the painting image interface and the area other than the local outline area in the layer) based on pixel points with a pixel value of 1, the binary mask corresponding to the transparency channel of the target painting object and the binary mask corresponding to the transparency channel of the painting elements contained in the target layer can be pixel-by-pixel ORed to obtain a result image. When there are pixels with a pixel value of 0 in the result image, it indicates that the binary mask corresponding to the transparency channel of the target painting object and the binary mask corresponding to the transparency channel of the painting elements contained in the target layer are ORed. If there is a common part between the binary images of the target painting object and the target layer, it can be considered that the overall contour area represented by the binary mask corresponding to the transparency channel of the target painting object includes the target local contour area represented by the binary mask corresponding to the transparency channel of the painting elements contained in the target layer. On the contrary, when the pixel value in the calculation result image is all 1, it means that there is no common part between the binary mask corresponding to the transparency channel of the target painting object and the binary mask corresponding to the transparency channel of the painting elements contained in the target layer. At this time, it can be considered that the overall contour area represented by the binary mask corresponding to the transparency channel of the target painting object does not include the target local contour area represented by the binary mask corresponding to the transparency channel of the painting elements contained in the target layer, thereby accurately judging the overall contour area of ​​the target painting object, including the target local contour areas corresponding to the painting elements in which layers.

[0072] In response to the overall contour area including the at least one target local contour area, selecting the at least one target painting element corresponding to the at least one target local contour area and the target layer from the multiple layers includes:

[0073] In response to the overall contour area including the at least one target local contour area, determining at least one target painting element identifier corresponding to the at least one target local contour area;

[0074] The at least one target drawing element and the target layer corresponding to the at least one target drawing element identifier are selected from the multiple layers.

[0075] In an embodiment of the present specification, when the overall contour area of ​​the target painting object includes a target local contour area corresponding to a painting element in the target layer, the painting element identifier corresponding to the above-mentioned painting element can be determined first, and then the above-mentioned painting element and the layer in which it is located can be accurately selected from multiple layers based on the above-mentioned painting element identifier.

[0076] In a second aspect, an embodiment of this specification provides a device for processing a drawing object, the device comprising:

[0077] A display unit, configured to display a painting image interface, wherein the painting image interface includes a picture displayed in combination of multiple layers;

[0078] A detection unit, configured to detect a user's selection operation on a target area on the drawing image interface;

[0079] an identification unit, configured to identify a target painting object in the target area in response to the frame selection operation;

[0080] The selection unit is configured to select at least one target painting element and its target layer corresponding to the target painting object from the multiple layers.

[0081] Optionally, the display unit is used to:

[0082] A frame selection operation identifier corresponding to the frame selection operation is displayed on the drawing image interface.

[0083] Optionally, the frame selection operation identifier is a frame selection track identifier corresponding to the frame selection operation.

[0084] Optionally, the frame selection track identifier includes any one of the following:

[0085] When the frame selection operation is a frame selection based on a rectangular frame, the frame selection track identifier is a rectangular track identifier;

[0086] When the frame selection operation is a frame selection based on a circular frame, the frame selection track identifier is a circular track identifier;

[0087] When the frame selection operation is a frame selection based on an elliptical frame, the frame selection track identifier is an elliptical track identifier;

[0088] When the frame selection operation is frame selection based on a triangular frame, the frame selection track identifier is a triangular track identifier.

[0089] Optionally, the frame selection trajectory identifier is a contour identifier of the target painting object.

[0090] Optionally, the display unit is further used for:

[0091] The target layer and other layers in the multiple layers are displayed differently.

[0092] Optionally, the display unit is specifically used to:

[0093] Adjusting the order of the target layer to the first M positions among the multiple layers, where M is equal to the number of the target layers;

[0094] Display the target layer in the first M positions differently from the other layers

[0095] Optionally, the display unit is further used for:

[0096] In the target layer, the selected target drawing element is displayed.

[0097] Optionally, the target layer further includes other drawing elements, and the display unit is specifically configured to:

[0098] In the target layer, the target painting element and the other painting elements are displayed differently.

[0099] Optionally, the device further includes:

[0100] a determining unit, configured to determine the drawing object operation corresponding to the frame selection operation based on a correspondence between the frame selection operation and the drawing object operation;

[0101] The operation unit is configured to apply the drawing object operation corresponding to the frame selection operation to the selected target drawing object.

[0102] Optionally, the identification unit is specifically configured to:

[0103] In response to the frame selection operation, generating an image sample to be identified corresponding to the target area;

[0104] The image sample to be identified is input into a painting object recognition model to identify the target painting object.

[0105] Optionally, the selection unit includes:

[0106] a contour obtaining unit, configured to obtain an overall contour area of ​​the target painting object and a local contour area of ​​the painting elements contained in each of the plurality of layers, wherein the overall contour area indicates a closed area formed by the edge of the target painting object, and the local contour area indicates a closed area formed by the edge of the painting elements;

[0107] The element selection unit is configured to select, in response to the overall contour area including at least one target local contour area among the multiple local contour areas, the at least one target painting element corresponding to the at least one target local contour area and the target layer from the multiple layers.

[0108] Optionally, the element selection unit includes:

[0109] a determining subunit, configured to determine whether the overall contour region includes the at least one target local contour region among the multiple local contour regions;

[0110] The element selection subunit is configured to select, in response to the overall contour area including the at least one target local contour area, the at least one target painting element corresponding to the at least one target local contour area and the target layer from the multiple layers.

[0111] Optionally, the contour obtaining unit is specifically configured to:

[0112] A binary image of the target painting object and a binary image of the painting elements contained in each layer are obtained, wherein the binary image of the target painting object is used to indicate the overall contour area of ​​the location of the target painting object, and the binary image of the painting elements contained in each layer is used to indicate the local contour area of ​​the corresponding painting element.

[0113] Optionally, the painting image interface has a transparency channel, and the contour obtaining unit is specifically configured to:

[0114] Obtaining a binary mask corresponding to the transparency channel of the target painting object and a binary mask corresponding to the transparency channel of the painting elements contained in each layer, wherein the binary mask corresponding to the transparency channel of the target painting object is used to indicate the overall contour area of ​​the location of the target painting object, and the binary mask corresponding to the transparency channel of the painting elements contained in each layer is used to indicate the local contour area of ​​the location of the painting elements.

[0115] Optionally, the binary image of the target painting object uses pixel points with binary values ​​of 1 to represent the overall contour area of ​​the target painting object, and uses pixel points with binary values ​​of 0 to represent other areas of the painting image interface except the overall contour area. In the binary image of the painting elements contained in each layer, the local contour area of ​​the painting element's location is represented by pixel points with binary values ​​of 1, and the other areas of the layer except the local contour area are represented by pixel points with binary values ​​of 0. The determining subunit is specifically configured to:

[0116] An AND operation is performed on the pixel values ​​of corresponding pixels in the binary image of the target painting object and the binary image of the painting elements included in the target layer among the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 1 in the operation result image, it is represented that the overall contour area includes the target local contour area corresponding to the target painting element; when all pixel points in the operation result image have binary values ​​of 0, it is represented that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0117] Optionally, the binary image of the target painting object uses pixel points with binary values ​​of 0 to represent the overall contour area at the location of the target painting object, and uses pixel points with binary values ​​of 1 to represent other areas of the painting image interface except the overall contour area. In the binary image of the painting elements contained in each layer, the local contour area at the location of the painting elements is represented by pixel points with binary values ​​of 0, and the other areas of the layer except the local contour area are represented by pixel points with binary values ​​of 1. The determining subunit is specifically configured to:

[0118] An AND operation is performed on the pixel values ​​of corresponding pixels in the binary image of the target painting object and the binary image of the painting elements included in the target layer among the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 0 in the operation result image, it is represented that the overall contour area includes the target local contour area corresponding to the target painting element; when all pixel points in the operation result image have binary values ​​of 1, it is represented that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0119] Optionally, the binary mask of the transparency channel of the target painting object uses pixels with binary values ​​of 1 to represent the overall contour area of ​​the target painting object, and uses pixels with binary values ​​of 0 to represent areas other than the overall contour area in the painting image interface. The binary mask of the painting elements contained in each layer uses pixels with binary values ​​of 1 to represent the local contour area of ​​the painting element, and uses pixels with binary values ​​of 0 to represent areas other than the local contour area in the layer. The determining subunit is specifically configured to:

[0120] An AND operation is performed on the pixel values ​​of corresponding pixels of the binary mask of the target painting object and the binary mask of the painting element included in the target layer among the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 1 in the operation result image, it is represented that the overall contour area includes the target local contour area corresponding to the target painting element; when all pixel points in the operation result image have binary values ​​of 0, it is represented that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0121] Optionally, the binary mask of the transparency channel of the target painting object uses pixel points with binary values ​​of 0 to represent the overall contour area of ​​the target painting object, and uses pixel points with binary values ​​of 1 to represent other areas of the painting image interface except the overall contour area. In the binary image of the painting elements contained in each layer, the local contour area of ​​the painting element's location is represented by pixel points with binary values ​​of 0, and the other areas of the layer except the local contour area are represented by pixel points with binary values ​​of 1. The determining subunit is specifically configured to:

[0122] An AND operation is performed on the pixel values ​​of corresponding pixels of the binary mask of the transparency channel of the target painting object and the binary mask of the transparency channel of the painting element included in the target layer among the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 0 in the operation result image, it is indicated that the overall contour area includes the target local contour area corresponding to the target painting element; when all pixel points in the operation result image have binary values ​​of 1, it is indicated that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0123] Optionally, the element selection subunit is specifically used to:

[0124] In response to the overall contour area including the at least one target local contour area, determining at least one target painting element identifier corresponding to the at least one target local contour area;

[0125] The at least one target drawing element and the target layer corresponding to the at least one target drawing element identifier are selected from the multiple layers.

[0126] In a third aspect, an embodiment of this specification provides an electronic device, comprising a memory for storing computer program instructions and a processor for executing program instructions, wherein, when the computer program instructions are executed by the processor, the terminal is triggered to execute the steps of the method described in any embodiment of the first aspect.

[0127] In a fourth aspect, an embodiment of this specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer instructions, and when the computer is running, the computer executes the steps of the method described in any embodiment of the first aspect or the second aspect.

[0128] In a fifth aspect, an embodiment of this specification provides a computer program product, which includes computer instructions. When the computer instructions are executed in a computer, the computer executes the steps of the method described in any embodiment of the first aspect or the second aspect.

[0129] It should be understood that the second to fifth aspects of the embodiments of this specification are consistent with the technical solutions of the first aspect of the embodiments of this specification, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0130] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0131] FIG1 is a schematic diagram of selecting a drawing object in a traditional manner provided in an embodiment of this specification;

[0132] FIG2 is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification;

[0133] FIG3 is a schematic diagram of the software structure of an electronic device provided in an embodiment of this specification;

[0134] FIG4 is a flow chart of a method for processing a drawing object provided in an embodiment of this specification;

[0135] FIG5 is a flow chart of a method for displaying a selection operation identifier according to an embodiment of this specification;

[0136] FIG6 is a schematic diagram of a frame selection trace mark provided in an embodiment of this specification;

[0137] FIG7 is a schematic diagram of another frame selection trace mark provided in an embodiment of this specification;

[0138] FIG8 is a flow chart of a method for identifying a target painting object provided in an embodiment of this specification;

[0139] FIG9 is a flow chart of a method for displaying a target layer according to an embodiment of the present disclosure;

[0140] FIG10 is a schematic diagram of displaying a target layer and other layers differently based on brightness according to an embodiment of the present disclosure;

[0141] FIG11 is a flow chart of a method for differentially displaying a target layer and other layers provided by an embodiment of this specification;

[0142] FIG12 is a schematic diagram of another embodiment of the present disclosure providing a method for displaying a target layer and other layers differently based on brightness;

[0143] FIG13 is a flow chart of a method for displaying drawing elements provided by an embodiment of this specification;

[0144] FIG14 is a schematic diagram of displaying a drawing element according to an embodiment of this specification;

[0145] FIG15 is a flow chart of a method for differentially displaying drawing elements in the same layer according to an embodiment of the present disclosure;

[0146] FIG16 is a schematic diagram of differential display of painting elements in the same layer provided by an embodiment of this specification;

[0147] FIG17 is a flow chart of a method for performing related operations on a target drawing object provided by an embodiment of this specification;

[0148] FIG18 is a flow chart of a method for matching painting objects according to an embodiment of this specification;

[0149] FIG19 is a flow chart of a method for obtaining an overall contour region and a local contour region according to an embodiment of this specification;

[0150] FIG20 is a schematic diagram of a binary image corresponding to a target painting object provided in an embodiment of this specification;

[0151] FIG21 is a schematic diagram of a binary image corresponding to another target painting object provided in an embodiment of this specification;

[0152] FIG22 is a schematic diagram of a binary image corresponding to a painting element provided in an embodiment of this specification;

[0153] FIG23 is a schematic diagram of a binary image corresponding to another painting element provided in an embodiment of this specification;

[0154] FIG24 is a flow chart of another method for obtaining an overall contour region and a local contour region provided in an embodiment of this specification;

[0155] FIG25 is a flowchart of a method for selecting a layer corresponding to a target painting object provided in an embodiment of this specification;

[0156] FIG26 is a flowchart of a method for determining whether an overall contour region includes at least one target local contour region based on an AND operation according to an embodiment of this specification;

[0157] FIG27 is a flow chart of another method for determining whether an overall contour region includes a target local contour region based on an AND operation according to an embodiment of this specification;

[0158] FIG28 is a schematic diagram of an AND operation provided in an embodiment of this specification;

[0159] FIG29 is a flowchart of a method for determining whether an overall contour area includes a target local contour area based on an OR operation according to an embodiment of this specification;

[0160] FIG30 is a flowchart of another method for determining whether an overall contour area includes a target local contour area based on an OR operation according to an embodiment of this specification;

[0161] FIG31 is a schematic diagram of an OR operation provided in an embodiment of this specification;

[0162] FIG32 is a flowchart of a method for selecting a painting element and its layer based on a painting element identifier provided by an embodiment of this specification;

[0163] FIG33 is a schematic diagram of the structure of a device for processing a painting object provided in an embodiment of this specification. DETAILED DESCRIPTION

[0164] In order to better understand the technical solutions of this specification, the embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0165] It should be clear that the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this specification.

[0166] The terms used in the embodiments of this specification are only for the purpose of describing specific embodiments and are not intended to limit this specification. The singular forms "a", "an", "the" and "the" used in the embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise.

[0167] The professional terms involved in the embodiments of this specification are explained below.

[0168] Binarized image: A grayscale image (or color image) is converted to an image with only two colors, one representing the target object and the other representing the background. In a binary image, each pixel has only two possible values, usually represented by binary 0 or binary 1, but can also be represented by two different numbers.

[0169] Alpha channel: A channel in an image that represents the transparency or opacity of each pixel. In an RGBA image, each pixel is composed of four channels: red (R), green (G), blue (B), and transparency (A). The value of the alpha channel typically ranges from 0 to 255, where 0 represents complete transparency and 255 represents complete opacity.

[0170] Mask: A matrix or image of the same size as the original image, in which the element values ​​are used to indicate whether the pixels at the corresponding positions are selected or masked. In image processing, the mask is usually a binary image (i.e., a binary mask), in which the element values ​​have only two values, usually 0 and 1. The non-zero elements in the mask indicate that the pixels at the corresponding positions are selected or masked (i.e., rendered white), while the zero elements indicate that the pixels at the corresponding positions are not selected or masked (i.e., rendered black). Alternatively, the zero elements in the mask indicate that the pixels at the corresponding positions are selected or masked (i.e., rendered black), while the non-zero elements indicate that the pixels at the corresponding positions are not selected or masked (i.e., rendered white).

[0171] Currently, users can perform various functions based on electronic devices. For example, users can perform painting functions based on electronic devices. Usually, during the painting process, it is often necessary to perform related operations on a certain painting object in the painting image interface. For example, a certain painting object may be moved or copied. Before that, it is necessary to select the painting object on which the related operations are to be performed. In fact, selecting a painting object is equivalent to selecting the elements that constitute the painting object, and the elements that constitute the painting object are often distributed in multiple layers. In order to select the painting object, it is necessary to search one by one in the existing layers, and then select the layer containing the elements that constitute the painting object, so as to select the painting object.

[0172] Please refer to Figure 1, which is a schematic diagram of selecting a drawing object in a traditional manner according to an embodiment of this specification. As shown in Figure 1, there are two drawing objects in the drawing image interface 10: the first drawing object is a person 101, and the second drawing object is grass 102. Person 101 is composed of a head element 1011, a hand element 1012, a body element 1013, and a foot element 1014, and each of these elements is located on a different layer; grass 102 is located entirely on the same layer. If a user wants to select person 101, they must sequentially find the layer containing head element 1011, the layer containing hand element 1012, the layer containing body element 1013, and the layer containing foot element 1014. They must then select all of them, before selecting person 101.

[0173] The above-mentioned process of selecting painting objects mainly has the following two problems: first, it requires manual searching of existing layers one by one, which is a cumbersome operation and results in low efficiency in selecting painting objects; second, when there are a large number of existing layers, some elements and layers that constitute the painting objects may be omitted due to negligence, resulting in poor accuracy in selecting painting objects.

[0174] In light of this, embodiments of this specification provide a method for processing drawing objects. In this method, a user selects a target area within a drawing image interface. The method automatically matches the target drawing elements and their corresponding target layers within multiple existing layers. Specifically, even when there are a large number of layers and the selected drawing object is complex, this method can quickly and accurately select the target drawing elements and their corresponding layers, eliminating tedious user operations and improving the efficiency and accuracy of selecting the target drawing object, resulting in a better user experience.

[0175] Please refer to Figure 2, which is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. The drawing layer processing method in the embodiment of this specification can be applied to electronic device 20. For example, electronic device 20 can be a smartphone, tablet computer, personal computer (PC), personal digital assistant (PDA), vehicle-mounted device, robot, etc., and electronic device 20 is not particularly limited here.

[0176] The electronic device 20 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0177] It should be understood that the structures illustrated in the embodiments of this specification do not constitute specific limitations on the electronic device 20. In other embodiments of this specification, the electronic device 20 may include more or fewer components than illustrated, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0178] The processor 110 may include one or more processing units. For example, the processor 110 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). The different processing units may be independent devices or integrated into one or more processors.

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

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

[0181] In some embodiments, the processor 110 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.

[0182] It is understood that the interface connection relationship between the modules illustrated in the embodiments of this specification is merely illustrative and does not constitute a structural limitation on the electronic device 20. In other embodiments of this specification, the electronic device 20 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0183] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 20. While charging the battery 142, the charging management module 140 can also provide power to the electronic device 20 via the power management module 141.

[0184] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0185] The wireless communication function of the electronic device 20 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0186] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 20 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.

[0187] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 20. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 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 150 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 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0188] In some embodiments, the electronic device 20 can establish a communication connection with the operator's mobile communication network through the mobile communication module 150 and access the Internet through the mobile communication network.

[0189] The wireless communication module 160 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 20. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0190] In some embodiments, the electronic device 20 can establish a communication connection with the Internet through the wireless communication module 160 to access the Internet.

[0191] In some embodiments, the antenna 1 of the electronic device 20 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 20 can communicate with the 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 global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).

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

[0193] Display screen 194 is used to display images, videos, and the like. Display screen 194 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 20 may include one or N display screens 194, where N is a positive integer greater than one.

[0194] The electronic device 20 can realize the shooting function through the ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0195] The ISP processes data fed back by camera 193. 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 converted 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 193.

[0196] The camera 193 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 for conversion 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 20 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0197] 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 20 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

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

[0199] 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 20, such as image recognition, face recognition, speech recognition, and text comprehension.

[0200] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 20. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0201] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 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 20 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 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 110 executes various functional applications and data processing of the electronic device 20 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0202] The electronic device 20 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0203] The touch sensor 180K is also referred to as a "touch-sensitive device." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 20, at a location different from that of the display screen 194.

[0204] In some embodiments, the electronic device can display a drawing image interface using a GPU, display screen 194, and processor 110. The drawing image interface can include multiple drawing objects, and the drawing data is stored in internal memory 121. When the touch sensor 180K detects a user's selection operation on a target area in the drawing image interface, the detected selection operation can be transmitted to the processor 110. The processor 110 can obtain the painting data from the internal memory 121, and identify the target painting object within the target area based on the position of the frame selection operation, and then obtain the overall contour area of ​​the target painting object, for example, generate a binary image corresponding to the target painting object (or obtain a binary mask of the transparency channel of the target painting object), and the local contour area of ​​the location of the painting elements contained in each existing layer, for example, generate a binary image corresponding to the painting elements contained in each layer (or a binary mask of the transparency channel of the painting elements contained in each layer), wherein the binary image corresponding to the target painting object (or the binary mask of the transparency channel of the target painting object) can be used to indicate the overall contour area of ​​the location of the target painting object, and the binary image corresponding to the painting elements contained in each layer (or the binary mask of the transparency channel of the painting elements contained in each layer) is used to indicate the local overall contour of the location of the contained painting elements. If the processor 110 determines that an AND operation is performed on pixels at corresponding positions between the binary image corresponding to the target painting object (or the binary mask of the transparency channel of the target painting object) and the binary image corresponding to the painting element contained in the target layer (or the binary mask of the transparency channel of the painting element contained in the target layer), a result image is obtained. When the binary image (or the binary mask) uses pixels with a binary value of 1 to represent the overall contour area and the local contour area, if there are pixels with a binary value of 1 in the result image, the painting element and the target layer in which it is located are selected. Alternatively, if the processor 110 determines that an OR operation is performed on pixels at corresponding positions between the binary image corresponding to the target painting object (or the binary mask of the transparency channel of the target painting object) and the binary image corresponding to the target layer (or the binary mask of the transparency channel of the painting element contained in the target layer), a result image is obtained. When the binarized image (or binary mask) uses pixels with a binary value of 0 to represent the overall contour area and the local contour area, if there are pixels with a binary value of 0 in the result image, the aforementioned drawing elements and the target layer on which they reside are selected. Based on this, the display screen 194 and the GPU display the selected effect of all elements and the layers on which they reside that constitute the target drawing object.

[0205] The software system of the electronic device 20 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 20.

[0206] FIG3 is a schematic diagram of the software structure of the electronic device 20 according to an embodiment of the present invention.

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

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

[0209] As shown in Figure 3, the application package may include applications such as camera, gallery, calendar, call, map, drawing application, WLAN, Bluetooth, music, video, short message, browser, etc. (only some are shown in the figure). Among them, most of these applications require Internet access, such as navigation, browser, video, music, etc.

[0210] In some embodiments, after detecting a user's selection operation on a target area in a drawing image interface, the drawing application may identify the target area. If a target drawing object is identified in the target area, the overall contour area of ​​the target drawing object's location may be obtained. For example, a binary image corresponding to the target drawing object may be generated (or a binary mask of a transparency channel of the target drawing object may be obtained), as well as the local contour areas of the locations of the drawing elements contained in each existing layer. For example, a binary image corresponding to the drawing elements contained in each layer may be generated (or a binary mask of a transparency channel of the drawing elements contained in each layer may be obtained). The binary image corresponding to the target drawing object (or the binary mask of a transparency channel of the drawing elements contained in each layer) may be used to indicate the overall contour area of ​​the target drawing object's location, and the binary image corresponding to the drawing elements contained in each layer (or the binary mask of a transparency channel of the drawing elements contained in each layer) may be used to indicate the local overall contour of the location of the drawing elements contained therein. The painting application then performs an AND operation on corresponding pixels between the binary image corresponding to the target painting object (or the binary mask of the target painting object's transparency channel) and the binary image corresponding to the painting elements contained in the target layer (or the binary mask of the transparency channel of each painting element contained in each layer), to obtain a result image. If the binary image (or binary mask) uses pixels with a binary 1 value to represent the overall contour area and the local contour area, if a pixel with a binary 1 value exists in the result image, the painting element identifier of the painting element is passed to the application framework layer. Alternatively, the painting application performs an OR operation on corresponding pixels between the binary image corresponding to the target painting object (or the binary mask of the transparency channel of the target painting object) and the binary image corresponding to the painting elements contained in the target layer (or the binary mask of the transparency channel of the painting elements contained in the target layer), to obtain a result image. When the above-mentioned binary image (or binary mask) uses pixel points with a pixel value of binary 0 to represent the overall contour area and the local contour area, once there is a pixel point with a pixel value of binary 0 in the calculation result image, the painting element identifier of the painting element is passed to the application framework layer.

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

[0212] The application framework layer may also include a window manager, content provider, view system, telephony manager, resource manager, notification manager, etc.

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

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

[0215] In some embodiments, after receiving the painting element identifier, the window manager and content provider in the application framework layer can select the painting element and the layer corresponding to the painting element identifier, and present the visual effect of the painting element and the layer being selected on the painting image interface.

[0216] 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 control panel's display interface might include a view for displaying text and a view for displaying images.

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

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

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

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

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

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

[0223] The system library may include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (e.g., OpenGL ES), and a 2D graphics engine (e.g., SGL).

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

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

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

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

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

[0229] The technical solutions provided by the embodiments of this specification are introduced below with reference to the accompanying drawings. The technical solutions involved in the following embodiments can all be implemented in an electronic device with a hardware architecture as shown in FIG2 and a software architecture as shown in FIG3.

[0230] Please refer to Figure 4, which is a flowchart of a method for processing a drawing object provided in an embodiment of this specification. The flow of the method is described as follows:

[0231] Step 201: Displaying a drawing image interface.

[0232] In the embodiments of this specification, during the drawing process, the user draws different drawing elements on multiple layers, that is, each layer includes at least one drawing element. By combining and displaying these multiple layers, the effect of displaying a drawing image interface can be achieved. The displayed drawing image interface can include multiple drawing objects, for example, multiple drawing objects can include animals, people, mountains, rivers, buildings, etc. This specification does not specifically limit the types of these multiple drawing objects.

[0233] Step 202: Detecting a user's selection operation on a target area on the drawing image interface.

[0234] In the embodiments of this specification, if a user wishes to select a target drawing object from a drawing image interface, they can perform a frame selection operation on a target area within the drawing image interface. It should be understood that the target area here refers to an area that covers the target drawing object, and the specific size and shape of the target area are not particularly limited. Furthermore, the frame selection operation is used to trigger the selection of target drawing objects that may exist within the target area; the frame selection operation itself does not directly select the target drawing object.

[0235] In some embodiments, after the user performs a frame selection operation on the target area, the performed frame selection operation may be explicitly presented so that the user can determine whether the frame selection operation is successfully performed.

[0236] Please refer to Figure 5, which is a flowchart of a method for displaying a selection operation identifier provided by an embodiment of this specification. After executing step 202, you can also continue to execute step 301:

[0237] Step 301: Displaying a frame selection operation icon corresponding to the frame selection operation on the drawing image interface.

[0238] In an embodiment of the present specification, the framing operation identifier can be used to indicate whether the user has performed a framing operation on the target area. The framing operation identifier can be related to the framing operation process. For example, the framing operation identifier can be a framing trace identifier. Of course, the framing operation identifier can also be unrelated to the framing operation. For example, the framing operation identifier √ is used to indicate that the user has performed a framing operation on the target area.

[0239] The following describes in detail the mark of the box selection operation as the box selection trace mark.

[0240] Case 1: Select the trace marker corresponding to the regular shape.

[0241] Please refer to Figure 6, which is a schematic diagram of a frame selection trace identification provided by an embodiment of this specification. As shown in Figure 6 (a), when the target area is framed based on a rectangular frame, the frame selection trace identification is a rectangular trace identification. It should be understood that when the above-mentioned rectangular trace identification is incomplete (i.e., a closed rectangle is not formed), it indicates that the frame selection operation has failed; as shown in Figure 6 (b), when the target area is framed based on a circular frame, the frame selection trace identification is a circular trace identification. It should be understood that when the above-mentioned circular trace identification is incomplete (i.e., a closed circle is not formed), it indicates that the frame selection operation has failed; as shown in Figure 6 (c), when the target area is framed based on a triangular frame, the frame selection trace identification is a triangular trace identification. It should be understood that when the above-mentioned triangular trace identification is incomplete (i.e., a closed triangle is not formed), it indicates that the frame selection operation has failed; as shown in Figure 6 (d), when the target area is framed based on an elliptical frame, the frame selection trace identification is an elliptical trace identification. It should be understood that when the above-mentioned elliptical trace identification is incomplete (i.e., a closed ellipse is not formed), it indicates that the frame selection operation has failed.

[0242] It should be understood that in the above embodiment, the target area is the closed area formed by the above-mentioned frame selection trace mark (rectangular track mark, circular track mark, triangular track mark, or elliptical track mark). At this time, the target area is the area where the target painting object is located.

[0243] Case 2: The selected trace mark corresponds to an irregular shape.

[0244] Please refer to Figure 7, which is a schematic diagram of another example of a selection trace provided in an embodiment of this specification. As shown in Figure 7, when a selection operation is performed along the edge of a target drawing object (person), the selection trace is identified as the outline of the target drawing object (person). It should be understood that if the outline is incomplete (i.e., it does not form a closed contour curve), it indicates that the selection operation has failed.

[0245] It should be understood that in the above embodiment, the target area is the closed area formed by the outline mark. In this case, the target area is equivalent to the area where the target painting object is located.

[0246] Step 203: In response to the frame selection operation, identify the target drawing object in the target area.

[0247] In an embodiment of the present specification, after the user selects a target area in the drawing image interface, the electronic device can determine that the user wants to select a drawing object that may exist in the target area. On this basis, the electronic device can identify the target area and obtain the target drawing object in the target area. Here, the area where the target drawing object is located is the area that the user actually wants to select (i.e., SelectArea).

[0248] Please refer to Figure 8, which is a flowchart of a method for identifying a target painting object provided in an embodiment of this specification. Step 203 can be implemented by executing sub-steps 2031 to 2032:

[0249] Step 2031: In response to the frame selection operation, generate an image sample to be identified corresponding to the target area.

[0250] Step 2032: Input the image sample to be identified into the painting object recognition model to identify the target painting object.

[0251] In the embodiments of this specification, the painting object recognition model can be considered to be trained based on a large number of painting image samples. For example, the painting object recognition model can be a convolutional neural network model (CNN), visual geometry group (VGG), residual network (ResNet), efficient network (EfficientNet), etc., and there is no particular limitation on the painting object recognition model herein. By generating a to-be-recognized image sample from the target area selected by the user and inputting it into the painting object recognition model, a "smart selection" function can be implemented, that is, the area where the target painting object is located can be identified from the to-be-recognized image sample.

[0252] Step 204: Select at least one target painting element and the target layer corresponding to the target painting object from the multiple layers.

[0253] In the embodiments of this specification, if each of the multiple existing layers includes at least one drawing element, the multiple layers can be considered to include multiple drawing elements. Some of these drawing elements constitute the target drawing object, while others do not. After identifying the target drawing object from the target area, at least one target drawing element constituting the target drawing object can be automatically matched from the multiple drawing elements. This at least one target drawing element and its target layer can then be selected, thereby achieving the target drawing object selection.

[0254] In some embodiments, when there are multiple layers, the selected target layer and other unselected layers can be represented in different ways so that the user can effectively distinguish which are the selected target layers when viewing.

[0255] Please refer to Figure 9, which is a flowchart of a method for displaying a target layer provided by an embodiment of this specification. After executing step 204, you can continue to execute step 302:

[0256] Step 302: Display the target layer and other layers in the multiple layers differently.

[0257] In the embodiments of this specification, the difference between the target layer and other layers when displayed can be mainly reflected by different brightness, or dynamic / static combination, etc., and the specific method of displaying the difference is not particularly limited here.

[0258] Please refer to Figure 10, which is a schematic diagram of an embodiment of this specification, providing a method for displaying a target layer and other layers differently based on brightness. As shown in Figure 10, the target drawing object (person 101) includes a head element 1011, a hand element 1012, a body element 1013, and a foot element 1014. The head element 1011 is located in layer 1, the hand element is located in layer 5, the body element is located in layer 3, and the foot element is located in layer 4. Therefore, the target layers (layers 1, 3, 4, and 5) can be displayed in a highlighted manner, while the other layers (layer 2) that do not contain any of the drawing elements of person 101 are displayed in a dimmed manner.

[0259] In some embodiments, when there are a large number of existing layers, if the target layers are arranged in a scattered order, it is not convenient for the user to view the selected target layer. Therefore, in the embodiments of this specification, the arrangement position of the target layer can be adjusted to a more prominent position so that the user can more easily view the selected target layer.

[0260] Please refer to Figure 11, which is a flowchart of a method for displaying a target layer differently from other layers provided in an embodiment of this specification. Step 302 can be implemented by executing sub-steps 3021 to 3022:

[0261] Step 3021: Adjust the order of the target layer to the first M positions among the multiple layers.

[0262] In the embodiments of this specification, M is the number of target layers. That is, no matter where the target layer is originally located among the multiple layers, during the rearrangement process, the first M bits will be reserved according to the number of target layers. These M bits are used to arrange the target layer, and the other layers are arranged at the back.

[0263] Step 3022: Display the target layer in the first M positions differently from other layers.

[0264] In the embodiment of the present specification, after the order is rearranged, the first M target layers and other layers may be displayed differently, so that the user can quickly view the selected target layer.

[0265] Please refer to Figure 12, which is a schematic diagram of another embodiment of this specification providing a method for displaying a target layer and other layers differently based on brightness. As shown in Figure 12, the target painting object (person 101) includes a head element 1011, a hand element 1012, a body element 1013, and a foot element 1014. The head element 1011 is located in layer 1, the hand element is located in layer 5, the body element is located in layer 3, and the foot element is located in layer 4. The target layers (layers 1, 3, 4, and 5) are arranged in the order of the first four and displayed in a highlighted manner. The other layer (layer 2) that does not contain any painting element of person 101 is arranged in the order of the last one and displayed in a low-brightness manner. This allows the user to effectively distinguish the target layer from the other layers and quickly view the target layer arranged in the front.

[0266] In some embodiments, in addition to highlighting the target layer, the painting elements constituting the target painting object in the target layer may also be highlighted so that the user can determine which target painting elements constituting the target painting object have been selected, and thus can promptly determine whether there are any unselected target painting elements.

[0267] Please refer to Figure 13, which is a flowchart of a method for displaying drawing elements provided in an embodiment of this specification. After executing step 302, you can continue to execute step 303:

[0268] Step 303: Display the selected target drawing element in the target layer.

[0269] Please refer to Figure 14, which is a schematic diagram of displaying drawing elements provided in an embodiment of this specification. As shown in Figure 14, the target drawing object (person 101) includes a head element 1011, a hand element 1012, a body element 1013, and a foot element 1014. The head element 1011 is located in layer 1, the hand element is located in layer 5, the body element is located in layer 3, and the foot element is located in layer 4. Therefore, while the target layers (layers 1, 3, 4, and 5) are highlighted, the head element 1011 in layer 1, the body element 1013 in layer 3, the foot element 1014 in layer 4, and the hand element 1012 in layer 5 are also highlighted. The other layer (layer 2) that does not contain any drawing elements of person 101 and the unselected grass element 102 in layer 2 are displayed in a low-light manner. This allows the user to effectively distinguish the target layer from the other layers and quickly check which drawing elements of person 101 have been selected, thereby determining whether there are any unselected drawing elements in the drawing elements of person 101.

[0270] In some embodiments, in addition to the target painting elements used to constitute the target painting object, the target layer may also include other elements. In the embodiments of this specification, different display methods can be used for different painting elements in the same target layer based on whether they constitute the target painting object.

[0271] Please refer to Figure 15, which is a flowchart of a method for displaying different drawing elements in the same layer according to an embodiment of this specification. Step 303 can be implemented by executing sub-step 3031:

[0272] Step 3031: In the target layer, display the selected target painting element differently from other unselected painting elements.

[0273] In an embodiment of the present specification, when a target painting element used to constitute a target painting object and other painting elements not used to constitute the target painting object exist in a target layer, the target painting element and the other painting elements are displayed differently, that is, the target painting element and the other painting elements present different display effects, so that the user can determine which target painting elements used to constitute the target painting object have been selected, and thus can promptly determine whether there are any unselected target painting elements.

[0274] Please refer to Figure 16, which is a schematic diagram of a method for displaying different drawing elements in the same layer according to an embodiment of this specification. As shown in Figure 15, the target drawing object (person 101) includes a head element 1011, a hand element 1012, a body element 1013, and a foot element 1014. The head element 1011 is located in layer 1, the hand element is located in layer 5, the body element is located in layer 3, and the foot element is located in layer 4. Then, while highlighting the target layers (layers 1, 3, 4, and 5), the head element 1011 in layer 1, the body element 1013 in layer 3, the foot element 1014 in layer 4, and the hand element 1014 in layer 5 are also highlighted. 101 is highlighted, while the other layer (layer 2) that does not contain any painting element of the person 101 and the unselected grass element 102 in layer 2 are displayed in a low-light manner. At the same time, the star element 103 located in layer 1 but not used to constitute the target painting object (person 101) is also displayed in a low-light manner. This allows the user to effectively distinguish the target layer from other layers, and can also quickly check which painting elements constituting the person 101 have been selected, thereby determining whether there are any unselected painting elements in the painting elements constituting the person 101.

[0275] In some embodiments, after a user selects a target painting object in a painting image interface, he or she may need to manually select a corresponding operation option to trigger the implementation of relevant operations on the selected target painting object, resulting in low efficiency in implementing relevant operations on the target painting object.

[0276] Please refer to Figure 17, which is a flowchart of a method for performing related operations on a target drawing object provided by an embodiment of this specification. After executing step 204, steps 205 to 206 may also be executed:

[0277] Step 205: Based on the correspondence between the frame selection operation and the drawing object operation, determine the drawing object operation corresponding to the frame selection operation.

[0278] Step 206 : Applying a drawing object operation corresponding to the frame selection operation to the selected target drawing object.

[0279] In the embodiments of this specification, since there are multiple types of frame selection operations, a one-to-one correspondence can be established between different frame selection operations and different drawing object operations after the target drawing object is selected. For example, when the frame selection operation is to select the target drawing object based on a rectangular frame, the corresponding drawing object operation is a copy operation; or, when the frame selection operation is to select the target drawing object based on an elliptical frame, the corresponding drawing object operation is a move operation; and when the frame selection operation is to select the target drawing object based on a triangular frame, the corresponding drawing object operation is a mirror symmetry operation. Therefore, when the user triggers the selection of the target drawing object based on the frame selection operation, the drawing object operation corresponding to the frame selection operation can be automatically performed on the selected target drawing object, eliminating the need for the user to manually select the relevant operation to be performed after the target drawing object is selected, thereby improving the efficiency of performing relevant operations on the target drawing object.

[0280] The following describes in detail how to match the target painting element and the target layer corresponding to the target painting object.

[0281] Please refer to Figure 18, which is a flowchart of a method for matching painting objects provided in an embodiment of this specification. Step 204 can be specifically implemented through sub-steps 2041 and 2042:

[0282] Step 2041: Obtain the overall contour area of ​​the target painting object and the local contour area of ​​the painting elements contained in each of the multiple layers.

[0283] In an embodiment of the present specification, after the target painting object is detected within the target area framed by the user, the electronic device can know that the user intends to select the target painting object. At this time, on the one hand, the electronic device can determine the overall contour area of ​​the target painting object, where the overall contour area is used to indicate the closed area formed by the edge of the target painting object. On the other hand, the electronic device can determine the local contour area of ​​the position of the painting elements contained in each layer of the existing multiple layers, where the local contour area is used to indicate the closed area formed by the edge of the painting element, that is, determine the overall contour area of ​​the target painting object and the local contour areas of the positions of multiple painting elements.

[0284] The following describes in detail how to obtain the overall contour area of ​​the target drawing object and the local contour area of ​​the elements contained in each layer.

[0285] Please refer to FIG19 , which is a flowchart of a method for obtaining an overall contour area and a local contour area provided in an embodiment of this specification.

[0286] Step 2041 can be specifically implemented by executing sub-step 401:

[0287] Step 401: Obtain a binary image of a target painting object and a binary image of the painting elements contained in each layer.

[0288] In the embodiments of this specification, when a target painting object is identified in the target area of ​​the painting image interface, a binary image corresponding to the target painting object is generated, as well as a binary image corresponding to the painting elements contained in each layer. It should be understood that the process of generating the binary image of the target painting object is similar to the process of generating the binary image of the painting elements contained in the layer. In both cases, the original color image is first converted into a grayscale image, and then an appropriate threshold is selected to set the pixels in the grayscale image with a grayscale value greater than the threshold to white (i.e., a binary pixel value of 1), and the pixels with a grayscale value less than the threshold to black (i.e., a binary pixel value of 0); alternatively, the pixels in the grayscale image with a grayscale value greater than the threshold are set to black (i.e., a binary pixel value of 0), and the pixels with a grayscale value less than the threshold are set to white (i.e., a binary pixel value of 1). The above thresholds can be set according to actual conditions and are not particularly limited in this specification.

[0289] The binary image corresponding to the target painting object can be used to indicate the overall contour area of ​​the target painting object. For example, as shown in FIG20 , in the binary image corresponding to the target painting object, the overall contour area of ​​the target painting object is represented by pixels with a binary value of 1, and the areas other than the overall contour area of ​​the painting image interface are represented by pixels with a binary value of 0. That is, the white area represents the overall contour area of ​​the target painting object, and the black area represents the background area. Alternatively, as shown in FIG21 , in the binary image corresponding to the target painting object, the overall contour area of ​​the target painting object is represented by pixels with a binary value of 0, and the areas other than the target painting object are represented by pixels with a binary value of 1. That is, the black area represents the overall contour area of ​​the target painting object, and the white area represents the background area.

[0290] The binary image corresponding to each drawing element in each layer can be used to indicate the local contour area of ​​the drawing element's location. For example, in the binary image corresponding to each drawing element in each layer, pixels with a binary value of 1 represent the local contour area of ​​the drawing element's location, and pixels with a binary value of 0 represent the remaining areas of the layer excluding the local contour area of ​​the drawing element's location. That is, the white area represents the local contour area of ​​the drawing element's location, and the black area represents the background area. As shown in Figure 22, the binary image corresponding to the drawing element in layer 4 shows the white area representing the local contour area of ​​the foot element's location, and the black area represents the background area. Alternatively, in the binary image corresponding to each drawing element in each layer, pixels with a binary value of 0 represent the local contour area of ​​the drawing element's location, and pixels with a binary value of 1 represent the remaining areas of the layer excluding the local contour area of ​​the drawing element's location. That is, the black area represents the local contour area of ​​the drawing element's location, and the white area represents the background area. As shown in FIG23 , this is a binary image corresponding to layer 4. In the binary image, the black area represents the local contour area where the foot element is located, and the white area represents the background area.

[0291] Please refer to Figure 24, which is a flowchart of another method for obtaining the overall contour area and the local contour area provided in an embodiment of this specification. Step 2041 can be specifically implemented by executing sub-step 402:

[0292] Step 402: Obtain a binary mask corresponding to the transparency channel of the target painting object and a binary mask corresponding to the transparency channel of the painting elements contained in each layer.

[0293] In the embodiments of this specification, the drawing image interface has a transparency channel, and the multiple layers that make up the drawing layer interface naturally also have corresponding transparency channels. After the electronic device identifies the target drawing object within the target area selected by the user, it can obtain the binary mask corresponding to the transparency channel of the target drawing object (i.e., the binary mask of the area selected by the user, mask_selectArea), as well as the binary mask corresponding to the transparency channel of the drawing elements contained in each layer. It should be understood that the process of generating a binary mask for the transparency channel of the target painting object is similar to the process of generating a binary mask for the transparency channel of the painting elements contained in the layer. In both cases, the transparency channel of the original image (painting image interface or layer) is first extracted, and then the extracted transparency channel is binarized, with pixels with values ​​greater than a threshold being set to white (i.e., a binary value of 1) and pixels with values ​​less than the threshold being set to black (i.e., a binary value of 0); alternatively, pixels with values ​​greater than the threshold being set to black (i.e., a binary value of 0) and pixels with values ​​less than the threshold being set to white (i.e., a binary value of 1). The above thresholds can be set according to actual circumstances and are not specifically limited in this specification. Of course, other methods can also be used to obtain the binary mask corresponding to the transparency channel of the original image, and are not specifically limited here.

[0294] The binary mask corresponding to the target painting object's transparency channel can be used to indicate the overall contour area of ​​the target painting object. For example, in the binary mask corresponding to the target painting object's transparency channel, pixels with binary values ​​of 1 represent the overall contour area of ​​the target painting object's location, and pixels with binary values ​​of 0 represent areas of the painting image interface other than the overall contour area of ​​the target painting object's location. That is, the white area represents the overall contour area of ​​the target painting object's location, and the black area represents the background area. It should be understood that in the above scenario, the visual effect of the binary mask corresponding to the target painting object's transparency channel is the same as the visual effect of the binary image of the target painting object, that is, the same as the visual effect shown in FIG. 20. Alternatively, in the binary mask corresponding to the target painting object's transparency channel, pixels with binary values ​​of 0 represent the overall contour area of ​​the target painting object's location, and pixels with binary values ​​of 1 represent areas of the painting image interface other than the target painting object's location. That is, the black area represents the overall contour area of ​​the target painting object's location, and the white area represents the background area. It should be understood that in the above scenario, the visual effect of the binary mask corresponding to the transparency channel of the target painting object is the same as the visual effect of the binary image of the target painting object, that is, the same as the visual effect in FIG. 21 .

[0295] The binary image corresponding to the transparency channel of each painting element contained in each layer can be used to indicate the local contour area of ​​the painting element. For example, in the binary mask corresponding to the transparency channel of each painting element contained in each layer, pixels with a binary value of 1 represent the local contour area of ​​the painting element, and pixels with a binary value of 0 represent the remaining areas of the layer excluding the local contour area of ​​the painting element. That is, the white area represents the local contour area of ​​the painting element, and the black area represents the background area. It should be understood that in the above scenario, the visual effect of the binary mask corresponding to the transparency channel of the painting element is the same as the visual effect of the binary image of the painting element. For example, when the target layer is layer 4, the visual effect is the same as that in Figure 22. Alternatively, in the binary mask corresponding to the transparency channel of each painting element contained in each layer, pixels with a binary value of 0 represent the local contour area of ​​the painting element, and pixels with a binary value of 1 represent the remaining areas of the layer excluding the local contour area of ​​the painting element. That is, the black area represents the local outline of the painting element, and the white area represents the background. It should be understood that in the above scenario, the visual effect of the binary mask corresponding to the transparency channel of the painting element is the same as the visual effect of the binary image of the target painting element. For example, when the target layer is layer 4, the visual effect is the same as Figure 23.

[0296] Step 2042: In response to the overall contour area including at least one target local contour area among the multiple local contour areas, at least one target painting element and its target layer corresponding to the at least one target local contour area are selected from multiple layers.

[0297] In the embodiments of this specification, since the target drawing object is composed of drawing elements distributed across some of the existing multiple layers, it can be considered that the overall contour area at the location of the target drawing object can be composed of the local contour areas at the locations of the drawing elements distributed across the aforementioned layers. Therefore, after obtaining the overall contour area at the location of a target drawing object and multiple local contour areas at the locations of multiple drawing elements (one drawing element corresponds to one local contour area), if the electronic device determines that the overall contour area includes a target local contour area among the multiple local contour areas, then the target local contour area is part of the overall contour area. This allows for a relatively simple determination that the target drawing element corresponding to the target local contour area constitutes the target drawing object. Based on this, the target drawing element and the target layer it resides in can be automatically selected, eliminating the tedious manual search process, improving the efficiency and accuracy of selecting the target drawing object, and providing a better user experience.

[0298] In some embodiments, in order to detect which local contour areas belong to the overall contour area without omission, a traversal method may be used to determine in turn whether each local contour area belongs to the overall contour area.

[0299] Please refer to FIG. 25 , which is a flowchart of a method for selecting a layer corresponding to a target painting object provided in an embodiment of this specification.

[0300] Step 2042 can be specifically implemented by executing sub-steps 501 and 502:

[0301] Step 501: Determine whether the overall contour region includes at least one target local contour region among a plurality of local contour regions.

[0302] In the embodiment of this specification, the layers corresponding to the drawing image interface can be considered to be arranged in a certain order. Therefore, based on the arrangement order of the existing multiple layers, it can be determined in sequence whether the overall contour area includes at least one target local contour area among the multiple local contour areas.

[0303] For example, please continue to refer to 14. If the target painting object is a person 101, the overall contour area where the person 101 is located can be determined in the forward order of layers 1 to 5 to determine whether it includes the target local contour areas where the painting elements contained in layers 1, 2, 3, 4, and 5 are located; or, the overall contour area where the person 101 is located can be determined in the reverse order from layer 5 to layer 1 to determine whether it includes the target local contour areas corresponding to the painting elements contained in layers 5, 4, 3, 2, and 1.

[0304] The following describes in detail how to determine whether the overall contour area includes a target local contour area among multiple local contour areas.

[0305] Method 1: Based on AND operation.

[0306] Please refer to Figure 26, which is a flowchart of a method for determining whether the overall contour area includes at least one target local contour area based on an AND operation according to an embodiment of this specification. Step 501 can be specifically implemented by executing sub-step 5011:

[0307] Step 5011: performing an AND operation on the pixel values ​​of corresponding pixels in the binary image of the target painting object and the binary images of the painting elements contained in the target layer among the multiple layers to obtain an operation result image.

[0308] In an embodiment of the present specification, when, in the binary image corresponding to the target painting object, the overall contour area of ​​the target painting object's location is represented by pixels with binary values ​​of 1, and the areas other than the overall contour area of ​​the target painting object's location in the painting image interface are represented by pixels with binary values ​​of 0; and in the binary image corresponding to the painting elements contained in each layer, the local contour area of ​​the painting element's location is represented by pixels with binary values ​​of 1, and the areas other than the local contour area of ​​the painting element's location in the layer are represented by pixels with binary values ​​of 0, that is, the binary image corresponding to the target painting object and the binary image corresponding to the painting element both use white to represent the foreground area (the overall contour area or the local contour area) and black to represent the background area, the binary image corresponding to the target painting object and the binary images corresponding to the painting elements contained in the target layer in multiple layers can be ANDed together with the pixel values ​​of the corresponding pixels to obtain a result image. When there are pixel points with binary values ​​of 1 in the calculation result image, it can be considered that the overall contour area includes the target local contour area corresponding to the target painting element; conversely, when all the pixel points in the calculation result image are binary values ​​of 0, it can be considered that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0309] It should be understood that in the above embodiment, performing an AND operation on the pixel values ​​of the corresponding positions of the binary image corresponding to the target painting object and the binary image corresponding to the painting element contained in the target layer is equivalent to performing a multiplication operation on the pixel values ​​of the corresponding positions of the two. If, in the obtained calculation result image, there are pixels with a pixel value of binary 1 (that is, the result of the multiplication operation is not empty), it can be considered that the overall contour area includes the target local contour area corresponding to the target painting element; conversely, when the calculation result image contains only pixels with a pixel value of binary 0 (that is, the result of the multiplication operation is empty), it can be considered that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0310] Please refer to Figure 27, which is a flowchart of another method for determining whether the overall contour area includes the target local contour area based on an AND operation according to an embodiment of this specification. Step 501 can be specifically implemented by executing sub-step 5012:

[0311] Step 5012: performing an AND operation on the pixel values ​​of corresponding positions of the binary mask of the target painting object and the binary masks of the painting elements contained in the target layer among the multiple layers to obtain an operation result image.

[0312] In an embodiment of the present specification, when, in the binary mask corresponding to the transparency channel of the target painting object, pixels with binary values ​​of 1 represent the overall contour area of ​​the target painting object, and pixels with binary values ​​of 0 represent areas other than the overall contour area of ​​the target painting object in the painting image interface, and in the binary mask corresponding to the transparency channel of the painting elements contained in each layer, pixels with binary values ​​of 1 represent the local contour area of ​​the painting element, and pixels with binary values ​​of 0 represent areas other than the local contour area of ​​the painting element in the layer, that is, the binary mask corresponding to the transparency channel of the target painting object and the binary mask corresponding to the transparency channel of the layer both represent the foreground area (overall contour area or local contour area) with white and the background area with black, an AND operation can be performed on the pixel values ​​of corresponding pixels of the binary mask corresponding to the transparency channel of the target painting object and the binary masks corresponding to the transparency channels of the painting elements contained in the target layer in multiple layers to obtain a result image. When there are pixel points with binary 1 values ​​in the calculation result image, it can be considered that the overall contour area includes the target local contour area corresponding to the target layer; conversely, when all the pixel points in the calculation result image have binary 0 values, it can be considered that the overall contour area does not include the target local contour area corresponding to the target layer.

[0313] It should be understood that in the above embodiment, the pixel values ​​of the corresponding pixel points of the binary image corresponding to the transparency channel of the target painting object and the binary mask corresponding to the transparency channel of the painting element contained in the target layer are subjected to an AND operation, which is equivalent to multiplying the pixel values ​​of the corresponding pixel points of the two. In the obtained calculation result image, if there are pixels with a pixel value of binary 1 (that is, the result of the multiplication operation is not empty), then it can be considered that the overall contour area includes the target local contour area corresponding to the target painting element; conversely, when the calculation result image contains only pixels with a pixel value of binary 0 (that is, the result of the multiplication operation is empty), it can be considered that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0314] Please refer to Figure 28, which is a schematic diagram of an AND operation provided in an embodiment of this specification. As shown in Figure 28, a binary image (or binary mask) 601 of a target painting object (person) is subjected to a pixel-by-pixel AND operation with a binary image (or binary mask) 602 of a head element, a binary image (or binary mask) 603 of a grass element, a binary image (or binary mask) 604 of a body element, a binary image (or binary mask) 605 of a foot element, and a binary image (or binary mask) 606 of a hand element, respectively, to obtain corresponding operation result images 607 to 611. Among them, the calculation result image 607 contains pixel points with binary values ​​of 1, indicating that the overall contour area of ​​the target painting object includes the target local contour area of ​​the head element; the calculation result image 608 contains pixel points with binary values ​​of 0, indicating that the overall contour area of ​​the target painting object does not include the target local contour area of ​​the grass element; the calculation result image 609 contains pixel points with binary values ​​of 1, indicating that the overall contour area of ​​the target painting object includes the target local contour area of ​​the body element; the calculation result image 610 contains pixel points with binary values ​​of 1, indicating that the overall contour area of ​​the target painting object includes the target local contour area of ​​the foot element; the calculation result image 611 contains pixel points with binary values ​​of 1, indicating that the overall contour area of ​​the target painting object includes the target local contour area of ​​the hand element.

[0315] Method 2: Based on OR operation.

[0316] Please refer to Figure 29, which is a flowchart of a method for determining whether the overall contour area includes the target local contour area based on an OR operation according to an embodiment of this specification. Step 501 can be specifically implemented by executing sub-step 5013:

[0317] Step 5013: performing an OR operation on the pixel values ​​of corresponding positions of the binary image of the target painting object and the binary images of the painting elements contained in the target layer among the multiple layers to obtain a result image.

[0318] In an embodiment of the present specification, when, in the binary image corresponding to the target painting object, the overall contour area of ​​the target painting object's location is represented by pixels with binary values ​​of 0, and the areas other than the overall contour area of ​​the target painting object's location in the painting image interface are represented by pixels with binary values ​​of 1; and in the binary image corresponding to the painting elements contained in each layer, the local contour area of ​​the painting element's location is represented by pixels with binary values ​​of 0, and the areas other than the local contour area of ​​the painting element's location in the layer are represented by pixels with binary values ​​of 1, that is, the binary image corresponding to the target painting object and the binary image corresponding to the painting element both use black to represent the foreground area (the overall contour area or the local contour area) and use white to represent the background area, the binary image corresponding to the target painting object and the binary images corresponding to the painting elements contained in the target layer in multiple layers can be ORed together with the pixel values ​​of the corresponding pixels to obtain a result image. When there are pixel points with binary 0 values ​​in the calculation result image (that is, there are both binary 0 and binary 1 pixels), it can be considered that the overall contour area includes the target local contour area corresponding to the target painting element layer; conversely, when the calculation result image contains only pixel points with binary 1 values ​​(that is, there are no binary 0 pixels), it can be considered that the overall contour area does not include the target local contour area corresponding to the target painting element.

[0319] Please refer to Figure 30, which is a flowchart of another method for determining whether the overall contour area includes the target local contour area based on OR operation according to an embodiment of this specification. Step 501 can be specifically implemented by executing sub-step 5014:

[0320] Step 5014: Perform an OR operation on the binary mask of the transparency channel of the target painting object and the pixel values ​​of the corresponding positions of the binary mask of the transparency channel of the painting elements contained in the target layer in the multiple layers to obtain a calculation result image.

[0321] In an embodiment of the present specification, when, in the binary mask corresponding to the transparency channel of the target painting object, the overall contour area of ​​the target painting object's location is represented by pixels with binary values ​​of 0, and the areas other than the overall contour area of ​​the target painting object's location in the painting image interface are represented by pixels with binary values ​​of 1, and in the binary mask corresponding to the transparency channel of the painting elements contained in each layer, the local contour area of ​​the painting elements' location is represented by pixels with binary values ​​of 0, and the areas other than the local contour area of ​​the painting elements' location in the layer are represented by pixels with binary values ​​of 1, that is, the binary mask corresponding to the transparency channel of the target painting object and the binary mask corresponding to the transparency channel of the painting objects contained in the layer both use black to represent the foreground area (the overall contour area or the local contour area) and white to represent the background area, the binary mask corresponding to the transparency channel of the target painting object and the binary mask corresponding to the transparency channel of the painting elements contained in the target layer in multiple layers can be ORed together with the pixel values ​​of the corresponding pixels to obtain a result image. When there are pixels with binary 0 values ​​in the calculation result image (that is, there are both binary 0 and binary 1 pixels), the overall contour area can be considered to include the target local contour area corresponding to the target layer; conversely, when all the pixels in the calculation result image are binary 1 values ​​(that is, there are no binary 0 pixels), the overall contour area can be considered to not include the target local contour area corresponding to the target layer.

[0322] Please refer to Figure 31, which is a schematic diagram of an OR operation provided in an embodiment of this specification. As shown in Figure 31, a pixel-by-pixel OR operation is performed on a binary image (or binary mask) 701 of a target painting object (person), a binary image (or binary mask) 702 of a head element, a binary image (or binary mask) 703 of a grass element, a binary image (or binary mask) 704 of a body element, and a binary image (or binary mask) 705 of a foot element, respectively, to obtain corresponding operation result images 707 to 711. Among them, the calculation result image 707 contains pixel points with binary values ​​of 0, indicating that the overall contour area of ​​the target painting object includes the target local contour area of ​​the head element; the calculation result image 708 contains pixel points with binary values ​​of 1, indicating that the overall contour area of ​​the target painting object does not include the target local contour area of ​​the grass element; the calculation result image 709 contains pixel points with binary values ​​of 0, indicating that the overall contour area of ​​the target painting object includes the target local contour area of ​​the body element; the calculation result image 710 contains pixel points with binary values ​​of 0, indicating that the overall contour area of ​​the target painting object includes the target local contour area of ​​the foot element; the calculation result image 711 contains pixel points with binary values ​​of 0, indicating that the overall contour area of ​​the target painting object includes the target local contour area of ​​the hand element.

[0323] Step 502 : In response to the overall contour area including at least one target local contour area, selecting at least one target painting element and the target layer corresponding to the at least one target local contour area from multiple layers.

[0324] In an embodiment of the present specification, if the electronic device determines that the above-mentioned overall contour area includes at least one target local contour area among the above-mentioned multiple local contour areas, the target painting element corresponding to the at least one target local contour area and the target layer in which it is located are quickly and accurately selected, which not only improves the search efficiency but also avoids the omission of certain layers.

[0325] In some embodiments, each of the existing multiple layers can be considered to have a corresponding layer identifier. Therefore, in the process of selecting a layer, the layer identifier of the layer to be selected can be determined first, and then the corresponding layer can be selected based on the layer identifier.

[0326] Please refer to Figure 32, which is a flowchart of a method for selecting a drawing element and its layer based on a drawing element identifier according to an embodiment of this specification. Step 502 can be implemented by executing sub-steps 5021 and 5022:

[0327] Step 5021: In response to the overall contour area including at least one target local contour area, determining at least one target painting element identifier corresponding to the at least one target local contour area.

[0328] Step 5022: Select at least one target drawing element and its target layer corresponding to at least one target drawing element identifier from multiple layers.

[0329] In the embodiments of this specification, a drawing element identifier may include only element information. For example, 10 indicates the first drawing element in layer 1, and 13 indicates the second drawing element in layer 2. Of course, a drawing element identifier may also include both layer information and element information. For example, a drawing element identifier may be 5_2, where 5 indicates that the drawing element belongs to layer 5 and 2 indicates the second drawing element. Thus, the drawing element identifier 5_2 may be used to indicate the second drawing element in layer 5. It should be understood that a drawing element identifier may be represented by Arabic numerals or Roman numerals, or may be represented by a custom string, and this is not particularly limited here.

[0330] Please refer to FIG33, which is a schematic diagram of a structure of a device for processing a drawing object provided in an embodiment of this specification based on the same inventive concept. The device includes:

[0331] The display unit 801 is used to display a painting image interface, which includes a picture displayed by combining multiple layers;

[0332] A detection unit 802 is configured to detect a user's selection operation on a target area on the drawing image interface;

[0333] The recognition unit 803 is configured to recognize a target painting object in a target area in response to a frame selection operation;

[0334] The selection unit 804 is configured to select at least one target painting element and its target layer corresponding to the target painting object from multiple layers.

[0335] Optionally, the display unit 801 is used to:

[0336] A frame selection operation icon corresponding to the frame selection operation is displayed on the drawing image interface.

[0337] Optionally, the box selection operation identifier is a box selection track identifier corresponding to the box selection operation.

[0338] Optionally, the selected track identifier includes any of the following:

[0339] When the selection operation is based on a rectangular frame, the selection track identifier is a rectangular track identifier;

[0340] When the selection operation is based on a circular frame, the selection track identifier is a circular track identifier;

[0341] When the selection operation is based on an elliptical frame, the selection track identifier is an elliptical track identifier;

[0342] When the selection operation is based on a triangle box, the selection track identifier is a triangle track identifier.

[0343] Optionally, the selection trajectory identifier is an outline identifier of the target drawing object.

[0344] Optionally, the display unit 801 is further configured to:

[0345] Display the target layer and other layers in multiple layers differently.

[0346] Optionally, the display unit 801 is specifically configured to:

[0347] Adjust the order of the target layer to the first M positions among the multiple layers, where M is equal to the number of target layers;

[0348] The target layer in the first M positions is displayed differently from other layers.

[0349] Optionally, the display unit 801 is further configured to:

[0350] In the target layer, the selected target drawing element is displayed.

[0351] Optionally, the target layer also includes other unselected drawing elements, and the display unit 801 is specifically configured to:

[0352] In the target layer, the selected target drawing element and other unselected drawing elements are displayed differently.

[0353] Optionally, the device further includes:

[0354] a determining unit, configured to determine the drawing object operation corresponding to the frame selection operation based on a correspondence between the frame selection operation and the drawing object operation;

[0355] The operation unit is used to apply a drawing object operation corresponding to the frame selection operation to the selected target drawing object.

[0356] Optionally, the identification unit 803 is specifically configured to:

[0357] In response to the frame selection operation, generating an image sample to be identified corresponding to the target area;

[0358] The image sample to be identified is input into the painting object recognition model to identify the target painting object.

[0359] Optionally, the selecting unit 804 includes:

[0360] a contour obtaining unit, configured to obtain an overall contour area of ​​a target painting object and a local contour area of ​​a painting element contained in each of the plurality of layers, wherein the overall contour area indicates a closed area formed by edges of the target painting object, and the local contour area indicates a closed area formed by edges of the painting elements;

[0361] The element selection unit is configured to select at least one target painting element and its target layer corresponding to the at least one target local contour area from multiple layers in response to the overall contour area including at least one target local contour area among the multiple local contour areas.

[0362] Optionally, the element selection unit includes:

[0363] a determining subunit, configured to determine whether the overall contour region includes at least one target local contour region among the multiple local contour regions;

[0364] The element selection subunit is configured to select at least one target painting element and its target layer corresponding to the at least one target local contour area from multiple layers in response to the overall contour area including the at least one target local contour area.

[0365] Optionally, the contour obtaining unit is specifically used to:

[0366] A binary image of the target painting object and a binary image of the painting elements contained in each layer are obtained. The binary image of the target painting object is used to indicate the overall contour area of ​​the target painting object, and the binary image of the painting elements contained in each layer is used to indicate the local contour area of ​​the corresponding painting element.

[0367] Optionally, the drawing image interface has a transparency channel, and the contour obtaining unit is specifically used to:

[0368] Obtain a binary mask corresponding to the transparency channel of the target painting object and a binary mask corresponding to the transparency channel of the painting elements contained in each layer. The binary mask corresponding to the transparency channel of the target painting object is used to indicate the overall contour area of ​​the target painting object, and the binary mask corresponding to the transparency channel of the painting elements contained in each layer is used to indicate the local contour area of ​​the painting elements.

[0369] Optionally, the binary image of the target painting object uses pixel points with binary values ​​of 1 to represent the overall contour area of ​​the target painting object, and uses pixel points with binary values ​​of 0 to represent other areas of the painting image interface except the overall contour area. In the binary image of the painting elements contained in each layer, the local contour area of ​​the painting element's location is represented by pixel points with binary values ​​of 1, and the other areas of the layer except the local contour area are represented by pixel points with binary values ​​of 0. The determining subunit is specifically used for:

[0370] An AND operation is performed on the pixel values ​​of corresponding pixel points of the binary image of the target painting object and the binary images of the painting elements contained in the target layer in the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 1 in the operation result image, the overall contour area includes the target local contour area corresponding to the target painting element; when the pixel points with binary values ​​of all the pixel points in the operation result image are binary 0, the overall contour area does not include the target local contour area corresponding to the target painting element.

[0371] Optionally, the binary image of the target painting object uses pixel points with binary values ​​of 0 to represent the overall contour area of ​​the target painting object, and uses pixel points with binary values ​​of 1 to represent other areas of the painting image interface except the overall contour area. In the binary image of the painting elements contained in each layer, the local contour area of ​​the painting element's location is represented by pixel points with binary values ​​of 0, and the other areas of the layer except the local contour area are represented by pixel points with binary values ​​of 1. The determining subunit is specifically used for:

[0372] An AND operation is performed on the pixel values ​​of corresponding pixel points of the binary image of the target painting object and the binary images of the painting elements contained in the target layer in the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 0 in the operation result image, the overall contour area includes the target local contour area corresponding to the target painting element; when the pixel values ​​in the operation result image are all binary values ​​of 1, the overall contour area does not include the target local contour area corresponding to the target painting element.

[0373] Optionally, the binary mask of the transparency channel of the target painting object uses pixels with binary values ​​of 1 to represent the overall contour area of ​​the target painting object, and uses pixels with binary values ​​of 0 to represent areas other than the overall contour area in the painting image interface. The binary mask of the painting elements contained in each layer uses pixels with binary values ​​of 1 to represent the local contour area of ​​the painting element, and uses pixels with binary values ​​of 0 to represent areas other than the local contour area in the layer. The determining subunit is specifically used for:

[0374] An AND operation is performed on the pixel values ​​of corresponding pixels of the binary mask of the target painting object and the binary masks of the painting elements contained in the target layer in the multiple layers to obtain an operation result image, wherein when there are pixels with binary values ​​of 1 in the operation result image, the overall contour area includes the target local contour area corresponding to the target painting element; when the pixel values ​​in the operation result image are all binary values ​​of 0, the overall contour area does not include the target local contour area corresponding to the target painting element.

[0375] Optionally, the binary mask of the transparency channel of the target painting object uses pixel points with binary values ​​of 0 to represent the overall contour area of ​​the target painting object, and uses pixel points with binary values ​​of 1 to represent other areas of the painting image interface except the overall contour area. In the binary image of the painting elements contained in each layer, the local contour area of ​​the painting element is represented by pixel points with binary values ​​of 0, and the other areas of the layer except the local contour area are represented by pixel points with binary values ​​of 1. The determining subunit is specifically used for:

[0376] An AND operation is performed on the pixel values ​​of corresponding pixels of the binary mask of the transparency channel of the target painting object and the binary mask of the transparency channel of the painting element contained in the target layer in multiple layers to obtain an operation result image, wherein when there are pixels with binary values ​​of 0 in the operation result image, the overall contour area includes the target local contour area corresponding to the target painting element; when the pixel values ​​in the operation result image are all binary values ​​of 1, the overall contour area does not include the target local contour area corresponding to the target painting element.

[0377] Optionally, the element selection subunit is specifically used to:

[0378] In response to the overall contour area including at least one target local contour area, determining at least one target painting element identifier corresponding to the at least one target local contour area;

[0379] At least one target drawing element and its target layer corresponding to at least one target drawing element identifier are selected from multiple layers.

[0380] An embodiment of this specification also provides a computer storage medium, wherein the computer storage medium stores computer instructions, which, when the computer instructions are executed on a computer, enable the computer to execute the methods described in Figures 4-5, 8-9, 11, 13, 15, 17-19, 24-27, and 29-30.

[0381] An embodiment of the present specification provides a computer program product, which includes computer instructions. When the computer instructions are executed on a computer, the computer executes the methods described in Figures 4-5, 8-9, 11, 13, 15, 17-19, 24-27, and 29-30.

[0382] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of this specification is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid state drive (SSD).

[0383] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. A method for selecting a painting object, characterized in that: The method comprises: Displaying a painting image interface, wherein the painting image interface includes a picture displayed in combination of multiple layers; Detecting a user's frame selection operation on a target area on the drawing image interface; In response to the frame selection operation, identifying a target painting object in the target area; At least one target painting element and the target layer corresponding to the target painting object are selected from the multiple layers.

2. The method according to claim 1, characterized in that After detecting that the user performs a frame selection operation on the target area on the drawing image interface, the method further includes: A box selection operation identifier corresponding to the box selection operation is displayed on the drawing image interface.

3. The method according to claim 2, characterized in that The box selection operation identifier is a box selection track identifier corresponding to the box selection operation.

4. The method according to claim 3, characterized in that The frame selection track identifier includes any of the following: When the box selection operation is box selection based on a rectangular box, the box selection track identifier is a rectangular track identifier; When the box selection operation is box selection based on a circular box, the box selection track identifier is a circular track identifier; When the box selection operation is box selection based on an elliptical box, the box selection track identifier is an elliptical track identifier; When the box selection operation is box selection based on a triangle box, the box selection track identifier is a triangle track identifier.

5. The method according to claim 3, characterized in that: The frame selection trajectory mark is the outline mark of the target painting object.

6. The method according to claim 1, characterized in that After selecting at least one target painting element corresponding to the target painting object and the target layer in which it is located from the multiple layers, the method further includes: The target layer and other layers in the multiple layers are displayed differentially.

7. The method according to claim 6, characterized in that Displaying the target layer and other layers in the multiple layers differently includes: Adjusting the arrangement order of the target layer to the first M positions among the multiple layers, where M is equal to the number of the target layers; The target layer located in the first M positions is displayed differentially from the other layers.

8. The method according to claim 6 or 7, characterized in that: The method further comprises: In the target layer, the selected target painting element is displayed.

9. The method according to claim 8, characterized in that The target layer also includes other painting elements. In the target layer, displaying the target painting elements included therein includes: In the target layer, the target painting element and the other painting elements are displayed differently.

10. The method according to claim 4, characterized in that The method further comprises: Based on the correspondence between the box selection operation and the drawing object operation, determining the drawing object operation corresponding to the box selection operation; A drawing object operation corresponding to the frame selection operation is applied to the selected target drawing object.

11. The method according to claim 1, characterized in that: In response to the frame selection operation, identifying a target painting object in the target area includes: In response to the frame selection operation, generating an image sample to be identified corresponding to the target area; The image sample to be identified is input into a painting object recognition model to identify the target painting object.

12. The method according to any one of claims 1 to 11, characterized in that: Selecting at least one target painting element corresponding to the target painting object and the target layer in the multiple layers includes: Obtaining an overall contour area of ​​the target painting object and a local contour area of ​​the painting elements contained in each of the multiple layers, wherein the overall contour area is used to indicate a closed area formed by the edge of the target painting object, and the local contour area is used to indicate a closed area formed by the edge of the painting element; In response to the overall contour area including at least one target local contour area among the plurality of local contour areas, the at least one target painting element corresponding to the at least one target local contour area and the target layer are selected from the plurality of layers.

13. The method according to claim 12, characterized in that In response to the overall contour area including at least one target local contour area among the plurality of local contour areas, selecting at least one target painting element corresponding to the at least one target local contour area and the target layer from the plurality of layers, comprising: determining whether the overall contour region includes the at least one target local contour region among the plurality of local contour regions; In response to the overall contour region including the at least one target local contour region, the at least one target local contour region is selected from the plurality of layers. The at least one target painting element corresponding to the target local contour area and the target layer to which it belongs.

14. The method according to claim 13, characterized in that Obtaining the overall contour area of ​​the target painting object and the local contour area of ​​the painting elements contained in each of the multiple layers, including: A binary image of the target painting object and a binary image of the painting elements contained in each layer are obtained, wherein the binary image of the target painting object is used to indicate the overall contour area of ​​the position of the target painting object, and the binary image of the painting elements contained in each layer is used to indicate the local contour area of ​​the corresponding painting element.

15. The method according to claim 13, characterized in that The painting image interface has a transparency channel, and obtaining the overall contour area of ​​the target painting object and the local contour area of ​​the painting elements contained in each layer of the multiple layers includes: A binary mask corresponding to the transparency channel of the target painting object and a binary mask corresponding to the transparency channel of the painting elements contained in each layer are obtained, wherein the binary mask corresponding to the transparency channel of the target painting object is used to indicate the overall contour area of ​​the position of the target painting object, and the binary mask corresponding to the transparency channel of the painting elements contained in each layer is used to indicate the local contour area of ​​the position of the painting elements.

16. The method according to claim 14, characterized in that The binary image of the target painting object represents the overall contour area at the location of the target painting object by using pixel points with binary values ​​of 1, and represents other areas in the painting image interface except the overall contour area by using pixel points with binary values ​​of 0, and the local contour area at the location of the painting element is represented by pixel points with binary values ​​of 1 in the binary image of the painting element contained in each layer, and represents other areas in the layer except the local contour area by using pixel points with binary values ​​of 0, and determining whether the overall contour area includes at least one target local contour area among the multiple local contour areas includes: An AND operation is performed on the pixel values ​​of corresponding pixel points of the binary image of the target painting object and the binary image of the painting elements included in the target layer among the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 1 in the operation result image, it is represented that the overall contour area includes the target local contour area corresponding to the target painting element; when the pixel values ​​in the operation result image are all binary values ​​of 0, it is represented that the overall contour area does not include the target local contour area corresponding to the target painting element.

17. The method according to claim 14, characterized in that The binary image of the target painting object represents the overall contour area at the location of the target painting object by using pixel points with binary values ​​of 0, and represents other areas in the painting image interface except the overall contour area by using pixel points with binary values ​​of 1, and the local contour area at the location of the painting element is represented by pixel points with binary values ​​of 0 in the binary image of the painting element contained in each layer, and represents other areas in the layer except the local contour area by using pixel points with binary values ​​of 1, and determining whether the overall contour area includes at least one target local contour area among the multiple local contour areas includes: An AND operation is performed on the pixel values ​​of corresponding pixel points of the binary image of the target painting object and the binary image of the painting elements included in the target layer among the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 0 in the operation result image, it is represented that the overall contour area includes the target local contour area corresponding to the target painting element; when the pixel values ​​in the operation result image are all binary 1, it is represented that the overall contour area does not include the target local contour area corresponding to the target painting element.

18. The method according to claim 15, characterized in that The binary mask of the transparency channel of the target painting object represents the overall contour area at the location of the target painting object by using pixel points with binary values ​​of 1, and represents other areas in the painting image interface except the overall contour area by using pixel points with binary values ​​of 0, and the binary mask of the painting elements contained in each layer represents the local contour area at the location of the painting element by using pixel points with binary values ​​of 1, and represents other areas in the layer except the local contour area by using pixel points with binary values ​​of 0, and determining whether the overall contour area includes at least one target local contour area among the multiple local contour areas includes: An AND operation is performed on the pixel values ​​of corresponding pixel points of the binary mask of the target painting object and the binary mask of the painting element included in the target layer among the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 1 in the operation result image, it is represented that the overall contour area includes the target local contour area corresponding to the target painting element; when the pixel values ​​in the operation result image are all binary values ​​of 0, it is represented that the overall contour area does not include the target local contour area corresponding to the target painting element.

19. The method according to claim 15, characterized in that The binary mask of the transparency channel of the target painting object represents the overall contour area at the location of the target painting object by using pixel points with binary values ​​of 0, and represents other areas in the painting image interface except the overall contour area by using pixel points with binary values ​​of 1, and the local contour area at the location of the painting element is represented by pixel points with binary values ​​of 0 in the binary image of the painting element contained in each layer, and represents other areas in the layer except the local contour area by using pixel points with binary values ​​of 1, and determining whether the overall contour area includes at least one target local contour area among the multiple local contour areas includes: An AND operation is performed on the pixel values ​​of corresponding pixel points of the binary mask of the transparency channel of the target painting object and the binary mask of the transparency channel of the painting element included in the target layer among the multiple layers to obtain an operation result image, wherein when there are pixel points with binary values ​​of 0 in the operation result image, it is represented that the overall contour area includes the target local contour area corresponding to the target painting element; when the pixel values ​​in the operation result image are all binary 1, it is represented that the overall contour area does not include the target local contour area corresponding to the target painting element.

20. The method according to any one of claims 13 to 19, characterized in that: In response to the overall contour area including the at least one target local contour area, selecting the at least one target painting element corresponding to the at least one target local contour area and the target layer from the multiple layers, comprising: In response to the overall contour region including the at least one target local contour region, determining at least one target painting element identifier corresponding to the at least one target local contour region; The at least one target painting element and the target layer corresponding to the at least one target painting element identifier are selected from the multiple layers.

21. An electronic device, characterized in that: The electronic device comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the steps of the method as claimed in any one of claims 1 to 20.

22. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed in a computer, the computer is caused to execute the steps of the method according to any one of claims 1 to 20.

23. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed on a computer, the computer is caused to perform the steps of the method according to any one of claims 1 to 20.

Citation Information

Patent Citations

  • Primitive selection method and device and electronic equipment

    CN111737800A

  • Drawing support tool for monitoring control screen of monitoring control system

    JP2009151490A