Line body contour completion method and device, equipment and storage medium
By performing contour extraction and irregular triangular network construction methods on line body areas in the image, the problem of pixel points missing in contour extraction is solved, and a higher quality line body contour extraction is achieved.
Patent Information
- Application Number
- CN202411757744.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-28
AI Technical Summary
When the prior art performs contour extraction of line body areas in image processing, due to the presence of noise and blur, pixel points are missing in the contour image, which reduces the contour extraction quality.
By obtaining the line area in the original image, contour extraction is performed, irregular triangle nets are constructed and centroid points are extracted, irregular triangle nets that do not fall into the line area, and finally the remaining irregular triangle nets are fused to complete the outline.
Effectively complete the pixel point loss during contour extraction, improving the quality of line contour extraction.
Smart Images

Figure CN119722716A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a line contour completion method, device, equipment and storage medium. Background Art
[0002] In the field of image processing technology, it is often necessary to extract the contour of a target area in an image.
[0003] In the related technology, contour extraction includes two main steps: edge detection and contour detection. First, the local edge in the target area is highlighted by the edge enhancement operator, the "edge strength" of the pixel is defined, and then the edge point set is extracted by setting the threshold, and these extracted edge points are connected into a complete line.
[0004] However, due to the presence of noise and blur, the detected boundary may become wider or discontinuous at a certain point, resulting in the defect of missing pixels in the contour image obtained by contour extraction, especially when contour extraction is performed on line areas, which greatly reduces the quality of contour extraction. Summary of the invention
[0005] The purpose of the present application is to provide a line contour completion method, device, equipment and storage medium, which can complete the missing pixels during contour extraction and improve the quality of line contour extraction.
[0006] The present application provides a line contour completion method, including:
[0007] Obtaining an original image having a plurality of line regions;
[0008] Extracting the contour of the line area in the original image to obtain a line contour image;
[0009] Constructing an irregular triangulated network using pixel points of the line area in the line contour image, and extracting the centroid point of the irregular triangulated network;
[0010] Eliminate the target irregular triangulated network; the target irregular triangulated network is an irregular triangulated network whose centroid does not fall within the line area in the line contour image;
[0011] The remaining irregular triangulated networks are fused to obtain a line contour completion image.
[0012] In some embodiments, the step of extracting the contour of the line area in the original image to obtain the line contour image includes:
[0013] Marking the line area in the original image to obtain a marked image;
[0014] Binarizing the logo image to obtain a binary image;
[0015] A contour extraction tool is called to perform contour extraction on the line area in the binary image to obtain the line contour image.
[0016] In some embodiments, constructing an irregular triangulated network using pixel points of the line area in the line contour image and extracting the centroid point of the irregular triangulated network includes:
[0017] Extracting the center point of the pixel points of the line area in the line contour image;
[0018] Using an irregular triangulated network generation algorithm, connecting the center points of the pixel points of the line area in the line contour image to construct multiple irregular triangulated networks;
[0019] Extract the centroid point of each irregular triangulated network.
[0020] In some embodiments, when the number of the line regions is at least two, the center points of the pixel points of different line regions in the line contour image are connected to construct a plurality of irregular triangulated networks between the different line regions.
[0021] In some embodiments, the removing of the target irregular triangulated network includes:
[0022] Generate a centroid point area centered on the centroid point of the irregular triangulated network;
[0023] Determine whether the centroid area falls within the line area in the line contour image;
[0024] If it does not fall into the region, the irregular triangulated network where the centroid point region is located is eliminated.
[0025] In some embodiments, the fusing of the remaining irregular triangulated networks to obtain a line contour completion image includes:
[0026] The outermost contour lines of the remaining irregular triangulated networks are retained, other contour lines of the remaining irregular triangulated networks are removed, and the areas surrounded by the outermost contour lines of the remaining irregular triangulated networks are filled to obtain a line contour completion image.
[0027] In some embodiments, the line contour completion method further includes:
[0028] Extracting skeleton lines of the line body area in the line body contour completion image;
[0029] The skeleton line of the line area in the line body contour completion image is superimposed on the line body contour image, and the line area completion quality of the line body contour completion image is determined according to the skeleton line superposition result.
[0030] The present application also provides a line contour completion device, including:
[0031] The first module is used to obtain an original image having a plurality of linear regions;
[0032] The second module is used to extract the contour of the line area in the original image to obtain a line contour image;
[0033] The third module is used to construct an irregular triangulated network using the pixel points of the line area in the line contour image, and extract the centroid point of the irregular triangulated network;
[0034] The fourth module is used to remove the target irregular triangulated network; the target irregular triangulated network is an irregular triangulated network whose centroid does not fall within the line area in the line contour image;
[0035] The fifth module is used to fuse the remaining irregular triangulated networks to obtain a line contour completion image.
[0036] An embodiment of the present application further provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned line contour completion method when executing the computer program.
[0037] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned line contour completion method is implemented.
[0038] The beneficial effects of the present application are as follows: by extracting the contour of the line area in the original image, a line contour image is obtained, an irregular triangulated network is constructed using the pixel points of the line area in the line contour image and the centroid point of the irregular triangulated network is extracted, the irregular triangulated networks whose centroid points do not fall within the line area in the line contour image are eliminated, and finally the remaining irregular triangulated networks are merged to obtain a line contour completion image. Since an irregular triangulated network is constructed using the pixel points of the line area in the line contour image after the contour of the line area in the original image is extracted, and then an effective irregular triangulated network is determined based on the centroid point of the irregular triangulated network, and the line contour is completed using the effective irregular triangulated network, the missing pixels during contour extraction can be effectively completed, thereby improving the quality of line contour extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flow chart of the line contour completion method provided in an embodiment of the present application.
[0040] Figure 2 It is a flowchart of the specific method of step S102 provided in an embodiment of the present application.
[0041] Figure 3 It is a flowchart of the specific method of step S103 provided in an embodiment of the present application.
[0042] Figure 4 It is a flowchart of the specific method of step S104 provided in an embodiment of the present application.
[0043] Figure 5 It is a structural schematic diagram of a line contour completion device provided in an embodiment of the present application.
[0044] Figure 6 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application.
[0045] Figure 7 It is a schematic diagram of the effect of the logo image provided in the embodiment of the present application.
[0046] Figure 8 It is a schematic diagram of the effect of the binarization image provided in the embodiment of the present application.
[0047] Fig. 9 It is a schematic diagram of the line contour image effect provided in an embodiment of the present application.
[0048] Fig.10 It is a schematic diagram of the effect of extracting the center point of the pixel points of the line area in the line contour image provided by the embodiment of the present application.
[0049] Fig.11 It is a schematic diagram of the effect of constructing an irregular triangulated network provided in an embodiment of the present application.
[0050] Fig.12 It is a schematic diagram of the effect of extracting the centroid point of an irregular triangulated network provided in an embodiment of the present application.
[0051] Fig.13 It is a schematic diagram of the effect of generating a centroid point area provided in an embodiment of the present application.
[0052] Fig.14 It is a schematic diagram of the effect after removing the target irregular triangulated network provided in an embodiment of the present application.
[0053] Fig.15 It is a schematic diagram of the effect of completing the line contour of an image provided in an embodiment of the present application.
[0054] Fig.16 It is a schematic diagram of the effect of extracting the skeleton line of the line area in the line contour completion image provided by an embodiment of the present application.
[0055] Fig.17 It is a schematic diagram of the effect of the superposition effect diagram of the skeleton line of the line area in the line contour completion image and the line contour image provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0057] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown can be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second" and the like in the specification, claims and drawings are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0059] Figure 1 is a flow chart of the line contour completion method provided in the embodiment of the present application. Figure 1 In some embodiments, the method may include but is not limited to steps S101 to S105.
[0060] It should be noted that the execution subject of the line contour completion method provided in the embodiment of this specification can be applied to the terminal side device or the cloud side device, and this embodiment does not limit this.
[0061] Step S101, obtaining an original image having a plurality of linear regions.
[0062] The execution subject may obtain the original image having the plurality of linear regions, for example, by calling the original image from a preset database or downloading the original image from a cloud device.
[0063] It is understandable that the original image is an image containing a corresponding scene screen, and the local area in the scene screen includes a plurality of line areas. For example, the scene screen can be a geographic information screen, a pipe network information screen, or a highway information screen, and the line areas are distributed within the scene screen.
[0064] It is understandable that the line area is a long strip area in the scene picture. For example, the line area can be a river outline area in a geographic information picture, a pipeline outline area in a pipe network information picture, or a highway outline area in a highway information picture.
[0065] Step S102, extracting the contour of the line area in the original image to obtain a line contour image.
[0066] After determining the line area in the original image, the execution subject extracts the contour of the line area in the original image to obtain a line contour image. In a specific implementation, the line area in the original image can be determined by the user marking the line area in the original image, or the execution subject can use a corresponding contour recognition algorithm to detect the line area in the original image. After identifying the marking result or detecting the line area in the original image, the execution subject can call a corresponding contour extraction algorithm to extract the contour of the line area in the original image to obtain a line contour image.
[0067] Figure 2 is a flowchart of a specific method of step S102 provided in an embodiment of the present application. Figure 2 In some embodiments, the method includes but is not limited to steps S201 to S203.
[0068] Step S201, marking the line area in the original image to obtain a marked image.
[0069] Step S202, binarization processing is performed on the logo image to obtain a binarized image.
[0070] Step S203, calling a contour extraction tool to extract the contour of the line area in the binary image to obtain a line contour image.
[0071] After determining the line area in the original image, the user interacts with the execution subject to identify the line area in the original image. The execution subject binarizes the identified image and calls the contour extraction tool to extract the contour of the line area in the binary image to obtain a line contour image. In a specific implementation, the user interacts with the execution subject to identify the line area in the original image so that the pixel color of the line area in the original image is different from the pixel color of the non-line area to obtain the identification image. The execution subject obtains the identification image and assigns the identification image a corresponding image coordinate system. The identification image is then binarized to extract the identified line area in the identification image, improve the contrast between the line area and the non-line area, and obtain a binary image. The contour extraction tool is then called to extract the contour of the line area in the binary image to extract pixel points whose pixel colors meet the preset pixel color threshold requirements in the binary image to obtain a line contour image. The line area in the line contour image is composed of multiple pixel points obtained by contour extraction. Exemplary, such as Figure 7As shown in the figure, the line area in the logo image is marked in yellow, where the scene picture contained in the original image is the highway information picture, and the line area is the highway contour area in the highway information picture. The execution subject performs binarization processing on the logo image by creating a mask, and obtains the following Figure 8 The binary image shown in the figure is then executed by calling the contour extraction tool to perform contour extraction on the line area in the binary image to extract the pixel points whose pixel colors meet the preset pixel color threshold requirements in the binary image, and the following is obtained: Fig. 9 Line body contour image shown.
[0072] Preferably, the contour extraction tool is an openCV platform.
[0073] It is understandable that the color of the pixels in the non-linear area will affect the contour extraction of the linear area, resulting in varying degrees of pixel missing in the linear area in the linear contour image, and the linear area in the linear contour image is incomplete. Therefore, further contour completion is required.
[0074] Step S103, constructing an irregular triangulated network using the pixel points of the line area in the line contour image, and extracting the centroid point of the irregular triangulated network.
[0075] After obtaining the line body contour image, the execution subject constructs an irregular triangulated network using the pixel points of the line body area in the line body contour image, and extracts the centroid point of the irregular triangulated network. In the specific implementation, the execution subject adopts the corresponding irregular triangulated network generation algorithm to connect the pixel points of the line body area in the line body contour image to construct multiple irregular triangulated networks, and after traversing all the pixel points of the line body area in the line body contour image, extracts the centroid point of each irregular triangulated network.
[0076] Figure 3 is a flowchart of a specific method of step S103 provided in an embodiment of the present application. Figure 3 In some embodiments, the method includes but is not limited to steps S301 to S303.
[0077] Step S301, extracting the center point of the pixel points of the line area in the line contour image.
[0078] Step S302: using an irregular triangulated network generation algorithm, connecting the center points of the pixel points of the line area in the line contour image to construct a plurality of irregular triangulated networks.
[0079] Step S303: extracting the centroid points of each irregular triangulated network.
[0080] After obtaining the line body contour image, the execution body first extracts the center points of the pixel points of the line body area in the line body contour image as the reference points of the pixel points, and then uses the irregular triangulated network generation algorithm to connect the center points of the pixel points of the line body area in the line body contour image. Each center point can be connected to at least two other center points to construct multiple irregular triangulated networks. The triangulated network centroid point extraction algorithm is used, and finally each irregular triangulated network is traversed to extract the centroid point of each irregular triangulated network to obtain the centroid point of each irregular triangulated network.
[0081] In some embodiments, when the number of line regions is at least two, the center points of the pixels of different line regions in the line contour image are connected to construct a plurality of irregular triangulated networks between different line regions. In a specific implementation, when the number of line regions is at least two, the center point of a pixel of one line region is connected to the center points of two pixel of another line region to construct an irregular triangulated network, so that the constructed irregular triangulated network covers the blank areas between the line regions, which can improve the accuracy of line contour completion. Exemplarily, after extracting the center points of the pixels of the line regions in the line contour image, the following is obtained: Fig.10 The center points of the pixels in the line area in the line contour image are distributed as shown in FIG. 1 , and then the irregular triangulated network generation algorithm is used to connect the center points of the pixels in the line area in the line contour image to construct a triangulated network as shown in FIG. Fig.11 The multiple irregular triangulated networks shown in the figure are finally extracted with the centroid points of each irregular triangulated network to obtain the following Fig.12 The centroid points of each irregular triangulated network are shown.
[0082] Step S104, eliminating the target irregular triangulated network, wherein the target irregular triangulated network is an irregular triangulated network whose centroid does not fall within the line region of the line contour image.
[0083] After obtaining the centroid point of each irregular triangulated network, the execution subject uses the position of the centroid point of the irregular triangulated network as a basis to screen each irregular triangulated network, retaining the irregular triangulated network whose centroid point falls within the line body area in the line body contour image, and eliminating the irregular triangulated network whose centroid point does not fall within the line body area in the line body contour image, that is, eliminating the target irregular triangulated network.
[0084] Figure 4 is a flowchart of a specific method of step S104 provided in an embodiment of the present application. Figure 4 In some embodiments, the method includes but is not limited to steps S401 to S404.
[0085] Step S401, generating a centroid area centered on the centroid of the irregular triangulated network.
[0086] Step S402, determining whether the centroid area falls within the line area in the line contour image.
[0087] If not, execute step S403; if yes, execute step S404.
[0088] Step S403, eliminating the irregular triangulated network where the centroid point area is located.
[0089] Step S404, retaining the irregular triangulated network where the centroid point area is located.
[0090] After obtaining the centroid point of each irregular triangulated network, for the centroid point of each irregular triangulated network, the execution body generates a centroid point area centered on the centroid point of the irregular triangulated network, so that the effective area of the centroid point of the irregular triangulated network extends from the outer edge to the area range of the centroid point area, that is, the area range of the centroid point area is used as the effective area range of the centroid point of the irregular triangulated network, and then determines whether the centroid point area falls within the line area in the line contour image. If it does, the irregular triangulated network where the centroid point area is located is considered to be a valid irregular triangulated network, and the irregular triangulated network where the centroid point area is located is retained. If it does not fall, the irregular triangulated network where the centroid point area is located is considered to be an invalid irregular triangulated network, and the irregular triangulated network where the centroid point area is located is discarded. Exemplarily, a centroid point area centered on the centroid point of the irregular triangulated network is generated, and the following is obtained: Fig.13 Then determine whether the centroid area falls within the line area in the line body contour image, and remove the irregular triangulated network whose centroid area does not fall within the line area in the line body contour image, and obtain the following Fig.14 The centroid point area shown falls within the irregular triangulated network within the line body area in the line body contour image.
[0091] Step S105, fusing the remaining irregular triangulated networks to obtain a line contour completion image.
[0092] In a specific embodiment, the execution body retains the outermost contour lines of the remaining irregular triangulated networks, removes other contour lines of the remaining irregular triangulated networks, fills the area surrounded by the outermost contour lines of the remaining irregular triangulated networks, and obtains a line contour completion image. Exemplarily, the remaining irregular triangulated networks are fused to obtain the following: Fig.15 The line body contour completion image shown.
[0093] In some embodiments, the line contour completion method provided in the embodiments of the present application also includes: extracting the skeleton lines of the line area in the line contour completion image; superimposing the skeleton lines of the line area in the line contour completion image onto the line contour image, and determining the line area completion quality of the line contour completion image based on the skeleton line superposition results.
[0094] In a specific implementation, after obtaining the line body contour completion image, a skeleton line extraction algorithm is used to extract the skeleton lines of the line body area in the line body contour completion image. Then, the skeleton lines of the line body area in the line body contour completion image are superimposed on the line body contour image to identify whether the skeleton lines of the line body area in the line body contour completion image all fall within the line body area in the line body contour image. If they all fall within the line body area in the line body contour image, it is determined that the line body area completion quality of the line body contour completion image meets the requirements. Otherwise, it is determined that the line body area completion quality of the line body contour completion image does not meet the requirements.
[0095] Exemplarily, the skeleton line of the line body area in the line body contour completion image is extracted to obtain the following Fig.16 The skeleton line of the line body area in the line body contour completion image shown in FIG. 1 is superimposed on the line body contour image to obtain the following Fig.17 The superposition effect diagram of the skeleton line of the line body area in the line body contour completion image and the line body contour image is shown.
[0096] See also Figure 5 The embodiment of the present application also provides a line contour completion device, which can implement the above-mentioned line contour completion method, and the device includes:
[0097] The first module 501 is used to obtain an original image having a plurality of linear regions;
[0098] The second module 502 is used to extract the contour of the line area in the original image to obtain a line contour image;
[0099] The third module 503 is used to construct an irregular triangulated network using the pixel points of the line area in the line contour image, and extract the centroid point of the irregular triangulated network;
[0100] The fourth module 504 is used to remove the target irregular triangulated network; the target irregular triangulated network is an irregular triangulated network whose centroid does not fall within the line area of the line contour image;
[0101] The fifth module 505 is used to fuse the remaining irregular triangulated networks to obtain a line contour completion image.
[0102] The specific implementation of the line contour completion device is basically the same as the specific implementation of the above-mentioned line contour completion method, and will not be repeated here.
[0103] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment.
[0104] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present disclosure is described. Figure 6The electronic device 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0105] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0106] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned line contour completion method section of this specification.
[0107] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0108] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0109] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0110] The electronic device 600 may also communicate with one or more external devices 600' (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0111] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned line contour completion method is implemented.
[0112] The line contour completion method, device, equipment and storage medium provided in the embodiments of the present application extract the contour of the line area in the original image to obtain the line contour image, use the pixel points of the line area in the line contour image to construct an irregular triangulated network and extract the centroid point of the irregular triangulated network, remove the irregular triangulated networks whose centroid points do not fall within the line area in the line contour image, and finally merge the remaining irregular triangulated networks to obtain the line contour completion image. Since the irregular triangulated network is constructed using the pixel points of the line area in the line contour image after the contour of the line area in the original image is extracted, and then the effective irregular triangulated network is determined according to the centroid point of the irregular triangulated network, and the line contour is completed using the effective irregular triangulated network, the missing pixels during contour extraction can be effectively completed, thereby improving the quality of line contour extraction.
[0113] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation of the present disclosure.
[0114] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0115] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0116] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
[0117] The exemplary embodiments of the present disclosure are specifically shown and described above. It should be understood that the present disclosure is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present disclosure is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.
Claims
1. A line contour completion method, characterized in that: include: Obtaining an original image having a plurality of line regions; Extracting the contour of the line area in the original image to obtain a line contour image; Constructing an irregular triangulated network using pixel points of the line area in the line contour image, and extracting the centroid point of the irregular triangulated network; Eliminate the target irregular triangulated network; the target irregular triangulated network is an irregular triangulated network whose centroid does not fall within the line area in the line contour image; The remaining irregular triangulated networks are fused to obtain a line contour completion image.
2. The line contour completion method according to claim 1, characterized in that: The step of extracting the contour of the line area in the original image to obtain a line contour image includes: Marking the line area in the original image to obtain a marked image; Binarizing the logo image to obtain a binary image; A contour extraction tool is called to perform contour extraction on the line area in the binary image to obtain the line contour image.
3. The line contour completion method according to claim 1, characterized in that: The step of constructing an irregular triangulated network using pixel points of a line region in the line contour image and extracting a centroid point of the irregular triangulated network includes: Extracting the center point of the pixel points of the line area in the line contour image; Using an irregular triangulated network generation algorithm, connecting the center points of the pixel points of the line area in the line contour image to construct multiple irregular triangulated networks; Extract the centroid point of each irregular triangulated network.
4. The line contour completion method according to claim 3, characterized in that: When the number of the line regions is at least two, the center points of the pixel points of different line regions in the line contour image are connected to construct a plurality of irregular triangulated networks between the different line regions.
5. The line contour completion method according to claim 1, characterized in that: The removing target irregular triangulated network comprises: Generate a centroid point area centered on the centroid point of the irregular triangulated network; Determine whether the centroid area falls within the line area in the line contour image; If it does not fall into the region, the irregular triangulated network where the centroid point region is located is eliminated.
6. The line contour completion method according to claim 1, characterized in that: The step of fusing the remaining irregular triangulated networks to obtain a line contour completion image includes: The outermost contour lines of the remaining irregular triangulated networks are retained, other contour lines of the remaining irregular triangulated networks are removed, and the areas surrounded by the outermost contour lines of the remaining irregular triangulated networks are filled to obtain a line contour completion image.
7. The line contour completion method according to claim 1, characterized in that: Also includes: Extracting skeleton lines of the line body area in the line body contour completion image; The skeleton line of the line area in the line body contour completion image is superimposed on the line body contour image, and the line area completion quality of the line body contour completion image is determined according to the skeleton line superposition result.
8. A line contour completion device, characterized in that: include: The first module is used to obtain an original image having a plurality of linear regions; The second module is used to extract the contour of the line area in the original image to obtain a line contour image; The third module is used to construct an irregular triangulated network using the pixel points of the line area in the line contour image, and extract the centroid point of the irregular triangulated network; The fourth module is used to remove the target irregular triangulated network; the target irregular triangulated network is an irregular triangulated network whose centroid does not fall within the line area in the line contour image; The fifth module is used to fuse the remaining irregular triangulated networks to obtain a line contour completion image.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the line contour completion method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the line contour completion method according to any one of claims 1 to 7 is implemented.