Image editing method and control device, storage medium, and computer equipment
By using display canvas, drawing canvas and recording canvas in image editing, recording the area and type selected by the user, and using the server-side image recognition algorithm to process the images, the complex and time-consuming problem of image editing in the prior art is solved, and the realization of the realization of image editing Efficient and intelligent image editing.
Patent Information
- Application Number
- CN202011555506.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-24
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2040-12-24
AI Technical Summary
The prior art requires the user to perform at least two operations when retaining and removing the original image, and the server needs to be run twice, resulting in the image editing process being complex, time-consuming and inefficient.
By creating display canvas, drawing canvas and recording canvas, users can select reserved areas and remove areas on the original image, record the movement trajectory of the canvas record operation tool and its area type, and the server side uses image recognition algorithm to use the original based on the information of the recording canvas. The image is processed.
It realizes that users complete all image editing operations at one time, simplifies the image editing operation process, saves time, improves image editing efficiency, and realizes the intelligent image cutting function.
Smart Images

Figure CN112686973B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image editing applications, and in particular relates to an image editing method and control device, a storage medium, and a computer device. Background Art
[0002] At present, when the original image is simultaneously retained and removed for editing, the following steps are required: first, a retention area is selected on the original image, and the background server performs the first processing; then, a removal area is selected on the image after the first processing, and the background server performs the second processing. Therefore, the user needs to perform at least two operations, and the server needs to run twice to obtain the target image, which makes the image editing process complicated and time-consuming, resulting in low image editing efficiency.
[0003] In addition, although it is possible to edit images using browser plug-ins such as flash, after installing the corresponding plug-in, users can draw new graphics or images on the original image. However, the plug-in method requires users to install the corresponding plug-in on the client before using it, which brings inconvenience to user operation and lacks flexibility in programming operation. Summary of the invention
[0004] In view of the above problems, the present invention provides an image editing method and control device, a storage medium and a computer device.
[0005] In a first aspect, the present invention provides an image editing method, comprising the following steps:
[0006] In response to receiving a command to start editing an original image, creating a display canvas, a drawing canvas, and a recording canvas for editing the original image, wherein the display canvas, the drawing canvas, and the recording canvas are stacked on top of each other;
[0007] In response to receiving a selection operation instruction for selecting an area on the original image, the following steps are performed:
[0008] On the display canvas, a real-time position of an operating tool used to select an area on the original image is displayed;
[0009] On the drawing canvas, dynamically presenting the movement trajectory of the operating tool according to the change of the position of the operating tool on the display canvas over time;
[0010] On the recording canvas, each area and its area type encircled by the moving track of the operating tool on the drawing canvas are recorded, wherein the area type of each area is correspondingly defined as a removal area or a retention area according to the operation type of the selection operation instruction for selecting the area, and the selection operation instruction is divided into a removal area instruction and a retention area instruction according to the operation type;
[0011] The information of the recording canvas and the information of the original image are collected to perform image processing on the original image according to the information of the recording canvas and the information of the original image, and to display the image processing result of the original image.
[0012] According to an embodiment of the present invention, preferably, the collecting the information of the recording canvas and the information of the original image for performing image processing on the original image according to the information of the recording canvas and the information of the original image comprises the following steps:
[0013] The information of the recorded canvas and the information of the original image are converted into corresponding data codes, and the data codes are sent to a server so that the image processing software set on the server can perform image processing on the original image; wherein the image processing includes the following steps:
[0014] Restoring the original image according to the data encoding and determining a selected retaining area and / or removal area on the original image;
[0015] An image recognition algorithm is used to identify the target object in the selected retention area and / or removal area on the original image, and the target object is retained and / or removed accordingly.
[0016] According to an embodiment of the present invention, preferably, dynamically presenting the movement track of the operating tool on the drawing canvas according to the change of the position of the operating tool on the display canvas over time comprises the following steps:
[0017] On the drawing canvas, lines of different colors are used to present the movement trajectory of the operating tool when executing selection operation instructions of different operation types.
[0018] According to an embodiment of the present invention, preferably, the method further comprises the following steps:
[0019] In response to receiving an erase operation instruction to erase the movement trajectory, a line of a color different from the movement trajectory is used on the drawing canvas to dynamically present the movement trajectory of the operating tool when executing the erase operation instruction.
[0020] According to an embodiment of the present invention, preferably, recording each area and its area type delineated by the moving track of the operating tool on the drawing canvas comprises the following steps:
[0021] A plurality of lines of different colors are used to present the movement track of the operating tool on the recording canvas when executing the selection operation instructions of different operation types, and a color different from the plurality of lines of different colors is used to paint the area on the recording canvas except the movement track.
[0022] According to an embodiment of the present invention, preferably, lines of a first color are used to present the movement trajectory of the operating tool when executing a remove area instruction, lines of a second color are used to present the movement trajectory of the operating tool when executing a retain area instruction, and a third color is used to paint the area on the recording canvas excluding the movement trajectory.
[0023] According to an embodiment of the present invention, preferably, in response to receiving an erase operation instruction to erase the movement trajectory, the movement trajectory of the operating tool on the recording canvas when executing the erase operation instruction is recorded using a color used to coat the area on the recording canvas excluding the movement trajectory.
[0024] In a second aspect, the present invention provides an image editing control device, comprising:
[0025] A creation module, configured to create, in response to receiving a command to start editing an original image, a display canvas, a drawing canvas, and a recording canvas for editing the original image, wherein the display canvas, the drawing canvas, and the recording canvas are stacked on top of each other;
[0026] The editing module is configured to, in response to receiving a selection operation instruction for selecting an area on the original image, perform the following steps:
[0027] On the display canvas, a real-time position of an operating tool used to select an area on the original image is displayed;
[0028] On the drawing canvas, dynamically presenting the movement trajectory of the operating tool according to the change of the position of the operating tool on the display canvas over time;
[0029] On the recording canvas, each area and its area type encircled by the moving track of the operating tool on the drawing canvas are recorded, wherein the area type of each area is correspondingly defined as a removal area or a retention area according to the operation type of the selection operation instruction for selecting the area, and the selection operation instruction is divided into a removal area instruction and a retention area instruction according to the operation type;
[0030] The collection module is used to collect the information of the recording canvas and the information of the original image, so as to perform image processing on the original image according to the information of the recording canvas and the information of the original image, and display the image processing result of the original image.
[0031] In a third aspect, the present invention provides a storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.
[0032] In a fourth aspect, the present invention provides a computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, and the computer program implements the steps of the above method when executed by the processor.
[0033] Compared with the prior art, one or more embodiments of the above scheme may have the following advantages or beneficial effects:
[0034] 1) When selecting an area on the original image, the image editing method of this embodiment records the various areas and their area types delineated by the moving trajectory of the operating tool on the drawing canvas on the recording canvas, and can arbitrarily select a retaining area and a removal area on a given original image, and then generate a new image according to the retaining area and the removal area selected by the user through an algorithm, so that the user can complete all image editing operations at one time, and the original image is processed at one time according to all the image editing operations of the user through the algorithm, which simplifies the image editing operation process, saves image editing operation time, and improves image editing efficiency;
[0035] 2) In the image editing method of this embodiment, the image editing software on the server side uses the background in the recorded canvas as the base map of the original image, determines the reserved area and the removed area on the original image according to their positions in the recorded canvas, and calls the image recognition algorithm to identify the target objects in the reserved area and the removed area on the original image, and performs corresponding retention and removal processing on the target objects in the original image, so that the user only needs to simply delimit the reserved area and the removed area to accurately cut out the target objects in the reserved area and the removed area, thereby realizing intelligent cutting out;
[0036] 3) The image editing method of this embodiment uses lines of different colors on the drawing canvas to present the movement trajectory of the operating tool when selecting the reserved area and removing the area, and presents the operations of selecting the reserved area and removing the area differently, which not only improves the user's visual experience, but also allows the user to judge whether his operation is in line with his original intention based on the color, thereby playing a role in error correction;
[0037] 4) In the image editing method of this embodiment, on the drawing canvas, a line of a color different from the moving track is used to dynamically present the movement track of the operating tool when executing the erasing operation instruction, so that the erasing operation can be effectively presented through the drawing canvas, that is, the erasing operation is presented in a color different from the boundary lines of the retained area and the removed area, which not only improves the user's visual experience, but also can remind the user whether the operation is consistent with his or her original intention;
[0038] 5) In the image editing method of this embodiment, when the first color, the second color and the third color are black, white and gray respectively, the recording canvas is a black, white and gray three-color image, which can more conveniently and quickly convert the recording canvas into a data code, thereby saving time for image editing;
[0039] 6) In the image editing method of the present embodiment, on the recording canvas, the color used to coat the area on the recording canvas excluding the moving trajectory is used to record the movement trajectory of the operating tool on the recording canvas when executing the erase operation instruction, and the moving trajectory used to select the retained area and / or the removed area is undone, thereby adjusting the selected retained area and / or the removed area, so that in one operation of image editing, the retained area and / or the removed area can be arbitrarily selected, and the selected retained area and / or the removed area can also be canceled, thereby simplifying the image editing process and improving the image editing efficiency.
[0040] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0042] Figure 1 A flowchart of an image editing method according to an embodiment of the present invention is shown;
[0043] Figure 2 A flowchart of an image editing method according to a second embodiment of the present invention is shown;
[0044] Figure 3 A flowchart of an image editing method according to a third embodiment of the present invention is shown;
[0045] Figure 4 A schematic diagram showing the effect of the moving track of the operating tool presented to the user on the drawing canvas in the third embodiment of the present invention;
[0046] Figure 5 FIG. 4 is a schematic diagram of the effect of the movement trajectory of the operating tool recorded on the three-color canvas according to the third embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will describe the implementation methods of the present invention in detail with reference to the accompanying drawings and embodiments, so that the implementation process of how the present invention applies technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. It should be noted that as long as there is no conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other, and the technical solutions formed are all within the protection scope of the present invention.
[0048] Embodiment 1
[0049] In order to solve the above technical problems existing in the prior art, an embodiment of the present invention provides an image editing method.
[0050] Reference Figure 1 The image editing method of this embodiment includes the following steps:
[0051] S110, in response to receiving a command to start editing the original image, creating a display canvas, a drawing canvas, and a recording canvas for editing the original image, wherein the display canvas, the drawing canvas, and the recording canvas are stacked on top of each other;
[0052] S120, determining in real time whether a selection operation instruction for selecting an area on the original image is received:
[0053] If yes, execute step S130;
[0054] If not, no response will be given;
[0055] S130, on the display canvas, displaying the real-time position of the operating tool used to select an area on the original image; on the drawing canvas, dynamically presenting the movement trajectory of the operating tool according to the change of the position of the operating tool on the display canvas over time; on the recording canvas, recording each area and its area type delineated by the movement trajectory of the operating tool on the drawing canvas, wherein the area type of each area is correspondingly defined as a removal area or a retention area according to the operation type of the selection operation instruction for selecting the area, and the selection operation instruction is divided into a removal area instruction and a retention area instruction according to the operation type;
[0056] S140, converting the information of the recorded canvas and the information of the original image into corresponding data codes, and sending the data codes to the server, so that the image processing software set on the server can process the original image and display the image processing result of the original image, wherein the data code is binary data or base64 string.
[0057] Wherein, in step S120, the operating tool includes but is not limited to a mouse and a stylus.
[0058] In step S130, the operation type includes selecting a removal area and selecting a retention area. The area type of each area is defined as a removal area or a retention area according to the operation type of the selection operation instruction for selecting the area. The selection operation instruction is divided into a removal area instruction and a retention area instruction according to the operation type, and includes the following steps:
[0059] When the selection operation instruction for selecting the area is a remove area instruction, the operation type is select remove area, and the area type is remove area;
[0060] When the selection operation instruction for selecting the area is a reserved area instruction, the operation type is selecting a reserved area, and the area type is a reserved area.
[0061] In step S140, the information of the recorded canvas includes a reserved area and a removed area on the recorded canvas.
[0062] The image editing method of this embodiment can arbitrarily select the retained area and the removed area on a given original image through the mouse, and then generate a new image according to the retained area and the removed area selected by the user through the algorithm, so that the user can complete all image editing operations at one time, and the original image can be processed at one time according to all the image editing operations of the user through the algorithm, thereby simplifying the image editing operations and saving time and effort.
[0063] The image editing method of this embodiment uses lines of different colors on the drawing canvas to present the movement trajectory of the operating tool when selecting the retained area and removing the area, and presents the operations of selecting the retained area and removing the area differently, which not only improves the user's visual experience, but also allows the user to judge whether his or her operations are in line with his or her original intention based on the color, thereby playing a role in error correction.
[0064] Embodiment 2
[0065] In order to solve the above-mentioned technical problems existing in the prior art, an embodiment of the present invention provides an image editing method based on embodiment one, wherein, in this embodiment, lines of different colors are used to present the movement trajectory of the operating tool when executing selection operation instructions of different operation types.
[0066] S210, in response to receiving a command to start editing the original image, creating a display canvas, a drawing canvas, and a recording canvas for editing the original image, wherein the display canvas, the drawing canvas, and the recording canvas are stacked on top of each other;
[0067] S220, determining in real time whether a selection operation instruction for selecting an area on the original image is received:
[0068] If yes, execute step S230;
[0069] If not, no response will be given;
[0070] S230, on the display canvas, displaying the real-time position of the operating tool used to select an area on the original image; on the drawing canvas, using lines of different colors to present the movement trajectory of the operating tool when executing selection operation instructions of different operation types; on the recording canvas, using multiple lines of different colors to present the movement trajectory of the operating tool on the recording canvas when executing selection operation instructions of different operation types, and using a color different from the multiple lines of different colors to paint the area on the recording canvas except the movement trajectory;
[0071] S240, determining in real time whether an erase operation instruction for erasing the movement track is received:
[0072] If yes, execute step S250;
[0073] If not, no response will be given;
[0074] S250, on the drawing canvas, dynamically presenting the movement trajectory of the operating tool when executing the erase operation instruction by using a line of a color different from the movement trajectory; on the recording canvas, recording the movement trajectory of the operating tool when executing the erase operation instruction on the recording canvas by using a color used to coat the area on the recording canvas excluding the movement trajectory;
[0075] S260, converting the information of the recorded canvas and the information of the original image into corresponding data codes, and sending the data codes to the server;
[0076] S270, the image processing software installed on the server restores the original image according to the data encoding and determines the selected retained area and / or removed area on the original image; uses the image recognition algorithm to identify the target object in the selected retained area and / or removed area on the original image, and retains and / or removes the target object accordingly, and displays the image processing result of the original image.
[0077] Among them, in step S230, in the recording canvas, lines of the first color are used to present the movement trajectory of the operating tool when executing the remove area instruction, lines of the second color are used to present the movement trajectory of the operating tool when executing the retain area instruction, and the third color is used to paint the area on the recording canvas except the movement trajectory. For example, the first color, the second color and the third color can be black, white and gray respectively.
[0078] In step S270, the image recognition algorithm includes but is not limited to an AI algorithm.
[0079] In particular, when the image editing method of this embodiment is applied to a web browser, the display canvas, the drawing canvas and the recording canvas are all canvases.
[0080] In the image editing method of the present embodiment, when black lines are used to present the movement trajectory of the operating tool when executing the remove area instruction, white lines are used to present the movement trajectory of the operating tool when executing the retain area instruction, and gray is used to cover the area on the recording canvas excluding the movement trajectory, the recording canvas is made into a black, white and gray three-color image, which can more conveniently and quickly convert the recording canvas into data encoding, thereby saving time in image editing.
[0081] In the image editing method of the present embodiment, on the drawing canvas, lines of a color different from the moving trajectory are used to dynamically present the movement trajectory of the operating tool when executing the erasing operation instruction. The erasing operation can be effectively presented through the drawing canvas, that is, the erasing operation is presented in a color different from the boundary lines of the retained area and the removed area. This not only improves the user's visual experience, but also can remind the user whether the operation is consistent with his or her original intention.
[0082] In the image editing method of the present embodiment, on the recording canvas, the movement trajectory of the operating tool on the recording canvas when executing the erase operation instruction is recorded by using the color used to coat the area on the recording canvas excluding the movement trajectory, and the movement trajectory used to select the retained area and / or the removed area is undone, thereby adjusting the selected retained area and / or the removed area, so that in one operation of image editing, the retained area and / or the removed area can be arbitrarily selected, and the selected retained area and / or the removed area can also be canceled, thereby simplifying the image editing process and improving the image editing efficiency.
[0083] In the image editing method of this embodiment, the image editing software on the server side uses the background in the recorded canvas as the base map of the original image to determine the retained area and the removed area on the original image according to their positions in the recorded canvas, and calls the AI algorithm to identify the target objects in the retained area and the removed area on the original image, and performs corresponding retention and removal processing on the target objects in the original image, so that the user only needs to simply delineate the retained area and the removed area to accurately cut out the target objects in the retained area and the removed area, thereby realizing intelligent cutout.
[0084] Embodiment 3
[0085] In order to solve the above technical problems existing in the prior art, the embodiment of the present invention provides an image editing method applied to a web browsing terminal based on the first embodiment.
[0086] Reference Figure 3The image editing method of this embodiment includes the following steps:
[0087] When the user selects the retaining area and removing area on the specified image by mouse, the web application will create three canvases in the process. These three canvases are drawing canvas, black and white gray three-color canvas and white transparent canvas, and draw different images on the canvas. After the selection is completed, click the Generate button to convert the original image and the three-color image into binary data and pass it to the server program. The server then calls the AI algorithm to generate the modified image. Specifically, canvas provides a JavaScript and HTML <canvas>Elements are used to draw graphics. It can be used for animation, game screens, data visualization, image editing, and real-time video processing.
[0088] The detailed steps of the above image editing method are as follows:
[0089] Initialize and load the original image, and create three canvas tags (each canvas is equivalent to a canvas), namely:
[0090] A white transparent canvas is used to show the moving position of the operating tool;
[0091] Drawing canvas, used to visually present the user's operation process;
[0092] Three-color canvas, generates black, white and gray renderings, with the background filled with gray, which is used to pass parameters to the backend server;
[0093] Click the "Keep" and "Remove" buttons on the web page to select the area to keep and the area to remove on the original image. The web application needs to handle the mouse press, move, and lift events. During the mouse movement process, drawings are drawn on the three canvases respectively. Finally, a complete interactive effect is presented to the user:
[0094] On the white transparent canvas, when selecting the operation of retaining the area, a blue dot can be used to accompany the movement of the operation tool. When selecting the operation of removing the area, a red origin can be used to accompany the movement of the operation tool.
[0095] When you hold down the mouse and move it, the mouse movement track can be displayed in blue on the drawing canvas when the operation of retaining the area is selected, and the mouse movement track can be displayed in red when the operation of removing the area is selected, such as Figure 4 As shown;
[0096] When you hold down the mouse and move it, the mouse movement track can be recorded in white on the three-color canvas when the operation of retaining the area is selected, and the mouse movement track can be recorded in black when the operation of removing the area is selected, such as Figure 5 As shown;
[0097] When you click the "Erase" button, along with the mouse being pressed and moved, you need to erase the image on the canvas:
[0098] On a white transparent canvas, you can use a white origin to accompany the movement of the operating tool;
[0099] On the drawing canvas, when you press the mouse and move it, you can use the white origin to accompany the movement of the operating tool and erase the previous movement track of the operating tool;
[0100] On the three-color canvas, when you press the mouse and move, you can use the gray origin to accompany the movement of the operating tool and erase the previous movement track of the operating tool;
[0101] Click the "Generate" button to convert the original image and the image on the three-color canvas into ArrayBuffer (binary data) respectively, and pass them to the server as parameters. The server calls the AI image processing algorithm to generate the processed image, returns the result to the browser and displays it.
[0102] It should be noted that the setting of the globalCompositeOperation property of the context object in the canvas, when retaining and removing operations, needs to be set to "source-over", the new graphic will cover the original content, so that the lines used to select the retaining area and the removal area will cover the original image; when erasing operations, it needs to be set to "destination-out", so that the part of the original content that does not overlap with the new graphic will be retained.
[0103] In the image editing method of this embodiment, the user only needs to arbitrarily select the areas to be retained and removed on the web network to implement image editing, thereby reducing the difficulty of image editing for the user.
[0104] In the image editing method of this embodiment, canvas technology is used to easily draw various graphics on the web page, and the user's interaction process can be visually displayed, and the operation data is passed to the server-side program for processing, which greatly facilitates image processing on the web side.
[0105] Embodiment 4
[0106] In order to solve the above technical problems existing in the prior art, an embodiment of the present invention further provides an image editing control device.
[0107] The image editing control device of this embodiment includes:
[0108] A creation module, configured to create, in response to receiving a command to start editing an original image, a display canvas, a drawing canvas, and a recording canvas for editing the original image, wherein the display canvas, the drawing canvas, and the recording canvas are stacked on top of each other;
[0109] The editing module is configured to, in response to receiving a selection operation instruction for selecting an area on the original image, perform the following steps:
[0110] On the display canvas, a real-time position of an operating tool used to select an area on the original image is displayed;
[0111] On the drawing canvas, dynamically presenting the movement trajectory of the operating tool according to the change of the position of the operating tool on the display canvas over time;
[0112] On the recording canvas, each area and its area type encircled by the moving track of the operating tool on the drawing canvas are recorded, wherein the area type of each area is correspondingly defined as a removal area or a retention area according to the operation type of the selection operation instruction for selecting the area, and the selection operation instruction is divided into a removal area instruction and a retention area instruction according to the operation type;
[0113] The collection module is used to collect the information of the recording canvas and the information of the original image, so as to perform image processing on the original image according to the information of the recording canvas and the information of the original image, and display the image processing result of the original image.
[0114] Embodiment 5
[0115] In order to solve the above technical problems existing in the prior art, an embodiment of the present invention further provides a storage medium.
[0116] The storage medium of this embodiment stores a computer program, which, when executed by a processor, implements the steps of the image editing method in the above embodiment.
[0117] The beneficial effects of the storage medium provided by the embodiment of the present invention are the same as the beneficial effects of the above-mentioned image editing method, which will not be described in detail here.
[0118] Embodiment 6
[0119] In order to solve the above technical problems existing in the prior art, an embodiment of the present invention further provides a computer device.
[0120] The computer device of this embodiment includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the steps of the image editing method in the above embodiment are implemented.
[0121] The processor described in the embodiment of the present invention may be a processor or a collective term for multiple processing elements. For example, the processor may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (FPGAs).
[0122] The memory may be a storage device or a collective term for multiple storage elements, and is used to store executable program codes, etc. The memory may include random access memory (RAM) or non-volatile memory (non-volatile memory), such as disk storage, flash memory, etc.
[0123] Although the embodiments disclosed in the present invention are as above, the contents described are only embodiments adopted for facilitating the understanding of the present invention and are not intended to limit the present invention. Any technician in the technical field to which the present invention belongs can make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in the present invention, but the protection scope of the present invention shall still be subject to the scope defined in the attached claims.< / canvas>
Claims
1. An image editing method, characterized in that: The following steps are involved: In response to receiving a command to start editing an original image, creating a display canvas, a drawing canvas, and a recording canvas for editing the original image, wherein the display canvas, the drawing canvas, and the recording canvas are stacked on top of each other; In response to receiving a selection operation instruction for selecting an area on the original image, the following steps are performed: On the display canvas, displaying the real-time position of the operating tool used to select an area on the original image; On the drawing canvas, dynamically presenting the movement trajectory of the operating tool according to the change of the position of the operating tool on the display canvas over time; On the recording canvas, each area and its area type encircled by the moving track of the operating tool on the drawing canvas are recorded, wherein the area type of each area is correspondingly defined as a removal area or a retention area according to the operation type of the selection operation instruction for selecting the area, and the selection operation instruction is divided into a removal area instruction and a retention area instruction according to the operation type; The information of the recording canvas and the information of the original image are collected to perform image processing on the original image according to the information of the recording canvas and the information of the original image, and to display the image processing result of the original image.
2. The method according to claim 1, characterized in that The collecting of the information of the recording canvas and the information of the original image for performing image processing on the original image according to the information of the recording canvas and the information of the original image comprises the following steps: The information of the recorded canvas and the information of the original image are converted into corresponding data codes, and the data codes are sent to a server so that the image processing software set on the server can perform image processing on the original image; wherein the image processing includes the following steps: Restoring the original image according to the data encoding and determining a selected retaining area and / or removal area on the original image; An image recognition algorithm is used to identify the target object in the selected retention area and / or removal area on the original image, and the target object is retained and / or removed accordingly.
3. The method according to claim 1, characterized in that The method of dynamically presenting the movement track of the operating tool on the drawing canvas according to the change of the position of the operating tool on the display canvas over time comprises the following steps: On the drawing canvas, lines of different colors are used to present the movement trajectory of the operating tool when executing selection operation instructions of different operation types.
4. The method according to claim 3, characterized in that The method further comprises the following steps: In response to receiving an erase operation instruction to erase the movement trajectory, a line of a color different from the movement trajectory is used on the drawing canvas to dynamically present the movement trajectory of the operating tool when executing the erase operation instruction.
5. The method according to claim 1, characterized in that: The recording of each area and its area type defined by the moving track of the operating tool on the drawing canvas comprises the following steps: A plurality of lines of different colors are used to present the movement track of the operating tool on the recording canvas when executing the selection operation instructions of different operation types, and a color different from the plurality of lines of different colors is used to paint the area on the recording canvas except the movement track.
6. The method according to claim 5, characterized in that: The moving track of the operating tool when executing the remove area command is presented using lines of the first color, the moving track of the operating tool when executing the retain area command is presented using lines of the second color, and the area on the recording canvas excluding the moving track is painted using a third color.
7. The method according to claim 5, characterized in that: In response to receiving an erase operation instruction to erase the movement track, the movement track of the operating tool on the recording canvas when executing the erase operation instruction is recorded using a color used to paint the area on the recording canvas except the movement track.
8. An image editing control device, characterized in that: include: A creation module, configured to create, in response to receiving a command to start editing an original image, a display canvas, a drawing canvas, and a recording canvas for editing the original image, wherein the display canvas, the drawing canvas, and the recording canvas are stacked on top of each other; The editing module is configured to, in response to receiving a selection operation instruction for selecting an area on the original image, perform the following steps: On the display canvas, displaying the real-time position of the operating tool used to select an area on the original image; On the drawing canvas, dynamically presenting the movement trajectory of the operating tool according to the change of the position of the operating tool on the display canvas over time; On the recording canvas, each area and its area type encircled by the moving track of the operating tool on the drawing canvas are recorded, wherein the area type of each area is correspondingly defined as a removal area or a retention area according to the operation type of the selection operation instruction for selecting the area, and the selection operation instruction is divided into a removal area instruction and a retention area instruction according to the operation type; The collection module is used to collect the information of the recording canvas and the information of the original image, so as to perform image processing on the original image according to the information of the recording canvas and the information of the original image, and display the image processing result of the original image.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, which implements the steps of the method according to any one of claims 1 to 7 when executed by the processor.
Citation Information
Patent Citations
Electronic equipment
CN102685374A
Image processing method and device
CN104574454A