CN114154466A - Structure reconstruction method and device of structure diagram, electronic equipment and storage medium - Google Patents

Structure reconstruction method and device of structure diagram, electronic equipment and storage medium Download PDF

Info

Publication number
CN114154466A
CN114154466A CN202111276077.8A CN202111276077A CN114154466A CN 114154466 A CN114154466 A CN 114154466A CN 202111276077 A CN202111276077 A CN 202111276077A CN 114154466 A CN114154466 A CN 114154466A
Authority
CN
China
Prior art keywords
node
nodes
search
picture
processed
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.)
Pending
Application number
CN202111276077.8A
Other languages
Chinese (zh)
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 Sogou Technology Development Co Ltd
Original Assignee
Beijing Sogou Technology Development 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 Sogou Technology Development Co Ltd filed Critical Beijing Sogou Technology Development Co Ltd
Priority to CN202111276077.8A priority Critical patent/CN114154466A/en
Publication of CN114154466A publication Critical patent/CN114154466A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration

Abstract

The invention discloses a structure reconstruction method, a structure reconstruction device, electronic equipment and a storage medium of a structure diagram, wherein the method comprises the following steps: acquiring a picture to be processed, wherein the picture to be processed comprises a structure diagram; detecting a picture to be processed to obtain a structure node and a guide line in a structure diagram; adjusting the structure nodes and the guide lines; and performing structure search according to the structure nodes and the guide lines to obtain the frame structure of the structure diagram. The method disclosed by the invention can quickly and accurately restore the frame structure in the structure diagram to support a user to edit the structure diagram.

Description

Structure reconstruction method and device of structure diagram, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of intelligent office, in particular to a structure reconstruction method and device of a structure diagram and electronic equipment.
Background
With the continuous development of information science, the intelligent office gradually replaces the traditional office and goes deep into each work level, and the demand of users for the intelligent office is also bigger and bigger. The intelligent office can assist manual work to perform office business processing, managing various information, assisting leader decision and other operations by means of advanced office equipment, fully utilize information resources as far as possible, and improve office efficiency and office quality to the maximum extent, so that higher-value information is generated.
In general, a user has a need to edit a structure diagram at the time of smart office, but since the structure diagram such as a mind diagram and a flowchart generally exists in the form of an image, only reference is supported. Therefore, how to support the user to edit the structure diagram is a technical problem which needs to be solved urgently at present.
Disclosure of Invention
The embodiment of the invention provides a structure reconstruction method and device of a structure diagram and electronic equipment, which can quickly and accurately restore a frame structure in the structure diagram to support a user to edit the structure diagram.
A first aspect of an embodiment of the present invention provides a structure reconstruction method for a structure diagram, where the method includes:
acquiring a picture to be processed, wherein the picture to be processed comprises a structure diagram;
detecting the picture to be processed to obtain a structure node and a guide line in the structure chart;
adjusting the structural nodes and the guide lines;
and performing structure search according to the structure nodes and the guide lines to obtain a frame structure of the structure diagram.
Preferably, the detecting the picture to be processed to obtain the structure node and the guide line in the structure diagram includes:
conducting guide line detection on the picture to be processed to obtain the guide line; wherein the guidewire has a guidewire position and a guidewire size;
carrying out node detection on the picture to be processed to obtain the structural node; wherein the structure node has a node location, a node size, and a node type.
Preferably, the adjusting the structure node and the guide line includes:
generating a mask image;
in the mask image, the structure nodes are adjusted according to a first proportion, and the guide lines are adjusted and lengthened according to a second proportion; wherein the second ratio is determined by the first ratio.
Preferably, in the mask image, the adjusting the structure node according to a first ratio and the adjusting and lengthening the guide line according to a second ratio includes:
and in the mask image, when a target guide line with a length smaller than or equal to a preset length exists, adjusting the structure node according to the first proportion, and adjusting the target guide line according to the second proportion.
Preferably, the adjusting the structural node according to the first ratio includes:
and adjusting the structure node connected with the target guide wire according to the first proportion.
Preferably, the performing a structure search according to the structure node and the guide line to obtain the frame structure of the structure diagram includes:
according to the structural nodes, performing structural search on the mask image by a structural search method to obtain a node relation tree;
and acquiring the frame structure according to the node relation tree and the guide line.
Preferably, the performing a structure search on the mask image according to the structure node by a structure search method to obtain a node relationship tree includes:
storing a root node in the structure nodes in a node stack, and performing structure search on the mask image by taking the root node as a starting point, wherein the structure search step is as follows;
selecting a pth search point positioned in a pth node from the node stack, and if the node identifier of the pth search point is different from the node identifier of the pth node, determining that the pth node is a child node of the pth search point, and the pth search point is a node; if the node identification of the p-th search point is the same as that of the j-th node, performing connected domain analysis on the mask image by taking the p-th search point as a center, if a q-th search point communicated with the p-th search point is searched, storing the q-th search point in the node stack, and taking the node identification of the p-th search point as the node identification of the q-th search point, wherein the j-th node is a node in the structural node;
obtaining the node relationship tree after each of the structure nodes is searched for by the structure searching step.
Preferably, after the obtaining the frame structure of the structure diagram, the method further includes:
and saving the frame structure.
The second aspect of the embodiments of the present invention also provides a structure reconstruction apparatus, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a picture to be processed, and the picture to be processed comprises a structure diagram;
the detection unit is used for detecting the picture to be processed and acquiring a structure node and a guide line in the structure chart;
the adjusting unit is used for adjusting the structure nodes and the guide lines;
and the searching unit is used for carrying out structure searching according to the structure nodes and the guide lines to obtain the frame structure of the structure diagram.
Preferably, the detection unit is configured to:
conducting guide line detection on the picture to be processed to obtain the guide line; wherein the guidewire has a guidewire position and a guidewire size;
carrying out node detection on the picture to be processed to obtain the structural node; wherein the structure node has a node location, a node size, and a node type.
Preferably, the adjusting unit is configured to:
generating a mask image;
in the mask image, the structure nodes are adjusted according to a first proportion, and the guide lines are adjusted and lengthened according to a second proportion; wherein the second ratio is determined by the first ratio.
Preferably, the adjusting unit is configured to:
and in the mask image, when a target guide line with a length smaller than or equal to a preset length exists, adjusting the structure node according to the first proportion, and adjusting the target guide line according to the second proportion.
Preferably, the adjusting unit is configured to: and adjusting the structure node connected with the target guide wire according to the first proportion.
Preferably, the search unit is configured to:
according to the structural nodes, performing structural search on the mask image by a structural search method to obtain a node relation tree;
and acquiring the frame structure according to the node relation tree and the guide line.
Preferably, the search unit is configured to: storing a root node in the structure nodes in a node stack, and performing structure search on the mask image by taking the root node as a starting point, wherein the structure search step is as follows;
selecting a pth search point positioned in a pth node from the node stack, and if the node identifier of the pth search point is different from the node identifier of the pth node, determining that the pth node is a child node of the pth search point, and the pth search point is a node; if the node identification of the p-th search point is the same as that of the j-th node, performing connected domain analysis on the mask image by taking the p-th search point as a center, if a q-th search point communicated with the p-th search point is searched, storing the q-th search point in the node stack, and taking the node identification of the p-th search point as the node identification of the q-th search point, wherein the j-th node is a node in the structural node;
obtaining the node relationship tree after each of the structure nodes is searched for by the structure searching step.
Preferably, the apparatus further comprises:
and the storage unit is used for storing the frame structure.
A third aspect of the embodiments of the present invention provides an electronic device, which includes a memory and one or more programs, where the one or more programs are stored in the memory and configured to be executed by one or more processors, where the one or more programs include operation instructions for performing the structure reconstruction method according to the structure diagram provided in the first aspect.
A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps corresponding to the structure reconstruction method of the structure diagram provided in the first aspect.
A fourth aspect of embodiments of the present invention provides a computer program product, where the computer program product includes computer instructions stored in a computer-readable storage medium and adapted to be read and executed by a processor, so as to enable a computer device having the processor to execute steps corresponding to the structure reconstruction method of the structure diagram provided in the first aspect.
The above one or at least one technical solution in the embodiments of the present application has at least the following technical effects:
based on the technical scheme, the picture to be processed containing the structure graph is detected through an image processing method, and structure nodes and guide lines in the structure graph are obtained; then adjusting the structure nodes and the guide lines; and then, carrying out structure search according to the structure nodes and the guide lines to obtain the frame structure of the structure chart. Therefore, after the node structure and the guide line are obtained, the node structure and the guide line are adjusted and optimized to avoid the disorder of structure searching, and further, the frame structure of the structure diagram can be quickly and accurately restored during structure searching to support a user to edit the structure diagram.
Drawings
Fig. 1 is a schematic flowchart of a structure reconstruction method for a structure diagram according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a mind map provided by an embodiment of the present application;
fig. 3A is a schematic structural diagram of a structural diagram provided in an embodiment of the present application;
fig. 3B is a schematic diagram of a node structure in the structure diagram provided in the embodiment of the present application;
fig. 3C is a schematic structural diagram of a node relationship tree according to an embodiment of the present application;
fig. 4 is a block diagram of a structure reconstruction apparatus in a structural diagram according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The main implementation principle, the specific implementation mode and the corresponding beneficial effects of the technical scheme of the embodiment of the present application are explained in detail with reference to the accompanying drawings.
The invention provides a structure reconstruction method and device of a structure diagram, electronic equipment and a storage medium, which can quickly and accurately restore a frame structure in the structure diagram to support a user to edit the structure diagram. Referring to fig. 1, an embodiment of the present application provides a structure reconstruction method for a structure diagram, where the method includes:
step 101, obtaining a picture to be processed.
And 102, detecting the picture to be processed, and acquiring the structure nodes and the guide lines in the structure chart.
Step 103, adjusting the structure nodes and the guide lines.
And 104, performing structure search according to the structure nodes and the guide lines to obtain a frame structure of the structure diagram.
The method provided by the embodiment of the invention can be applied to terminal equipment, such as a smart phone and a tablet computer, can also be applied to a server which is established with data interaction with the terminal equipment, and can also be applied to a system which consists of the terminal equipment and the server, and the method is not limited here.
In step 101, the picture to be processed is a picture including a structure diagram, and only refers and does not support editing. The structure diagram of the present embodiment includes, but is not limited to, a mind map and a flow chart. When the to-be-processed picture is obtained, the to-be-processed picture may be obtained from the picture library according to a selection operation of the user, or may be downloaded from a network or transmitted by another terminal, but the method is not limited. Wherein, the structure diagram of this embodiment includes two parts: framework structure and textual content. The frame structure represents the structural hierarchy of the structure diagram, and the frame structure comprises two parts, namely a structural node and a guide line. Referring to fig. 2, the structure diagram takes an thought-chart as an example, the thought-chart includes thought-chart nodes and guide lines, and the thought-chart nodes have text contents.
In step 102, when the picture to be processed is detected, conducting the lead detection on the picture to be processed through the image segmentation network to obtain a lead. The guide wire has guide wire related parameters, such as guide wire position, guide wire size, and guide wire type. The guide line position refers to its coordinate position in the image to be processed, and the guide line size refers to the size it occupies in the image to be processed. And carrying out node detection on the picture to be processed through an image detection network to obtain a structural node. Wherein the structure node has node location information, node size, and node type. The node position refers to its coordinate position in the image to be processed, the node size refers to the size it occupies in the image to be processed, and the guide line type includes frame type, dot type, frameless type, and the like. For example, fig. 2, wherein the mind map nodes have frame type nodes, frameless type nodes.
Specifically, the image segmentation network and the image detection network are obtained by training using any one of the convolutional neural network CNN, the deep neural network DNN and the like as an initial model.
See fig. 3A-3B. The structure diagram in the to-be-processed picture in fig. 3A is a mental diagram. And inputting the picture to be processed into an image detection network to obtain a structural node. As shown in fig. 3B, the structure node specifically includes the following nodes: node 31, node 311, node 3111, node 31111, node 31112, node 3112, node 31121, node 31122, node 31123, node 31124, node 31125, node 312, node 3121, node 31211, node 31212, node 3122, node 3123, node 313, node 3131, node 3132, node 314, node 3141, node 3142, node 3143, node 3144, node 3145. Except that the node type of the node 31 is a frame type, the node type of each of the remaining nodes is a frameless type.
After the nodes and the guide lines in the structure diagram are acquired, the structural reconstruction of the structure diagram is greatly influenced due to the size of the guide lines. Specifically, the too short lead line between two structure nodes may cause structure confusion of the structure nodes during structure search. For example, the too short guide line in the dashed line frame of fig. 2 may cause the structure nodes before and after the guide line to generate structure confusion during structure search. Therefore, step 103 is executed to avoid the occurrence of structure disorder during the structure search.
In step 103, adjustments may be made directly to the structure nodes and the steering lines. The structure nodes and the guide lines can also be adjusted in the mask image (mask image). Specifically, a mask image is generated, binarization information is stored on the mask image, pixel points in the guide lines and the structural nodes are represented by 1 in the binarization information, and the rest pixel points are represented by 0 in the binarization information. In this way, the guiding lines and the structure nodes can be made to appear white on the mask image, and the rest of the pixel points are referred to as black as the background, although the two can be interchanged, for example, the guiding lines and the structure nodes are made to appear black on the mask image, and the rest of the pixel points are made to appear white as the background, as shown in fig. 3B. The size, position and other parameters of the structure nodes and the guide lines can be adjusted in the mask image. Furthermore, in the mask image, the structure nodes are adjusted according to a first proportion, for example, the structure nodes are reduced, and the guide lines are adjusted and extended according to a second proportion, so that the guide lines are connected with the corresponding structure nodes. The second proportion of the steering lines is determined by the first proportion of the structure nodes.
In one embodiment of the present description, all of the nodes in the structure node are adjusted according to a first ratio, and all of the leads are extended according to a second ratio. In another embodiment of the present specification, in the mask image, when there is a target guide line less than or equal to a preset length. In the embodiment, the present embodiment refers to the case where there is a guide line smaller than or equal to the preset length as a target guide line to distinguish other guide lines larger than the preset length. The target guide line needs to be extended, and because the target guide line and the structure nodes are mutually influenced, before the target guide line is extended, the structure nodes are firstly adjusted according to a first proportion, and then the target guide line is adjusted and extended according to a second proportion, so that the guide line and the corresponding structure nodes are connected, and the frame structure of the structural drawing is kept unchanged. Specifically, in the process of adjusting the structure node, all nodes in the structure node may be adjusted according to the first ratio, or the node connected to the target pilot line may be adjusted according to the first ratio. Based on fig. 3B, for example, the lead line between node 3111 and node 31111 does not satisfy the predetermined length, node 3111 and/or node 31111 are scaled down, e.g., by a first ratio and the width is unchanged. The lead line between the two is extended in a second ratio and connected to node 3111 and node 31111 to avoid structural clutter. Of course, the first ratio and the second ratio are related to the preset length of the guide wire, and the extended length of the guide wire is required to be above the preset length. And the rest guide lines which do not meet the preset length can be processed according to the method, so that the problem of disordered structure search caused by over short guide lines is avoided.
The guide line is optimized by extending the target guide line which does not meet the preset length, so that the problem of disordered structure search caused by over-short guide line can be solved, and a foundation is laid for quickly and accurately reconstructing a frame structure of a structure diagram. And can also save computing resources.
In step 104, according to the structure nodes and the guide lines, a structure search is performed on the mask image by a structure search method to obtain a node relation tree. Specifically, the structure nodes include adjusted nodes and unadjusted nodes, and the guide lines include adjusted guide lines and unadjusted guide lines. The structure searching method can be a depth-first searching algorithm and a connected domain algorithm, a breadth-first searching algorithm and a connected domain algorithm, an optimal-first algorithm and a neighborhood algorithm, a hill climbing method and a connected domain algorithm and the like.
Specifically, when structure searching is carried out, firstly, a root node in the structure nodes is stored in a node stack, and the root node is used as a starting point to combine with a guide line to carry out structure searching on a mask image, wherein the structure searching step is as follows; selecting a pth search point positioned in a jth node from the node stack, and if the node identification of the pth search point is different from that of the jth node, determining the jth node as a child node of the pth search point, wherein the pth search point is a node; if the node identification of the pth search point is the same as that of the jth node, performing connected domain analysis on the mask image by taking the pth search point as the center, if a qth search point communicated with the pth search point is searched, storing the qth search point in a node stack, and taking the node identification of the pth search point as the node identification of the qth search point, wherein the jth node is a node in the structure nodes; after each of the structural nodes is searched for by the structural search step, a node relationship tree is acquired.
In the practical application process, the concrete implementation steps of the structure searching method are as follows:
s1, firstly, extracting a root node from the structure node, and storing the root node in a node stack D;
s2, circularly executing steps S21 and S22;
s21, taking out a search point p from D, if p is in node j and p.id (node number of p) is not equal to j.id, indicating that a new node is found to be p and node j is a child node of node p, then continuing to circularly execute step S21, and taking out another search point from D; otherwise, step S22 is executed.
S22, taking p as a center and radius r, generating a search circle (or search box) on the mask image, performing connected domain analysis in the search circle, if q and p are connected for a point q on the search circle whose mask value is 1, storing q in stack a, and storing the last searched node id;
and, after each of the structural nodes is searched through the steps S21 and S22, one tree structure relationship of all the nodes is obtained, and the tree structure relationship is taken as the node relationship tree. Referring to fig. 3C, the child node direction is indicated by an arrow J after the node relationship trees of all the nodes are acquired through steps S21 and S22. Further, acquiring a frame structure of the structure diagram according to the node relation tree and the guide line; wherein, the frame structure of the structure chart is in an editable state. For example, the mask image is in an editable state, and can receive operation instructions of a user to perform corresponding modification such as extension, shortening and deletion. Therefore, the frame structure of the structure diagram can be quickly and accurately restored by combining the node relation tree with the guide line to support a user to edit the structure diagram.
In another embodiment of the present specification, after the frame structure of the structure diagram is obtained, the frame structure of the structure diagram is maintained, and the frame structure of the structure diagram is made to be in an editable state in a corresponding file. For example, the framework structures are saved as visio and word, but do not form a limitation. In this manner, the user can open the file to edit the structure map. Of course, the embodiment may also use a structured description file to save the framework structure of the structure diagram, such as a JSON file.
Based on the technical scheme, the picture to be processed containing the structure graph is detected through an image processing method, and structure nodes and guide lines in the structure graph are obtained; then adjusting the structure nodes and the guide lines; and performing structure search according to the structure nodes and the guide lines to obtain the frame structure of the structure diagram. Therefore, after the node structure and the guide line are obtained, the node structure and the guide line are adjusted and optimized to avoid the disorder of structure searching, and further, the frame structure of the structure diagram can be quickly and accurately restored during structure searching to support a user to edit the structure diagram.
Based on the same inventive concept as one or more of the above embodiments, an embodiment of the present invention further provides a structure reconstructing apparatus in a structural diagram, referring to fig. 4, where the apparatus includes:
an obtaining unit 401, configured to obtain a to-be-processed picture, where the to-be-processed picture includes a structure diagram;
a detection unit 402, configured to detect the to-be-processed picture, and obtain a structure node and a guidance wire in the structure diagram;
an adjusting unit 403, configured to adjust the structure node and the guide line;
a searching unit 404, configured to perform structure search according to the structure node and the guide line, and obtain a frame structure of the structure diagram.
In an optional implementation manner, the detecting unit 402 is configured to:
conducting guide line detection on the picture to be processed to obtain the guide line; wherein the guidewire has a guidewire position, a guidewire size;
carrying out node detection on the picture to be processed to obtain the structural node; wherein the structure node has a node location, a node size, and a node type.
In an optional implementation manner, the adjusting unit 403 is configured to:
in the mask image, the structure nodes are adjusted according to a first proportion, and the guide lines are adjusted and lengthened according to a second proportion; wherein the second ratio is determined by the first ratio.
In an optional implementation manner, the adjusting unit 403 is configured to:
and in the mask image, when a target guide line with a length smaller than or equal to a preset length exists, adjusting the structure node according to the first proportion, and adjusting the target guide line according to the second proportion.
In an optional implementation manner, the adjusting unit 403 is configured to: and adjusting the structure node connected with the target guide wire according to the first proportion.
In an optional implementation manner, the search unit 404 is configured to:
according to the structural nodes, performing structural search on the mask image by a structural search method to obtain a node relation tree;
and acquiring the frame structure according to the node relation tree and the guide line.
In an optional implementation manner, the search unit 404 is configured to:
storing a root node in the structure nodes in a node stack, and performing structure search on the mask image by taking the root node as a starting point, wherein the structure search step is as follows;
selecting a pth search point positioned in a pth node from the node stack, and if the node identifier of the pth search point is different from the node identifier of the pth node, determining that the pth node is a child node of the pth search point, and the pth search point is a node; if the node identification of the p-th search point is the same as that of the j-th node, performing connected domain analysis on the mask image by taking the p-th search point as a center, if a q-th search point communicated with the p-th search point is searched, storing the q-th search point in the node stack, and taking the node identification of the p-th search point as the node identification of the q-th search point, wherein the j-th node is a node in the structural node;
obtaining the node relationship tree after each of the structure nodes is searched for by the structure searching step.
In an alternative embodiment, the apparatus further comprises:
and the storage unit is used for storing the frame structure.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Based on the same inventive concept, an embodiment of the present invention provides an electronic device 800, and fig. 5 is a block diagram illustrating the electronic device 800 according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 5, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/presentation (P/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing elements 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides a presentation interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to present and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for presenting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
Fig. 6 is a schematic diagram of a server in some embodiments of the invention. The server 1900 may vary widely by configuration or performance and may include one or more Central Processing Units (CPUs) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) storing applications 1942 or data 1944. Memory 1932 and storage medium 1930 can be, among other things, transient or persistent storage. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a series of instructions operating on a server. Still further, a central processor 1922 may be provided in communication with the storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input-output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
Based on the same inventive concept, in an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the electronic device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions stored thereon that, when executed by a processor of a mobile terminal, enable the mobile terminal to perform a structure reconstruction method of a structure diagram, the method comprising:
acquiring a picture to be processed, wherein the picture to be processed comprises a structure diagram;
detecting the picture to be processed to obtain a structure node and a guide line in the structure chart;
adjusting the structural nodes and the guide lines;
and performing structure search according to the structure nodes and the guide lines to obtain a frame structure of the structure diagram.
Further, it should be noted that: embodiments of the present application also provide a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor can execute the computer instruction, so that the computer device executes the description of the structure reconstruction method for the structure map in the embodiment corresponding to fig. 1, which is described above, and therefore, the description of this method will not be repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer program product or the computer program referred to in the present application, reference is made to the description of the embodiments of the method of the present application.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is only limited by the appended claims
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (12)

1. A method for reconstructing a structure of a structure map, the method comprising:
acquiring a picture to be processed, wherein the picture to be processed comprises a structure diagram;
detecting the picture to be processed to obtain a structure node and a guide line in the structure chart;
adjusting the structural nodes and the guide lines;
and performing structure search according to the structure nodes and the guide lines to obtain a frame structure of the structure diagram.
2. The method of claim 1, wherein the detecting the picture to be processed to obtain the structure nodes and the guide lines in the structure diagram comprises:
conducting guide line detection on the picture to be processed to obtain the guide line; wherein the guidewire has a guidewire position and a guidewire size;
carrying out node detection on the picture to be processed to obtain the structural node; wherein the structure node has a node location, a node size, and a node type.
3. The method of claim 1, wherein the adjusting the structural nodes and the steering wires comprises:
generating a mask image;
in the mask image, the structure nodes are adjusted according to a first proportion, and the guide lines are adjusted and lengthened according to a second proportion; wherein the second ratio is determined by the first ratio.
4. The method of claim 3, wherein said adjusting said structure nodes to a first scale and said steering lines to a second scale in said mask image comprises:
and in the mask image, when a target guide line with a length smaller than or equal to a preset length exists, adjusting the structure node according to the first proportion, and adjusting the target guide line according to the second proportion.
5. The method of claim 4, wherein said adjusting said fabric node according to a first ratio comprises:
and adjusting the structure node connected with the target guide wire according to the first proportion.
6. The method of claim 3, wherein said performing a structure search based on said structure nodes and said guideline to obtain a frame structure of said structure graph comprises:
according to the structural nodes, performing structural search on the mask image by a structural search method to obtain a node relation tree;
and acquiring the frame structure according to the node relation tree and the guide line.
7. The method of claim 6, wherein the performing a structure search on the mask image according to the structure node by a structure search method to obtain a node relationship tree comprises:
storing a root node in the structure nodes in a node stack, and performing structure search on the mask image by taking the root node as a starting point, wherein the structure search step is as follows;
selecting a pth search point positioned in a pth node from the node stack, and if the node identifier of the pth search point is different from the node identifier of the pth node, determining that the pth node is a child node of the pth search point, and the pth search point is a node; if the node identification of the p-th search point is the same as that of the j-th node, performing connected domain analysis on the mask image by taking the p-th search point as a center, if a q-th search point communicated with the p-th search point is searched, storing the q-th search point in the node stack, and taking the node identification of the p-th search point as the node identification of the q-th search point, wherein the j-th node is a node in the structural node;
obtaining the node relationship tree after each of the structure nodes is searched for by the structure searching step.
8. The method of claim 1, wherein after said obtaining the framework structure of the architectural view, the method further comprises:
and saving the frame structure.
9. A structure reconstruction apparatus for a structure map, the apparatus comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a picture to be processed, and the picture to be processed comprises a structure diagram;
the detection unit is used for detecting the picture to be processed and acquiring a structure node and a guide line in the structure chart;
the adjusting unit is used for adjusting the structure nodes and the guide lines;
and the searching unit is used for carrying out structure searching according to the structure nodes and the guide lines to obtain the frame structure of the structure diagram.
10. An electronic device comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors to execute operating instructions included in the one or more programs for performing the corresponding method according to any one of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps corresponding to the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that it comprises computer instructions stored in a computer readable storage medium and adapted to be read and executed by a processor to cause a computer device having said processor to perform the method of any of claims 1-8.
CN202111276077.8A 2021-10-29 2021-10-29 Structure reconstruction method and device of structure diagram, electronic equipment and storage medium Pending CN114154466A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111276077.8A CN114154466A (en) 2021-10-29 2021-10-29 Structure reconstruction method and device of structure diagram, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111276077.8A CN114154466A (en) 2021-10-29 2021-10-29 Structure reconstruction method and device of structure diagram, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114154466A true CN114154466A (en) 2022-03-08

Family

ID=80458867

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111276077.8A Pending CN114154466A (en) 2021-10-29 2021-10-29 Structure reconstruction method and device of structure diagram, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114154466A (en)

Similar Documents

Publication Publication Date Title
US10296201B2 (en) Method and apparatus for text selection
CN108256555B (en) Image content identification method and device and terminal
CN108038102B (en) Method and device for recommending expression image, terminal and storage medium
CN109961094B (en) Sample acquisition method and device, electronic equipment and readable storage medium
US11749273B2 (en) Speech control method, terminal device, and storage medium
EP3015997A1 (en) Method and device for facilitating selection of blocks of information
CN110781323A (en) Method and device for determining label of multimedia resource, electronic equipment and storage medium
CN110764627B (en) Input method and device and electronic equipment
CN110781905A (en) Image detection method and device
CN110930984A (en) Voice processing method and device and electronic equipment
CN112492201A (en) Photographing method and device and electronic equipment
CN110941727B (en) Resource recommendation method and device, electronic equipment and storage medium
CN112685269A (en) Data acquisition method and device, electronic equipment and storage medium
CN116092147A (en) Video processing method, device, electronic equipment and storage medium
CN114154466A (en) Structure reconstruction method and device of structure diagram, electronic equipment and storage medium
CN110968246A (en) Intelligent Chinese handwriting input recognition method and device
CN112784858B (en) Image data processing method and device and electronic equipment
CN114090738A (en) Method, device and equipment for determining scene data information and storage medium
CN114154465A (en) Structure reconstruction method and device of structure diagram, electronic equipment and storage medium
US10423706B2 (en) Method and device for selecting information
CN115484471B (en) Method and device for recommending anchor
US20230274565A1 (en) Image, pattern and character recognition
CN113096695B (en) Contrast display method and device for contrast display
CN110619634B (en) Image processing method, image processing apparatus, electronic device, and medium
US20230138241A1 (en) Method and apparatus for processing multimedia data, and storage medium

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