System and method for automatic processing of linear objects in divisions, place names and boundaries
Through the combination of the import module, the coloring module, the position calibration module, the encoding module and the filtering and color changing module, linear objects in the map are identified and processed, which solves the refined automation problem of processing linear objects in divisions, place names, and boundaries in the existing technology. , achieving efficient recognition and processing effects.
Patent Information
- Application Number
- CN202210469483.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-30
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-04-30
AI Technical Summary
The existing technology is difficult to effectively process the refined automation of linear objects in divisions, place names, and boundaries in maps, and cannot accurately identify and process linear objects.
The import module, coloring module, position calibration module, encoding module and filtering and color changing module are used to identify linear object pixels through encoding rules, and use odd and even numbers to form a color changing and filtering unit to achieve refined processing of pixels.
It achieves refined automatic processing of linear objects in divisions, place names, and boundaries, improves recognition speed and accuracy, has reasonable design, and improves computing efficiency.
Smart Images

Figure CN115225903B
Abstract
Description
Technical Field
[0001] The present invention relates to a mapping method, in particular to a system and method for automatically processing linear objects in divisions, place names and boundaries in a refined manner. Background Art
[0002] A map is a graphic or image that selectively represents certain phenomena of the earth (or other planets) in two-dimensional or multi-dimensional forms and means on a plane or sphere according to certain rules. It has a strict mathematical basis, symbol system, text annotations, and can use map generalization principles to scientifically reflect the distribution characteristics of natural and socio-economic phenomena and their interrelationships. An electronic map, or digital map, is a map that is stored and viewed digitally using computer technology. The map scale can be enlarged, reduced, or rotated without affecting the display effect. Divisions, place names, and boundaries are all important elements in a map.
[0003] Patent application number: 2020101973259 discloses a method for determining boundary lines in a map, including: obtaining an area divided into an obstacle boundary area, a visible area, and an invisible area, extracting pixel points in the obstacle boundary area that are adjacent to pixel points in the visible area, and merging the unextracted pixel points in the obstacle boundary area into the invisible area, forming an obstacle boundary line according to the extracted pixel points in the obstacle boundary area, so as to re-divide the map into new visible areas and invisible areas according to the obstacle boundary line, and can divide the obstacle boundary area into invisible areas and obstacle boundary lines, thereby achieving the purpose of extracting boundary lines that meet the requirements. Patent application number: 2020113084227 discloses a method, system, and computer-readable storage medium for delineating the boundaries of a map area in a game map, and discloses a method for delineating the boundaries of a map area in a game map, which delineates the boundaries by calibrating the edges of adjacent pixels in a clockwise or counterclockwise direction.
[0004] These methods are still not enough to solve the problem of automatic and refined processing of linear objects in divisions, place names, and boundaries in maps, so there is an urgent need to design a system and method for automatic and refined processing of linear objects in divisions, place names, and boundaries. Summary of the invention
[0005] Therefore, in order to realize the refined automatic processing of linear objects in divisions, place names and boundaries, the present invention encodes the selected pixels in the area where the linear objects are located, uses encoding rules to identify and determine the linear object pixels, and realizes the refined automatic processing of linear objects in electronic maps.
[0006] The technical solution adopted by the present invention is:
[0007] A system for refining and automatically processing linear objects in divisions, place names, and boundaries, characterized by:
[0008] It includes an import module, a color setting module, a position calibration module, an encoding module, and a screening and color changing module.
[0009] The import module imports the initial electronic map and converts it into an editable format.
[0010] The color setting module sets different objects in the electronic map to different colors, the pixel colors of other objects are set to color A, and the pixel colors of linear objects are set to color B.
[0011] The position calibration module is used to calibrate the pixel position. The space occupied by each pixel is a basic unit. The position of the pixel in the row is calibrated as x, increasing from left to right; the position in the column is calibrated as y, increasing from bottom to top.
[0012] The encoding module is used to encode the selected pixels in the following manner:
[0013] (1) The first bit is 1 or 0, which is used to identify the row number of the pixel. 1 represents that the row number of the pixel is an odd number, and 0 represents that the row number of the pixel is an even number.
[0014] (2) The second bit is 1 or 0, which is used to identify the number of columns of the pixel. 1 represents that the number of columns of the pixel is an odd number, and 0 represents that the number of columns of the pixel is an even number.
[0015] (3) The third bit is 1 or 0, which is used to identify the color of the pixel, where 1 represents color A and 0 represents color B.
[0016] The screening and color changing module is used to screen pixels that need to be changed in color and perform the color change in the following manner:
[0017] (1) Scan the coded pixels and select four pixels at the same corner point to form a color-changing filter unit. That is, the pixels at the four positions (x, y), (x+1, y), (x, y-1), and (x+1, y-1) form a color-changing filter unit. From left to right and from top to bottom, the first two code elements of the pixels in the color-changing filter unit have four combinations, namely:
[0018] Combination 1: 11, 10, 01, 00;
[0019] Combination 2: 10, 11, 00, 01;
[0020] Combination 3: 01, 00, 11, 10;
[0021] Combination 4: 00, 01, 10, 11.
[0022] (2) When the third bits of the four pixels in the color-changing and filtering unit are all 0, there are the following four combinations:
[0023] Combination 1: 110, 100, 010, 000;
[0024] Combination 2: 100, 110, 000, 010;
[0025] Combination 3: 010, 000, 110, 100;
[0026] Combination 4: 000, 010, 100, 110.
[0027] At this time, the colors of the pixels at the same corner points of the color-changing and filtering units are checked in turn, specifically in the following manner:
[0028] Check the third bit of the codeword (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codeword (x, y+1), (x+1, y+1), (x+1, y) of the pixel in the upper right corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, Start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0029] (3) The four pixels in the original color-changing screening unit form a new combination form, which is:
[0030] Combination 1: XX1, XX0, XX0, XX0;
[0031] Combination 2: XX0, XX1, XX0, XX0;
[0032] Combination 3: XX0, XX0, XX1, XX0;
[0033] Combination 4: XX0, XX0, XX0, XX1.
[0034] The composition of XX includes 11, 00, 10, and 01;
[0035] At this time, the colors of the three pixels with the third bit symbol of 0 in the new color-changing filter unit are checked in turn, and the specific method is as follows:
[0036] a) The third bit of the lower left pixel in the new color-changing filter unit is 1:
[0037] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0038] b) The third bit of the pixel in the upper right corner of the new color-changing filter unit is 1:
[0039] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0040] c) The third bit of the pixel in the lower right corner of the new color-changing filter unit is 1:
[0041] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0042] d) The third bit of the upper left pixel in the new color-changing filter unit is 1:
[0043] Check the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0044] A method for automatically processing linear objects in divisions, place names and boundaries in a refined manner, characterized by:
[0045] Step 1: distinguish the pixel colors of other objects and linear objects, set the pixel colors of other objects to color A, and set the pixel colors of linear objects to color B.
[0046] Step 2: Establish pixel position calibration rules. The space occupied by each pixel is the basic unit. The position of the pixel in the row is calibrated as x, increasing from left to right; the position in the column is calibrated as y, increasing from bottom to top.
[0047] Step 3, select the pixels to be encoded, take the first pixel in the upper left corner of the electronic map as the starting element, scan row by row from left to right, and after encountering a pixel of color B, the pixel position (x, y) and the adjacent pixels (x, y+1), (x, y-1), (x-1, y), and (x+1, y) centered on this pixel are the pixels to be encoded.
[0048] Step 4: Encode the selected pixels in the following way:
[0049] (1) The first bit is 1 or 0, which is used to identify the row number of the pixel. 1 represents that the row number of the pixel is an odd number, and 0 represents that the row number of the pixel is an even number.
[0050] (2) The second bit is 1 or 0, which is used to identify the number of columns of the pixel. 1 represents that the number of columns of the pixel is an odd number, and 0 represents that the number of columns of the pixel is an even number.
[0051] (3) The third bit is 1 or 0, which is used to identify the color of the pixel, where 1 represents color A and 0 represents color B.
[0052] Step 5: Filter the elements that need to be changed in color by:
[0053] (1) Scan the coded pixels and select four pixels at the same corner point to form a color-changing filter unit. That is, the pixels at the four positions (x, y), (x+1, y), (x, y-1), and (x+1, y-1) form a color-changing filter unit. From left to right and from top to bottom, the first two code elements of the pixels in the color-changing filter unit have four combinations, namely:
[0054] Combination 1: 11, 10, 01, 00;
[0055] Combination 2: 10, 11, 00, 01;
[0056] Combination 3: 01, 00, 11, 10;
[0057] Combination 4: 00, 01, 10, 11.
[0058] (2) When the third bits of the four pixels in the color-changing and filtering unit are all 0, there are the following four combinations:
[0059] Combination 1: 110, 100, 010, 000;
[0060] Combination 2: 100, 110, 000, 010;
[0061] Combination 3: 010, 000, 110, 100;
[0062] Combination 4: 000, 010, 100, 110.
[0063] At this time, the colors of the pixels at the same corner points of the color-changing and filtering units are checked in turn, specifically in the following manner:
[0064] Check the third bit of the codeword (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codeword (x, y+1), (x+1, y+1), (x+1, y) of the pixel in the upper right corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, Start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0065] (3) The four pixels in the original color-changing screening unit form a new combination form, which is:
[0066] Combination 1: XX1, XX0, XX0, XX0;
[0067] Combination 2: XX0, XX1, XX0, XX0;
[0068] Combination 3: XX0, XX0, XX1, XX0;
[0069] Combination 4: XX0, XX0, XX0, XX1.
[0070] The composition of XX includes 11, 00, 10, and 01;
[0071] At this time, the colors of the three pixels with the third bit symbol of 0 in the new color-changing filter unit are checked in turn, and the specific method is as follows:
[0072] a) The third bit of the lower left pixel in the new color-changing filter unit is 1:
[0073] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0074] b) The third bit of the pixel in the upper right corner of the new color-changing filter unit is 1:
[0075] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0076] c) The third bit of the pixel in the lower right corner of the new color-changing filter unit is 1:
[0077] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0078] d) The third bit of the upper left pixel in the new color-changing filter unit is 1:
[0079] Check the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0080] A device for automatic and refined processing of linear objects in divisions, place names and boundaries, comprising a built-in processor, a memory and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it can run the above-mentioned system for automatic and refined processing of linear objects in divisions, place names and boundaries, and implement this method for automatic and refined processing of linear objects in divisions, place names and boundaries.
[0081] The system and method for automatically processing linear objects in divisions, place names and boundaries of the present invention have the following advantages:
[0082] (1) Adjacent odd-numbered and even-numbered rows and columns are used to form four color-changing and filtering units in the form of co-corner pixels, and the color of the pixels in the color-changing and filtering units is changed, which is a novel idea;
[0083] (2) Based on the pattern of adjacent odd and even rows and columns forming a color-changing screening unit, four position coding forms of 11, 10, 01, and 00 are designed, and the third code element 1 or 0 is superimposed to reflect the pixel color, thereby improving the calculation and recognition speed, which is an ingenious idea;
[0084] (3) Set the pixel position calibration rule, taking the space occupied by each pixel as the basic unit. The position of the pixel in the row is calibrated as x, increasing from left to right; the position in the column is calibrated as y, increasing from bottom to top. The design is reasonable.
[0085] Therefore, this system and method for fine-grained automatic processing of linear objects in divisions, place names, and boundaries encodes the selected pixels in the area where the linear objects are located, uses encoding rules to identify and determine the linear object pixels, and realizes fine-grained automatic processing of linear objects in divisions, place names, and boundaries.
[0086] Other features and advantages of the present invention will be set forth in the following description or may be learned by practicing the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0088] Figure 1 It is a schematic diagram of the encoding rules for pixels in the encoding area.
[0089] Figure 2 It is a schematic diagram of the principle of fine delineation of pixels of the color-changing screening unit.
[0090] Figure 3 It is the main flow chart of the linear object fine delineation method.
[0091] Figure 4 It is a flow chart of a method for selecting elements that need to change color and performing color changing steps.
[0092] Numbers in the figure: P1-initial state of the original color-changing filtering unit, P2-state of a pixel in the original color-changing filtering unit after color-changing, P3-state of a pixel in the new color-changing filtering unit after color-changing. DETAILED DESCRIPTION
[0093] The following will further describe in detail a system and method for automatic refined processing of linear objects in divisions, place names, and boundaries of the present invention in conjunction with the accompanying drawings and embodiments. In terms of direction description, the left, right, up, and down directions of pixels are described in the vertical plane of an electronic map using the main viewing angle.
[0094] like Figure 1 , Figure 2 , Figure 3 , Figure 4 As shown, a system for automatically processing linear objects in divisions, place names, and boundaries is characterized by:
[0095] It includes an import module, a color setting module, a position calibration module, an encoding module, and a screening and color changing module.
[0096] The import module imports the initial electronic map and converts it into an editable format.
[0097] The color setting module sets different objects in the electronic map to different colors, the pixel colors of other objects are set to color A, and the pixel colors of linear objects are set to color B.
[0098] The position calibration module is used to calibrate the pixel position. The space occupied by each pixel is a basic unit. The position of the pixel in the row is calibrated as x, increasing from left to right; the position in the column is calibrated as y, increasing from bottom to top.
[0099] The encoding module is used to encode the selected pixels in the following manner:
[0100] (1) The first bit is 1 or 0, which is used to identify the row number of the pixel. 1 represents that the row number of the pixel is an odd number, and 0 represents that the row number of the pixel is an even number.
[0101] (2) The second bit is 1 or 0, which is used to identify the number of columns of the pixel. 1 represents that the number of columns of the pixel is an odd number, and 0 represents that the number of columns of the pixel is an even number.
[0102] (3) The third bit is 1 or 0, which is used to identify the color of the pixel, where 1 represents color A and 0 represents color B.
[0103] The screening and color changing module is used to screen pixels that need to be changed in color and perform the color change in the following manner:
[0104] (1) Scan the coded pixels and select four pixels at the same corner point to form a color-changing filter unit. That is, the pixels at the four positions (x, y), (x+1, y), (x, y-1), and (x+1, y-1) form a color-changing filter unit. From left to right and from top to bottom, the first two code elements of the pixels in the color-changing filter unit have four combinations, namely:
[0105] Combination 1: 11, 10, 01, 00;
[0106] Combination 2: 10, 11, 00, 01;
[0107] Combination 3: 01, 00, 11, 10;
[0108] Combination 4: 00, 01, 10, 11.
[0109] (2) When the third bits of the four pixels in the color-changing and filtering unit are all 0, there are the following four combinations:
[0110] Combination 1: 110, 100, 010, 000;
[0111] Combination 2: 100, 110, 000, 010;
[0112] Combination 3: 010, 000, 110, 100;
[0113] Combination 4: 000, 010, 100, 110.
[0114] At this time, the colors of the pixels at the same corner points of the color-changing and filtering units are checked in turn, specifically in the following manner:
[0115] Check the third bit of the codeword (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codeword (x, y+1), (x+1, y+1), (x+1, y) of the pixel in the upper right corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, Start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0116] (3) The four pixels in the original color-changing screening unit form a new combination form, which is:
[0117] Combination 1: XX1, XX0, XX0, XX0;
[0118] Combination 2: XX0, XX1, XX0, XX0;
[0119] Combination 3: XX0, XX0, XX1, XX0;
[0120] Combination 4: XX0, XX0, XX0, XX1;
[0121] The composition of XX includes 11, 00, 10, and 01;
[0122] At this time, the colors of the three pixels with the third bit symbol of 0 in the new color-changing filter unit are checked in turn, and the specific method is as follows:
[0123] a) The third bit of the lower left pixel in the new color-changing filter unit is 1:
[0124] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0125] b) The third bit of the pixel in the upper right corner of the new color-changing filter unit is 1:
[0126] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0127] c) The third bit of the pixel in the lower right corner of the new color-changing filter unit is 1:
[0128] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0129] d) The third bit of the upper left pixel in the new color-changing filter unit is 1:
[0130] Check the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0131] A method for automatically processing linear objects in divisions, place names and boundaries in a refined manner, characterized by:
[0132] Step 1: distinguish the pixel colors of other objects and linear objects, set the pixel colors of other objects to color A, and set the pixel colors of linear objects to color B.
[0133] Step 2: Establish pixel position calibration rules. The space occupied by each pixel is the basic unit. The position of the pixel in the row is calibrated as x, increasing from left to right; the position in the column is calibrated as y, increasing from bottom to top.
[0134] Step 3, select the pixels to be encoded, take the first pixel in the upper left corner of the electronic map as the starting element, scan row by row from left to right, and after encountering a pixel of color B, the pixel position (x, y) and the adjacent pixels (x, y+1), (x, y-1), (x-1, y), and (x+1, y) centered on this pixel are the pixels to be encoded.
[0135] Step 4: Encode the selected pixels in the following way:
[0136] (1) The first bit is 1 or 0, which is used to identify the row number of the pixel. 1 represents that the row number of the pixel is an odd number, and 0 represents that the row number of the pixel is an even number.
[0137] (2) The second bit is 1 or 0, which is used to identify the number of columns of the pixel. 1 represents that the number of columns of the pixel is an odd number, and 0 represents that the number of columns of the pixel is an even number.
[0138] (3) The third bit is 1 or 0, which is used to identify the color of the pixel, where 1 represents color A and 0 represents color B.
[0139] Step 5: Filter the elements that need to be changed in color by:
[0140] (1) Scan the coded pixels and select four pixels at the same corner point to form a color-changing filter unit. That is, the pixels at the four positions (x, y), (x+1, y), (x, y-1), and (x+1, y-1) form a color-changing filter unit. From left to right and from top to bottom, the first two code elements of the pixels in the color-changing filter unit have four combinations, namely:
[0141] Combination 1: 11, 10, 01, 00;
[0142] Combination 2: 10, 11, 00, 01;
[0143] Combination 3: 01, 00, 11, 10;
[0144] Combination 4: 00, 01, 10, 11.
[0145] (2) When the third bits of the four pixels in the color-changing and filtering unit are all 0, there are the following four combinations:
[0146] Combination 1: 110, 100, 010, 000;
[0147] Combination 2: 100, 110, 000, 010;
[0148] Combination 3: 010, 000, 110, 100;
[0149] Combination 4: 000, 010, 100, 110.
[0150] At this time, the colors of the pixels at the same corner points of the color-changing and filtering units are checked in turn, specifically in the following manner:
[0151] Check the third bit of the codeword (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codeword (x, y+1), (x+1, y+1), (x+1, y) of the pixel in the upper right corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, Start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0152] (3) The four pixels in the original color-changing screening unit form a new combination form, which is:
[0153] Combination 1: XX1, XX0, XX0, XX0;
[0154] Combination 2: XX0, XX1, XX0, XX0;
[0155] Combination 3: XX0, XX0, XX1, XX0;
[0156] Combination 4: XX0, XX0, XX0, XX1.
[0157] The composition of XX includes 11, 00, 10, and 01;
[0158] At this time, the colors of the three pixels with the third bit symbol of 0 in the new color-changing filter unit are checked in turn, and the specific method is as follows:
[0159] a) The third bit of the lower left pixel in the new color-changing filter unit is 1:
[0160] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0161] b) The third bit of the pixel in the upper right corner of the new color-changing filter unit is 1:
[0162] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0163] c) The third bit of the pixel in the lower right corner of the new color-changing filter unit is 1:
[0164] Check the third codewords of (x-1, y), (x-1, y+1), and (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0165] d) The third bit of the upper left pixel in the new color-changing filter unit is 1:
[0166] Check the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
[0167] A device for automatic and refined processing of linear objects in divisions, place names and boundaries, comprising a built-in processor, a memory and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it can run the above-mentioned system for automatic and refined processing of linear objects in divisions, place names and boundaries, and implement this method for automatic and refined processing of linear objects in divisions, place names and boundaries.
[0168] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A system for automatic processing of linear objects in divisions, place names and boundaries, characterized by: It includes import module, color setting module, position calibration module, encoding module, and screening and color changing module; The import module imports the initial electronic map and converts it into an editable format; The color setting module sets different objects in the electronic map to different colors, the pixel colors of other objects are set to color A, and the pixel colors of linear objects are set to color B; The position calibration module is used to calibrate the pixel position. The space occupied by each pixel is a basic unit. The position of the pixel in the row is calibrated as x, increasing from left to right; the position in the column is calibrated as y, increasing from bottom to top; The encoding module is used to encode the selected pixels in the following manner: (1) The first bit is 1 or 0, which is used to identify the row number of the pixel. 1 represents that the row number of the pixel is an odd number, and 0 represents that the row number of the pixel is an even number. (2) The second bit is 1 or 0, which is used to identify the number of columns of the pixel. 1 represents that the number of columns of the pixel is an odd number, and 0 represents that the number of columns of the pixel is an even number. (3) The third bit takes the value 1 or 0, which is used to identify the color of the pixel, where 1 represents color A and 0 represents color B; The screening and color changing module is used to screen pixels that need to be changed in color and perform the color change in the following manner: (1) Scan the coded pixels and select four pixels at the same corner point to form a color-changing filter unit. That is, the pixels at the four positions (x, y), (x+1, y), (x, y-1), and (x+1, y-1) form a color-changing filter unit. From left to right and from top to bottom, the first two code elements of the pixels in the color-changing filter unit have four combinations, namely: Combination 1: 11, 10, 01, 00; Combination 2: 10, 11, 00, 01; Combination 3: 01, 00, 11, 10; Combination 4: 00, 01, 10, 11; (2) When the third bits of the four pixels in the color-changing and filtering unit are all 0, there are the following four combinations: Combination 1: 110, 100, 010, 000; Combination 2: 100, 110, 000, 010; Combination 3: 010, 000, 110, 100; Combination 4: 000, 010, 100, 110; At this time, the colors of the pixels at the same corner points of the color-changing and filtering units are checked in turn, specifically in the following manner: Check the third bit of the codeword (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codeword (x, y+1), (x+1, y+1), (x+1, y) of the pixel in the upper right corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, Start checking the third bit of the codewords (x-1, y), (x-1, y-1), (x, y-1) of the pixel at the lower left corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codewords (x+1, y), (x+1, y-1), (x, y-1) of the pixel at the lower right corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. (3) The four pixels in the original color-changing screening unit form a new combination form, which is: Combination 1: XX1, XX0, XX0, XX0; Combination 2: XX0, XX1, XX0, XX0; Combination 3: XX0, XX0, XX1, XX0; Combination 4: XX0, XX0, XX0, XX1; The composition of XX includes 11, 00, 10, and 01; At this time, the colors of the three pixels with the third bit symbol of 0 in the new color-changing filter unit are checked in turn, and the specific method is as follows: a) The third bit of the lower left pixel in the new color-changing filter unit is 1: Check the third codewords of (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. b) The third bit of the pixel in the upper right corner of the new color-changing filter unit is 1: Check the third bit of the codewords (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codewords (x-1, y), (x-1, y-1), (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codewords (x+1, y), (x+1, y-1), (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. c) The third bit of the pixel in the lower right corner of the new color-changing filter unit is 1: Check the third codewords of (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. d) The third bit of the upper left pixel in the new color-changing filter unit is 1: Check the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
2. A method for automatic processing of linear objects in divisions, place names and boundaries, characterized by: Step 1, distinguishing the pixel colors of other objects and linear objects, setting the pixel colors of other objects to color A, and setting the pixel colors of linear objects to color B; Step 2: Establish pixel position calibration rules. The space occupied by each pixel is the basic unit. The position of the pixel in the row is calibrated as x, increasing from left to right; the position of the pixel in the column is calibrated as y, increasing from bottom to top. Step 3, select the pixel to be encoded, take the first pixel in the upper left corner of the electronic map as the starting element, scan row by row from left to right, and after encountering a pixel of color B, the pixel position (x, y) and the adjacent pixels (x, y+1), (x, y-1), (x-1, y), (x+1, y) centered on this pixel are the pixels to be encoded; Step 4: Encode the selected pixels in the following way: (1) The first bit is 1 or 0, which is used to identify the row number of the pixel. 1 represents that the row number of the pixel is an odd number, and 0 represents that the row number of the pixel is an even number. (2) The second bit is 1 or 0, which is used to identify the number of columns of the pixel. 1 represents that the number of columns of the pixel is an odd number, and 0 represents that the number of columns of the pixel is an even number. (3) The third bit takes the value 1 or 0, which is used to identify the color of the pixel, where 1 represents color A and 0 represents color B; Step 5: Filter the elements that need to be changed in color by: (1) Scan the coded pixels and select four pixels at the same corner point to form a color-changing filter unit. That is, the pixels at the four positions (x, y), (x+1, y), (x, y-1), and (x+1, y-1) form a color-changing filter unit. From left to right and from top to bottom, the first two code elements of the pixels in the color-changing filter unit have four combinations, namely: Combination 1: 11, 10, 01, 00; Combination 2: 10, 11, 00, 01; Combination 3: 01, 00, 11, 10; Combination 4: 00, 01, 10, 11; (2) When the third bits of the four pixels in the color-changing and filtering unit are all 0, there are the following four combinations: Combination 1: 110, 100, 010, 000; Combination 2: 100, 110, 000, 010; Combination 3: 010, 000, 110, 100; Combination 4: 000, 010, 100, 110; At this time, the colors of the pixels at the same corner points of the color-changing and filtering units are checked in turn, specifically in the following manner: Check the third bit of the codeword (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codeword (x, y+1), (x+1, y+1), (x+1, y) of the pixel in the upper right corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, Start checking the third bit of the codewords (x-1, y), (x-1, y-1), (x, y-1) of the pixel at the lower left corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codewords (x+1, y), (x+1, y-1), (x, y-1) of the pixel at the lower right corner of the color-changing filter unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. (3) The four pixels in the original color-changing screening unit form a new combination form, which is: Combination 1: XX1, XX0, XX0, XX0; Combination 2: XX0, XX1, XX0, XX0; Combination 3: XX0, XX0, XX1, XX0; Combination 4: XX0, XX0, XX0, XX1; The composition of XX includes 11, 00, 10, and 01; At this time, the colors of the three pixels with the third bit symbol of 0 in the new color-changing filter unit are checked in turn, and the specific method is as follows: a) The third bit of the lower left pixel in the new color-changing filter unit is 1: Check the third codewords of (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. b) The third bit of the pixel in the upper right corner of the new color-changing filter unit is 1: Check the third bit of the codewords (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codewords (x-1, y), (x-1, y-1), (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. Otherwise, start checking the third bit of the codewords (x+1, y), (x+1, y-1), (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third bit of the codeword of this pixel with 1 and stop. c) The third bit of the pixel in the lower right corner of the new color-changing filter unit is 1: Check the third codewords of (x-1, y), (x-1, y+1), (x, y+1) of the pixel in the upper left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x, y+1), (x+1, y+1), (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. d) The third bit of the upper left pixel in the new color-changing filter unit is 1: Check the third codewords of (x, y+1), (x+1, y+1), and (x+1, y) of the pixel in the upper right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x-1, y), (x-1, y-1), and (x, y-1) of the pixel in the lower left corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop. Otherwise, start checking the third codewords of (x+1, y), (x+1, y-1), and (x, y-1) of the pixel in the lower right corner of the color-changing filtering unit. When these three codewords are all 1, replace the third codeword of this pixel with 1 and stop.
