A foreign body data generation method and terminal
By extracting the position of the transmission line in the transmission line scene and pasting the preset foreign object image, the harmonized neural network is used to generate foreign object data, which solves the problem of data lack and migration, and improves the performance and robustness of foreign object detection.
Patent Information
- Application Number
- CN202111636113.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-12-29
AI Technical Summary
The existing technology has problems such as lack of data, migration problems and imbalance of foreign matter categories in the detection of foreign matter in transmission lines, resulting in a decline in detection performance.
By acquiring the transmission line scene image and the preset foreign object image, extract the transmission line position and paste the preset foreign object image into the target position, use the harmonization neural network to generate the initial foreign object data, enhance the foreign object image, crop and harmonize it, and generate the final Foreign body data.
It effectively increases the amount of foreign object data in power transmission line scenes, improves the authenticity and diversity of data, enriches training samples, reduces migration performance degradation, and improves the robustness of the target detection network.
Smart Images

Figure CN114283385B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a foreign object data generating method and a terminal. Background Art
[0002] Object detection is one of the most important tasks in computer vision. Among them, the detection of foreign objects on power lines has important research value. Common foreign objects on power lines include kites, plastic bags, and branches. The current difficulties in detecting foreign objects on power lines are: (1) there is little foreign object data; (2) the foreign object categories are unbalanced; and (3) the ever-changing forms of foreign objects further exacerbate the problem of insufficient data.
[0003] At present, most foreign object detection methods based on deep learning have the problem of data shortage. In order to solve the problem of data shortage, they collect foreign object data on power lines from all different places, use it to train the network, and apply it to other target scenarios that they want to monitor. This approach has two problems: (1) The transferability problem; the foreign object detection network we trained with various source domain data will have a significant drop in detection performance when placed in other target scenarios; (2) Even if all non-target domain data is collected for training, they still cannot get enough training data. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and a terminal for generating foreign object data, which can effectively increase the amount of foreign object data in a transmission line scene.
[0005] In order to solve the above technical problems, a technical solution adopted by the present invention is:
[0006] A method for generating foreign body data, comprising:
[0007] Acquire the transmission line scene image and the preset foreign object image;
[0008] Extracting the transmission line in the transmission line scene image to obtain the position of the transmission line;
[0009] Determine the target transmission line position from the transmission line positions, and paste the preset foreign object image into the target transmission line position to obtain initial foreign object data;
[0010] Based on the initial foreign body data, a preset image and harmonization neural network are used to perform harmonization to obtain final foreign body data.
[0011] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0012] A foreign object data generating terminal comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0013] Acquire the transmission line scene image and the preset foreign object image;
[0014] Extracting the transmission line in the transmission line scene image to obtain the position of the transmission line;
[0015] Determine the target transmission line position from the transmission line positions, and paste the preset foreign object image into the target transmission line position to obtain initial foreign object data;
[0016] Based on the initial foreign body data, a preset image and harmonization neural network are used to perform harmonization to obtain final foreign body data.
[0017] The beneficial effects of the present invention are: extracting the transmission line in the acquired transmission line scene image to obtain the transmission line position, determining the target transmission line position from the transmission line position, and pasting the preset foreign object image into the target transmission line position to obtain initial foreign object data, and using the preset image and the harmonization neural network to perform harmonization based on the initial foreign object data to obtain the final foreign object data. By acquiring various different transmission line scene images, extracting the transmission line position, and pasting the preset foreign object image into the target transmission line position, the generation of foreign object data on various different backgrounds can be achieved, and the number is not limited. Finally, based on the initial foreign object data, the preset image and the harmonization neural network are used to perform harmonization, which can make the foreign objects and scenes in the final foreign object data better integrated, and improve the real effect of the foreign object data, thereby effectively increasing the amount of foreign object data in a specific transmission line scene, enriching the training samples, and avoiding the problem of decreased migration performance caused by different training and test scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flowchart of a method for generating foreign body data according to an embodiment of the present invention;
[0019] Figure 2 A schematic diagram of the structure of a foreign object data generating terminal according to an embodiment of the present invention;
[0020] Figure 3 It is a schematic diagram of the process of generating final foreign body data in the foreign body data generating method according to an embodiment of the present invention;
[0021] Figure 4 It is a schematic diagram of a power transmission line scene image in a method for generating foreign object data according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0023] Please refer to Figure 1 , an embodiment of the present invention provides a method for generating foreign body data, comprising:
[0024] Acquire the transmission line scene image and the preset foreign object image;
[0025] Extracting the transmission line in the transmission line scene image to obtain the position of the transmission line;
[0026] Determine the target transmission line position from the transmission line positions, and paste the preset foreign object image into the target transmission line position to obtain initial foreign object data;
[0027] Based on the initial foreign body data, a preset image and harmonization neural network are used to perform harmonization to obtain final foreign body data.
[0028] From the above description, it can be seen that the beneficial effects of the present invention are: extracting the transmission line in the acquired transmission line scene image to obtain the transmission line position, determining the target transmission line position from the transmission line position, and pasting the preset foreign object image into the target transmission line position to obtain initial foreign object data, and using the preset image and the harmonization neural network to perform harmonization based on the initial foreign object data to obtain the final foreign object data. By acquiring various different transmission line scene images, extracting the transmission line position, and pasting the preset foreign object image into the target transmission line position, it is possible to generate foreign object data on various different backgrounds, and the number is not limited. Finally, based on the initial foreign object data, the preset image and the harmonization neural network are used to perform harmonization, which can make the foreign objects and scenes in the final foreign object data better integrated, and improve the real effect of the foreign object data, thereby effectively increasing the number of foreign object data in a specific transmission line scene, enriching the training samples, and avoiding the problem of decreased migration performance caused by different training and test scenarios.
[0029] Furthermore, the preset foreign body image includes a foreign body mask annotation;
[0030] The method of acquiring the transmission line scene image and the preset foreign object image comprises:
[0031] Performing data enhancement on the preset foreign body image according to the foreign body mask annotation to obtain an enhanced preset foreign body image;
[0032] Pasting the preset foreign object image into the target transmission line position to obtain initial foreign object data includes:
[0033] Paste the enhanced preset foreign object image into the target transmission line position to obtain initial foreign object data.
[0034] From the above description, it can be seen that data enhancement of the preset foreign object image according to the foreign object mask annotation can transform the foreign object itself into different forms, thereby improving the authenticity of the subsequently generated foreign object data.
[0035] Furthermore, extracting the transmission line in the transmission line scene image to obtain the transmission line position includes:
[0036] Using an edge extraction algorithm to extract edges from the transmission line scene image to obtain image edge information;
[0037] The image edge information is merged using a straight line detection algorithm to obtain a power line image, and the position of the power line is determined based on the power line image.
[0038] From the above description, it can be seen that the edge extraction algorithm is used to extract the edge of the transmission line scene image, and the straight line detection algorithm is used to merge the image edge information. By adjusting the threshold, most irrelevant lines such as watermarks and clouds in the transmission line scene image can be filtered out, so that the output result is only the image of the transmission line itself, ensuring the transmission line extraction effect.
[0039] Further, the determining the target transmission line position from the transmission line positions comprises:
[0040] Randomly select a pending transmission line position from the transmission line positions, determine whether the actual size of the pending transmission line position is less than or equal to the actual size of the foreign object in the preset foreign object image, if so, determine the pending transmission line position as the target transmission line position, if not, return to the step of randomly selecting a pending transmission line position from the transmission line positions, until the target transmission line position is determined from the transmission line positions;
[0041] Pasting the enhanced preset foreign object image into the target transmission line position to obtain initial foreign object data includes:
[0042] Determining the insertion state according to the enhanced preset foreign body image;
[0043] Obtaining the vertical coordinate size of the target transmission line position;
[0044] Performing a scaling operation on the enhanced preset foreign body image according to the size of the ordinate to obtain a scaled preset foreign body image;
[0045] The scaled preset foreign object image is pasted into the target power transmission line position according to the pasting state to obtain initial foreign object data.
[0046] From the above description, it can be seen that when determining the target transmission line position, a pending transmission line position is randomly selected from the transmission line positions. As long as the actual size of the position is large enough to allow the foreign object in the preset foreign object image to be pasted, it will be determined as the target transmission line position, thereby realizing the random pasting of foreign objects. When the foreign object image is pasted, the scaled preset foreign object image is pasted into the target transmission line position according to the pasted state, which can simulate the scene where there are foreign objects in the real transmission line, thereby improving the real effect of the foreign object data.
[0047] Further, the initial foreign body data is harmonized using a preset image and a harmonization neural network to obtain the final foreign body data, including:
[0048] The initial foreign body data is cropped to obtain a foreign body image block, and an initial size of the foreign body image block is acquired, wherein the foreign body image block includes a preset foreign body image in the initial foreign body data;
[0049] Inputting the foreign body image block and the foreign body mask annotation into a preset image and harmonization neural network for harmonization to obtain a harmonized foreign body image block;
[0050] The harmonized foreign body image block is restored to the initial size to obtain a restored foreign body image block, and the restored foreign body image block is resynthesized with the initial foreign body data to obtain final foreign body data.
[0051] From the above description, it can be seen that since the foreground and background of the initial foreign body data come from different images, their resolutions, tones, lighting, etc. are different, and the initial foreign body needs to be harmonized. The reference background when harmonizing the foreground should not be too large. Therefore, the initial foreign body data is first cropped to obtain foreign body image blocks, and the foreign body image blocks and foreign body mask annotations are input into the preset image and harmonization neural network for harmonization. After the foreign body image blocks are input into the network, they will be adjusted to a preset size, so finally the harmonized foreign body image blocks are restored to the initial size, and the restored foreign body image blocks are resynthesized with the initial foreign body data to obtain the final foreign body data, thereby improving the quality of the foreign body data, thereby being able to generate an unlimited number of transmission line foreign body data, which have different backgrounds, shapes, sizes and categories, greatly increasing the robustness of the target detection network, and improving the target detection network's ability to detect newly encountered foreign bodies in real applications.
[0052] Please refer to Figure 2 , a foreign object data generating terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0053] Acquire the transmission line scene image and the preset foreign object image;
[0054] Extracting the transmission line in the transmission line scene image to obtain the position of the transmission line;
[0055] Determine the target transmission line position from the transmission line positions, and paste the preset foreign object image into the target transmission line position to obtain initial foreign object data;
[0056] Based on the initial foreign body data, a preset image and harmonization neural network are used to perform harmonization to obtain final foreign body data.
[0057] From the above description, it can be seen that the beneficial effects of the present invention are: extracting the transmission line in the acquired transmission line scene image to obtain the transmission line position, determining the target transmission line position from the transmission line position, and pasting the preset foreign object image into the target transmission line position to obtain initial foreign object data, and using the preset image and the harmonization neural network to perform harmonization based on the initial foreign object data to obtain the final foreign object data. By acquiring various different transmission line scene images, extracting the transmission line position, and pasting the preset foreign object image into the target transmission line position, it is possible to generate foreign object data on various different backgrounds, and the number is not limited. Finally, based on the initial foreign object data, the preset image and the harmonization neural network are used to perform harmonization, which can make the foreign objects and scenes in the final foreign object data better integrated, and improve the real effect of the foreign object data, thereby effectively increasing the number of foreign object data in a specific transmission line scene, enriching the training samples, and avoiding the problem of decreased migration performance caused by different training and test scenarios.
[0058] Furthermore, the preset foreign body image includes a foreign body mask annotation;
[0059] The method of acquiring the transmission line scene image and the preset foreign object image comprises:
[0060] Performing data enhancement on the preset foreign body image according to the foreign body mask annotation to obtain an enhanced preset foreign body image;
[0061] Pasting the preset foreign object image into the target transmission line position to obtain initial foreign object data includes:
[0062] Paste the enhanced preset foreign object image into the target transmission line position to obtain initial foreign object data.
[0063] From the above description, it can be seen that data enhancement of the preset foreign object image according to the foreign object mask annotation can transform the foreign object itself into different forms, thereby improving the authenticity of the subsequently generated foreign object data.
[0064] Furthermore, extracting the transmission line in the transmission line scene image to obtain the transmission line position includes:
[0065] Using an edge extraction algorithm to extract edges from the transmission line scene image to obtain image edge information;
[0066] The image edge information is merged using a straight line detection algorithm to obtain a power line image, and the position of the power line is determined based on the power line image.
[0067] From the above description, it can be seen that the edge extraction algorithm is used to extract the edge of the transmission line scene image, and the straight line detection algorithm is used to merge the image edge information. By adjusting the threshold, most irrelevant lines such as watermarks and clouds in the transmission line scene image can be filtered out, so that the output result is only the image of the transmission line itself, ensuring the transmission line extraction effect.
[0068] Further, the determining the target transmission line position from the transmission line positions comprises:
[0069] Randomly select a pending transmission line position from the transmission line positions, determine whether the actual size of the pending transmission line position is less than or equal to the actual size of the foreign object in the preset foreign object image, if so, determine the pending transmission line position as the target transmission line position, if not, return to the step of randomly selecting a pending transmission line position from the transmission line positions, until the target transmission line position is determined from the transmission line positions;
[0070] Pasting the enhanced preset foreign object image into the target transmission line position to obtain initial foreign object data includes:
[0071] Determining the insertion state according to the enhanced preset foreign body image;
[0072] Obtaining the vertical coordinate size of the target transmission line position;
[0073] Performing a scaling operation on the enhanced preset foreign body image according to the size of the ordinate to obtain a scaled preset foreign body image;
[0074] The scaled preset foreign object image is pasted into the target power transmission line position according to the pasting state to obtain initial foreign object data.
[0075] From the above description, it can be seen that when determining the target transmission line position, a pending transmission line position is randomly selected from the transmission line positions. As long as the actual size of the position is large enough to allow the foreign object in the preset foreign object image to be pasted, it will be determined as the target transmission line position, thereby realizing the random pasting of foreign objects. When the foreign object image is pasted, the scaled preset foreign object image is pasted into the target transmission line position according to the pasted state, which can simulate the scene where there are foreign objects in the real transmission line, thereby improving the real effect of the foreign object data.
[0076] Further, the initial foreign body data is harmonized using a preset image and a harmonization neural network to obtain the final foreign body data, including:
[0077] The initial foreign body data is cropped to obtain a foreign body image block, and an initial size of the foreign body image block is acquired, wherein the foreign body image block includes a preset foreign body image in the initial foreign body data;
[0078] Inputting the foreign body image block and the foreign body mask annotation into a preset image and harmonization neural network for harmonization to obtain a harmonized foreign body image block;
[0079] The harmonized foreign body image block is restored to the initial size to obtain a restored foreign body image block, and the restored foreign body image block is resynthesized with the initial foreign body data to obtain final foreign body data.
[0080] From the above description, it can be seen that since the foreground and background of the initial foreign body data come from different images, their resolutions, tones, lighting, etc. are different, and the initial foreign body needs to be harmonized. The reference background when harmonizing the foreground should not be too large. Therefore, the initial foreign body data is first cropped to obtain foreign body image blocks, and the foreign body image blocks and foreign body mask annotations are input into the preset image and harmonization neural network for harmonization. After the foreign body image blocks are input into the network, they will be adjusted to a preset size, so finally the harmonized foreign body image blocks are restored to the initial size, and the restored foreign body image blocks are resynthesized with the initial foreign body data to obtain the final foreign body data, thereby improving the quality of the foreign body data, thereby being able to generate an unlimited number of transmission line foreign body data, which have different backgrounds, shapes, sizes and categories, greatly increasing the robustness of the target detection network, and improving the target detection network's ability to detect newly encountered foreign bodies in real applications.
[0081] The above-mentioned foreign body data generation method and terminal of the present invention are applicable to foreign body detection in a transmission line scenario, and are used to increase foreign body image sample data for training. The following is an explanation through a specific implementation method:
[0082] Embodiment 1
[0083] Please refer to Figure 1 , 3 4. A method for generating foreign body data in this embodiment includes:
[0084] S1, obtaining a transmission line scene image and a preset foreign object image;
[0085] The preset foreign body image includes a foreign body mask mark, and the preset foreign body image can be multiple. In this embodiment, the preset foreign body image is 200 preset foreign body images, including foreign bodies of different types and shapes, such as kites, plastic bags, etc.;
[0086] S2. Performing data enhancement on the preset foreign body image according to the foreign body mask annotation to obtain an enhanced preset foreign body image;
[0087] For example, the preset foreign body image is randomly rotated, enlarged, reduced and / or projected according to the foreign body mask to obtain an enhanced preset foreign body image, so as to transform the foreign body itself into a different form;
[0088] S3, extracting the transmission line in the transmission line scene image to obtain the position of the transmission line, specifically including:
[0089] S31, using an edge extraction algorithm to extract edges from the transmission line scene image to obtain image edge information;
[0090] Specifically, the Canny edge extraction operator is used to extract the edge of the transmission line scene image to obtain the image edge information;
[0091] S32, using a straight line detection algorithm to merge the image edge information to obtain a transmission line image, and determining the transmission line position according to the transmission line image;
[0092] Specifically, after setting the merging threshold and distance in the line segment detector (LSD) algorithm, the image edge information is merged using the LSD algorithm to obtain a transmission line image, and the transmission line position is determined based on the transmission line image;
[0093] The method further includes obtaining the length of the longest line other than the transmission line in the transmission line scene image;
[0094] Determine a merging threshold according to the length, the merging threshold being greater than the length;
[0095] That is, the merging threshold mainly depends on the longest length of the long lines formed by irrelevant objects in the transmission line scene image, and the merging threshold is set to be greater than this length;
[0096] S4, determining the target transmission line position from the transmission line position, and pasting the preset foreign body image into the target transmission line position to obtain initial foreign body data, wherein the preset foreign body image is an enhanced preset foreign body image; Figure 3 As shown, specifically including:
[0097] S41, randomly selecting a pending transmission line position from the transmission line positions, determining whether the actual size of the pending transmission line position is less than or equal to the actual size of the foreign object in the preset foreign object image, if so, determining the pending transmission line position as the target transmission line position, if not, returning to the step of randomly selecting a pending transmission line position from the transmission line positions, until the target transmission line position is determined from the transmission line positions;
[0098] The actual size of the transmission line location refers to the distance between the transmission lines at the transmission line location, ensuring that foreign objects can be inserted so that the generated image conforms to the actual scene;
[0099] In an optional implementation, a preset number of selections is set, a pending transmission line position is randomly selected from the transmission line positions, and it is determined whether the actual size of the pending transmission line position is less than or equal to the actual size of the foreign object in the preset foreign object image. If so, the pending transmission line position is determined as the target transmission line position. If not, the process returns to the step of randomly selecting a pending transmission line position from the transmission line positions until the preset number of selections is reached.
[0100] If the target transmission line position is not determined from the transmission line positions within the preset number of selections, the transmission line scene image of this time is discarded;
[0101] S42, pasting the preset foreign body image into the target transmission line position to obtain initial foreign body data, such as Figure 3 As shown, specifically including:
[0102] S421, determining the insertion state according to the enhanced preset foreign body image;
[0103] The sticking state includes a stuck state and a hanging state. The stuck state indicates that the foreign object is completely stuck on the power line, and the hanging state indicates that the foreign object is hanging on the power line in the form of a strip. Different sticking state sets are set for different types of foreign objects. For example, the sticking state set corresponding to a kite only includes a stuck state, and the sticking state set corresponding to a plastic bag only includes a hanging state.
[0104] For example, if the enhanced preset foreign body image is a kite image, the sticking state is determined to be a stuck state, and if the enhanced preset foreign body image is a plastic bag image, the sticking state is determined to be a hanging state, which can simulate the real foreign body existence scene as much as possible;
[0105] S422, obtaining the vertical coordinate size of the target transmission line position;
[0106] S423, scaling the enhanced preset foreign body image according to the size of the ordinate to obtain a scaled preset foreign body image;
[0107] For example, the target transmission line location is determined according to the size of the ordinate, such as Figure 4 As shown, if the acquired transmission line scene image is taken from bottom to top relative to the transmission line, the one closer to the top of the image means closer, and the enhanced preset foreign body image should be slightly larger, and it should be enlarged; if the one closer to the middle of the image means farther, the enhanced preset foreign body image should be slightly smaller, and it should be reduced;
[0108] S424, pasting the scaled preset foreign object image into the target transmission line position according to the pasting state to obtain initial foreign object data;
[0109] S5. Based on the initial foreign body data, a preset image and harmonization neural network are used to perform harmonization to obtain the final foreign body data, such as Figure 3 As shown, specifically including:
[0110] S51, cropping the initial foreign body data to obtain a foreign body image block, and acquiring an initial size of the foreign body image block, wherein the foreign body image block includes a preset foreign body image in the initial foreign body data;
[0111] S52, inputting the foreign body image block and the foreign body mask annotation into a preset image harmonization neural network for harmonization to obtain a harmonized foreign body image block;
[0112] In this embodiment, the preset image harmonization neural network is DoveNet;
[0113] Specifically, the foreign body image block and the foreign body mask are input into DoveNet for harmonization to obtain the harmonized foreign body image block;
[0114] S53, restoring the harmonized foreign body image block to the initial size to obtain a restored foreign body image block, and resynthesizing the restored foreign body image block with the initial foreign body data to obtain final foreign body data;
[0115] Because when an image is input into a neural network, the network will adjust the input image to a specific size. Therefore, after the network outputs the harmonized foreign body image block, it needs to be restored to its original size to ensure image quality.
[0116] Embodiment 2
[0117] Please refer to Figure 2A foreign body data generating terminal of this embodiment includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step in the foreign body data generating method of the first embodiment is implemented.
[0118] In summary, the present invention provides a method and terminal for generating foreign object data, which obtains a transmission line scene image and a preset foreign object image; extracts the transmission line in the transmission line scene image to obtain the transmission line position; determines the target transmission line position from the transmission line position, and pastes the preset foreign object image into the target transmission line position to obtain initial foreign object data. When determining the target transmission line position, a pending transmission line position is randomly selected from the transmission line position. As long as the actual size of the position is large enough for the foreign object in the preset foreign object image to be pasted, it is determined as the target transmission line position, thereby realizing the random pasting of foreign objects. When the foreign object image is pasted, the scaled preset foreign object image is pasted into the target transmission line position according to the pasted state, which can simulate the scene where a real transmission line has foreign objects, thereby achieving the random pasting of foreign objects. And improve the real effect of foreign body data; crop the initial foreign body data to obtain foreign body image blocks, input the foreign body image blocks and foreign body mask annotations into the preset image and harmonization neural network for harmonization, and after the foreign body image blocks are input into the network, they will be adjusted to the preset size, so finally the harmonized foreign body image blocks are restored to the initial size, and the restored foreign body image blocks are resynthesized with the initial foreign body data to obtain the final foreign body data, thereby improving the quality of foreign body data, thereby effectively increasing the number of foreign body data in specific power transmission line scenarios, enriching training samples, avoiding the problem of decreased migration performance caused by different training and test scenarios, greatly increasing the robustness of the target detection network, and improving the target detection network's ability to detect newly encountered foreign objects in real applications.
[0119] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for generating foreign body data, characterized in that: include: Acquire the transmission line scene image and the preset foreign object image; Extracting the transmission line in the transmission line scene image to obtain the position of the transmission line; Determine the target transmission line position from the transmission line positions, and paste the preset foreign object image into the target transmission line position to obtain initial foreign object data; Based on the initial foreign body data, a preset image and harmonization neural network is used to perform harmonization to obtain final foreign body data; The preset foreign body image includes a foreign body mask annotation; The method of acquiring the transmission line scene image and the preset foreign object image comprises: Performing data enhancement on the preset foreign body image according to the foreign body mask annotation to obtain an enhanced preset foreign body image; Pasting the preset foreign object image into the target transmission line position to obtain initial foreign object data includes: Pasting the enhanced preset foreign object image into the target transmission line position to obtain initial foreign object data; Pasting the enhanced preset foreign object image into the target transmission line position to obtain initial foreign object data includes: Determining a pasting state according to the type of the foreign object in the enhanced preset foreign object image, wherein different pasting state sets are pre-set for different types of foreign objects; Obtaining the vertical coordinate size of the target transmission line position; Performing a scaling operation on the enhanced preset foreign body image according to the size of the ordinate to obtain a scaled preset foreign body image; Pasting the scaled preset foreign object image into the target transmission line position according to the pasting state to obtain initial foreign object data; Determining the target transmission line position from the transmission line position comprises: Randomly select a pending transmission line position from the transmission line positions, determine whether the actual size of the pending transmission line position is less than or equal to the actual size of the foreign object in the preset foreign object image, if so, determine the pending transmission line position as the target transmission line position, if not, return to the step of randomly selecting a pending transmission line position from the transmission line positions, until the target transmission line position is determined from the transmission line positions; The actual size of the to-be-determined transmission line position refers to the distance between the transmission lines at the transmission line position, ensuring that foreign objects can be inserted.
2. The method for generating foreign body data according to claim 1, characterized in that: The extracting the transmission line in the transmission line scene image to obtain the transmission line position comprises: Using an edge extraction algorithm to extract edges from the transmission line scene image to obtain image edge information; The image edge information is merged using a straight line detection algorithm to obtain a power line image, and the position of the power line is determined based on the power line image.
3. The method for generating foreign body data according to claim 1, characterized in that: The harmonization is performed based on the initial foreign body data using a preset image and a harmonization neural network to obtain the final foreign body data, including: The initial foreign body data is cropped to obtain a foreign body image block, and an initial size of the foreign body image block is acquired, wherein the foreign body image block includes a preset foreign body image in the initial foreign body data; Inputting the foreign body image block and the foreign body mask annotation into a preset image and harmonization neural network for harmonization to obtain a harmonized foreign body image block; The harmonized foreign body image block is restored to the initial size to obtain a restored foreign body image block, and the restored foreign body image block is resynthesized with the initial foreign body data to obtain final foreign body data.
4. A foreign object data generating terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: Acquire the transmission line scene image and the preset foreign object image; Extracting the transmission line in the transmission line scene image to obtain the position of the transmission line; Determine the target transmission line position from the transmission line positions, and paste the preset foreign object image into the target transmission line position to obtain initial foreign object data; Based on the initial foreign body data, a preset image and harmonization neural network is used to perform harmonization to obtain final foreign body data; The preset foreign body image includes a foreign body mask annotation; The method of acquiring the transmission line scene image and the preset foreign object image comprises: Performing data enhancement on the preset foreign body image according to the foreign body mask annotation to obtain an enhanced preset foreign body image; Pasting the preset foreign object image into the target transmission line position to obtain initial foreign object data includes: Pasting the enhanced preset foreign object image into the target transmission line position to obtain initial foreign object data; Pasting the enhanced preset foreign object image into the target transmission line position to obtain initial foreign object data includes: Determining a pasting state according to the type of the foreign object in the enhanced preset foreign object image, wherein different pasting state sets are pre-set for different types of foreign objects; Obtaining the vertical coordinate size of the target transmission line position; Performing a scaling operation on the enhanced preset foreign body image according to the size of the ordinate to obtain a scaled preset foreign body image; Pasting the scaled preset foreign object image into the target transmission line position according to the pasting state to obtain initial foreign object data; Determining the target transmission line position from the transmission line position comprises: Randomly select a pending transmission line position from the transmission line positions, determine whether the actual size of the pending transmission line position is less than or equal to the actual size of the foreign object in the preset foreign object image, if so, determine the pending transmission line position as the target transmission line position, if not, return to the step of randomly selecting a pending transmission line position from the transmission line positions, until the target transmission line position is determined from the transmission line positions; The actual size of the to-be-determined transmission line position refers to the distance between the transmission lines at the transmission line position, ensuring that foreign objects can be inserted.
5. A foreign object data generating terminal according to claim 4, characterized in that: The extracting the transmission line in the transmission line scene image to obtain the transmission line position comprises: Using an edge extraction algorithm to extract edges from the transmission line scene image to obtain image edge information; The image edge information is merged using a straight line detection algorithm to obtain a power line image, and the position of the power line is determined based on the power line image.
6. The foreign object data generating terminal according to claim 4, characterized in that: The harmonization is performed based on the initial foreign body data using a preset image and a harmonization neural network to obtain the final foreign body data, including: The initial foreign body data is cropped to obtain a foreign body image block, and an initial size of the foreign body image block is acquired, wherein the foreign body image block includes a preset foreign body image in the initial foreign body data; Inputting the foreign body image block and the foreign body mask annotation into a preset image and harmonization neural network for harmonization to obtain a harmonized foreign body image block; The harmonized foreign body image block is restored to the initial size to obtain a restored foreign body image block, and the restored foreign body image block is resynthesized with the initial foreign body data to obtain final foreign body data.
