CN113760414B - Method and device for drawing graph - Google Patents

Method and device for drawing graph Download PDF

Info

Publication number
CN113760414B
CN113760414B CN202010489250.1A CN202010489250A CN113760414B CN 113760414 B CN113760414 B CN 113760414B CN 202010489250 A CN202010489250 A CN 202010489250A CN 113760414 B CN113760414 B CN 113760414B
Authority
CN
China
Prior art keywords
preset
target
picture
area
drawable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010489250.1A
Other languages
Chinese (zh)
Other versions
CN113760414A (en
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010489250.1A priority Critical patent/CN113760414B/en
Publication of CN113760414A publication Critical patent/CN113760414A/en
Application granted granted Critical
Publication of CN113760414B publication Critical patent/CN113760414B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the disclosure provides a method and a device for drawing a graph. The method for drawing the graph comprises the following steps: firstly, displaying an acquired picture on a screen of a picture display end, and acquiring coordinates of preset points corresponding to the picture, wherein the preset points comprise points representing boundary positions of preset areas in the picture, then determining a closed boundary of the preset areas based on the coordinates of the preset points, determining a target drawable area in a target picture according to picture contents in the preset areas, finally, responding to a drawing operation executed by a user on the target drawable area, drawing a corresponding graph in the target drawable area, determining a drawing area based on the preset areas, enabling the target drawable area of each picture to be more visual, and enabling a user to quickly determine the positions of the target drawable areas, so that the user can directly execute drawing operation on the target drawable area, and user operation is saved.

Description

Method and device for drawing graph
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method and apparatus for drawing graphics.
Background
With the development of mobile communication electronic technology, mobile terminals typically represented by mobile phones nowadays have not only a function of remote communication, and users can take pictures through cameras on the mobile phones and edit pictures, and the like, browse web page pictures through browsers of the mobile phones and download the web page pictures to the mobile phone terminals. When the terminal displays the pictures to the user, the terminal can receive the processing operation of the user on each displayed picture directly, and displays the processed pictures according to the operation of the user.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for drawing a graph.
In a first aspect, embodiments of the present disclosure provide a method of drawing a graphic, the method comprising: displaying the acquired picture on a screen of a picture display end, and acquiring coordinates of preset points corresponding to the picture, wherein the preset points comprise points representing boundary positions of preset areas in the picture; determining a closed boundary of a preset area based on coordinates of preset points, and determining a target drawable area in a target picture according to picture content in the preset area; in response to detecting a drawing operation performed by a user on the target drawable region, a corresponding graphic is drawn within the target drawable region.
In some embodiments, determining a target renderable region in a target picture according to picture content within a preset region includes: and analyzing the picture content in a preset area in the picture, and determining a target drawable area corresponding to the picture content analysis result in the preset area in the picture according to the preset corresponding relation between the picture content and the position of the drawable area.
In some embodiments, the preset correspondence between the picture content and the location of the renderable region includes: the relation between the picture content and the position condition satisfied by the preset point in the drawable area; and determining a target drawable region corresponding to a picture content analysis result in a preset region in the picture, wherein the target drawable region comprises: determining position conditions which are met by preset points in the drawable area and correspond to the picture content analysis result in the preset area; determining preset points meeting the position condition from the acquired preset points as target preset points; and determining a target drawable region containing the target preset points in the picture according to the coordinates of the target preset points.
In some embodiments, the location condition includes at least two sub-conditions, and determining, from the obtained preset points, a preset point satisfying the location condition as a target preset point includes: constructing a first external rectangle of the preset area, wherein the first external rectangle comprises all acquired preset points; constructing a second circumscribed rectangle containing each preset point satisfying one sub-condition in the position condition based on the first circumscribed rectangle; and extracting preset points meeting other sub-conditions in the position conditions from all preset points contained in the second externally connected rectangle as target preset points.
In some embodiments, the method further comprises: displaying a closed boundary of the preset area; and determining a target drawable region in the target picture according to the picture content in the preset region, comprising: and in response to receiving a drawing region selection operation executed by a user according to the picture content in the displayed preset region, drawing a closed boundary corresponding to the selection operation, and determining a region corresponding to the closed boundary as a target drawable region.
In a second aspect, embodiments of the present disclosure provide an apparatus for drawing a graphic, the apparatus comprising: the acquisition unit is configured to display the acquired picture on a screen of the picture display end, and acquire coordinates of preset points corresponding to the picture, wherein the preset points comprise points representing boundary positions of preset areas in the picture; a determining unit configured to determine a closed boundary of a preset area based on coordinates of preset points, and determine a target drawable area in a target picture according to picture content in the preset area; and a drawing unit configured to draw the corresponding graphic within the target renderable area in response to detection of a drawing operation performed by the user on the target renderable area.
In some embodiments, the determining unit is further configured to: and analyzing the picture content in a preset area in the picture, and determining a target drawable area corresponding to the picture content analysis result in the preset area in the picture according to the preset corresponding relation between the picture content and the position of the drawable area.
In some embodiments, the preset correspondence between the picture content and the location of the renderable region includes: the relation between the picture content and the position condition satisfied by the preset point in the drawable area; and a determining unit further configured to: determining position conditions which are met by preset points in the drawable area and correspond to the picture content analysis result in the preset area; determining preset points meeting the position condition from the acquired preset points as target preset points; and determining a target drawable region containing the target preset points in the picture according to the coordinates of the target preset points.
In some embodiments, the location condition comprises at least two sub-conditions, the determining unit being further configured to: constructing a first external rectangle of the preset area, wherein the first external rectangle comprises all acquired preset points; constructing a second circumscribed rectangle containing each preset point satisfying one sub-condition in the position condition based on the first circumscribed rectangle; and extracting preset points meeting other sub-conditions in the position conditions from all preset points contained in the second externally connected rectangle as target preset points.
In some embodiments, the apparatus further comprises: a display unit configured to: displaying a closed boundary of the preset area; and a determining unit further configured to: and in response to receiving a drawing region selection operation executed by a user according to the picture content in the displayed preset region, drawing a closed boundary corresponding to the selection operation, and determining a region corresponding to the closed boundary as a target drawable region.
In a third aspect, embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of drawing graphics as described in any of the embodiments of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method of drawing a graphic as described in any of the embodiments of the first aspect.
According to the method and the device for drawing the graph, firstly, the acquired picture is displayed on a screen of a picture display end, and the coordinates of the preset points corresponding to the picture are acquired, wherein the preset points comprise points representing the boundary positions of the preset areas in the picture, the closed boundaries of the preset areas are determined based on the coordinates of the preset points, the target drawable areas in the target picture are determined according to the picture content in the preset areas, the corresponding graph is drawn in the target drawable areas in response to the drawing operation performed by a user on the target drawable areas, the drawing areas are determined based on the preset areas, the target drawable areas of each picture are more visual, and the user can quickly determine the positions of the target drawable areas, so that the user can directly perform drawing operation on the target drawable areas, and user operation is saved.
Drawings
Other features, objects and advantages of the present disclosure will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings:
FIG. 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;
FIG. 2 is a flow chart of one embodiment of a method of drawing graphics in accordance with an embodiment of the present disclosure;
FIG. 3 is a schematic illustration of one application scenario of a method of drawing graphics according to an embodiment of the present disclosure;
FIG. 4 is an exemplary flow chart for determining a target renderable region according to an embodiment of the present disclosure;
FIG. 5 is an exemplary flow chart for determining target preset points according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural view of one embodiment of an apparatus for drawing graphics according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the related disclosure and not limiting thereof. It should be further noted that, for convenience of description, only the portions related to the disclosure are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present disclosure and features of the embodiments may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 of a method of drawing graphics and an apparatus of drawing graphics to which embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 104, 105, a network 106, and servers 101, 102, 103. The network 106 is used as a medium to provide communication links between the terminal devices 104, 105 and the servers 101, 102, 103. The network 106 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the servers 101, 102, 103 via the network 106 through the terminal devices 104, 105 to receive or transmit information or the like. Various applications may be installed on the terminal devices 104, 105, such as a picture processing application, a data analysis application, a data processing application, an instant messaging tool, social platform software, a search class application, a shopping class application, and the like.
The terminal devices 104, 105 may be hardware or software. When the terminal device is hardware, it may be a variety of electronic devices having a display screen and supporting communication with a server, including but not limited to smartphones, tablets, laptop and desktop computers, and the like. When the terminal device is software, it can be installed in the above-listed electronic device. Which may be implemented as a plurality of software or software modules, or as a single software or software module. The present invention is not particularly limited herein.
The terminal devices 104 and 105 may be terminals with image capturing function (such as intelligent devices with screen and camera shooting function, etc.), the terminal devices 104 and 105 may capture pictures through their own image capturing devices, or may obtain pictures from the servers 101, 102 and 103, then locally draw the pictures and display the processed pictures through the screen display device.
The servers 101, 102, 103 may be servers providing various services, such as a background server that receives a request transmitted from a terminal device with which a communication connection is established. The background server can receive and analyze the request sent by the terminal equipment and generate a processing result.
The server may be hardware or software. When the server is hardware, it may be various electronic devices that provide various services to the terminal device. When the server is software, a plurality of software or software modules providing various services to the terminal device may be realized, or a single software or software module providing various services to the terminal device may be realized. The present invention is not particularly limited herein.
It should be noted that the method for drawing graphics provided by the embodiments of the present disclosure may be performed by the terminal devices 104, 105. Accordingly, the means for drawing the graphics are provided in the terminal devices 104, 105.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method of drawing graphics according to the present disclosure is shown. The method for drawing the graph comprises the following steps:
and 210, displaying the acquired picture on a screen of a picture display end, and acquiring coordinates of a preset point corresponding to the picture.
In this step, the execution body on which the method for drawing the graphics operates may acquire the picture by shooting or receiving from the server, etc., and display the picture on the screen of the picture display terminal. The executing body may further obtain coordinates of a preset point corresponding to the picture, where the preset point corresponding to the picture includes a point representing a boundary position of a preset area in the picture, and the preset area is a closed area determined according to the preset point in the picture, and may be a specific area including a part of content of the picture.
The preset point may be a boundary point of a preset area that is manually marked, and coordinates of the manually marked boundary point may be stored in association with the picture in advance. The execution body may read the coordinates of the preset points stored in association together when reading the picture. It should be noted that, the preset points are only used to identify preset positions in the picture, and do not refer to exposable points in the picture.
Specifically, after the execution body obtains a picture, the execution body analyzes the content of the picture to obtain a plurality of content blocks included in the picture, and the picture is, for example, a landscape photograph including sun and white cloud, and the execution body analyzes the landscape photograph to obtain the content blocks including an area where the sun is located, an area where the white cloud is located and other areas. And then, after the executing body obtains the plurality of content blocks, extracting the content blocks meeting the conditions from the plurality of content blocks, wherein the conditions can be preset selection conditions according to the types of the pictures, each type of picture corresponds to different selection conditions, for example, the selection conditions corresponding to scenery in the selected picture are regions where scenery is located, the selection conditions corresponding to figures are regions where figures in the selected picture are located, the selection conditions corresponding to pictures including test questions are regions where test questions in the selected picture are located, and the like. Alternatively, the condition may be a preset position selection condition, for example, a middle region of each picture is selected, or an upper right corner region of each picture is selected, or the like. And finally, the executing body takes the boundary point of the extracted content block meeting the condition as a preset point, and determines the coordinates of the preset point, for example, the executing body can take the boundary point of the area where the white cloud in the landscape is located as the preset point, and the coordinates of the boundary point of the area are the coordinates of the preset point.
Alternatively, the executing body may acquire a picture by photographing and send the picture to the server. After the server receives the picture, analyzing the content of the picture, extracting content blocks meeting the conditions according to the content analysis result, taking boundary points of the extracted content blocks meeting the conditions as preset points, and then transmitting the determined preset points to the execution main body by the server.
Alternatively, the execution subject may receive the picture from the server. The server can determine a picture to be sent, analyze the content of the picture to be sent, extract content blocks meeting the conditions according to the content analysis result, take boundary points of the extracted content blocks meeting the conditions as preset points, and send the picture and the determined preset points to the execution main body.
Optionally, after the executing body displays the acquired picture through the screen of the picture display end, a preset point selection operation performed on the picture by the user may be received, for example, the user may perform a click operation at a certain position of the picture, the executing body may acquire coordinates of a point corresponding to the click operation, and the acquired coordinates of the point are used as coordinates of the preset point.
Step 220, determining a closed boundary of the preset area based on the coordinates of the preset points, and determining a target drawable area in the picture according to the picture content in the preset area.
In this step, after the executing body obtains the coordinates of the preset points in the picture, the executing body may determine the closed boundary of the preset area corresponding to the coordinates of the preset points according to the coordinates of the preset points in the picture. The execution body may further determine a target renderable area in the picture according to the picture content included in the preset area, where the target renderable area may be a closed area determined according to the picture content in the preset area, may receive a rendering operation performed by a user, and in response to the rendering operation performed by the user, display, to the user, a content such as a graphic corresponding to the rendering operation in the target renderable area.
In some optional implementations of this embodiment, the executing body may analyze the content of the picture in the preset area in the picture, and determine, according to a preset correspondence between the content of the picture and the position of the region that can be drawn, a target region that can be drawn in the picture and corresponds to the analysis result of the content of the picture in the preset area.
Specifically, the position of the drawable region of each picture may be a manually noted drawing position, and the manually noted drawing position may be stored in association with the picture in advance. The execution subject may read the position of the drawable region stored in association with the picture. The position of the drawable region of each picture may be preset according to the content of the picture, and the position of each type of picture corresponds to a different drawable region, for example, the position of the drawable region corresponding to the picture including the test question may be the right side of the region where the test question is located in the picture, the position of the drawable region corresponding to the person photograph may be the upper right corner of the region where the person is located in the picture, and so on.
The execution body can analyze the picture content in the preset area to obtain a picture content analysis result in the preset area, and determine the type of the picture content according to the picture content analysis result. The execution subject may read the position of the drawable region corresponding to the type of the picture content from the stored correspondence, and take the drawable region as the target drawable region of the picture.
In an exemplary scenario, the execution body analyzes the picture content in the preset area to obtain a result of analyzing the picture content in the preset area as a test question, and determines that the type of the picture content is a question type. And then the execution main body reads the position of the drawable region corresponding to the question type from the corresponding relation stored locally according to the question type, and determines the target drawable region of the question type as a right blank region of the question region.
In the implementation mode, the drawable region is preset based on the type of the picture content, so that the drawable region in the picture can be automatically selected, and the selected drawable region is more attached to the content of the picture.
In some optional implementations of this embodiment, after the executing body determines the closed boundary of the preset area based on the coordinates of the preset point, the closed boundary of the preset area may be displayed through a screen of the picture display end. The execution body responds to receiving a drawing region selection operation executed by a user according to the picture content in the displayed preset region, draws a closed boundary corresponding to the selection operation, and determines a region corresponding to the closed boundary as a target drawable region.
Specifically, the executing body displays the closed boundary of the preset area through the screen of the picture display end, after the user sees the content included in the preset area in the screen of the picture display end, the user can execute drawing area selection operation on the picture on the screen of the picture display end according to the self requirement, and the user can execute selection operation on preset points included in the preset area in the picture, for example, the user executes clicking operation on one of the preset points; alternatively, the user may perform a closed region drawing operation on the picture, for example, the user may draw a closed boundary, such as a circle or rectangle, at a certain position of the picture according to the content of the picture in the preset region. And then the execution body draws a corresponding closed boundary in the picture according to the selection operation of the user, and determines the area corresponding to the closed boundary as a target drawable area.
In an exemplary scenario, the execution body displays a closed boundary of a preset area through a screen of a picture display end, and then after a user determines that contents included in the preset area are test questions according to the displayed closed boundary of the preset area, a rectangle can be manually drawn on the right side of the preset area. And then, after the execution main body receives the operation of drawing the rectangle by the user, drawing a rectangle boundary at the corresponding position of the picture according to the operation of the user, and taking the region corresponding to the rectangle boundary as a target drawable region.
In the implementation manner, the picture content in the preset area is displayed to the user, the user can select the corresponding drawable area according to the needs of the user, the flexibility of selecting the drawable area in the picture can be realized, and the selected drawable area can meet the needs of the user.
In response to detecting a drawing operation performed by the user on the target drawable region, a corresponding graphic is drawn within the target drawable region, step 230.
In this step, after determining the target renderable area in the picture, the executing body may display the picture on which the target renderable area is drawn on a screen of the picture display end. The above-described execution subject may receive a drawing operation performed by the user in the target drawable region, and as an example, the user may draw a graphic required by the user in the target drawable region, for example, drawing a sign indicating that the title is correct, or a required polygon, or the like. The execution subject detects a drawing operation performed by a user on the target drawable region, and draws a corresponding figure in the target drawable region.
Alternatively, when the user draws a graphic in an area other than the target drawable area, the execution subject will not present the graphic in the corresponding area.
In an exemplary scenario, the execution body displays the test question picture with the target drawable area drawn on the screen of the picture display end, and the user can draw the required graph in the target drawable area. The execution body receives a symbol representing the question error from a user in a target drawable region, and displays the symbol representing the question error in the target drawable region.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method of drawing graphics according to the present embodiment. In the application scenario of fig. 3, the terminal 310 acquires the picture 320 including the test questions through the image acquisition device, and displays the picture 320 through a screen. The terminal 310 then parses the picture 320, where the obtained content block includes the region where the test question is located and the answer region. Then, the terminal 310 uses the boundary point of the area where the test question is located as a preset point, and determines the coordinates of the preset point. The terminal 310 then determines the test question area 330 according to the obtained coordinates of the preset points, and reads the target drawable area corresponding to the test question from the corresponding relationship between the locally stored picture content and the drawable area position according to the test question included in the test question area 330 as the right side of the test question area 330. The terminal 310 receives the user's operation of drawing the error symbol performed on the target drawable region, and displays the error symbol on the right side of the test question area 330.
According to the picture display method provided by the embodiment of the disclosure, the acquired picture is displayed on the screen of the picture display end, the coordinates of the preset points corresponding to the picture are acquired, wherein the preset points comprise points representing the boundary positions of the preset areas in the picture, the closed boundary of the preset areas is determined based on the coordinates of the preset points, the target drawable areas in the target picture are determined according to the picture content in the preset areas, the corresponding pictures are drawn in the target drawable areas in response to the fact that the drawing operation performed by a user on the target drawable areas is detected, the drawing areas are determined based on the preset areas, the target drawable areas of each picture are more visual, the user can quickly determine the positions of the target drawable areas, and accordingly the user can directly perform drawing operation on the target drawable areas, and user operation is saved.
In some optional implementations of the present embodiment, please refer to fig. 4, which illustrates a preset correspondence between the content of the picture and the location of the renderable region, including: and the relation between the picture content and the position condition satisfied by the preset point in the drawable area. And, determining a target renderable region in the picture corresponding to the picture content analysis result in the preset region may be performed according to the following procedure 400:
Step 410, determining a position condition satisfied by a preset point in the drawable area corresponding to the analysis result of the picture content in the preset area.
In this step, the execution subject stores in advance a relationship between the picture content and the position condition satisfied by the preset point in the drawable region, and different picture contents correspond to different drawable regions. The execution body can analyze the picture content in the preset area to obtain a picture content analysis result in the preset area, and determine the type of the picture content according to the picture content analysis result. The executing body may read, from the stored correspondence, the position condition satisfied by the preset point in the sketchable area corresponding to the picture content type according to the picture content type, that is, determine, according to the picture content type, the position condition for selecting the preset point, for example, the position condition satisfied by the preset point in the sketchable area corresponding to the question type may be a preset point on the right side, or the position condition satisfied by the preset point in the sketchable area corresponding to the figure may be a preset point on the upper right corner, and so on.
Step 420, determining a preset point meeting the position condition from the obtained preset points as a target preset point.
In this step, after the execution body obtains the position condition satisfied by the preset point in the sketchable area corresponding to the analysis result of the picture content in the preset area, the preset point satisfying the position condition is determined from the plurality of preset points as the target preset point. As an example, it is determined that the content of the picture in the preset area is a test question, and the position condition satisfied by the preset point in the drawable area corresponding to the test question type is a preset point on the right side, and the coordinates of the obtained plurality of preset points are compared to determine at least one preset point located on the right side of the preset area as a target preset point.
And 430, determining a target drawable area containing the target preset points in the picture according to the coordinates of the target preset points.
In this step, after determining the target preset point, the executing body draws a target drawable region including the target preset point in the picture according to the coordinates of the target preset point.
When the number of the target preset points is one, the execution body may use the target preset point as a center and use a circular area with a preset distance as a radius as a target drawable area.
When the number of the target preset points is plural, the execution body may use a closed area formed by the plural target preset points as the target drawable area. As an example, when the number of target preset points is 3, the above-described execution body may take a triangle area composed of 3 target preset points as the target renderable area.
In this implementation manner, the execution subject selects the target preset point based on the position condition, and determines the target renderable region based on the target preset point, so that the target renderable region is more accurate and more concise.
In some alternative implementations of the present embodiment, referring to fig. 5A, the location condition includes at least two sub-conditions. And the step 420, determining the preset point satisfying the position condition from the obtained preset points as the target preset point, may be performed according to the following procedure 500:
step 510, constructing a first circumscribed rectangle of the preset area.
In this step, the position condition acquired by the execution subject includes at least two sub-conditions, for example, if the position condition is an upper right corner, two sub-conditions are included, which are respectively an upper right side and an upper right side. After the execution body acquires the position condition, a first circumscribed rectangle of the preset area is constructed.
Step 520, based on the first bounding rectangle, constructing a second bounding rectangle containing preset points satisfying one of the sub-conditions of the location condition.
In this step, after the execution body constructs a first circumscribed rectangle of the preset area, a second circumscribed rectangle is constructed according to the sub-conditions included in the position condition, where the second circumscribed rectangle includes preset points that satisfy one of the sub-conditions.
As an example, the position condition is the upper right corner, and the sub-conditions included are the right side and the upper side, respectively. After the execution body constructs a first circumscribed rectangle of the preset area, a second circumscribed rectangle on the right side is constructed, and the second circumscribed rectangle comprises preset points all located on the right side.
In step 530, among the preset points included in the second external rectangle, the preset point satisfying other sub-conditions in the position condition is extracted as the target preset point.
In this step, after the execution body constructs the second external rectangle, the second external rectangle includes a preset point satisfying one of the sub-conditions. And then the execution main body extracts preset points meeting other sub-conditions from all preset points contained in the second external rectangle according to other sub-conditions contained in the position conditions, and the preset points meeting other sub-conditions are taken as target preset points, for example, whether the coordinates meet other sub-conditions or not is judged according to the coordinates of all the preset points, and the preset points with the coordinates meeting other sub-conditions are extracted.
As an example, the position condition is an upper right corner vertex, and the position condition may be satisfied when the position condition is split into two sub-conditions, i.e., the right side vertex and the upper side vertex, respectively, i.e., the two sub-conditions are satisfied simultaneously. After the execution body constructs a first circumscribed rectangle of the preset area, a second circumscribed rectangle on the right side is constructed, and the second circumscribed rectangle comprises preset points all located on the right side. And then the execution main body judges the coordinates of all preset points in all preset points contained in the second externally connected rectangle, determines the preset point with the coordinates positioned on the upper side, and takes the obtained preset point as a target preset point.
Referring to fig. 5B, in this implementation manner, if the preset area determined by the terminal is a polygon, and the target preset point to be determined is a preset point in the upper right corner. The execution body builds a first bounding rectangle 540 of the polygonal area. Then, the terminal further builds a second circumscribed rectangle 550 on the right side on the basis of the first circumscribed rectangle, and the second circumscribed rectangle 550 includes a preset point satisfying the position on the right side. Finally, the terminal selects a preset point located at the upper side from preset points included in the second external rectangle 550 according to coordinates of the preset points, and takes the preset point as a target preset point.
In the implementation manner, the execution body can determine two rectangles according to the position condition, and further position the target preset point according to the two rectangles, so that the automatic determination of the target preset point is realized, and the accuracy of the target preset point is improved.
As an implementation of the above method, the embodiment of the present disclosure further provides an apparatus for drawing a graphic.
As shown in fig. 6, the apparatus 600 for drawing a graphic of the present embodiment may include: an obtaining unit 610, configured to display the obtained picture on a screen of a picture display end, and obtain coordinates of preset points corresponding to the picture, where the preset points include points representing boundary positions of preset areas in the picture; a determining unit 620 configured to determine a closed boundary of the preset area based on coordinates of the preset point, and determine a target renderable area in the target picture according to picture content within the preset area; and a drawing unit 630 configured to draw the corresponding graphic within the target renderable area in response to detection of a drawing operation performed by the user on the target renderable area.
In some optional implementations of the present implementation, the determining unit 620 is further configured to: and analyzing the picture content in a preset area in the picture, and determining a target drawable area corresponding to the picture content analysis result in the preset area in the picture according to the preset corresponding relation between the picture content and the position of the drawable area.
In some optional implementations of the present implementation, the preset correspondence between the picture content and the location of the renderable region includes: the relation between the picture content and the position condition satisfied by the preset point in the drawable area; and a determining unit 620, further configured to: determining position conditions which are met by preset points in the drawable area and correspond to the picture content analysis result in the preset area; determining preset points meeting the position condition from the acquired preset points as target preset points; and determining a target drawable region containing the target preset points in the picture according to the coordinates of the target preset points.
In some optional implementations of the present implementation, the location condition includes at least two sub-conditions, the determining unit is further configured to: constructing a first external rectangle of the preset area, wherein the first external rectangle comprises all acquired preset points; constructing a second circumscribed rectangle containing each preset point satisfying one sub-condition in the position condition based on the first circumscribed rectangle; and extracting preset points meeting other sub-conditions in the position conditions from all preset points contained in the second externally connected rectangle as target preset points.
In some optional implementations of the present implementation, the apparatus further includes: a display unit configured to: displaying a closed boundary of the preset area; and a determining unit further configured to: and in response to receiving a drawing region selection operation executed by a user according to the picture content in the displayed preset region, drawing a closed boundary corresponding to the selection operation, and determining a region corresponding to the closed boundary as a target drawable region.
According to the device provided by the embodiment of the invention, the acquired picture is displayed on the screen of the picture display end, and the coordinates of the preset points corresponding to the picture are acquired, wherein the preset points comprise points representing the boundary positions of the preset areas in the picture, the closed boundaries of the preset areas are determined based on the coordinates of the preset points, the target drawable areas in the target picture are determined according to the picture content in the preset areas, the corresponding graph is drawn in the target drawable areas in response to the drawing operation performed by the user on the target drawable areas, and the drawing areas are determined based on the preset areas, so that the target drawable areas of each picture are more visual, the user can quickly determine the positions of the target drawable areas, the user can directly perform drawing operation on the target drawable areas, and the user operation is saved.
Referring now to fig. 7, a schematic diagram of an electronic device 700 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device shown in fig. 7 is only one example and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 7, the electronic device 700 may include a processing means (e.g., a central processor, a graphics processor, etc.) 701, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage means 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
In general, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 shows an electronic device 700 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 7 may represent one device or a plurality of devices as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 709, or installed from storage 708, or installed from ROM 702. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 701.
It should be noted that the computer readable medium of the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In an embodiment of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Whereas in embodiments of the present disclosure, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: displaying the acquired picture on a screen of a picture display end, and acquiring coordinates of preset points corresponding to the picture, wherein the preset points comprise points representing boundary positions of preset areas in the picture; determining a closed boundary of a preset area based on coordinates of preset points, and determining a target drawable area in a target picture according to picture content in the preset area; in response to detecting a drawing operation performed by a user on the target drawable region, a corresponding graphic is drawn within the target drawable region.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments described in the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes an acquisition unit, a determination unit, and a rendering unit. The names of these units do not limit the unit itself in some cases, and for example, the acquisition unit may also be described as "a unit that displays an acquired picture on a screen of a picture display end and acquires a point of coordinates of a preset point corresponding to the picture".
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.

Claims (10)

1. A method of drawing a graphic, comprising:
displaying the acquired picture on a screen of a picture display end, and acquiring coordinates of preset points corresponding to the picture, wherein the preset points comprise points representing boundary positions of preset areas in the picture;
determining a closed boundary of the preset area based on the coordinates of the preset points, and determining a target drawable area in a target picture according to the picture content in the preset area;
responsive to detecting a drawing operation performed by a user on the target drawable region, drawing a corresponding graphic within the target drawable region;
The determining the target drawable region in the target picture according to the picture content in the preset region comprises the following steps:
and analyzing the picture content in a preset area in the picture, and determining a target drawable area corresponding to the picture content analysis result in the preset area in the picture according to the preset corresponding relation between the picture content and the position of the drawable area.
2. The method of claim 1, wherein the preset correspondence between the picture content and the location of the renderable region comprises: the relation between the picture content and the position condition satisfied by the preset point in the drawable area; and
the determining the target drawable region corresponding to the picture content analysis result in the preset region in the picture includes:
determining position conditions which are met by preset points in the drawable area and correspond to the picture content analysis result in the preset area;
determining preset points meeting the position condition from the acquired preset points as target preset points;
and determining the target drawable area containing the target preset point in the picture according to the coordinates of the target preset point.
3. The method according to claim 2, wherein the location condition includes at least two sub-conditions, and the determining, from the obtained preset points, a preset point satisfying the location condition as a target preset point includes:
constructing a first circumscribed rectangle of the preset area, wherein the first circumscribed rectangle comprises all acquired preset points;
constructing a second circumscribed rectangle containing preset points meeting one sub-condition of the position conditions based on the first circumscribed rectangle;
and extracting preset points meeting other sub-conditions in the position conditions from all preset points contained in the second externally connected rectangle as target preset points.
4. A method according to any one of claims 1-3, wherein the method further comprises: displaying the closed boundary of the preset area; and
the determining the target drawable region in the target picture according to the picture content in the preset region includes:
and responding to receiving a drawing region selection operation executed by a user according to the displayed picture content in the preset region, drawing a closed boundary corresponding to the selection operation, and determining a region corresponding to the closed boundary as the target drawable region.
5. An apparatus for drawing graphics, comprising:
the image display device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is configured to display an acquired image on a screen of an image display end and acquire coordinates of preset points corresponding to the image, and the preset points comprise points representing boundary positions of preset areas in the image;
a determining unit configured to determine a closed boundary of the preset area based on coordinates of the preset point, and determine a target drawable area in a target picture according to picture content in the preset area;
a drawing unit configured to draw a corresponding graphic within the target renderable area in response to detection of a drawing operation performed by a user on the target renderable area;
the determining unit is further configured to:
and analyzing the picture content in a preset area in the picture, and determining a target drawable area corresponding to the picture content analysis result in the preset area in the picture according to the preset corresponding relation between the picture content and the position of the drawable area.
6. The apparatus of claim 5, wherein the preset correspondence between the picture content and the location of the renderable region comprises: the relation between the picture content and the position condition satisfied by the preset point in the drawable area; and
The determining unit is further configured to:
determining position conditions which are met by preset points in the drawable area and correspond to the picture content analysis result in the preset area;
determining preset points meeting the position condition from the acquired preset points as target preset points;
and determining the target drawable area containing the target preset point in the picture according to the coordinates of the target preset point.
7. The apparatus of claim 6, wherein the location condition comprises at least two sub-conditions, the determination unit further configured to:
constructing a first circumscribed rectangle of the preset area, wherein the first circumscribed rectangle comprises all acquired preset points;
constructing a second circumscribed rectangle containing preset points meeting one sub-condition of the position conditions based on the first circumscribed rectangle;
and extracting preset points meeting other sub-conditions in the position conditions from all preset points contained in the second externally connected rectangle as target preset points.
8. The apparatus of any of claims 5-7, wherein the apparatus further comprises: a display unit configured to: displaying the closed boundary of the preset area; and
The determining unit is further configured to:
and responding to receiving a drawing region selection operation executed by a user according to the displayed picture content in the preset region, drawing a closed boundary corresponding to the selection operation, and determining a region corresponding to the closed boundary as the target drawable region.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-4.
10. A computer readable medium on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any of claims 1-4.
CN202010489250.1A 2020-06-02 2020-06-02 Method and device for drawing graph Active CN113760414B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010489250.1A CN113760414B (en) 2020-06-02 2020-06-02 Method and device for drawing graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010489250.1A CN113760414B (en) 2020-06-02 2020-06-02 Method and device for drawing graph

Publications (2)

Publication Number Publication Date
CN113760414A CN113760414A (en) 2021-12-07
CN113760414B true CN113760414B (en) 2023-11-28

Family

ID=78782315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010489250.1A Active CN113760414B (en) 2020-06-02 2020-06-02 Method and device for drawing graph

Country Status (1)

Country Link
CN (1) CN113760414B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104965881A (en) * 2015-06-12 2015-10-07 北京奇虎科技有限公司 Method and device for extracting selected area from page
CN105068727A (en) * 2015-08-18 2015-11-18 百度在线网络技术(北京)有限公司 Realization method and device for drawing tool
CN106934842A (en) * 2017-03-10 2017-07-07 广州视源电子科技股份有限公司 The recognition methods of enclosed region and device
CN107133351A (en) * 2017-05-25 2017-09-05 北京元心科技有限公司 Drawing method and device, user terminal, server and computer-readable medium
CN108040144A (en) * 2017-12-13 2018-05-15 广东欧珀移动通信有限公司 Electronic device, image drawing method and Related product
CN110286992A (en) * 2019-07-02 2019-09-27 中国工商银行股份有限公司 The method and device that interface figure is redrawn
CN110633380A (en) * 2019-09-05 2019-12-31 北京无限光场科技有限公司 Control method and device for picture processing interface, electronic equipment and readable medium
CN110851059A (en) * 2019-11-13 2020-02-28 北京字节跳动网络技术有限公司 Picture editing method and device and electronic equipment
CN110989897A (en) * 2019-11-21 2020-04-10 深圳市富途网络科技有限公司 Screenshot picture acquisition method and device, terminal device and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9671953B2 (en) * 2013-03-04 2017-06-06 The United States Of America As Represented By The Secretary Of The Army Systems and methods using drawings which incorporate biometric data as security information

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104965881A (en) * 2015-06-12 2015-10-07 北京奇虎科技有限公司 Method and device for extracting selected area from page
CN105068727A (en) * 2015-08-18 2015-11-18 百度在线网络技术(北京)有限公司 Realization method and device for drawing tool
CN106934842A (en) * 2017-03-10 2017-07-07 广州视源电子科技股份有限公司 The recognition methods of enclosed region and device
CN107133351A (en) * 2017-05-25 2017-09-05 北京元心科技有限公司 Drawing method and device, user terminal, server and computer-readable medium
CN108040144A (en) * 2017-12-13 2018-05-15 广东欧珀移动通信有限公司 Electronic device, image drawing method and Related product
CN110286992A (en) * 2019-07-02 2019-09-27 中国工商银行股份有限公司 The method and device that interface figure is redrawn
CN110633380A (en) * 2019-09-05 2019-12-31 北京无限光场科技有限公司 Control method and device for picture processing interface, electronic equipment and readable medium
CN110851059A (en) * 2019-11-13 2020-02-28 北京字节跳动网络技术有限公司 Picture editing method and device and electronic equipment
CN110989897A (en) * 2019-11-21 2020-04-10 深圳市富途网络科技有限公司 Screenshot picture acquisition method and device, terminal device and storage medium

Also Published As

Publication number Publication date
CN113760414A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
CN112488783B (en) Image acquisition method and device and electronic equipment
CN110059623B (en) Method and apparatus for generating information
CN112306793A (en) Method and device for monitoring webpage
CN110908922A (en) Application program testing method and device
KR20210058768A (en) Method and device for labeling objects
CN111461968B (en) Picture processing method, device, electronic equipment and computer readable medium
EP4297415A1 (en) Information display method and apparatus based on video, and device and medium
CN111340015A (en) Positioning method and device
CN110673886B (en) Method and device for generating thermodynamic diagrams
JP2021006982A (en) Method and device for determining character color
CN114417782A (en) Display method and device and electronic equipment
CN111461965B (en) Picture processing method and device, electronic equipment and computer readable medium
CN112445394B (en) Screenshot method and screenshot device
CN109840059B (en) Method and apparatus for displaying image
CN113760414B (en) Method and device for drawing graph
CN111767098A (en) Method and device for adjusting font size
CN113726948B (en) Picture display method and device
CN111461964B (en) Picture processing method, device, electronic equipment and computer readable medium
CN111290812B (en) Display method, device, terminal and storage medium of application control
CN111401182B (en) Image detection method and device for feeding rail
CN111835917A (en) Method, device and equipment for showing activity range and computer readable medium
CN112308074A (en) Method and device for generating thumbnail
CN112000218A (en) Object display method and device
CN111461227B (en) Sample generation method, device, electronic equipment and computer readable medium
CN112306339B (en) Method and apparatus for displaying image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant