A block distribution recognition method and electronic device
Through edge detection and contour shape calculation, the problem of block distribution identification in automated drawing is solved, the layout of image files is optimized, block overlap and excessive blank areas are avoided, and automatic identification and optimization of block distribution are achieved.
Patent Information
- Application Number
- CN202211526965.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-11-30
AI Technical Summary
When using computer-aided design software for automated drawing, it is difficult for the program to identify the block distribution information, resulting in problems such as block overlap and unreasonable blank areas.
By performing edge detection on image files, determining the outline shape of the tiles, and calculating their distribution information in the image file, including the area ratio of the tiles to the canvas, the length and width of the outline shape, the horizontal and vertical axis distance, etc., the layout of the image file is optimized.
It realizes automatic identification of tile distribution, avoids problems of tile overlap and excessive blank areas, and improves the compactness and accuracy of image file layout.
Smart Images

Figure CN115861350B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image processing and automated program instruction control, and in particular to a block distribution recognition method and electronic device. Background Art
[0002] An image block refers to a graphic that occupies a certain spatial position in the canvas of an image file, such as a square, circle, or polygon.
[0003] Currently, when drawing using Computer Aided Design (CAD) software, the distribution of blocks on the screen is often observed by the naked eye. However, in automated drawing scenarios using programs, this information cannot be visually observed, making it difficult for the program to identify the block distribution information. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a block distribution recognition method and electronic device, which are used to improve the problem of difficulty in recognizing block distribution information.
[0005] An embodiment of the present application provides a block distribution identification method, comprising: performing edge detection on an image file to be processed to obtain edge information, wherein the image file includes at least one block; determining the outline shape of the block based on the edge information; and calculating the distribution information of the block in the image file based on the outline shape of the block. In the implementation of the above scheme, by performing edge detection and determining the outline shape of the image file to be processed, and calculating the distribution information of the block in the image file based on the obtained outline shape of the block, the situation of manually observing the block distribution information on the screen with the naked eye is effectively avoided, thereby realizing the function of identifying the distribution information of the block in the image file.
[0006] Optionally, in an embodiment of the present application, edge detection is performed on the image file to be processed, including: obtaining a canvas in the image file; determining whether the size of the canvas is within a preset size range; if not, scaling the size of the canvas to within the preset size range, obtaining the scaled canvas, and performing edge detection on the scaled canvas. In the implementation of the above scheme, by scaling the size of the canvas to within the preset size range, obtaining the scaled canvas, and performing edge detection on the scaled canvas, the problem of reduced edge detection accuracy due to a too small canvas size, or incomplete edge detection of the image block and low accuracy due to an overly large canvas size is avoided, thereby effectively taking into account both the precision and accuracy of edge detection.
[0007] Optionally, in an embodiment of the present application, scaling the size of the canvas to within a preset size range includes: counting the horizontal and vertical axis values of the pixels of all tiles in the image file on the canvas to obtain the maximum horizontal axis value, the minimum horizontal axis value, the maximum vertical axis value, and the minimum vertical axis value; scaling the canvas according to the maximum horizontal axis value, the minimum horizontal axis value, the maximum vertical axis value, and the minimum vertical axis value so that the size of the canvas is within the preset size range. In the implementation of the above scheme, the canvas is scaled according to the statistical maximum horizontal axis value, the minimum horizontal axis value, the maximum vertical axis value, and the minimum vertical axis value so that the size of the canvas is within the preset size range, thereby avoiding the problem of reduced edge detection accuracy due to the canvas size being too small, or incomplete edge detection of tiles and low accuracy due to the canvas size being too large, effectively taking into account both the precision and accuracy of edge detection.
[0008] Optionally, in an embodiment of the present application, the edge information includes: edge coordinate points; determining the outline shape of the image block based on the edge information includes: binarizing all pixel points within the canvas to obtain a binary image; and finding all coordinate points within the same connected domain as the edge coordinate points in the binary image to obtain the outline shape of the image block. In the implementation of the above scheme, the outline shape of the image block is obtained by finding all coordinate points within the same connected domain as the edge coordinate points in the binary image, thereby avoiding the problem of low outline accuracy caused by directly using color images for outline extraction, and effectively improving the accuracy of the outline shape of the image block.
[0009] Optionally, in an embodiment of the present application, the distribution information includes: the area ratio between the tile and the canvas; calculating the distribution information of the tile in the image file based on the outline shape of the tile, including: counting all the pixels within the outline shape of the tile to obtain the number of pixels of the tile; counting all the pixels within the canvas to obtain the number of pixels of the canvas; determining the area ratio between the tile and the canvas based on the number of pixels of the tile and the number of pixels of the canvas. In the implementation process of the above scheme, the area ratio between the tile and the canvas is determined by counting the number of pixels of the tile and the number of pixels of the canvas, thereby avoiding the problem of difficulty in calculating the area ratio between the tile and the canvas, and effectively realizing the calculation of the distribution information of the tile in the canvas.
[0010] Optionally, in an embodiment of the present application, the distribution information includes: the length value and width value of the outline shape of the tile; the distribution information of the tile in the image file is calculated based on the outline shape of the tile, including: measuring the vertical axis span of the pixel points of the outline shape of the tile on the canvas to obtain the length value of the outline shape; measuring the horizontal axis span of the pixel points of the outline shape of the tile on the canvas to obtain the width value of the outline shape. In the implementation process of the above scheme, the length value and width value of the outline shape are obtained by measuring the vertical axis span and horizontal axis span of the pixel points of the outline shape of the tile on the canvas, thereby improving the problem of difficulty in calculating the length value and width value of the outline shape, and effectively realizing the calculation of the distribution information of the tile in the canvas.
[0011] Optionally, in an embodiment of the present application, the distribution information includes: a horizontal axis distance and / or a vertical axis distance, and the image file includes: a first tile and a second tile; the distribution information of the tile in the image file is calculated according to the contour shape of the tile, including: determining the horizontal axis distance and / or vertical axis distance between the first tile and the second tile according to the coordinate values of the pixel points of the contour shape of the first tile and the coordinate values of the pixel points of the contour shape of the second tile on the canvas. In the implementation process of the above scheme, by determining the horizontal axis distance and / or vertical axis distance between the first tile and the second tile according to the coordinate values of the pixel points of the contour shape of the first tile and the second tile on the canvas, the problem of difficulty in calculating the horizontal axis distance and / or vertical axis distance is improved, and the calculation of the distribution information of the tile in the canvas is effectively realized.
[0012] Optionally, in an embodiment of the present application, the distribution information includes: the location area of the tiles in the image file; after calculating the distribution information of the tiles in the image file based on the outline shape of the tiles, the method further includes: determining a blank area in the image file based on the location area of the tiles in the image file; and modifying the image file based on the blank area in the image file. In implementing the above solution, by modifying the image file based on the blank area determined by the distribution information such as the location area, problems such as excessive blank areas in the image file are alleviated, effectively optimizing the distribution of tiles in the image file.
[0013] Optionally, in an embodiment of the present application, modifying an image file based on its blank area includes determining whether the size of the blank area in the image file is larger than the size of the tile to be inserted; and if so, filling the blank area with the tile to be inserted. In implementing this solution, by filling the blank area with the tile to be inserted if the blank area in the image file is larger than the size of the tile to be inserted, problems such as excessive blank area in the image file are addressed, effectively optimizing the distribution of tiles in the image file.
[0014] Optionally, in an embodiment of the present application, modifying an image file based on its blank area includes: determining whether the size of the blank area of the image file is larger than a preset size; if so, deleting the blank area of the image file by the preset size, or changing the position of the image block in the image file so that the size of the blank area of the image file is less than or equal to the preset size. In the implementation of the above solution, by deleting the blank area of the image file by the preset size, or changing the position of the image block in the image file, problems such as excessively large blank areas in the image file are improved, effectively optimizing the layout of the image file.
[0015] Optionally, in an embodiment of the present application, after calculating the distribution information of the tiles in the image file based on their contour shapes, the method further includes determining whether the tiles overlap based on the distribution information in the image file. In implementing the above solution, by determining whether the tiles overlap based on the distribution information in the image file, the difficulty in determining whether the tiles overlap is avoided, effectively improving the robustness of tile distribution recognition.
[0016] Optionally, in an embodiment of the present application, the distribution information includes: horizontal axis distance and / or vertical axis distance; and determining whether tiles overlap based on the distribution information in the image file includes: determining whether tiles overlap based on the horizontal axis distance and / or vertical axis distance. In implementing the above solution, by determining whether tiles overlap based on the horizontal axis distance and / or vertical axis distance, the difficulty in determining whether tiles overlap is avoided, effectively improving the robustness of tile distribution recognition.
[0017] An embodiment of the present application also provides a block distribution identification device, including: an edge information acquisition module, used to perform edge detection on an image file to be processed to obtain edge information, wherein the image file includes at least one block; a contour shape determination module, used to determine the contour shape of the block based on the edge information; and a distribution information calculation module, used to calculate the distribution information of the block in the image file based on the contour shape of the block.
[0018] Optionally, in an embodiment of the present application, the edge information acquisition module includes: an image canvas acquisition submodule, used to obtain the canvas in the image file; a canvas size judgment submodule, used to judge whether the size of the canvas is within a preset size range; a canvas size scaling submodule, used to scale the size of the canvas to within the preset size range if the size of the canvas is not within the preset size range, obtain the scaled canvas, and perform edge detection on the scaled canvas.
[0019] Optionally, in an embodiment of the present application, the canvas size scaling submodule includes: a horizontal and vertical maximum value obtaining unit, which is used to count the horizontal and vertical axis values of the pixel points of all blocks in the image file on the canvas to obtain the horizontal axis maximum value, horizontal axis minimum value, vertical axis maximum value and vertical axis minimum value; a canvas size scaling unit, which is used to scale the canvas according to the horizontal axis maximum value, horizontal axis minimum value, vertical axis maximum value and vertical axis minimum value so that the size of the canvas is within a preset size range.
[0020] Optionally, in an embodiment of the present application, the edge information includes: edge coordinate points; a contour shape determination module, including: a pixel binarization submodule, used to binarize all pixel points in the canvas to obtain a binary image; a contour shape acquisition submodule, used to find all coordinate points in the same connected domain of the edge coordinate point in the binarized image to obtain the contour shape of the block.
[0021] Optionally, in an embodiment of the present application, the distribution information includes: the area ratio between the tile and the canvas; the distribution information calculation module includes: a contour shape statistics sub-module, used to count all pixel points within the contour shape of the tile to obtain the number of pixel points of the tile; a canvas pixel statistics sub-module, used to count all pixel points within the canvas to obtain the number of pixel points of the canvas; and an area ratio determination sub-module, used to determine the area ratio between the tile and the canvas based on the number of pixel points of the tile and the number of pixel points of the canvas.
[0022] Optionally, in an embodiment of the present application, the distribution information includes: the length value and width value of the contour shape of the tile; the distribution information calculation module includes: a vertical axis span measurement submodule, which is used to measure the vertical axis span of the pixel points of the contour shape of the tile on the canvas to obtain the length value of the contour shape; and a horizontal axis span measurement submodule, which is used to measure the horizontal axis span of the pixel points of the contour shape of the tile on the canvas to obtain the width value of the contour shape.
[0023] Optionally, in an embodiment of the present application, the distribution information includes: horizontal axis distance and / or vertical axis distance, and the image file includes: a first tile and a second tile; the distribution information calculation module includes: a tile distance determination submodule, which is used to determine the horizontal axis distance and / or vertical axis distance between the first tile and the second tile based on the coordinate values of the pixel points of the outline shape of the first tile and the coordinate values of the pixel points of the outline shape of the second tile on the canvas.
[0024] Optionally, in an embodiment of the present application, the distribution information includes: the position area of the tile in the image file; the tile distribution identification device also includes: a blank area determination module, used to determine the blank area of the image file based on the position area of the tile in the image file; and an image file modification module, used to modify the image file based on the blank area of the image file.
[0025] Optionally, in an embodiment of the present application, the image file modification module includes: a blank area judgment submodule, used to judge whether the size of the blank area of the image file is larger than the size of the block to be inserted; and a blank area filling submodule, used to fill the block to be inserted into the blank area if the size of the blank area of the image file is larger than the size of the block to be inserted.
[0026] Optionally, in an embodiment of the present application, the image file modification module includes: an area size judgment submodule, used to judge whether the size of the blank area of the image file is greater than a preset size; a tile position change module, used to delete the blank area of the image file by the preset size if the size of the blank area of the image file is greater than the preset size, or to change the position area of the tile in the image file so that the size of the blank area of the image file is less than or equal to the preset size.
[0027] Optionally, in an embodiment of the present application, the block distribution identification device further includes: a block overlap determination module, configured to determine whether the blocks overlap based on distribution information in the image file.
[0028] Optionally, in an embodiment of the present application, the distribution information includes: horizontal axis distance and / or vertical axis distance; the distribution information calculation module includes: an overlap determination submodule, which is used to determine whether there is overlap in the blocks based on the horizontal axis distance and / or vertical axis distance.
[0029] An embodiment of the present application further provides an electronic device, including: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method described above is performed.
[0030] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described above is executed.
[0031] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and in part will become apparent from the description, or may be understood by practicing the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only illustrate certain embodiments of the embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0033] Figure 1A schematic flow chart of a block distribution identification method provided in an embodiment of the present application is shown;
[0034] Figure 2 A schematic diagram of the image file processing process provided by an embodiment of the present application is shown;
[0035] Figure 3 A schematic diagram of edge detection after scaling provided by an embodiment of the present application is shown;
[0036] Figure 4 A schematic diagram showing scaling based on diagonal coordinates provided in an embodiment of the present application is shown;
[0037] Figure 5 A schematic diagram showing distribution information of image blocks in an image file provided by an embodiment of the present application is shown;
[0038] Figure 6 A schematic structural diagram of a block distribution recognition device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments in the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the embodiments of the present application for protection, but merely represents selected embodiments in the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the embodiments of the present application.
[0040] It is understood that the terms "first" and "second" in the embodiments of the present application are used to distinguish similar objects. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or order of execution, and that the terms "first" and "second" do not necessarily define differences.
[0041] Before introducing the block distribution recognition method provided by the embodiment of the present application, some concepts involved in the embodiment of the present application are first introduced:
[0042] Image processing refers to the technology of analyzing, processing and manipulating images to make them meet visual, psychological or other requirements; image processing is an application of signal processing in the field of images; currently most images are stored in digital form, so image processing in many cases refers to digital image processing; image processing is a subcategory of signal processing, and is also closely related to fields such as computer science and artificial intelligence.
[0043] Robotic Process Automation (RPA) technology can simulate the keyboard and mouse operations employees perform in their daily work, performing tasks such as logging into systems, operating software, reading and writing data, downloading files, and reading emails. Using automated robots as a company's virtual workforce can free employees from repetitive, low-value tasks, freeing them to focus on high-value-added work. This allows companies to achieve digital and intelligent transformation while reducing costs and increasing efficiency.
[0044] RPA is a process in which software robots replace manual tasks in business processes and interact with computer front-end systems like humans. Therefore, RPA can be considered a software-based robot running on a personal PC or server. It mimics user operations on a computer to automatically repeat these operations, such as retrieving emails, downloading attachments, logging into systems, and processing and analyzing data. It does so quickly, accurately, and reliably. Like traditional physical robots, RPA uses specific rules to address the speed and accuracy challenges of human work. However, traditional physical robots are a combination of hardware and software, requiring specific hardware support and software to perform their tasks. RPA robots, on the other hand, are purely software-based and can be deployed on any PC or server to complete the specified tasks, as long as the corresponding software is installed.
[0045] It should be noted that the tile distribution identification method provided in the embodiments of this application can be executed by electronic devices. Electronic devices herein refer to device terminals or servers capable of executing computer programs, such as smartphones, personal computers, tablet computers, personal digital assistants, or mobile internet devices. Servers refer to devices that provide computing services over a network, such as x86 servers and non-x86 servers. Non-x86 servers include mainframes, minicomputers, and UNIX servers.
[0046] The following describes application scenarios where this block distribution recognition method is applicable. These scenarios include, but are not limited to, using RPA robots to simulate humans and draw images using drawing software. Examples of such software include, but are not limited to, CAD, Photoshop, 3D Studio Max, SketchUp, SolidWorks, Blender, and Maya. In practice, it has been observed that when RPA robots use drawing software to draw large numbers of images, they are likely to encounter overlapping blocks within the image files (also known as collisions).
[0047] Recognizing the various shortcomings mentioned above, we proposed a block distribution recognition method after in-depth research. This method allows RPA robots to identify the distribution information of blocks in image files. After knowing the distribution information, the RPA robot can use this distribution information to prevent overlap (also known as block collision or part collision). For example, when adding blocks, the blocks can be added to the blank areas of the image file instead of the blocks in the image file. Another example is changing the position of overlapping blocks in the image file to prevent block overlap. Of course, after identifying the block distribution information in the image file, the blocks in the image file can also be rearranged or excessive blank areas can be deleted based on the block distribution information, thereby achieving a more compact layout of the image file.
[0048] See Figure 1 The flowchart of the block distribution identification method provided by the embodiment of the present application is shown; the embodiment of the present application provides a block distribution identification method, including:
[0049] Step S110: performing edge detection on the image file to be processed to obtain edge information, where the image file includes at least one image block.
[0050] See Figure 2 The following is a schematic diagram of the image file processing process provided by an embodiment of the present application. An image file (Image File) refers to a file whose image blocks need to be identified. The image file here can be an image file drawn by a CAD application (such as an interior design floor plan), an image file drawn by SolidWorks software, or an image file drawn by Photoshop software, or an image file captured by an image acquisition device such as a camera. An image file includes at least one block (Image Block). A block here refers to a graphic that occupies a certain spatial position and has a connected domain on the canvas of the image file. For example, the floor plan of a house is obviously one block, and the floor plans of two houses are obviously two blocks.
[0051] Edge detection involves detecting the edges of target objects in an image file. For example, in interior design, it involves detecting all the wall lines in a floor plan. Edge detection can generate various types of edge information, including but not limited to edge coordinates (e.g., the coordinates of the pixels where the wall is located) and pixel coordinates within the image block (e.g., the coordinates of the pixels where the indoor usable area is located).
[0052] Step S120: determining the outline shape of the image block according to the edge information.
[0053] It can be understood that the outline shape of a block refers to the shape formed by the outer contour lines of the block. For example, in the field of interior design, if all the wall lines in the floor plan are detected, then the outline shape of the floor plan is the shape formed by all the exterior walls in the floor plan.
[0054] Step S130: Calculating distribution information of the image block in the image file according to the outline shape of the image block.
[0055] It is understandable that there are many types of distribution information calculated based on the outline shape of the block, including but not limited to: the area ratio between the block and the canvas (for example, the area ratio between the floor plan and the master plan), the length and width values of the outline shape of the block (for example, the east-west span distance and the south span distance of the floor plan), the horizontal axis distance and / or the vertical axis distance (for example, the east-west building distance and / or the south building distance), etc.
[0056] In the above implementation process, by performing edge detection and determining the contour shape of the image file to be processed, and calculating the distribution information of the block in the image file based on the contour shape of the block, the situation of observing the block distribution information on the screen with the naked eye is effectively avoided, thereby realizing the function of identifying the distribution information of the block in the image file.
[0057] See Figure 3 The schematic diagram of scaling followed by edge detection provided by an embodiment of the present application is shown; it is understandable that because the canvas in the image file is sometimes too small, it is difficult to detect edges, or the canvas is sometimes too large, making it impossible to detect all tiles. Therefore, in order to ensure that all tiles in the image file are detected, when the canvas size is not within a preset size range, the canvas in the image file can be scaled first to obtain the scaled canvas, and edge detection can be performed on the scaled canvas to obtain edge information. As an optional implementation of the above-mentioned step S110, during edge detection, edge detection can also be performed after scaling. This implementation may include:
[0058] Step S111: Acquire the canvas in the image file.
[0059] Canvas refers to the rendering space for user interface (UI) layout in an image file.
[0060] The implementation method of the above-mentioned step S111 includes: obtaining the canvas in the image file according to the drawing program of the image file. For example, assuming that the image file is drawn by a CAD application, the canvas in the image file can be obtained through the application programming interface (API). The API interface here includes but is not limited to: ObjectArx, AutoLisp, ActiveX (com) and other interfaces.
[0061] Step S112: Determine whether the size of the canvas is within a preset size range.
[0062] Step S113: If the size of the canvas is not within the preset size range, the size of the canvas is scaled to be within the preset size range to obtain a scaled canvas, and edge detection is performed on the scaled canvas to obtain edge information.
[0063] Zoom refers to zooming out or zooming in. It is understandable that since the size of the canvas is most likely not within the preset size range, the canvas needs to be zoomed.
[0064] The implementation method of the above steps S112 to S113 is, for example: using an executable program compiled or interpreted in a preset programming language to determine whether the size of the canvas is within a preset size range, if the size of the canvas is smaller than the preset size (for example, the minimum value in the preset size range, which may be 600 pixels), then the size of the canvas is enlarged to within the preset size range (for example, 600 pixels to 700 pixels), to obtain an enlarged canvas, and edge detection is performed on the enlarged canvas to obtain edge information. If the size of the canvas is larger than the preset size (for example, the minimum value in the preset size range, which may be 700 pixels), then the size of the canvas is reduced to within the preset size range (for example, 600 pixels to 700 pixels), to obtain a reduced canvas, and edge detection is performed on the reduced canvas using a Holistically-nested Edge Detection (HED) algorithm, a Sobel operator algorithm, or a Canny operator algorithm to obtain edge information. Of course, you can also use cv2.findContours(img,mode,method) in the OpenCV library to perform edge detection on the reduced canvas to obtain edge information; where img represents the image file to be processed (which can be a binary image), mode represents the contour detection mode, and method represents the approximate method of contour detection.
[0065] See Figure 4The schematic diagram of scaling based on diagonal coordinates provided in an embodiment of the present application is shown. As an optional implementation of the above step S113, during the above canvas size scaling process, scaling based on diagonal coordinates may also be performed, which may include:
[0066] Step S113a: Count the horizontal axis values and vertical axis values of the pixels of all the blocks in the image file on the canvas to obtain the maximum horizontal axis value, the minimum horizontal axis value, the maximum vertical axis value, and the minimum vertical axis value.
[0067] Diagonal Coordinates refer to the reference diagonal coordinates used to scale the canvas size. The distance between these two diagonal coordinates on the canvas can be the farthest or relatively far away, and can be set according to the specific situation.
[0068] The implementation method of the above-mentioned step S113a includes: performing statistical processing on the horizontal axis values and vertical axis values of the pixel points of all blocks in the image file on the canvas through various forms of API interfaces such as ObjectArx, AutoLisp, ActiveX (com), LISP and COM, and obtaining the horizontal axis maximum value, horizontal axis minimum value, vertical axis maximum value and vertical axis minimum value.
[0069] Step S113b: scaling the canvas according to the maximum value of the horizontal axis, the minimum value of the horizontal axis, the maximum value of the vertical axis, and the minimum value of the vertical axis, so that the size of the canvas is within a preset size range.
[0070] There are many implementations of step S113b, including but not limited to the following:
[0071] In a first embodiment, scaling is performed by executing a scaling instruction in the command line window of a CAD application. For example, assuming that the above-mentioned image file can be an image file drawn by a CAD application (such as AutoCAD), a control program compiled or interpreted using a preset programming language can be used to obtain the maximum value of the horizontal axis, the minimum value of the horizontal axis, the maximum value of the vertical axis, and the minimum value of the vertical axis, and convert the maximum value of the horizontal axis, the minimum value of the horizontal axis, the maximum value of the vertical axis, and the minimum value of the vertical axis into diagonal coordinates in the image file. There are two cases of diagonal coordinates here: the first diagonal coordinates are, for example: (minimum value of the horizontal axis, minimum value of the vertical axis) and (maximum value of the horizontal axis, maximum value of the vertical axis). The second diagonal coordinates are, for example: (maximum value of the horizontal axis, minimum value of the vertical axis) and (minimum value of the horizontal axis, maximum value of the vertical axis). Then, the control program is used to input the scaling instruction "zoom" in the command line window of the CAD application (such as AutoCAD), and the first diagonal coordinate or the second diagonal coordinate is input into the command line window of the CAD application (such as AutoCAD), so that the CAD application (such as AutoCAD) automatically scales the canvas so that the size of the canvas is within the preset size range.
[0072] The second implementation method is to control the CAD application to scale by using an API interface. For example, assuming that the above-mentioned image file can be an image file drawn by a CAD application (such as AutoCAD), the API interface in the pyautocad library can be used to control the CAD application (such as AutoCAD) to automatically scale the canvas so that the size of the canvas is within a preset size range. The above-mentioned pyautocad library is a library for simplifying AutoCAD ActiveX Automation scripts written in Python. Of course, in the specific implementation process, other API interfaces can also be used for scaling. For example, various API interfaces such as ObjectArx, AutoLisp, ActiveX (com), LISP and COM can be used to control the CAD application (such as AutoCAD) to automatically scale the canvas so that the size of the canvas is within a preset size range.
[0073] As an optional implementation of the above step S120, the above edge information may include: edge coordinate points; the image may be binarized before determining the contour shape of the block. This implementation may include:
[0074] Step S121: binarize all pixels in the canvas to obtain a binary image.
[0075] The implementation of the above step S121 is, for example: using a Kirsch operator or an adaptive threshold method to binarize all pixels in the canvas to obtain a binary image.
[0076] Step S122: searching for all coordinate points in the same connected domain of the edge coordinate point in the binary image to obtain the contour shape of the image block.
[0077] The implementation method of the above-mentioned step S122 is, for example: using an executable program compiled or interpreted by a preset programming language to search for all coordinate points in the same connected domain of the edge coordinate point in the binary image to obtain the contour shape of the block. The programming languages that can be used are, for example: C, C++, Java, BASIC, JavaScript, LISP, Shell, Perl, Ruby, Python and PHP, etc.
[0078] As a first optional implementation of step S130, the distribution information may include: the area ratio between the tile and the canvas; and the implementation of calculating the area ratio may include:
[0079] Step S131: Count all the pixels within the outline of the block to obtain the number of pixels in the block.
[0080] The implementation of the above step S131 is as follows: Figure 2 , an executable program compiled or interpreted using a preset programming language can be used to count the number of all pixels within the outline shape of the block. Assuming that the block is a large floor plan, the number of all pixels within the outline shape can be counted to be 8000.
[0081] Step S132: Count all the pixels in the canvas to obtain the number of pixels in the canvas.
[0082] The implementation of the above step S132 is as follows: Figure 2 , an executable program compiled or interpreted using a preset programming language is used to count all the pixels in the canvas, and the number of pixels in the canvas can be 10,000.
[0083] Step S133: Determine the area ratio between the image block and the canvas according to the number of pixels in the image block and the number of pixels in the canvas.
[0084] For example, in the implementation of step S133, assuming the number of pixels in the tile is 8,000 and the number of pixels in the canvas is 10,000, an executable program compiled or interpreted in a predetermined programming language can be used to divide the number of pixels in the tile (i.e., 8,000) by the number of pixels in the canvas (i.e., 10,000), thereby obtaining an area ratio of 80% between the tile and the canvas. Of course, in a specific implementation, the area ratio of the tile to the display screen can also be calculated. This area ratio is also referred to as the tile-to-screen ratio. The calculation process for the tile-to-screen ratio is similar to the above-described area ratio calculation process and is therefore not further described.
[0085] See Figure 5 A schematic diagram of distribution information of image blocks in an image file provided by an embodiment of the present application is shown; as a second optional implementation of the above-mentioned step S130, the above-mentioned distribution information may further include: the length value and width value of the outline shape of the image block; when calculating the distribution information of the image block in the image file, the length value and width value of the outline shape of the image block may be calculated, and this implementation may include:
[0086] Step S134: measuring the vertical axis span of the pixel points of the outline shape of the block on the canvas to obtain the length value of the outline shape.
[0087] The implementation of the above step S134 is, for example, to measure the vertical axis span of the pixel points of the outline shape of the first block and the second block on the canvas using an executable program compiled or interpreted in a preset programming language to obtain the length value of the outline shape of the first block and the second block ( Figure 5 The length values of the outline shapes of the first and second tiles in the image are the same).
[0088] Step S135: measuring the horizontal axis span of the pixel points of the outline shape of the block on the canvas to obtain the width value of the outline shape.
[0089] Step S135 may be implemented, for example, by using an executable program compiled or interpreted in a preset programming language to measure the horizontal span of the pixels of the first tile's outline on the canvas to obtain the width of the first tile's outline. Alternatively, the executable program may be used to measure the horizontal span of the pixels of the second tile's outline on the canvas to obtain the width of the second tile's outline.
[0090] As a third optional implementation of step S130, the distribution information may further include: a horizontal axis distance and / or a vertical axis distance; the image file may further include: a first image block and a second image block; and the process of calculating the horizontal axis distance and / or the vertical axis distance between the first image block and the second image block based on the outline shape of the first image block and the outline shape of the second image block may include:
[0091] Step S136: Determine the horizontal axis distance and / or vertical axis distance between the first block and the second block according to the coordinate values of the pixels of the outline shape of the first block and the coordinate values of the pixels of the outline shape of the second block on the canvas.
[0092] The implementation of the above step S136 is as follows: Figure 5 If the first block and the second block do not overlap, and the first block is on the left and the second block is on the right, then the horizontal axis coordinate value of the leftmost pixel point of the second block can be subtracted from the horizontal axis coordinate value of the rightmost pixel point of the first block to obtain the horizontal axis distance between the first block and the second block. It can be understood that Figure 5 The vertical axis distance in is 0, and the calculation method of the vertical axis distance is similar to the horizontal axis distance, so it will not be repeated. Similarly, if the coordinate values of the pixel points of the outline shape of the first block on the canvas and the coordinate values of the pixel points of the outline shape of the second block on the canvas overlap in the horizontal axis direction (or vertical axis direction), then it can be determined that the horizontal axis distance between the first block and the second block is a negative value (indicating the distance of the overlap between the two). The calculation method of the horizontal axis distance in the overlapping case is similar to the non-overlapping horizontal axis distance mentioned above, so it will not be repeated.
[0093] In the above implementation process, the horizontal axis distance and / or vertical axis distance between the first tile and the second tile are determined based on the coordinate values of the pixel points of the outline shapes of the first tile and the second tile on the canvas, thereby improving the problem of difficulty in calculating the horizontal axis distance and / or vertical axis distance, and effectively realizing the calculation of the distribution information of the tiles in the canvas.
[0094] As an optional implementation of the above-mentioned block distribution identification method, the distribution information includes: the location area of the block in the image file; after calculating the distribution information of the block in the image file based on the outline shape of the block, the method further includes:
[0095] Step S140: determining a blank area of the image file according to the position area of the image block in the image file.
[0096] The implementation of the above step S140 is as follows: It can be understood that, in the process of identifying the distribution of blocks, the outline shape of the blocks has been identified above (see Figure 2 The distribution information of the black area, or the outer contour of the black area, Figure 5 ), so the inner area of the tile's outline shape (see Figure 2 The black area of the distribution information of the image block is determined as the location area of the image block in the image file. Similarly, the outer area of the outline shape of the image block can be determined as the blank area of the image file (see Figure 5 the outer area of the outline shape).
[0097] Step S150: modifying the image file according to the blank area of the image file.
[0098] It is understood that there are many implementations of step S150, and therefore, the implementation of step S150 will be described in detail below. In the above implementation process, the image file is modified by the blank area determined based on the distribution information such as the location area, thereby improving the problem of excessive blank area in the image file and effectively optimizing the distribution of tiles in the image file.
[0099] As a first optional implementation of the above step S150, the implementation of modifying the image file according to the blank area of the image file may include:
[0100] Step S151: determining whether the size of the blank area of the image file is larger than the size of the image block to be inserted.
[0101] An implementation example of the above-mentioned step S151 is: using an electronic device running an RPA robot to obtain the size of the block to be inserted, and reading the blank area from the distribution information of the image file, and determining whether the size of the blank area of the image file is larger than the size of the block to be inserted.
[0102] Step S152 : If the size of the blank area of the image file is larger than the size of the block to be inserted, fill the blank area with the block to be inserted.
[0103] An implementation example of the above-mentioned step S152 is: if the RPA robot determines that the size of the blank area of the image file is larger than the size of the block to be inserted, the RPA robot can fill the block to be inserted into the blank area through an executable program compiled or interpreted in a preset programming language.
[0104] In the implementation process of the above solution, when the size of the blank area of the image file is larger than the size of the block to be inserted, the block to be inserted is filled into the blank area, thereby improving the problem of the blank area in the image file being too large and effectively optimizing the distribution of blocks in the image file.
[0105] As a second optional implementation of the above step S150, the implementation of modifying the image file according to the blank area of the image file may include:
[0106] Step S153: determining whether the size of the blank area of the image file is larger than a preset size.
[0107] For example, in step S153, an electronic device running an RPA robot may be used to obtain the size of the image block to be inserted, read the blank area from the distribution information of the image file, and determine whether the size of the blank area of the image file is larger than a preset size. The preset size can be set based on the specific situation. For example, in traditional media scenarios such as newspapers, the preset size can be set to 1 cm or 2 cm.
[0108] Step S154: If the size of the blank area of the image file is larger than the preset size, the blank area of the image file is deleted by the preset size, or the position area of the block in the image file is changed so that the size of the blank area of the image file is smaller than or equal to the preset size.
[0109] The implementation methods of the above-mentioned step S154 include: in traditional media scenarios such as newspapers, RPA robots can be used to automatically typeset image files. For example: if the RPA robot detects that the size of the blank area of the image file is larger than the preset size, the RPA robot can delete the blank area of the image file by the preset size through an executable program, or the RPA robot can change the position area of the block in the image file so that the size of the blank area of the image file is less than or equal to the preset size.
[0110] In the implementation of the above solution, by deleting the preset size of the blank area of the image file, or changing the position area of the block in the image file, the problem of the blank area in the image file being too large is improved, and the layout of the image file is effectively optimized.
[0111] As an optional implementation of the above block distribution identification method, after calculating the distribution information of the blocks in the image file, the method further includes:
[0112] Step S160: determining whether image blocks overlap according to distribution information in the image file.
[0113] There are many ways to determine whether there is overlap in step S160, including but not limited to the following:
[0114] As the first method for determining whether there is overlap in step S160, the distribution information may further include: horizontal axis distance and / or vertical axis distance. Then, whether there is overlap in the image blocks may be determined specifically based on the horizontal axis distance and / or vertical axis distance. This implementation may include:
[0115] Step S161: determining whether there is overlap of image blocks according to the horizontal axis distance and / or the vertical axis distance.
[0116] An example of an implementation of the above-mentioned step S161 is: assuming that the image file includes a first block and a second block, if the horizontal axis distance between the first block and the second block is a negative value, then it can be determined that the first block and the second block overlap in the horizontal axis direction; similarly, if the vertical axis distance between the first block and the second block is a negative value, then it can be determined that the first block and the second block overlap in the vertical axis direction. It can be understood that, assuming that the horizontal axis distance and the vertical axis distance between the first block and the second block are both negative values, then it can be determined that the first block and the second block overlap in both the horizontal and vertical directions. If the electronic device determines that the blocks overlap based on the horizontal axis distance and / or the vertical axis distance, then the electronic device can output an overlapping prompt message.
[0117] As a second method for determining whether there is overlap in step S160, whether there is overlap is determined based on the coordinate values of the pixel points of the outline shape of the block on the canvas. This implementation may include:
[0118] Step S162: determining whether the tiles overlap based on the coordinate values of the pixels of the outline of the first tile and the coordinate values of the pixels of the outline of the second tile on the canvas.
[0119] The implementation method of the above-mentioned step S162 is, for example: determining whether the coordinate values of the pixel points of the outline shape of the first block and the coordinate values of the pixel points of the outline shape of the second block on the canvas are the same, that is, the coordinate values of the pixel points of the outline shape of the first block on the canvas and the coordinate values of the pixel points of the outline shape of the second block on the canvas can be used to determine whether the first block and the second block overlap in the horizontal axis direction (or vertical axis direction) (i.e., whether the coordinate values of the pixel points of the two blocks are the same). If the horizontal axis coordinate values of the pixel points of the outline shape of the first block on the canvas and the horizontal axis coordinate values of the pixel points of the outline shape of the second block on the canvas are the same, then it can be determined that the first block and the second block overlap in the horizontal axis direction. Similarly, if the vertical axis coordinate values of the pixel points of the outline shape of the first block on the canvas and the vertical axis coordinate values of the pixel points of the outline shape of the second block on the canvas are the same, then it can be determined that the first block and the second block overlap in the vertical axis direction.
[0120] See Figure 6 The block distribution recognition device 200 provided in the embodiment of the present application is shown as a structural diagram. The embodiment of the present application provides a block distribution recognition device 200, comprising:
[0121] The edge information obtaining module 210 is configured to perform edge detection on an image file to be processed to obtain edge information. The image file includes at least one image block.
[0122] The outline shape determination module 220 is configured to determine the outline shape of the image block according to the edge information.
[0123] The distribution information calculation module 230 is configured to calculate the distribution information of the image block in the image file according to the outline shape of the image block.
[0124] Optionally, in an embodiment of the present application, the edge information obtaining module includes:
[0125] The image canvas acquisition submodule is used to obtain the canvas in the image file.
[0126] The canvas size determination submodule is used to determine whether the canvas size is within a preset size range.
[0127] The canvas size scaling submodule is used to scale the size of the canvas to within the preset size range if the size of the canvas is not within the preset size range, obtain the scaled canvas, and perform edge detection on the scaled canvas.
[0128] Optionally, in an embodiment of the present application, the canvas size scaling submodule includes:
[0129] The horizontal and vertical maximum value obtaining unit is used to count the horizontal and vertical axis values of the pixel points of all blocks in the image file on the canvas to obtain the horizontal maximum value, horizontal minimum value, vertical maximum value and vertical minimum value.
[0130] The canvas size scaling unit is used to scale the canvas according to the maximum value of the horizontal axis, the minimum value of the horizontal axis, the maximum value of the vertical axis, and the minimum value of the vertical axis so that the size of the canvas is within a preset size range.
[0131] Optionally, in an embodiment of the present application, the edge information includes: edge coordinate points; and the contour shape determination module includes:
[0132] The pixel binarization submodule is used to binarize all pixels in the canvas to obtain a binary image.
[0133] The contour shape acquisition submodule is used to find all coordinate points in the same connected domain of the edge coordinate point in the binary image to obtain the contour shape of the block.
[0134] Optionally, in an embodiment of the present application, the distribution information includes: the area ratio between the tile and the canvas; the distribution information calculation module includes:
[0135] The outline shape statistics submodule is used to count all the pixels within the outline shape of the block to obtain the number of pixels in the block.
[0136] The canvas pixel statistics submodule is used to count all the pixels in the canvas and obtain the number of pixels in the canvas.
[0137] The area ratio determination submodule is used to determine the area ratio between the tile and the canvas according to the number of pixels in the tile and the number of pixels in the canvas.
[0138] Optionally, in an embodiment of the present application, the distribution information includes: a length value and a width value of the outline shape of the block; and the distribution information calculation module includes:
[0139] The vertical axis span measurement submodule is used to measure the vertical axis span of the pixel points of the outline shape of the block on the canvas to obtain the length value of the outline shape.
[0140] The horizontal axis span measurement submodule is used to measure the horizontal axis span of the pixel points of the outline shape of the block on the canvas to obtain the width value of the outline shape.
[0141] Optionally, in an embodiment of the present application, the distribution information includes: a horizontal axis distance and / or a vertical axis distance; the image file includes: a first image block and a second image block; and the distribution information calculation module includes:
[0142] The tile distance determination submodule is used to determine the horizontal axis distance and / or vertical axis distance between the first tile and the second tile based on the coordinate values of the pixel points of the outline shape of the first tile and the coordinate values of the pixel points of the outline shape of the second tile on the canvas.
[0143] Optionally, in an embodiment of the present application, the distribution information includes: a location area of a block in an image file; and the block distribution identification device further includes:
[0144] A blank area determination module, used for determining the blank area of the image file according to the position area of the image block in the image file;
[0145] The image file modification module is used to modify the image file according to the blank area of the image file.
[0146] Optionally, in an embodiment of the present application, the image file modification module includes:
[0147] A blank area determination submodule is used to determine whether the size of the blank area of the image file is larger than the size of the block to be inserted;
[0148] The blank area filling submodule is used to fill the image block to be inserted into the blank area if the size of the blank area of the image file is larger than the size of the image block to be inserted.
[0149] Optionally, in an embodiment of the present application, the image file modification module includes:
[0150] The area size determination submodule is used to determine whether the size of the blank area of the image file is larger than a preset size;
[0151] The block position changing module is used to delete the blank area of the image file by the preset size if the size of the blank area of the image file is larger than the preset size, or to change the position area of the block in the image file so that the size of the blank area of the image file is smaller than or equal to the preset size.
[0152] Optionally, in the embodiment of the present application, the image block distribution recognition device further includes:
[0153] The block overlap determination module is used to determine whether the blocks overlap according to the distribution information in the image file.
[0154] Optionally, in an embodiment of the present application, the distribution information includes: horizontal axis distance and / or vertical axis distance; the distribution information calculation module includes:
[0155] The overlap determination submodule is used to determine whether the image blocks overlap according to the horizontal axis distance and / or the vertical axis distance.
[0156] It should be understood that the device corresponds to the above-mentioned block distribution identification method embodiment and can perform each step involved in the above-mentioned method embodiment. The specific functions of the device can be found in the description above. To avoid repetition, the detailed description is omitted here. The device includes at least one software function module that can be stored in the memory in the form of software or firmware or embedded in the device's operating system (OS).
[0157] An electronic device provided by an embodiment of the present application includes: a processor and a memory, the memory storing machine-readable instructions executable by the processor, and the above method being executed when the machine-readable instructions are executed by the processor.
[0158] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the above method is executed.
[0159] Among them, the computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0160] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similarities between the various embodiments can be referred to in conjunction with each other. For device embodiments, since they are generally similar to method embodiments, their description is relatively simple, and for relevant details, reference can be made to the description of the method embodiments.
[0161] In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are only schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible implementation architectures, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also be different from the order of occurrence marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which is mainly based on the functions involved.
[0162] In addition, the functional modules of each embodiment in the embodiments of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. In addition, in the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiments of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in an appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradicting each other.
[0163] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any actual relationship or order between these entities or operations.
[0164] The above description is only an optional implementation method of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited to this. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in the embodiment of the present application, and they should all be covered by the protection scope of the embodiment of the present application.
Claims
1. A block distribution recognition method, characterized in that: include: Performing edge detection on an image file to be processed to obtain edge information, wherein the image file includes at least one image block; determining a contour shape of the image block according to the edge information; Calculating distribution information of the image block in the image file according to the contour shape of the image block; The image file includes: an image file drawn by a CAD application; the edge detection of the image file to be processed includes: obtaining a canvas in the image file through an ObjectArx or ActiveX application interface; judging whether the size of the canvas is within a preset size range; if not, performing statistics on the horizontal and vertical axis values of the pixel points of all blocks in the image file on the canvas to obtain the horizontal maximum value, the horizontal minimum value, the vertical maximum value and the vertical minimum value; scaling the canvas according to the horizontal maximum value, the horizontal minimum value, the vertical maximum value and the vertical minimum value so that the size of the canvas is within the preset size range, obtaining the scaled canvas, and performing edge detection on the scaled canvas.
2. The method according to claim 1, characterized in that The edge information includes: edge coordinate points; and determining the outline shape of the block according to the edge information includes: Binarizing all pixels in the canvas to obtain a binary image; All coordinate points in the same connected domain of the edge coordinate point are searched in the binary image to obtain the contour shape of the image block.
3. The method according to claim 1, characterized in that The distribution information includes: the area ratio between the block and the canvas; the calculation of the distribution information of the block in the image file based on the outline shape of the block includes: Counting all pixels within the outline of the image block to obtain the number of pixels in the image block; Counting all pixels in the canvas to obtain the number of pixels in the canvas; An area ratio between the image block and the canvas is determined according to the number of pixels of the image block and the number of pixels of the canvas.
4. The method according to claim 1, wherein The distribution information includes: a length value and a width value of the outline shape of the image block; and calculating the distribution information of the image block in the image file according to the outline shape of the image block includes: Measuring the vertical axis span of the pixel points of the outline shape of the image block on the canvas to obtain a length value of the outline shape; The horizontal axis span of the pixel points of the outline shape of the block on the canvas is measured to obtain a width value of the outline shape.
5. The method according to claim 1, wherein The distribution information includes: a horizontal axis distance and / or a vertical axis distance; the image file includes: a first image block and a second image block; and calculating the distribution information of the image block in the image file according to the contour shape of the image block includes: The horizontal axis distance and / or vertical axis distance between the first block and the second block are determined according to the coordinate values of the pixel points of the outline shape of the first block on the canvas and the coordinate values of the pixel points of the outline shape of the second block on the canvas.
6. The method according to claim 1, characterized in that The distribution information includes: the location area of the image block in the image file; after calculating the distribution information of the image block in the image file according to the outline shape of the image block, the method further includes: determining a blank area of the image file according to a position area of the image block in the image file; The image file is modified according to the blank area of the image file.
7. The method according to claim 6, characterized in that The step of modifying the image file according to the blank area of the image file comprises: Determine whether the size of the blank area of the image file is larger than the size of the image block to be inserted; If so, fill the blank area with the block to be inserted.
8. The method according to claim 6, characterized in that The step of modifying the image file according to the blank area of the image file comprises: Determining whether the size of the blank area of the image file is greater than a preset size; If so, the preset size is deleted from the blank area of the image file, or the position area of the block in the image file is changed so that the size of the blank area of the image file is less than or equal to the preset size.
9. The method according to claim 1, characterized in that After calculating the distribution information of the image block in the image file according to the contour shape of the image block, the method further includes: It is determined whether the image blocks overlap according to the distribution information in the image file.
10. The method according to claim 9, characterized in that The distribution information includes: horizontal axis distance and / or vertical axis distance; and determining whether the image blocks overlap based on the distribution information in the image file includes: It is determined whether the image blocks overlap according to the horizontal axis distance and / or the vertical axis distance.
11. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method according to any one of claims 1 to 10 is performed.
Citation Information
Patent Citations
In-decoration-picture block recognition method based on deep learning
CN111126414A