CN116051430A - Boundary map checking and repairing system and method - Google Patents

Boundary map checking and repairing system and method Download PDF

Info

Publication number
CN116051430A
CN116051430A CN202310336623.5A CN202310336623A CN116051430A CN 116051430 A CN116051430 A CN 116051430A CN 202310336623 A CN202310336623 A CN 202310336623A CN 116051430 A CN116051430 A CN 116051430A
Authority
CN
China
Prior art keywords
unit
breakpoint
calculation unit
blank
types
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.)
Granted
Application number
CN202310336623.5A
Other languages
Chinese (zh)
Other versions
CN116051430B (en
Inventor
王向春
田瑜基
满旺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Kingtop Information Technology Co Ltd
Original Assignee
Xiamen Kingtop Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Kingtop Information Technology Co Ltd filed Critical Xiamen Kingtop Information Technology Co Ltd
Priority to CN202310336623.5A priority Critical patent/CN116051430B/en
Publication of CN116051430A publication Critical patent/CN116051430A/en
Application granted granted Critical
Publication of CN116051430B publication Critical patent/CN116051430B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a boundary map checking and repairing system and method, comprising a graph simplifying module, a coordinate establishing module, a left breakpoint identifying module, a right breakpoint identifying module and a repairing module; the image simplification module is used for merging and simplifying pixel units in the area where the boundary to be detected is located; the coordinate establishing module establishes a coordinate system by taking the left lower corner of a computing unit at the leftmost lower part of the area where the boundary to be measured is positioned as an original point, taking the horizontal right of the original point as an X axis and taking the vertical upward of the original point as a Y axis; the left breakpoint identification module is used for identifying a left breakpoint of the boundary line, scanning from left to right column by column, and checking the types of the adjacent computing units on the right side, the upper right side and the lower right side of each computing unit one by one to judge whether the boundary line is coherent; the right breakpoint identification module is used for identifying a right breakpoint of the boundary line, scanning the boundary line from right to left in a row-by-row manner, and checking the types of the left, upper left and lower left adjacent computing units of each computing unit one by one to judge whether the boundary line is coherent; the repair module is used for repairing the break points of the left boundary line and the right boundary line to be consistent.

Description

Boundary map checking and repairing system and method
Technical Field
The invention relates to the field of image processing, in particular to a boundary map checking and repairing system and method.
Background
When the boundary electronic map is drawn, since the color filling condition of the tiny pixel elements is difficult to be identified by human eyes, the problem that the boundary is coherent in visual sense exists, but in practice, the boundary at some tiny places is not coherent exists. The pixel cells marking the border are filled with color, the width of the border being between the width of the pixel cell and the diagonal length of the pixel cell. In order to detect the continuity of a certain boundary line in an electronic map and repair the non-continuous boundary line, a boundary line map checking and repairing system and method are required to be designed to perform continuity checking and repairing on the certain boundary line in the electronic map.
Disclosure of Invention
Therefore, the invention designs a boundary map checking and repairing system and method for detecting the continuity of a certain boundary in an electronic map and repairing the non-continuity boundary.
The technical scheme adopted by the invention is as follows: a boundary map inspection and repair system:
the system comprises a graph simplifying module, a coordinate establishing module, a left breakpoint identifying module, a right breakpoint identifying module and a repairing module.
The pattern simplification module is used for merging and simplifying pixel units in the area where the boundary to be detected is located, and the specific mode is as follows:
(1) Combining four mutually adjacent square pixel units into a square computing unit, wherein the adjacent form comprises edge line adjacency and corner adjacency; the combined form of the computing units is 6 types in total:
(1) the upper left pixel unit fills in, the upper right pixel unit fills in, the lower left pixel unit is blank, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1100;
(2) the upper left pixel unit fills in color, the upper right pixel unit is blank, the lower left pixel unit fills in color, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1010;
(3) the upper left pixel unit fills up, the upper right pixel unit is blank, the lower left pixel unit is blank, and the lower right pixel unit fills up, and the type of the calculation unit is 1001;
(4) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is filled with color, and the type of the calculation unit is marked as 0101;
(5) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is filled with color, and the right lower pixel unit is blank, and the type of the calculation unit is marked as 0110;
(6) the left upper pixel unit is blank, the right upper pixel unit is blank, the left lower pixel unit is filled with color, and the right lower pixel unit is filled with color, and the type of the calculation unit is 0011;
(2) In addition to the above 6 calculation unit types, there are the following 4 kinds of edge units, which are also square units composed of four mutually adjacent square pixel units, including:
(1) the left upper pixel unit fills in color, the right upper pixel unit is blank, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 1000;
(2) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 0100;
(3) the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit filled with color and the right lower pixel unit blank, and the type of the calculation unit is 0010;
(4) the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit blank and the right lower pixel unit are filled with color, and the type of the calculation unit is marked 0001;
(3) The edge units are replaced by blank units, the blank units are square units formed by combining four mutually adjacent square pixel units, the top left pixel unit blank, the top right pixel unit blank, the bottom left pixel unit blank and the bottom right pixel unit blank of the square units, and the type of the calculation unit is marked as 0000.
The coordinate building module takes the lower left corner of the computing unit at the far left and below the area where the boundary line to be detected is located as an origin, takes the origin horizontal rightward as an X axis, takes the origin vertical upward as a Y axis, takes the order of the computing units on the X axis from the origin to the right as an X coordinate value, and takes the order of the computing units on the Y axis from the origin to the upward as a Y coordinate value, for example: the 100 th, 200 th calculation unit from origin to right, from original upward, has coordinates of (100, 200).
The left breakpoint identification module is used for identifying left breakpoints of the boundary lines, scanning the boundary lines from left to right in a region between the positive directions of the X axis and the positive directions of the Y axis, and starting from the first computing unit at the leftmost position, checking the type of adjacent computing units on the right side (X axis coordinates plus 1 and Y axis coordinates are unchanged), the upper right side (X axis coordinates plus 1 and Y axis coordinates plus 1) and the lower right side (X axis coordinates plus 1 and Y axis coordinates minus 1) of each computing unit one by one to judge whether the boundary lines are consistent, and the specific mode is that:
(1) The types of computing units that may be adjacent to the right side of computing unit 1100 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(2) The right side, upper right, and lower right of the computing unit 1010 have no computing unit types that can be adjoined;
(3) The types of computing units that may be adjacent to the right side of computing unit 1001 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(4) The types of computing units that may be contiguous to the right side of computing unit 0101 include 1100, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(5) The types of computing units that may be adjacent to the right side of computing unit 0110 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(6) The types of computing units that may be adjacent to the right side of computing unit 0011 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous to the bottom right include 1100, 1010, 1001.
When none of the above 6 calculation unit types has a calculation unit that can be accessed, the calculation unit is determined to be positioned at the left breakpoint of the boundary line.
The right breakpoint identification module is used for identifying a right breakpoint of the boundary line, scans from right to left in a region between the positive X-axis direction and the positive Y-axis direction, and checks the left side (X-axis coordinate minus 1, Y-axis coordinate unchanged), the upper left side (X-axis coordinate minus 1, Y-axis coordinate plus 1) and the lower left side (X-axis coordinate minus 1, Y-axis coordinate minus 1) of each computing unit one by one from the first computing unit at the right to determine whether the boundary line is consistent, and the specific mode is that:
(1) The types of computing units that may be contiguous to the left side of computing unit 1100 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(2) The types of computing units that may be adjacent to the left side of computing unit 1010 include 1100, 1001, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the types of computing units that may be adjoined at the bottom left include 1100, 1010, 0110;
(3) The types of computing units that may be adjacent to the left side of computing unit 1001 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(4) The left side, the upper left side and the lower left side of the computing unit 0101 have no computing unit types which can be adjacent;
(5) The types of computing units that may be contiguous to the left of computing unit 0110 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that can be adjoined at the bottom left include 1100, 0101, 0110;
(6) The types of computing units that may be contiguous to the left side of computing unit 0011 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that may be contiguous at the bottom left include 1100, 0101, 0110.
When none of the above 6 calculation unit types has a calculation unit that can be accessed, the calculation unit is determined to be positioned at the right breakpoint of the boundary line.
The repairing module is used for repairing the break points of the left boundary line and the right boundary line to be consistent, and the repairing module is used for repairing the break points of the left boundary line and the right boundary line to be consistent by the following steps:
(1) When the X-axis coordinate of the left breakpoint calculation unit is greater than the X-axis coordinate of the right breakpoint calculation unit:
(1) the type of the left breakpoint calculation unit is replaced by a blank unit, the type of the right breakpoint calculation unit is replaced by a blank unit, and the operation is repeated until the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit;
(2) When the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(3) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(4) and the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired.
(2) When the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit:
(1) when the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(2) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(3) and the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired.
(3) When the X-axis coordinate of the left breakpoint calculation unit is smaller than the X-axis coordinate of the right breakpoint calculation unit:
(1) when the left breakpoint calculation unit type is 1010, it is replaced with 1001;
(2) when the type of the breakpoint calculation unit on the right side is 0101, the breakpoint calculation unit is replaced by 0110;
(3) on the basis of completing (1) and (2), when the breakpoint can still be identified by using the left breakpoint identification module only or using the right breakpoint identification module only:
(4) The Y-axis coordinates of the left breakpoint calculation unit and the right breakpoint calculation unit are the same, the left breakpoint calculation unit type is multiplexed on the right side of the left breakpoint calculation unit, and then the right breakpoint calculation unit type is multiplexed on the left side of the right breakpoint calculation unit; repeating the steps until the breakpoint repairing is completed;
(5) the Y-axis coordinate of the left breakpoint calculation unit is smaller than that of the right breakpoint calculation unit, the blank unit on the right of the left breakpoint calculation unit is continuously replaced by 0110 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4);
(6) the Y-axis coordinate of the left breakpoint calculation unit is larger than that of the right breakpoint calculation unit, the blank unit at the lower right of the left breakpoint calculation unit is continuously replaced by 1001 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4).
A boundary map checking and repairing method is characterized in that:
step 1, merging and simplifying pixel units in a region where a boundary to be detected is located, wherein the specific mode is as follows:
(1) Combining four mutually adjacent square pixel units into a square computing unit, wherein the adjacent form comprises edge line adjacency and corner adjacency; the combined form of the computing units is 6 types in total:
(1) The upper left pixel unit fills in, the upper right pixel unit fills in, the lower left pixel unit is blank, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1100;
(2) the upper left pixel unit fills in color, the upper right pixel unit is blank, the lower left pixel unit fills in color, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1010;
(3) the upper left pixel unit fills up, the upper right pixel unit is blank, the lower left pixel unit is blank, and the lower right pixel unit fills up, and the type of the calculation unit is 1001;
(4) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is filled with color, and the type of the calculation unit is marked as 0101;
(5) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is filled with color, and the right lower pixel unit is blank, and the type of the calculation unit is marked as 0110;
(6) the left upper pixel unit is blank, the right upper pixel unit is blank, the left lower pixel unit is filled with color, and the right lower pixel unit is filled with color, and the type of the calculation unit is 0011;
(2) In addition to the above 6 calculation unit types, there are the following 4 kinds of edge units, which are also square units composed of four mutually adjacent square pixel units, including:
(1) The left upper pixel unit fills in color, the right upper pixel unit is blank, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 1000;
(2) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 0100;
(3) the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit filled with color and the right lower pixel unit blank, and the type of the calculation unit is 0010;
(4) the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit blank and the right lower pixel unit are filled with color, and the type of the calculation unit is marked 0001;
(3) The edge units are replaced by blank units, the blank units are square units formed by combining four mutually adjacent square pixel units, the top left pixel unit blank, the top right pixel unit blank, the bottom left pixel unit blank and the bottom right pixel unit blank of the square units, and the type of the calculation unit is marked as 0000.
Step 2, taking the lower left corner of the computing unit at the far left of the area where the boundary line to be measured is located as an origin, taking the horizontal right of the origin as an X axis, taking the vertical upward of the origin as a Y axis, taking the order of the computing units on the X axis from the origin to the right as an X coordinate value, and taking the order of the computing units on the Y axis from the origin to the upward as a Y coordinate value, for example: the 100 th, 200 th calculation unit from origin to right, from original upward, has coordinates of (100, 200).
Step 3, identifying the left break point of the boundary line, scanning from left to right in the area between the X-axis positive direction and the Y-axis positive direction, starting from the first computing unit at the leftmost position, checking the right side (X-axis coordinate is added with 1 and Y-axis coordinate is unchanged), the upper right side (X-axis coordinate is added with 1 and Y-axis coordinate is added with 1), and the lower right side (X-axis coordinate is added with 1 and Y-axis coordinate is subtracted with 1) of each computing unit one by one, and judging whether the boundary line is coherent or not by the following specific modes:
(1) The types of computing units that may be adjacent to the right side of computing unit 1100 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(2) The right side, upper right, and lower right of the computing unit 1010 have no computing unit types that can be adjoined;
(3) The types of computing units that may be adjacent to the right side of computing unit 1001 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(4) The types of computing units that may be contiguous to the right side of computing unit 0101 include 1100, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(5) The types of computing units that may be adjacent to the right side of computing unit 0110 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(6) The types of computing units that may be adjacent to the right side of computing unit 0011 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
when none of the above 6 calculation unit types has a calculation unit that can be accessed, the calculation unit is determined to be positioned at the left breakpoint of the boundary line.
Step 4, identifying the right break point of the boundary line, scanning from right to left in the area between the X-axis forward direction and the Y-axis forward direction, and starting from the first computing unit at the right, checking the left side (X-axis coordinate minus 1, Y-axis coordinate unchanged), the upper left side (X-axis coordinate minus 1, Y-axis coordinate plus 1) and the lower left side (X-axis coordinate minus 1, Y-axis coordinate minus 1) of each computing unit one by one, and abutting the computing unit types to judge whether the boundary line is consistent, wherein the specific method is as follows:
(1) The types of computing units that may be contiguous to the left side of computing unit 1100 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(2) The types of computing units that may be adjacent to the left side of computing unit 1010 include 1100, 1001, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the types of computing units that may be adjoined at the bottom left include 1100, 1010, 0110;
(3) The types of computing units that may be adjacent to the left side of computing unit 1001 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(4) The left side, the upper left side and the lower left side of the computing unit 0101 have no computing unit types which can be adjacent;
(5) The types of computing units that may be contiguous to the left of computing unit 0110 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that can be adjoined at the bottom left include 1100, 0101, 0110;
(6) The types of computing units that may be contiguous to the left side of computing unit 0011 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that can be adjoined at the bottom left include 1100, 0101, 0110;
when none of the above 6 calculation unit types has a calculation unit that can be accessed, the calculation unit is determined to be positioned at the right breakpoint of the boundary line.
And 5, repairing the break points of the left boundary line and the right boundary line to be consistent, wherein the method comprises the following steps:
(1) When the X-axis coordinate of the left breakpoint calculation unit is greater than the X-axis coordinate of the right breakpoint calculation unit:
(1) the type of the left breakpoint calculation unit is replaced by a blank unit, the type of the right breakpoint calculation unit is replaced by a blank unit, and the operation is repeated until the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit;
(2) when the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(3) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(4) and the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired.
(2) When the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit:
(1) when the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(2) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(3) and the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired.
(3) When the X-axis coordinate of the left breakpoint calculation unit is smaller than the X-axis coordinate of the right breakpoint calculation unit:
(1) when the left breakpoint calculation unit type is 1010, it is replaced with 1001;
(2) when the type of the breakpoint calculation unit on the right side is 0101, the breakpoint calculation unit is replaced by 0110;
(3) on the basis of completing (1) and (2), when the breakpoint can still be identified by using the left breakpoint identification module only or using the right breakpoint identification module only:
(4) the Y-axis coordinates of the left breakpoint calculation unit and the right breakpoint calculation unit are the same, the left breakpoint calculation unit type is multiplexed on the right side of the left breakpoint calculation unit, and then the right breakpoint calculation unit type is multiplexed on the left side of the right breakpoint calculation unit; repeating the steps until the breakpoint repairing is completed;
(5) the Y-axis coordinate of the left breakpoint calculation unit is smaller than that of the right breakpoint calculation unit, the blank unit on the right of the left breakpoint calculation unit is continuously replaced by 0110 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4);
(6) the Y-axis coordinate of the left breakpoint calculation unit is larger than that of the right breakpoint calculation unit, the blank unit at the lower right of the left breakpoint calculation unit is continuously replaced by 1001 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4).
The boundary map checking and repairing system and method have the following advantages:
(1) The arrangement modes of pixels related to the boundary lines are summarized into 6 calculation unit types, so that the calculation speed is greatly improved;
(2) The continuity of the boundary line is judged by identifying the type of the adjacent computing unit of each computing unit, so that the innovation is strong;
(3) The boundary break point is optimized through the replacement of the calculation unit type at the break point, and the break point is repaired according to the situation, so that the method is practical and novel.
Additional features and advantages of the invention will be set forth in the description which follows, or may be learned by practice of the invention.
Drawings
The drawings are only for purposes of illustrating particular embodiments and are not to be construed as limiting the invention, like reference numerals being used to refer to like parts throughout the several views.
Fig. 1 is a schematic diagram of the types of computing units in 6 basic forms.
Fig. 2 is a schematic diagram of 4 types of edge cells replaced with blank cells.
Fig. 3 is a flow chart of the method of the present invention.
Detailed Description
The system and method for inspecting and repairing a boundary map according to the present invention will be described in further detail with reference to the accompanying drawings and examples.
The technical scheme adopted by the invention is that a boundary map inspection and repair system comprises:
The system comprises a graph simplifying module, a coordinate establishing module, a left breakpoint identifying module, a right breakpoint identifying module and a repairing module.
As shown in fig. 1, the graphics simplifying module merges and simplifies the pixel units in the area where the boundary to be measured is located, specifically:
(1) Combining four mutually adjacent square pixel units into a square computing unit, wherein the adjacent form comprises edge line adjacency and corner adjacency; the combined form of the computing units is 6 types in total:
(1) the upper left pixel unit fills in, the upper right pixel unit fills in, the lower left pixel unit is blank, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1100;
(2) the upper left pixel unit fills in color, the upper right pixel unit is blank, the lower left pixel unit fills in color, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1010;
(3) the upper left pixel unit fills up, the upper right pixel unit is blank, the lower left pixel unit is blank, and the lower right pixel unit fills up, and the type of the calculation unit is 1001;
(4) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is filled with color, and the type of the calculation unit is marked as 0101;
(5) The left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is filled with color, and the right lower pixel unit is blank, and the type of the calculation unit is marked as 0110;
(6) the left upper pixel unit is blank, the right upper pixel unit is blank, the left lower pixel unit is filled with color, and the right lower pixel unit is filled with color, and the type of the calculation unit is 0011;
(2) In addition to the above 6 calculation unit types, there are the following 4 kinds of edge units, which are also square units composed of four mutually adjacent square pixel units, as shown in fig. 2, including:
(1) the left upper pixel unit fills in color, the right upper pixel unit is blank, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 1000;
(2) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 0100;
(3) the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit filled with color and the right lower pixel unit blank, and the type of the calculation unit is 0010;
(4) the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit blank and the right lower pixel unit are filled with color, and the type of the calculation unit is marked 0001;
(3) As shown in fig. 2, the edge units are replaced by blank units, the blank units are square units formed by combining four adjacent square pixel units, the top left pixel unit blank, the top right pixel unit blank, the bottom left pixel unit blank and the bottom right pixel unit blank of the square units, and the type of the calculation unit is marked as 0000.
The coordinate building module takes the lower left corner of the computing unit at the far left and below the area where the boundary line to be detected is located as an origin, takes the origin horizontal rightward as an X axis, takes the origin vertical upward as a Y axis, takes the order of the computing units on the X axis from the origin to the right as an X coordinate value, and takes the order of the computing units on the Y axis from the origin to the upward as a Y coordinate value, for example: the 100 th, 200 th calculation unit from origin to right, from original upward, has coordinates of (100, 200).
The left breakpoint identification module is used for identifying left breakpoints of the boundary lines, scanning the boundary lines from left to right in a region between the positive directions of the X axis and the positive directions of the Y axis, and starting from the first computing unit at the leftmost position, checking the type of adjacent computing units on the right side (X axis coordinates plus 1 and Y axis coordinates are unchanged), the upper right side (X axis coordinates plus 1 and Y axis coordinates plus 1) and the lower right side (X axis coordinates plus 1 and Y axis coordinates minus 1) of each computing unit one by one to judge whether the boundary lines are consistent, and the specific mode is that:
(1) The types of computing units that may be adjacent to the right side of computing unit 1100 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(2) The right side, upper right, and lower right of the computing unit 1010 have no computing unit types that can be adjoined;
(3) The types of computing units that may be adjacent to the right side of computing unit 1001 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(4) The types of computing units that may be contiguous to the right side of computing unit 0101 include 1100, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(5) The types of computing units that may be adjacent to the right side of computing unit 0110 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(6) The types of computing units that may be adjacent to the right side of computing unit 0011 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous to the bottom right include 1100, 1010, 1001.
When none of the above 6 calculation unit types has a calculation unit that can be accessed, the calculation unit is determined to be positioned at the left breakpoint of the boundary line.
The right breakpoint identification module is used for identifying a right breakpoint of the boundary line, scans from right to left in a region between the positive X-axis direction and the positive Y-axis direction, and checks the left side (X-axis coordinate minus 1, Y-axis coordinate unchanged), the upper left side (X-axis coordinate minus 1, Y-axis coordinate plus 1) and the lower left side (X-axis coordinate minus 1, Y-axis coordinate minus 1) of each computing unit one by one from the first computing unit at the right to determine whether the boundary line is consistent, and the specific mode is that:
(1) The types of computing units that may be contiguous to the left side of computing unit 1100 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(2) The types of computing units that may be adjacent to the left side of computing unit 1010 include 1100, 1001, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the types of computing units that may be adjoined at the bottom left include 1100, 1010, 0110;
(3) The types of computing units that may be adjacent to the left side of computing unit 1001 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(4) The left side, the upper left side and the lower left side of the computing unit 0101 have no computing unit types which can be adjacent;
(5) The types of computing units that may be contiguous to the left of computing unit 0110 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that can be adjoined at the bottom left include 1100, 0101, 0110;
(6) The types of computing units that may be contiguous to the left side of computing unit 0011 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that may be contiguous at the bottom left include 1100, 0101, 0110.
When none of the above 6 calculation unit types has a calculation unit that can be accessed, the calculation unit is determined to be positioned at the right breakpoint of the boundary line.
The repairing module is used for repairing the break points of the left boundary line and the right boundary line to be consistent, and the repairing module is used for repairing the break points of the left boundary line and the right boundary line to be consistent by the following steps:
(1) When the X-axis coordinate of the left breakpoint calculation unit is greater than the X-axis coordinate of the right breakpoint calculation unit:
(1) the type of the left breakpoint calculation unit is replaced by a blank unit, the type of the right breakpoint calculation unit is replaced by a blank unit, and the operation is repeated until the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit;
(2) When the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(3) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(4) and the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired.
(2) When the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit:
(1) when the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(2) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(3) and the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired.
(3) When the X-axis coordinate of the left breakpoint calculation unit is smaller than the X-axis coordinate of the right breakpoint calculation unit:
(1) when the left breakpoint calculation unit type is 1010, it is replaced with 1001;
(2) when the type of the breakpoint calculation unit on the right side is 0101, the breakpoint calculation unit is replaced by 0110;
(3) on the basis of completing (1) and (2), when the breakpoint can still be identified by using the left breakpoint identification module only or using the right breakpoint identification module only:
(4) The Y-axis coordinates of the left breakpoint calculation unit and the right breakpoint calculation unit are the same, the left breakpoint calculation unit type is multiplexed on the right side of the left breakpoint calculation unit, and then the right breakpoint calculation unit type is multiplexed on the left side of the right breakpoint calculation unit; repeating the steps until the breakpoint repairing is completed;
(5) the Y-axis coordinate of the left breakpoint calculation unit is smaller than that of the right breakpoint calculation unit, the blank unit on the right of the left breakpoint calculation unit is continuously replaced by 0110 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4);
(6) the Y-axis coordinate of the left breakpoint calculation unit is larger than that of the right breakpoint calculation unit, the blank unit at the lower right of the left breakpoint calculation unit is continuously replaced by 1001 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4).
As shown in fig. 3, a boundary map inspection and repair method:
step 1, merging and simplifying pixel units in a region where a boundary to be detected is located, wherein the specific mode is as follows:
(1) Combining four mutually adjacent square pixel units into a square computing unit, wherein the adjacent form comprises edge line adjacency and corner adjacency; the combined form of the computing units is 6 types in total:
(1) The upper left pixel unit fills in, the upper right pixel unit fills in, the lower left pixel unit is blank, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1100;
(2) the upper left pixel unit fills in color, the upper right pixel unit is blank, the lower left pixel unit fills in color, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1010;
(3) the upper left pixel unit fills up, the upper right pixel unit is blank, the lower left pixel unit is blank, and the lower right pixel unit fills up, and the type of the calculation unit is 1001;
(4) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is filled with color, and the type of the calculation unit is marked as 0101;
(5) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is filled with color, and the right lower pixel unit is blank, and the type of the calculation unit is marked as 0110;
(6) the left upper pixel unit is blank, the right upper pixel unit is blank, the left lower pixel unit is filled with color, and the right lower pixel unit is filled with color, and the type of the calculation unit is 0011;
(2) In addition to the above 6 calculation unit types, there are the following 4 kinds of edge units, which are also square units composed of four mutually adjacent square pixel units, including:
(1) The left upper pixel unit fills in color, the right upper pixel unit is blank, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 1000;
(2) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 0100;
(3) the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit filled with color and the right lower pixel unit blank, and the type of the calculation unit is 0010;
(4) the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit blank and the right lower pixel unit are filled with color, and the type of the calculation unit is marked 0001;
(3) The edge units are replaced by blank units, the blank units are square units formed by combining four mutually adjacent square pixel units, the top left pixel unit blank, the top right pixel unit blank, the bottom left pixel unit blank and the bottom right pixel unit blank of the square units, and the type of the calculation unit is marked as 0000.
Step 2, taking the lower left corner of the computing unit at the far left of the area where the boundary line to be measured is located as an origin, taking the horizontal right of the origin as an X axis, taking the vertical upward of the origin as a Y axis, taking the order of the computing units on the X axis from the origin to the right as an X coordinate value, and taking the order of the computing units on the Y axis from the origin to the upward as a Y coordinate value, for example: the 100 th, 200 th calculation unit from origin to right, from original upward, has coordinates of (100, 200).
Step 3, identifying the left break point of the boundary line, scanning from left to right in the area between the X-axis positive direction and the Y-axis positive direction, starting from the first computing unit at the leftmost position, checking the right side (X-axis coordinate is added with 1 and Y-axis coordinate is unchanged), the upper right side (X-axis coordinate is added with 1 and Y-axis coordinate is added with 1), and the lower right side (X-axis coordinate is added with 1 and Y-axis coordinate is subtracted with 1) of each computing unit one by one, and judging whether the boundary line is coherent or not by the following specific modes:
(1) The types of computing units that may be adjacent to the right side of computing unit 1100 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(2) The right side, upper right, and lower right of the computing unit 1010 have no computing unit types that can be adjoined;
(3) The types of computing units that may be adjacent to the right side of computing unit 1001 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(4) The types of computing units that may be contiguous to the right side of computing unit 0101 include 1100, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(5) The types of computing units that may be adjacent to the right side of computing unit 0110 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(6) The types of computing units that may be adjacent to the right side of computing unit 0011 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
when none of the above 6 calculation unit types has a calculation unit that can be accessed, the calculation unit is determined to be positioned at the left breakpoint of the boundary line.
Step 4, identifying the right break point of the boundary line, scanning from right to left in the area between the X-axis forward direction and the Y-axis forward direction, and starting from the first computing unit at the right, checking the left side (X-axis coordinate minus 1, Y-axis coordinate unchanged), the upper left side (X-axis coordinate minus 1, Y-axis coordinate plus 1) and the lower left side (X-axis coordinate minus 1, Y-axis coordinate minus 1) of each computing unit one by one, and abutting the computing unit types to judge whether the boundary line is consistent, wherein the specific method is as follows:
(1) The types of computing units that may be contiguous to the left side of computing unit 1100 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(2) The types of computing units that may be adjacent to the left side of computing unit 1010 include 1100, 1001, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the types of computing units that may be adjoined at the bottom left include 1100, 1010, 0110;
(3) The types of computing units that may be adjacent to the left side of computing unit 1001 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(4) The left side, the upper left side and the lower left side of the computing unit 0101 have no computing unit types which can be adjacent;
(5) The types of computing units that may be contiguous to the left of computing unit 0110 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that can be adjoined at the bottom left include 1100, 0101, 0110;
(6) The types of computing units that may be contiguous to the left side of computing unit 0011 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that can be adjoined at the bottom left include 1100, 0101, 0110;
when none of the above 6 calculation unit types has a calculation unit that can be accessed, the calculation unit is determined to be positioned at the right breakpoint of the boundary line.
And 5, repairing the break points of the left boundary line and the right boundary line to be consistent, wherein the method comprises the following steps:
(1) When the X-axis coordinate of the left breakpoint calculation unit is greater than the X-axis coordinate of the right breakpoint calculation unit:
(1) the type of the left breakpoint calculation unit is replaced by a blank unit, the type of the right breakpoint calculation unit is replaced by a blank unit, and the operation is repeated until the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit;
(2) when the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(3) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(4) and the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired.
(2) When the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit:
(1) when the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(2) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(3) and the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired.
(3) When the X-axis coordinate of the left breakpoint calculation unit is smaller than the X-axis coordinate of the right breakpoint calculation unit:
(1) when the left breakpoint calculation unit type is 1010, it is replaced with 1001;
(2) when the type of the breakpoint calculation unit on the right side is 0101, the breakpoint calculation unit is replaced by 0110;
(3) on the basis of completing (1) and (2), when the breakpoint can still be identified by using the left breakpoint identification module only or using the right breakpoint identification module only:
(4) the Y-axis coordinates of the left breakpoint calculation unit and the right breakpoint calculation unit are the same, the left breakpoint calculation unit type is multiplexed on the right side of the left breakpoint calculation unit, and then the right breakpoint calculation unit type is multiplexed on the left side of the right breakpoint calculation unit; repeating the steps until the breakpoint repairing is completed;
(5) the Y-axis coordinate of the left breakpoint calculation unit is smaller than that of the right breakpoint calculation unit, the blank unit on the right of the left breakpoint calculation unit is continuously replaced by 0110 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4);
(6) the Y-axis coordinate of the left breakpoint calculation unit is larger than that of the right breakpoint calculation unit, the blank unit at the lower right of the left breakpoint calculation unit is continuously replaced by 1001 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4).
The present invention is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present invention are intended to be included in the scope of the present invention.

Claims (2)

1. A boundary map inspection repair system, characterized by:
the system comprises a graph simplifying module, a coordinate establishing module, a left breakpoint identifying module, a right breakpoint identifying module and a repairing module;
the pattern simplification module is used for merging and simplifying pixel units in the area where the boundary to be detected is located, and the specific mode is as follows:
(1) Combining four mutually adjacent square pixel units into a square computing unit, wherein the adjacent form comprises edge line adjacency and corner adjacency; the combined form of the computing units is 6 types in total:
(1) the upper left pixel unit fills in, the upper right pixel unit fills in, the lower left pixel unit is blank, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1100;
(2) the upper left pixel unit fills in color, the upper right pixel unit is blank, the lower left pixel unit fills in color, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1010;
(3) The upper left pixel unit fills up, the upper right pixel unit is blank, the lower left pixel unit is blank, and the lower right pixel unit fills up, and the type of the calculation unit is 1001;
(4) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is filled with color, and the type of the calculation unit is marked as 0101;
(5) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is filled with color, and the right lower pixel unit is blank, and the type of the calculation unit is marked as 0110;
(6) the left upper pixel unit is blank, the right upper pixel unit is blank, the left lower pixel unit is filled with color, and the right lower pixel unit is filled with color, and the type of the calculation unit is 0011;
(2) In addition to the above 6 calculation unit types, there are the following 4 kinds of edge units, which are also square units composed of four mutually adjacent square pixel units, including:
(1) the left upper pixel unit fills in color, the right upper pixel unit is blank, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 1000;
(2) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 0100;
(3) The left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit filled with color and the right lower pixel unit blank, and the type of the calculation unit is 0010;
(4) the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit blank and the right lower pixel unit are filled with color, and the type of the calculation unit is marked 0001;
(3) The edge units are replaced by blank units, the blank units are square units formed by combining four mutually adjacent square pixel units, the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit blank and the right lower pixel unit blank of the square units are marked with 0000;
the coordinate building module takes the lower left corner of the computing unit at the far left of the area where the boundary to be measured is located as an origin, takes the origin horizontal to the right as an X axis, takes the origin vertical upwards as a Y axis, takes the order of the computing units on the X axis from the origin to the right as an X coordinate value, and takes the order of the computing units on the Y axis from the origin to the up as a Y coordinate value;
the left breakpoint identification module is used for identifying left breakpoints of the boundary lines, scanning the boundary lines from left to right in a region between the positive directions of the X axis and the positive directions of the Y axis, and starting from the first computing unit which is the leftmost computing unit, checking the types of the adjacent computing units on the right side, the upper right and the lower right of each computing unit one by one to judge whether the boundary lines are consistent, wherein the specific mode is as follows:
(1) The types of computing units that may be adjacent to the right side of computing unit 1100 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(2) The right side, upper right, and lower right of the computing unit 1010 have no computing unit types that can be adjoined;
(3) The types of computing units that may be adjacent to the right side of computing unit 1001 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(4) The types of computing units that may be contiguous to the right side of computing unit 0101 include 1100, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(5) The types of computing units that may be adjacent to the right side of computing unit 0110 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(6) The types of computing units that may be adjacent to the right side of computing unit 0011 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
When none of the upper right, the right side and the lower right of the above 6 calculation unit types has a calculation unit which can be adjacent, determining that the calculation unit is positioned at the left breakpoint of the boundary line;
the right breakpoint identification module is used for identifying a right breakpoint of the boundary line, scans from right to left in a region between the positive directions of the X axis and the positive directions of the Y axis, and starts from the first computing unit which is the rightmost computing unit, and checks the type of the adjacent computing units on the left side, the upper left side and the lower left side of each computing unit one by one to judge whether the boundary line is coherent, and the specific mode is as follows:
(1) The types of computing units that may be contiguous to the left side of computing unit 1100 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(2) The types of computing units that may be adjacent to the left side of computing unit 1010 include 1100, 1001, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the types of computing units that may be adjoined at the bottom left include 1100, 1010, 0110;
(3) The types of computing units that may be adjacent to the left side of computing unit 1001 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(4) The left side, the upper left side and the lower left side of the computing unit 0101 have no computing unit types which can be adjacent;
(5) The types of computing units that may be contiguous to the left of computing unit 0110 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that can be adjoined at the bottom left include 1100, 0101, 0110;
(6) The types of computing units that may be contiguous to the left side of computing unit 0011 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that can be adjoined at the bottom left include 1100, 0101, 0110;
when the upper left, the left side and the lower left of the above 6 calculation unit types have no calculation units which can be adjacent, judging that the calculation unit is positioned at the right breakpoint of the boundary line;
the repairing module is used for repairing the break points of the left boundary line and the right boundary line to be consistent, and the repairing module is used for repairing the break points of the left boundary line and the right boundary line to be consistent by the following steps:
(1) When the X-axis coordinate of the left breakpoint calculation unit is greater than the X-axis coordinate of the right breakpoint calculation unit:
(1) the type of the left breakpoint calculation unit is replaced by a blank unit, the type of the right breakpoint calculation unit is replaced by a blank unit, and the operation is repeated until the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit;
(2) When the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(3) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(4) the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired;
(2) When the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit:
(1) when the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(2) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(3) the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired;
(3) When the X-axis coordinate of the left breakpoint calculation unit is smaller than the X-axis coordinate of the right breakpoint calculation unit:
(1) when the left breakpoint calculation unit type is 1010, it is replaced with 1001;
(2) when the type of the breakpoint calculation unit on the right side is 0101, the breakpoint calculation unit is replaced by 0110;
(3) on the basis of completing (1) and (2), when the breakpoint can still be identified by using the left breakpoint identification module only or using the right breakpoint identification module only:
(4) The Y-axis coordinates of the left breakpoint calculation unit and the right breakpoint calculation unit are the same, the left breakpoint calculation unit type is multiplexed on the right side of the left breakpoint calculation unit, and then the right breakpoint calculation unit type is multiplexed on the left side of the right breakpoint calculation unit; repeating the steps until the breakpoint repairing is completed;
(5) the Y-axis coordinate of the left breakpoint calculation unit is smaller than that of the right breakpoint calculation unit, the blank unit on the right of the left breakpoint calculation unit is continuously replaced by 0110 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4);
(6) the Y-axis coordinate of the left breakpoint calculation unit is larger than that of the right breakpoint calculation unit, the blank unit at the lower right of the left breakpoint calculation unit is continuously replaced by 1001 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4).
2. A boundary map checking and repairing method is characterized in that:
step 1, merging and simplifying pixel units in a region where a boundary to be detected is located, wherein the specific mode is as follows:
(1) Combining four mutually adjacent square pixel units into a square computing unit, wherein the adjacent form comprises edge line adjacency and corner adjacency; the combined form of the computing units is 6 types in total:
(1) The upper left pixel unit fills in, the upper right pixel unit fills in, the lower left pixel unit is blank, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1100;
(2) the upper left pixel unit fills in color, the upper right pixel unit is blank, the lower left pixel unit fills in color, and the lower right pixel unit is blank, and the type of the calculation unit is marked as 1010;
(3) the upper left pixel unit fills up, the upper right pixel unit is blank, the lower left pixel unit is blank, and the lower right pixel unit fills up, and the type of the calculation unit is 1001;
(4) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is filled with color, and the type of the calculation unit is marked as 0101;
(5) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is filled with color, and the right lower pixel unit is blank, and the type of the calculation unit is marked as 0110;
(6) the left upper pixel unit is blank, the right upper pixel unit is blank, the left lower pixel unit is filled with color, and the right lower pixel unit is filled with color, and the type of the calculation unit is 0011;
(2) In addition to the above 6 calculation unit types, there are the following 4 kinds of edge units, which are also square units composed of four mutually adjacent square pixel units, including:
(1) The left upper pixel unit fills in color, the right upper pixel unit is blank, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 1000;
(2) the left upper pixel unit is blank, the right upper pixel unit is filled with color, the left lower pixel unit is blank, the right lower pixel unit is blank, and the type of the calculation unit is marked as 0100;
(3) the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit filled with color and the right lower pixel unit blank, and the type of the calculation unit is 0010;
(4) the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit blank and the right lower pixel unit are filled with color, and the type of the calculation unit is marked 0001;
(3) The edge units are replaced by blank units, the blank units are square units formed by combining four mutually adjacent square pixel units, the left upper pixel unit blank, the right upper pixel unit blank, the left lower pixel unit blank and the right lower pixel unit blank of the square units are marked with 0000;
step 2, taking the left lower corner of the computing unit at the far left lower part of the area where the boundary to be detected is located as an origin, taking the origin as an X axis in a horizontal right direction, taking the origin as a Y axis in a vertical upward direction, taking the order of the computing units on the X axis from the origin to the right as an X coordinate value, and taking the order of the computing units on the Y axis from the origin to the upward direction as a Y coordinate value;
Step 3, identifying the left break point of the boundary line, scanning from left to right in the area between the X-axis positive direction and the Y-axis positive direction, starting from the first computing unit at the leftmost position, and checking the type of the adjacent computing units at the right side, the upper right and the lower right of each computing unit one by one to judge whether the boundary line is coherent, wherein the specific method is as follows:
(1) The types of computing units that may be adjacent to the right side of computing unit 1100 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(2) The right side, upper right, and lower right of the computing unit 1010 have no computing unit types that can be adjoined;
(3) The types of computing units that may be adjacent to the right side of computing unit 1001 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(4) The types of computing units that may be contiguous to the right side of computing unit 0101 include 1100, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
(5) The types of computing units that may be adjacent to the right side of computing unit 0110 include 1100, 1010, 1001, 0110, 0011; the types of computing units that may be immediately above right include 1010, 0110, 0011; the lower right has no computational unit types that can be approached;
(6) The types of computing units that may be adjacent to the right side of computing unit 0011 include 1100, 1010, 1001, 0110, 0011; the upper right has no computational unit types that can be accessed; the types of computing units that may be contiguous at the bottom right include 1100, 1010, 1001;
when none of the upper right, the right side and the lower right of the above 6 calculation unit types has a calculation unit which can be adjacent, determining that the calculation unit is positioned at the left breakpoint of the boundary line;
and 4, identifying a right breakpoint of the boundary line, scanning the boundary line from right to left in a region between the X-axis forward direction and the Y-axis forward direction, and starting from the first computing unit at the right, checking the left side, the upper left side and the lower left side of each computing unit one by one to judge whether the boundary line is coherent, wherein the specific mode is as follows:
(1) The types of computing units that may be contiguous to the left side of computing unit 1100 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(2) The types of computing units that may be adjacent to the left side of computing unit 1010 include 1100, 1001, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the types of computing units that may be adjoined at the bottom left include 1100, 1010, 0110;
(3) The types of computing units that may be adjacent to the left side of computing unit 1001 include 1100, 1001, 0101, 0110, 0011; the types of computing units that can be adjoined at the top left include 1001, 0101, 0011; the lower left has no computational unit types that can be adjoined;
(4) The left side, the upper left side and the lower left side of the computing unit 0101 have no computing unit types which can be adjacent;
(5) The types of computing units that may be contiguous to the left of computing unit 0110 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that can be adjoined at the bottom left include 1100, 0101, 0110;
(6) The types of computing units that may be contiguous to the left side of computing unit 0011 include 1100, 1001, 0101, 0110, 0011; the upper left has no computational unit types that can be adjoined; the types of computing units that can be adjoined at the bottom left include 1100, 0101, 0110;
when the upper left, the left side and the lower left of the above 6 calculation unit types have no calculation units which can be adjacent, judging that the calculation unit is positioned at the right breakpoint of the boundary line;
And 5, repairing the break points of the left boundary line and the right boundary line to be consistent, wherein the method comprises the following steps:
(1) When the X-axis coordinate of the left breakpoint calculation unit is greater than the X-axis coordinate of the right breakpoint calculation unit:
(1) the type of the left breakpoint calculation unit is replaced by a blank unit, the type of the right breakpoint calculation unit is replaced by a blank unit, and the operation is repeated until the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit;
(2) when the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(3) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(4) the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired;
(2) When the X-axis coordinate of the left breakpoint calculation unit is equal to the X-axis coordinate of the right breakpoint calculation unit:
(1) when the type of the breakpoint calculation unit with large Y-axis coordinates is 1100, the breakpoint calculation unit is replaced by 1001;
(2) when the type of the breakpoint calculation unit with small Y-axis coordinates is 0011, the breakpoint calculation unit is replaced by 0110;
(3) the blank units between the two breakpoint calculation units are replaced by 1010 type calculation units from bottom to top, and then are replaced by 0101 type calculation units until the breakpoints are repaired;
(3) When the X-axis coordinate of the left breakpoint calculation unit is smaller than the X-axis coordinate of the right breakpoint calculation unit:
(1) when the left breakpoint calculation unit type is 1010, it is replaced with 1001;
(2) when the type of the breakpoint calculation unit on the right side is 0101, the breakpoint calculation unit is replaced by 0110;
(3) on the basis of completing (1) and (2), when the breakpoint can still be identified by using the left breakpoint identification module only or using the right breakpoint identification module only:
(4) the Y-axis coordinates of the left breakpoint calculation unit and the right breakpoint calculation unit are the same, the left breakpoint calculation unit type is multiplexed on the right side of the left breakpoint calculation unit, and then the right breakpoint calculation unit type is multiplexed on the left side of the right breakpoint calculation unit; repeating the steps until the breakpoint repairing is completed;
(5) the Y-axis coordinate of the left breakpoint calculation unit is smaller than that of the right breakpoint calculation unit, the blank unit on the right of the left breakpoint calculation unit is continuously replaced by 0110 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4);
(6) the Y-axis coordinate of the left breakpoint calculation unit is larger than that of the right breakpoint calculation unit, the blank unit at the lower right of the left breakpoint calculation unit is continuously replaced by 1001 until the Y-axis coordinate of the left breakpoint calculation unit is equal to that of the right breakpoint calculation unit, and finally the breakpoint is repaired in a mode of (4).
CN202310336623.5A 2023-03-31 2023-03-31 Boundary map checking and repairing system and method Active CN116051430B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310336623.5A CN116051430B (en) 2023-03-31 2023-03-31 Boundary map checking and repairing system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310336623.5A CN116051430B (en) 2023-03-31 2023-03-31 Boundary map checking and repairing system and method

Publications (2)

Publication Number Publication Date
CN116051430A true CN116051430A (en) 2023-05-02
CN116051430B CN116051430B (en) 2023-06-30

Family

ID=86131759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310336623.5A Active CN116051430B (en) 2023-03-31 2023-03-31 Boundary map checking and repairing system and method

Country Status (1)

Country Link
CN (1) CN116051430B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1573811A (en) * 2003-05-19 2005-02-02 株式会社日立制作所 Map generation device, map delivery method, and map generation program
KR101353613B1 (en) * 2013-09-05 2014-01-23 네이버시스템(주) A system of making digital map using identification of gis and base point
CN109427062A (en) * 2017-08-30 2019-03-05 深圳星行科技有限公司 Roadway characteristic labeling method, device, computer equipment and readable storage medium storing program for executing
CN114445565A (en) * 2020-11-06 2022-05-06 北京嘀嘀无限科技发展有限公司 Data processing method and device, electronic equipment and computer readable medium
CN114663615A (en) * 2022-03-30 2022-06-24 阿里巴巴(中国)有限公司 Electronic map display method and device and electronic equipment
CN115444312A (en) * 2022-08-09 2022-12-09 深圳市无限动力发展有限公司 Intelligent partitioning method, device and equipment
CN115689946A (en) * 2022-12-29 2023-02-03 北京集度科技有限公司 Image restoration method, electronic device and computer program product

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1573811A (en) * 2003-05-19 2005-02-02 株式会社日立制作所 Map generation device, map delivery method, and map generation program
KR101353613B1 (en) * 2013-09-05 2014-01-23 네이버시스템(주) A system of making digital map using identification of gis and base point
CN109427062A (en) * 2017-08-30 2019-03-05 深圳星行科技有限公司 Roadway characteristic labeling method, device, computer equipment and readable storage medium storing program for executing
CN114445565A (en) * 2020-11-06 2022-05-06 北京嘀嘀无限科技发展有限公司 Data processing method and device, electronic equipment and computer readable medium
CN114663615A (en) * 2022-03-30 2022-06-24 阿里巴巴(中国)有限公司 Electronic map display method and device and electronic equipment
CN115444312A (en) * 2022-08-09 2022-12-09 深圳市无限动力发展有限公司 Intelligent partitioning method, device and equipment
CN115689946A (en) * 2022-12-29 2023-02-03 北京集度科技有限公司 Image restoration method, electronic device and computer program product

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张蓉生;张伟华;李春晓;魏学锋;李立;: "复杂线素图像多因素预测矢量化跟踪", 计算机集成制造系统, no. 12 *

Also Published As

Publication number Publication date
CN116051430B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN109345528B (en) Display screen defect detection method and device based on human visual characteristics
CN109472271B (en) Printed circuit board image contour extraction method and device
CN109752392B (en) PCB defect type detection system and method
KR20090101356A (en) Defect detecting device, and defect detecting method
CN107014818B (en) Laser etching defect visual detection system and method
CN109829910B (en) PCB defect detection method based on neighborhood search
CN104331695A (en) Robust round identifier shape quality detection method
CN102854195B (en) Method for detecting defect coordinates on color filter
CN112862773A (en) Shaving board image defect classification detection method and device
CN105205803A (en) Display panel defect detection method
CN105554494A (en) Snow point image detection method and device and video quality detection device and system
CN113538603A (en) Optical detection method and system based on array product and readable storage medium
CN114998217A (en) Method for determining defect grade of glass substrate, computer device and storage medium
CN115861265A (en) Chip pin coplanarity detection method based on 3D dynamic scanning imaging technology
JP5167731B2 (en) Inspection apparatus and method
CN116051430A (en) Boundary map checking and repairing system and method
CN1898555B (en) Substrate inspection device
CN101685000B (en) Computer system and method for image boundary scan
CN112198685B (en) COA substrate detection method and device
CN112258510B (en) Image anomaly detection method based on connected region algorithm
JP5136277B2 (en) Defect detection method for netted or lined glass
JPH03175343A (en) Method for extracting flaw by inspection appearance
CN114972147A (en) Method and device for detecting wafer defects
JP2710685B2 (en) Defect detection method by visual inspection
CN112581473B (en) Method for realizing surface defect detection gray level image positioning algorithm

Legal Events

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