Power distribution network engineering card image acquisition method and device, equipment and storage medium
Through the video processing module, the card images of distribution network engineering are detected and extracted, and the problems of misreport and misreport during manual acquisition are solved, and automated and accurate card information acquisition is realized, which improves application convenience.
Patent Information
- Application Number
- CN202411406774.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-10
AI Technical Summary
The existing distribution network engineering card image acquisition method relies on manual photography, which is prone to image missed and misreported, resulting in poor convenience for subsequent applications.
The video processing module processes card videos, detects target outline images, determines card areas, extracts card information, obtains card images for distribution network engineering card images, eliminates manual reporting process, and improves the accuracy and convenience of image acquisition.
It realizes automatic acquisition of distribution network engineering card images, reduces manual errors, improves the accuracy of image acquisition and convenience of subsequent applications.
Smart Images

Figure CN119296003A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, device, equipment and storage medium for acquiring images of distribution network engineering cards. Background Art
[0002] In order to facilitate the management of the distribution network, it is necessary to regularly obtain the project card images of the distribution network, wherein the projects under the distribution network may be concealed projects, and each concealed project is provided with a corresponding card.
[0003] At present, the method of obtaining the distribution network project card image is as follows: the construction personnel of the distribution network subordinate project obtain the distribution network project card image by taking photos, and then report the distribution network project card image to the system background.
[0004] However, since the distribution network engineering card images are obtained manually, problems such as image omission and image misreporting are prone to occur, which can easily lead to poor convenience in subsequent applications of the distribution network engineering card images. Summary of the invention
[0005] In order to facilitate the convenience of subsequent application of distribution network engineering card images, the present application provides a distribution network engineering card image acquisition method, device, equipment and storage medium.
[0006] In a first aspect, the present application provides a method for acquiring a card image of a distribution network project, comprising:
[0007] Process the acquired card video to obtain an image to be detected;
[0008] Detecting the card in the image to be detected to obtain a target contour image;
[0009] Determine the area where the card is located in the target contour image to obtain a target area image;
[0010] Information is extracted from the target area image to obtain card information, and a distribution network project card image corresponding to the card information in the card video is acquired.
[0011] In a second aspect, the present application provides a distribution network engineering card image acquisition device, comprising:
[0012] A video processing module is used to process the acquired card video to obtain an image to be detected;
[0013] A card detection module, used to detect the card in the image to be detected to obtain a target contour image;
[0014] An area determination module, used for determining the area where the card is located in the target outline image to obtain a target area image;
[0015] The image acquisition module is used to extract information from the target area image to obtain card information, and obtain the distribution network project card image corresponding to the card information in the card video.
[0016] In a third aspect, the present application provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method when executing the computer program.
[0017] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.
[0018] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0019] The above-mentioned distribution network engineering card image acquisition method, device, equipment and storage medium obtain the image to be detected by processing the acquired card video; detect the card in the image to be detected to obtain the target contour image; determine the area where the card is located in the target contour image to obtain the target area image; extract information from the target area image to obtain card information, and obtain the distribution network engineering card image corresponding to the card information in the card video; through the above implementation, in the process of obtaining card information, not only the process of manually reporting card images is eliminated, but also the card information can be obtained by image processing of the card video, and then the distribution network engineering card image corresponding to the card information can be further obtained from the card video, thereby improving the convenience of subsequent application of the distribution network engineering card image.
[0020] It should be understood that the contents described in this section are not intended to mark the key or important features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A flow chart of a method for acquiring a card image of a distribution network project provided in an embodiment of the present application;
[0023] Figure 2 A schematic diagram of the structure of a distribution network engineering card image acquisition device provided in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application;
[0025] Figure 4 This is a diagram of the internal structure of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0028] In this article, the term "and / or" is only a description of the association relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the related objects before and after are in an "or" relationship.
[0029] Embodiment 1
[0030] Figure 1 This is a flow chart of a distribution network engineering card image acquisition method provided in Example 1 of the present application, refer to Figure 1 The method may be performed by a device for performing the method, and the device may be implemented by software and / or hardware. The method includes:
[0031] S110: Process the acquired card video to obtain an image to be detected.
[0032] Among them, the distribution network project includes but is not limited to concealed projects, which include foundation inspection trenches and earth excavation projects, underground concrete structure construction projects, waterproofing and anti-corrosion projects, and steel bar concealed projects; cards are set up at the construction sites of the distribution network projects, namely, distribution network project cards. The distribution network project card is a blackboard with a special mark, which is generally set in the upper left corner of the blackboard. The special mark is used to represent the company or organization to which the distribution network belongs; the length and width of the blackboard are 1.0m*0.8m, and the blackboard also has the name of the construction project and the distribution network project code; the distribution network project card is located within the shooting range of the distribution network project camera, and the distribution network project camera is connected to the background system for communication. The background system is used to obtain videos related to the distribution network project card through the distribution network project camera, namely, the card video, and process the card video to obtain images for subsequent collection of information on the distribution network project card, namely, the image to be detected.
[0033] Specifically, the background system controls the distribution network engineering camera to capture the video of the distribution network engineering card to obtain the card video; the background system further processes the card video to obtain the image to be detected.
[0034] S120, detecting the card in the image to be detected to obtain a target contour image.
[0035] Among them, the card is the blackboard in the image to be detected, and the target contour image is the image containing the blackboard contour in the image to be detected; the background system can detect the card in the image to be detected through the corresponding detection algorithm, so as to obtain the target contour image of the card.
[0036] Specifically, the background system detects the card in the image to be detected through a preset detection algorithm to obtain a target contour image of the card.
[0037] S130: Determine the area where the card is located in the target outline image to obtain a target area image.
[0038] Among them, the background system can detect the boundary of the card on the target contour image, and define the boundary on the target contour image, so as to obtain the target boundary image; a target area extraction algorithm is preset in the background system, and the target area extraction algorithm includes but is not limited to the GrabCut algorithm. The GrabCut algorithm is used to iteratively optimize the foreground (blackboard part, that is, the area where the card is located) and the background (non-blackboard part) in the target boundary image, so as to accurately extract the foreground in the target boundary image, that is, the target area image; because the (foreground) is generally darker in color and easily forms a clear contrast with the background, it is easy to determine the target area image from the target contour image through the GrabCut algorithm.
[0039] Specifically, the background system defines the boundary of the card on the target contour image to obtain a target boundary image; further, the background system extracts the area where the card is located in the target boundary image through a preset target area extraction algorithm to obtain a target area image.
[0040] It should be noted that, by extracting the target area image from the target outline image, it is possible to prevent the adverse effects of the non-card portion of the target outline image on the subsequent acquisition of information on the card.
[0041] S140. Extract information from the target area image to obtain card information, and acquire a distribution network project card image corresponding to the card information in the card video.
[0042] Among them, information extraction is the background system extracting information on the target area image, and the card information is the extracted information; in this embodiment, the card information includes the card mark position and the card text, the card mark position is the position of the special mark on the card, and the card text is the text set on the card. Exemplarily, the card text is the construction project name and the distribution network project code; the distribution network project card image is the video frame image in the card video corresponding to the card information.
[0043] Specifically, the background system extracts information from the target area image to obtain card information; in this embodiment, the card information includes at least one of the card mark position and the card text; further, the video frame image corresponding to the card information in the card video is obtained to obtain the distribution network project card image.
[0044] It should be noted that, in this embodiment, the image to be detected is obtained by processing the acquired card video; the card in the image to be detected is detected to obtain a target contour image; the area where the card is located in the target contour image is determined to obtain a target area image; information is extracted from the target area image to obtain card information, and a distribution network engineering card image corresponding to the card information is obtained in the card video; through the above implementation, in the process of obtaining card information, not only the process of manually reporting card images is eliminated, but also the card information can be obtained by performing image processing on the card video, and then the distribution network engineering card image corresponding to the card information can be further obtained from the card video, thereby improving the convenience of subsequent application of the distribution network engineering card image.
[0045] Embodiment 2
[0046] A method for acquiring a card image of a distribution network project is provided in a second embodiment of the present application. The method optimizes the "processing the acquired card video to obtain an image to be detected" in the first embodiment. It should be noted that for the parts not described in detail in this embodiment, reference may be made to the descriptions of other embodiments. The method includes:
[0047] S211. Periodically acquire images in the card video to obtain initial images, wherein the number of saved initial images at the same shooting angle is lower than a preset number threshold.
[0048] Among them, after the background system obtains the card video, it can periodically obtain the video frames in the card video at a certain frequency to obtain the initial image, and save the initial image; in this embodiment, the certain frequency is preferably every half an hour; in addition, the number of initial images saved at the same shooting angle is lower than the preset number threshold. In this embodiment, the saving number threshold is preferably 3.
[0049] Specifically, the background system periodically obtains video frames from the card video at a certain frequency to obtain an initial image, and saves the initial image, wherein the number of saved initial images of the same shooting angle is less than 3.
[0050] S212: Convert the initial image to obtain a grayscale image.
[0051] The conversion is to convert the initial image into a grayscale image. The background system can first obtain the pixel value (R, G, B) corresponding to each pixel of the initial image, and take the pixel value of one of the pixels as an example to perform corresponding mathematical processing on the pixel value, thereby obtaining the grayscale value Gray of the pixel. In this embodiment, the corresponding mathematical processing of the pixel value includes but is not limited to: (1) average value method, Gray = (R + G + B) / 3; (2) weighted method: the first weight corresponding to R is 0.299, the second weight corresponding to G is 0.587, and the third weight corresponding to B is 0.114, Gray = 0.299 * R + 0.587 * G + 0.114B; (3) maximum value method, Gray = max (R, G, B); (4) minimum value method, Gray = min (R, G, B). The corresponding grayscale value corresponding to each pixel is calculated by one of the above mathematical processing methods to obtain the corresponding grayscale image.
[0052] Specifically, the pixel value of each pixel point of the initial image is obtained, and then the grayscale value corresponding to each pixel value is calculated through a corresponding mathematical processing method, so as to obtain a grayscale image.
[0053] S213: De-noise the grayscale image to obtain an image to be detected.
[0054] Among them, a Gaussian blur algorithm is preset in the background system, and the Gaussian blur algorithm is used to reduce the noise of the grayscale image. The image to be detected is an image obtained after the grayscale image is reduced in noise.
[0055] Specifically, the grayscale image is input into a Gaussian blur algorithm for noise reduction, thereby obtaining an image to be detected.
[0056] It should be noted that by performing noise reduction processing on grayscale images through the Gaussian blur algorithm, noise and texture irrelevant to the grayscale image can be reduced, thereby improving the detection effect of subsequent detection of the image to be detected, and further improving the accuracy of the obtained card information.
[0057] S220: Detect the card in the image to be detected to obtain a target contour image.
[0058] S230: Determine the area where the card is located in the target outline image to obtain a target area image.
[0059] S240: extract information from the target area image to obtain card information, and acquire a distribution network project card image corresponding to the card information in the card video.
[0060] Embodiment 3
[0061] A method for acquiring a card image of a distribution network project is provided in a third embodiment of the present application. The method optimizes the "detecting a card in the image to be detected to obtain a target contour image" in the first embodiment. It should be noted that for the parts not described in detail in this embodiment, reference may be made to the descriptions of other embodiments. The method includes:
[0062] S310: Process the acquired card video to obtain an image to be detected.
[0063] S321, performing edge detection on the image to be detected to obtain a card edge image.
[0064] Among them, an edge detection algorithm is preset in the background system, and the edge detection algorithm is used to perform edge detection on the image to be detected, so as to obtain the image to be detected with a card edge, that is, the card edge image; in this embodiment, the edge detection algorithm is preferably a Canny edge detection algorithm based on the Canny operator. In other embodiments, the edge detection algorithm can also be a Sobel edge detection algorithm based on the Sobel operator, and a Prewitt edge detection algorithm based on the Prewitt operator, etc., which are not limited here.
[0065] Specifically, the image to be detected is input into a preset edge detection algorithm for edge detection, and a card edge image is output.
[0066] S322: Perform contour detection on the card edge image to obtain a pre-selected contour set.
[0067] Among them, a contour detection algorithm is also preset in the background system, which is used to perform contour detection on the card edge image. Contour detection is to further determine all possible card contours from the card edges determined in the card edge image, that is, the pre-selected contour set.
[0068] Specifically, the card edge image is input into a preset contour detection algorithm for processing, and a pre-selected contour set is output.
[0069] S323: Filter the pre-selected contours whose contour points are the preset number in the pre-selected contour set to obtain a target contour set, and determine the circumscribed rectangle corresponding to each target contour in the target contour set to obtain a pre-selected rectangle set.
[0070] Among them, the number of contour points is the number of vertices of the corresponding card contour in the pre-selected contour set, and the pre-selected contour is also the card contour. The number of contour points is used to characterize the shape of the corresponding card contour. Exemplarily, if the number of contour points is 4, the corresponding card contour is characterized as a rectangle; it should be noted that the card contour in the pre-selected contour set may be a triangle, a rectangle, a pentagon, etc., but it is required to be preset from this embodiment later, because it is necessary to determine the contour of the card (blackboard) from the card edge image later. Since the contour of the card (blackboard) is a rectangle, it is necessary to filter out the rectangular card contour from the pre-selected contour set. Therefore, it is also necessary to require that the number of contour points corresponding to the filtered card contour is 4, and the preset number of points is 4; the target contour set is a set of pre-selected contours (card contours) with a preset number of contour points in the pre-selected contour set; the pre-selected contour is not a rectangle, but the contour vertices corresponding to the pre-selected contour can be circumscribed into a corresponding rectangle, that is, a circumscribed rectangle; the pre-selected rectangle set is a set of rectangles circumscribed according to each pre-selected contour.
[0071] Specifically, preselected contours with a preset number of contour points are selected from the preselected contour set to obtain a target contour set; and then the circumscribed rectangle corresponding to each target contour in the target contour set is determined to obtain a preselected rectangle set.
[0072] S324: Obtain a target contour image based on the card and the pre-selected rectangle set.
[0073] The target contour image is an image used to reflect the real contour of the card on the card edge image.
[0074] Specifically, the target contour image is obtained by processing the card and the pre-selected rectangle set.
[0075] S330: Determine the area where the card is located in the target outline image to obtain a target area image.
[0076] S340: extract information from the target area image to obtain card information, and acquire a distribution network project card image corresponding to the card information in the card video.
[0077] Embodiment 4
[0078] A method for acquiring a card image of a distribution network project is provided in a fourth embodiment of the present application. The method optimizes the "obtaining a target contour image based on the card and the preselected rectangle set" in the third embodiment. It should be noted that for the parts not described in detail in this embodiment, reference may be made to the descriptions of other embodiments. The method includes:
[0079] S410: Process the acquired card video to obtain an image to be detected.
[0080] S421, performing edge detection on the image to be detected to obtain a card edge image.
[0081] S422: Perform contour detection on the card edge image to obtain a pre-selected contour set.
[0082] S423: Filter the pre-selected contours whose contour points are the preset number in the pre-selected contour set to obtain a target contour set, and determine the circumscribed rectangle corresponding to each target contour in the target contour set to obtain a pre-selected rectangle set.
[0083] S424A, calculating the aspect ratio of the card to obtain the card aspect ratio.
[0084] The card (blackboard) has a corresponding length and width. In this embodiment, the length of the card is 1 m and the width is 0.8 m. The aspect ratio of the card is the ratio of the length of the card to the width of the card, that is, 1 m / 0.8 m=1.25.
[0085] Specifically, the aspect ratio of the card is calculated according to the length of the card and the width of the card to obtain the aspect ratio of the card.
[0086] S424B, calculating the aspect ratio of the pre-selected rectangles in the pre-selected rectangle set to obtain the rectangle aspect ratio.
[0087] The pre-selected rectangle set may include multiple pre-selected rectangles, each of which has a rectangle length and a rectangle width. The length-width ratio of the pre-selected rectangle, ie, the rectangle length-width ratio, can be calculated through the rectangle length and the rectangle width.
[0088] Specifically, taking a preselected rectangle in the preselected rectangle set as an example, first obtain the rectangular length and rectangular width of the preselected rectangle, and then calculate the aspect ratio of the preselected rectangle based on the rectangular length and the rectangular width to obtain the rectangular aspect ratio of the preselected rectangle; calculate the rectangular aspect ratio of each preselected rectangle in the preselected rectangle set in the above manner.
[0089] S424C, determining a target contour image based on the card aspect ratio, the rectangle aspect ratio, and the target contour set.
[0090] Among them, each pre-selected contour in the target contour set has its corresponding pre-selected rectangle, and each pre-selected rectangle has its corresponding rectangular aspect ratio; if the rectangular aspect ratio is very close to the card aspect ratio, then the pre-selected contour corresponding to the rectangular aspect ratio is very likely to be the real card contour of the card, and the pre-selected contour corresponding to the rectangular aspect ratio can be used as the target contour image.
[0091] Specifically, the rectangular aspect ratio corresponding to each preselected contour in the target contour set is obtained, the rectangular aspect ratio closest to the card aspect ratio is determined from the rectangular aspect ratios, and the preselected contour corresponding to the rectangular aspect ratio is used as the target contour image.
[0092] S430: Determine the area where the card is located in the target outline image to obtain a target area image.
[0093] S440: extract information from the target area image to obtain card information, and acquire a distribution network project card image corresponding to the card information in the card video.
[0094] Embodiment 5
[0095] A method for acquiring a card image of a distribution network project is provided in a fifth embodiment of the present application. The method optimizes the "extracting information from the target area image to obtain card information" in the first embodiment. It should be noted that for the parts not described in detail in this embodiment, reference may be made to the descriptions of other embodiments. The method includes:
[0096] S510: Process the acquired card video to obtain an image to be detected.
[0097] S520: Detect the card in the image to be detected to obtain a target contour image.
[0098] S530: Determine the area where the card is located in the target outline image to obtain a target area image.
[0099] S541. Determine a card mark position based on the target area image.
[0100] The card mark position is the position of the card mark on the target area image; the card mark position can be determined by performing detection processing on the target area image.
[0101] Specifically, the target area image is processed to determine the card mark position.
[0102] S542: extract card text from the target area image.
[0103] The card text is the text on the target area image. In this embodiment, the card text includes: the construction project name and the distribution network engineering code; the card text can be extracted from the target area image by performing text extraction on the target area image.
[0104] Specifically, text is extracted from the target area image to obtain the card text.
[0105] S543: Obtain card information based on the card mark position and / or the card text.
[0106] The card information includes the card logo and / or the card text.
[0107] S544. Obtain a distribution network project card image corresponding to the card information in the card video.
[0108] Embodiment 6
[0109] A method for acquiring a card image of a distribution network project is provided in Example 6 of the present application. The method optimizes the "determining a card mark position based on the target area image" in Example 5. It should be noted that for the parts not described in detail in this embodiment, reference can be made to the descriptions of other embodiments. The method includes:
[0110] S610: Process the acquired card video to obtain an image to be detected.
[0111] S620: Detect the card in the image to be detected to obtain a target contour image.
[0112] S630: Determine the area where the card is located in the target outline image to obtain a target area image.
[0113] S641A, extracting a preset area image from the target area image.
[0114] The preset area is the area of 25%-30% of the upper left corner of the target area image, and generally the card mark is set in the preset area; the preset area image is the image corresponding to the preset area of the target area image.
[0115] Specifically, a preset area image in the target area image is extracted.
[0116] S641B, determine whether there is a card mark in the preset area image.
[0117] Among them, the preset image matching algorithm can be used to determine whether there is a card mark in the preset area image. In this embodiment, the preset image matching algorithm can be the matchTemplate algorithm of OpenCV. By inputting the preset area image and the preset logo template image into the matchTemplate algorithm for processing, the matchTemplate algorithm can output a correlation score, wherein the logo template image is an image consistent with the special mark on the card, and the correlation score is used to characterize the degree of similarity between the image content of the preset area image and the special mark in the logo template image. The higher the correlation score, the higher the degree of similarity between the image content of the preset area image and the special mark in the logo template image; if the correlation score exceeds the preset score threshold, it is determined that there is a card mark in the preset area image.
[0118] In addition, the trained deep learning model can also be used to determine whether there is a card mark in the preset area image; a trained deep learning model can be obtained by training the deep learning model with a large number of mark template images; the trained deep learning model is used to determine whether there is a card mark in the preset area image.
[0119] Specifically, in one embodiment, the preset area image and the preset logo template image are input into the matchTemplate algorithm for processing, and the matchTemplate algorithm outputs a correlation score; further, it is determined whether the correlation score exceeds the corresponding score threshold, and if so, it is determined that the preset area image has a card logo. In another embodiment, the preset area image is input into a trained deep learning model for processing, and the result of whether the preset area image has a card logo is output.
[0120] S641C: If yes, determine the position of the card mark on the target area image to obtain the card mark position.
[0121] Wherein, when it is determined that a card mark exists in the preset area image, the position of the card mark on the target area image, that is, the card mark position, can be further determined.
[0122] S642: extract card text from the target area image.
[0123] S643: Obtain card information based on the card mark position and / or the card text.
[0124] S644: Obtain a distribution network project card image corresponding to the card information in the card video.
[0125] Embodiment 7
[0126] A method for acquiring a card image of a distribution network project is provided in Embodiment 7 of the present application. The method optimizes the "extracting card text from the target area image" in Embodiment 5. It should be noted that for the parts not described in detail in this embodiment, reference may be made to the descriptions of other embodiments. The method includes:
[0127] S710: Process the acquired card video to obtain an image to be detected.
[0128] S720: Detect the card in the image to be detected to obtain a target contour image.
[0129] S730: Determine the area where the card is located in the target outline image to obtain a target area image.
[0130] S741. Determine a card mark position based on the target area image.
[0131] S742A, enhancing the contrast of the target area image to obtain an enhanced image.
[0132] Among them, by enhancing the contrast of the target area image, the text part on the target area image can be highlighted, thereby facilitating the improvement of the subsequent effect of extracting the card text from the target area image; the enhanced image is an image after the contrast of the card text on the target area image is enhanced; in this embodiment, the contrast of the target area image can be enhanced by histogram equalization or adaptive thresholding. In other embodiments, no specific limitation is made.
[0133] Specifically, the contrast of the target area image is enhanced by histogram equalization or adaptive thresholding to obtain an enhanced image.
[0134] S742B, converting the enhanced image into a black and white image.
[0135] Among them, the enhanced image can be converted into a black and white image through image processing software.
[0136] S742C, binarize the black-and-white image to obtain a denoised image.
[0137] Among them, by binarizing the black and white image, the background noise of the black and white image can be removed, so that only the text area in the foreground is retained, which makes it easier to further improve the accuracy of the extracted card text.
[0138] Specifically, the black-and-white image is binarized to obtain a denoised image.
[0139] S742D: Determine whether the card text in the denoised image needs to be corrected.
[0140] It should be noted that due to the limitations of shooting angle and other reasons, the card text in the denoised image may be in a tilted or distorted state. In order to extract accurate card text later, the card text in the denoised image needs to be corrected first. To this end, it is necessary to first determine whether the card text in the denoised image needs to be corrected.
[0141] Specifically, the background system determines whether the card text in the denoised image needs to be corrected.
[0142] S742E: If yes, correct the card text in the denoised image to obtain a text-corrected image.
[0143] The text-corrected image is the image after the card text in the denoised image is corrected.
[0144] Specifically, when it is determined that the card text in the denoised image needs to be corrected, the background system further corrects the card text in the noisy image to obtain a text-corrected image.
[0145] S742F, extracting text from the text-corrected image to obtain card text.
[0146] The background system is preset with an OCR engine, and the OCR engine is used to extract text from the text-corrected image. In this embodiment, the OCR engine specifically adopts Tesseract, an open source OCR engine.
[0147] Specifically, the card text is obtained by extracting text from the text-rectified image using a preset OCR engine.
[0148] It should be noted that in this embodiment, after extracting the card text, the background system will further send the initial image corresponding to the card text (that is, the distribution network project card image) to the engineering picture database of the one-key settlement system corresponding to the construction project name in the card text for storage, so that subsequent project management personnel can check the initial image in the engineering picture database.
[0149] S743. Obtain card information based on the card mark position and / or the card text.
[0150] S744. Obtain a distribution network project card image corresponding to the card information in the card video.
[0151] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0152] Embodiment 8
[0153] Based on the same inventive concept, this embodiment also provides a distribution network engineering card image acquisition device for implementing the distribution network engineering card image acquisition method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more distribution network engineering card image acquisition device embodiments provided below can refer to the limitations of the distribution network engineering card image acquisition method above, and will not be repeated here.
[0154] In this embodiment, Figure 2 As shown, a distribution network engineering card image acquisition device is provided, comprising:
[0155] A video processing module is used to process the acquired card video to obtain an image to be detected;
[0156] A card detection module, used to detect the card in the image to be detected to obtain a target contour image;
[0157] An area determination module, used for determining the area where the card is located in the target outline image to obtain a target area image;
[0158] The image acquisition module is used to extract information from the target area image to obtain card information, and obtain the distribution network project card image corresponding to the card information in the card video.
[0159] Each module in the above-mentioned distribution network engineering card image acquisition device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0160] It should be noted that, in this embodiment, the image to be detected is obtained by processing the acquired card video; the card in the image to be detected is detected to obtain a target contour image; the area where the card is located in the target contour image is determined to obtain a target area image; information is extracted from the target area image to obtain card information, and a distribution network engineering card image corresponding to the card information is obtained in the card video; through the above implementation, in the process of obtaining card information, not only the process of manually reporting card images is eliminated, but also the card information can be obtained by performing image processing on the card video, and then the distribution network engineering card image corresponding to the card information can be further obtained from the card video, thereby improving the convenience of subsequent application of the distribution network engineering card image.
[0161] Embodiment 9
[0162] In this embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a distribution network engineering card image acquisition method is implemented.
[0163] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the computer device to which the scheme of the present disclosure is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0164] Embodiment 10
[0165] In this embodiment, a computer readable storage medium is provided. Figure 4 As shown, a computer program is stored thereon, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0166] Embodiment 11
[0167] In this embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0168] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0169] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present disclosure may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided by the present disclosure may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0170] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0171] The above-described embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the attached claims.
Claims
1. A method for acquiring a card image of a distribution network project, characterized in that: include: Process the acquired card video to obtain an image to be detected; Detecting the card in the image to be detected to obtain a target contour image; Determine the area where the card is located in the target contour image to obtain a target area image; Information is extracted from the target area image to obtain card information, and a distribution network project card image corresponding to the card information in the card video is acquired.
2. The method according to claim 1, characterized in that The step of processing the acquired card video to obtain the image to be detected includes: The image in the card video is acquired at a fixed time to obtain an initial image, wherein the number of saved initial images at the same shooting angle is lower than a preset number threshold; Converting the initial image to obtain a grayscale image; De-noising the grayscale image to obtain an image to be detected.
3. The method according to claim 1, characterized in that The step of detecting the card in the image to be detected to obtain a target contour image includes: Performing edge detection on the image to be detected to obtain a card edge image; Performing contour detection on the card edge image to obtain a pre-selected contour set; The preselected contours having a preset number of contour points in the preselected contour set are screened to obtain a target contour set, and the circumscribed rectangle corresponding to each target contour in the target contour set is determined to obtain a preselected rectangle set; A target contour image is obtained based on the card and the pre-selected rectangle set.
4. The method according to claim 3, characterized in that The step of obtaining a target contour image based on the card and the pre-selected rectangle set includes: Calculating the aspect ratio of the card to obtain the card aspect ratio; Calculating the aspect ratio of the preselected rectangles in the preselected rectangle set to obtain a rectangle aspect ratio; An object contour image is determined based on the card aspect ratio, the rectangle aspect ratio, and the object contour set.
5. The method according to claim 1, characterized in that The step of extracting information from the target area image to obtain card information includes: Determine the card mark position based on the target area image; Extracting card text from the target area image; The card information is obtained based on the card logo position and / or the card text.
6. The method according to claim 5, characterized in that The determining the card mark position based on the target area image includes: Extracting a preset area image from the target area image; Determine whether there is a card mark in the preset area image; If so, determine the position of the card mark on the target area image to obtain the card mark position.
7. The method according to claim 5, characterized in that The step of extracting card text from the target area image includes: enhancing the contrast of the target area image to obtain an enhanced image; converting the enhanced image into a black and white image; Binarizing the black-and-white image to obtain a denoised image; Determining whether the card text in the denoised image needs to be corrected; If yes, correcting the card text in the denoised image to obtain a text-corrected image; Perform text extraction on the text-rectified image to obtain card text.
8. A distribution network engineering card image acquisition device, characterized in that: The device comprises: A video processing module is used to process the acquired card video to obtain an image to be detected; A card detection module, used to detect the card in the image to be detected to obtain a target contour image; An area determination module, used for determining the area where the card is located in the target outline image to obtain a target area image; The image acquisition module is used to extract information from the target area image to obtain card information, and obtain the distribution network project card image corresponding to the card information in the card video.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.