Target detection method, system, device and medium for train linear array images
Through non-overlapping segmentation and bisection splicing technology, combined with deep learning target detection network, the problem of low accuracy and efficiency in target detection of train linear array images in the field of rail transit is solved, and efficient detection of targets of different sizes is achieved.
Patent Information
- Application Number
- CN202111525585.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-12-14
AI Technical Summary
The existing technology has the problems of poor accuracy, low efficiency, and high rate of false positives and false negatives in the target detection of train linear array images in the field of rail transit. In particular, it is not adaptive for detecting targets of different sizes, resulting in a decrease in detection efficiency.
The non-overlapping segmentation method is used to process the linear array image, and the images are spliced by the dichotomy method to obtain a complete target frame. The deep learning target detection network is combined for target detection to reduce repeated calculations and improve detection efficiency.
It achieves the acquisition of complete target frames at image segmentation, is suitable for targets to be detected of different sizes, reduces the problem of repeated calculations, improves target detection efficiency, and is compatible with existing general deep learning target detection algorithms.
Smart Images

Figure CN114332794B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent detection technology for rail transit, and in particular to a target detection method, system, device and medium for train linear array images. Background Art
[0002] In recent years, with the rapid development of my country's rail transit industry, the inspection requirements for ensuring the safe operation of trains are also constantly increasing. For a long time, my country's railway departments have mainly relied on manual experience to inspect key parts of train bodies. Due to the frequent passing of trains, the large number of small parts of vehicles and their scattered distribution, long-term manual inspections are often affected by fatigue, resulting in misjudgments or missed judgments. The existing automatic detection equipment is not yet perfect in the target detection algorithm of linear array sequence images, and it often faces problems such as poor accuracy, low efficiency, and high false alarm and missed alarm rates, which bring serious safety hazards to the operation of trains. Therefore, realizing intelligent detection in the field of rail transit is an urgent need for the current development of my country's railways. Among them, one of the most important factors affecting the accuracy and efficiency of target detection of train linear array images is the accurate acquisition of the complete boundary box of the target at the segmentation of the train body linear array sequence image.
[0003] In the prior art, line array cameras acquire images by push-scanning. The entire image acquired has the characteristics of high resolution and large aspect ratio difference. The target size along the push-scanning direction accounts for a small proportion. The general target detection method is usually only applicable to images with an aspect ratio close to 1:1. If the entire line array image is forcibly scaled, it will inevitably cause serious image distortion and lose the image feature information of the target to be detected. Therefore, it is impossible to directly use the general target detection algorithm to handle such line array acquisition image target detection problems.
[0004] To solve the above problems, existing methods mainly divide high-resolution large-size images into several sub-regions according to certain segmentation rules, perform target detection on the images in each region separately, and finally restore the image coordinates of the target in the whole image according to the segmentation rules.
[0005] In order to deal with the situation where the target appears at the image segmentation point, the main processing method adopted by the existing methods is to use an image segmentation method with overlapping regions at the image segmentation point, but this will bring two relatively serious problems. First, as the image resolution in the push-scan direction increases, this method will additionally bring more and more repeated calculation areas, resulting in a decrease in detection efficiency; second, in this method, the size of the overlapping regions must be larger than the size of the detection target. As the size of the detection target increases, the proportion of the overlapping region is required to increase accordingly, which not only increases the repeated detection area, but also has a lack of adaptive ability for detection of targets of different sizes, which will also have a serious impact on the detection efficiency. Summary of the invention
[0006] In response to the above problems, the present invention provides a target detection method, system, device and medium for train linear array images, which can achieve the acquisition of a complete target frame at the image segmentation point and is applicable to targets of different sizes to be inspected, reducing the problem of image duplication calculation caused by image overlap and improving target detection efficiency.
[0007] The technical solution is: a target detection method for train linear array images, characterized in that it includes the following steps:
[0008] The acquired linear array images are divided into non-overlapping segments with a fixed width to obtain a number of sequential images of the same size;
[0009] Perform target detection on each image to obtain the type of detected target and the corresponding target frame;
[0010] Set a boundary threshold, and judge whether the distance between the boundary of the target frame and the image boundary in each image is greater than the boundary threshold. If not, based on the dichotomy method, cut the current image and the adjacent image in half in the width direction of the image, and splice them to obtain a spliced image. For the spliced image in which the detected target is detected, judge whether the distance between the boundary of the target frame in the spliced image and the image boundary is greater than the boundary threshold. If not, reduce the width of the split to half and then splice, keep the width of the spliced image unchanged, and repeat the judgment until the distance between the target boundary of the target frame and the image boundary satisfies the requirement of not being greater than the boundary threshold, so that each spliced image satisfies the requirement of containing the complete target frame, and output the coordinates of the target frame;
[0011] Compare the detected targets in the stitched image and the left and right images adjacent to its original image. If the types of the detected targets are the same and the intersection-over-union ratio of the target frames is greater than the specified threshold, the detected targets are considered to be the same, the target frames are fused, and the coordinates of the detected targets are output.
[0012] Furthermore, the target detection on the image includes: detecting the target using a deep learning target detection network.
[0013] Furthermore, before using the target detection network, the target detection network is trained through training samples. When training the target detection network, data enhancement operations including random translation and cropping are performed on the training samples to improve the generalization ability of the target detection network.
[0014] Furthermore, the boundary threshold is used to determine whether a target box appears within the boundary threshold. If the distance between the left boundary of the target box and the left boundary of the image is less than the boundary threshold t, k is taken. l = 1, the back of the i-1th picture The image with pixel width is the same as the previous image in the i-th image. The images of pixel width are stitched together to obtain the first stitched image on the left border of the i-th image. Stitch the image on the left edge of the i-th image Perform target detection. If the target is detected, continue to detect the boundary threshold t. If the left boundary of the i-th image is spliced If the distance between the right boundary of the target box and the right boundary of the image is less than the boundary threshold t, then k is reset. l =k l +1, the back of the i-1th picture The image with pixel width is the same as the previous image in the i-th image. The images with pixel width are stitched together, and the kth pixel on the left edge of the i-th image is updated. l Iteration stitching image Repeatedly judge the left border of the i-th image to stitch the image Is the distance between the right edge of the target box and the right edge of the image greater than t? Until the left edge of the i-th image is stitched together The distance between the right boundary of the target box and the right boundary of the image is greater than the boundary threshold t, the rightmost boundary of the incomplete target box is obtained, and the iterative stitching operation of the left boundary of the image is stopped;
[0015] If the distance between the right boundary of the target box and the right boundary of the image is less than or equal to t, take k r = 1, the back of the i-th picture The image with pixel width is the same as the previous image in the i+1th image. The images of pixel width are stitched together to obtain the first stitched image on the right border of the i-th image. Merge the image on the right edge of the i-th image Perform target detection. If the target is detected, continue to detect the boundary threshold t. If the right boundary of the i-th image is spliced The left boundary of the target box is less than or equal to the boundary threshold t, and k is reset. r =k r +1, the back of the i-th picture The image with pixel width is the same as the previous image in the i+1th image. The images with pixel width are stitched together, and the updated image has the kth pixel on the right edge. r Second stitch image Repeatedly judge the right border of the i-th image to stitch the image together Is the left boundary of the target box in the image less than or equal to the boundary threshold t, until the right boundary of the i-th image is stitched together The left boundary of the target box in the image is greater than the boundary threshold t, the leftmost boundary of the incomplete target box is obtained, and the iterative stitching operation of the right boundary of the image is stopped.
[0016] Furthermore, after the iterative stitched image contains a complete target frame, the coordinates of the detected target are converted from the image coordinate system of the stitched image to the image coordinate system of the corresponding original image according to the number of iterations of segmentation and stitching, and the image coordinates of the target frame in the original image are output.
[0017] Furthermore, the detected target frames in the left and right images adjacent to the stitched image and its original image are fused, and the coordinates of the obtained target frames are converted into the global image coordinate system of the entire train.
[0018] A target detection system for train linear array images, characterized by comprising:
[0019] An image segmentation module is used to segment the acquired linear array image without overlap with a fixed width to obtain a number of sequence images of the same size;
[0020] The target detection module is used to perform target detection on each image to obtain the type of the detected target and the corresponding target frame;
[0021] The target search module near the boundary is used to set the boundary threshold, and judge whether the distance between the boundary of the target frame and the image boundary in each image is greater than the boundary threshold. If not, based on the dichotomy method, the current image and the adjacent image are cut in half in the width direction of the image, and spliced to obtain a spliced image. For the spliced image in which the detected target is detected, it is judged whether the distance between the boundary of the target frame in the spliced image and the image boundary is greater than the boundary threshold. If not, the width of the split is reduced to half and then spliced, and the width of the spliced image is maintained unchanged. The judgment is repeated until the distance between the target boundary of the target frame and the image boundary satisfies the boundary threshold, so that each spliced image contains a complete target frame, and the coordinates of the target frame are output;
[0022] The global target fusion module is used to fuse the detected target frames in the stitched image and the left and right images adjacent to its original image. If the types of the detected targets are the same and the intersection and union ratio of the target frames is greater than the specified threshold, the detected targets are considered to be the same, the target frames are fused, and the coordinates of the detected targets are output.
[0023] A target detection device for train linear array images, characterized in that it comprises: a processor, a memory and a program;
[0024] The program is stored in the memory, and the processor calls the program stored in the memory to execute the above-mentioned target detection method for train linear array images.
[0025] A computer-readable storage medium, characterized in that: the computer-readable storage medium is used to store a program, and the program is used to execute the above-mentioned target detection method for train linear array images.
[0026] The present invention has the following advantages:
[0027] The present invention directly divides the image captured by the linear array camera into non-overlapping areas, and performs target re-inspection only when the target appears at the image segmentation position, thereby reducing the problem of image repeated calculation caused by image overlap and improving target detection efficiency.
[0028] The present invention can realize the acquisition of a complete target frame at the image segmentation point and is applicable to targets to be inspected of different sizes.
[0029] The target detection in the present invention can be implemented by almost all existing general deep learning target detection algorithms. Combining any general target detection algorithm can realize the acquisition of the complete target frame of the linear array sequence image.
[0030] The present invention can realize the automatic fusion of detection target frames in adjacent segmented images and remove repeated or incomplete target frames. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of the steps of a method for detecting a target in a train linear array image in an embodiment;
[0032] Figure 2 A comparison diagram of the linear array image segmentation method in the present invention and the linear array image segmentation method in the prior art;
[0033] Figure 3 This is a schematic diagram of performing a segmentation and stitching operation in step 3 of the method of the embodiment to obtain a stitched image with a complete target frame;
[0034] Figure 4 A schematic diagram of a stitched image having a complete target frame after two splitting and stitching steps in step 3 of the method of the embodiment;
[0035] Figure 5 Comparison of the time complexity of target detection between the method of the present invention and the prior art;
[0036] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0037] In the following description, reference is made to the accompanying drawings that form a part of the present invention, which illustrate specific aspects of embodiments of the present invention or specific aspects of embodiments of the present invention that can be used by way of illustration. It should be understood that embodiments of the present invention can be used in other aspects and include structural or logical changes that are not depicted in the accompanying drawings. Therefore, the following detailed description is not intended to be limiting, and the scope of the present invention is defined by the appended claims.
[0038] It should be understood that although the steps are described in a numbered manner for ease of understanding in the embodiments of the present disclosure, these numbers do not represent the order in which the steps are executed, nor do they mean that the steps with sequential numbering must be executed together. It should be understood that one or more of the multiple steps with sequential numbering can be executed separately to solve the corresponding technical problems and achieve the predetermined technical solutions. Even if multiple steps are exemplarily listed together in the accompanying drawings, it does not mean that these steps must be executed together; the accompanying drawings are only exemplarily listed together for ease of understanding.
[0039] See Figure 1 A target detection method for train linear array images in the present invention comprises at least the following steps:
[0040] Step 1: Segment the acquired linear array image without overlap at a fixed width to obtain a number of sequence images of the same size;
[0041] Step 2: Perform target detection on each image to obtain the type of detected target and the corresponding target frame;
[0042] Step 3: Set the boundary threshold, and judge whether the distance between the boundary of the target frame and the image boundary in each image is greater than the boundary threshold. If not, based on the binary method, the current image and the adjacent image are cut in half in the width direction of the image, and spliced to obtain a spliced image. For the spliced image in which the detected target is detected, judge whether the distance between the boundary of the target frame in the spliced image and the image boundary is greater than the boundary threshold. If not, reduce the width of the split to half and then splice, keep the width of the spliced image unchanged, and repeat the judgment until the distance between the target boundary of the target frame and the image boundary satisfies the boundary threshold, so that each spliced image satisfies the requirement of containing the complete target frame, and output the coordinates of the target frame;
[0043] Step 4: Compare the detected target frames in the stitched image and the left and right images adjacent to the original image. If the types of the detected targets are the same and the intersection-over-union ratio of the target frames is greater than the specified threshold, the detected targets are considered to be the same, the target frames are fused, and the coordinates of the detected targets are output.
[0044] In one embodiment of the present invention, in step 1, the acquired linear array image is firstly segmented in the camera push-scan direction without overlap, such as Figure 2 As shown in a), the image is segmented according to a fixed length to obtain a series of sequence images of the same size. Figure 2 b) in the figure shows an image segmentation method according to a certain overlap ratio which is commonly used in existing high-resolution image target detection methods.
[0045] After processing in step 1, a series of sequence images are obtained, and then in step 2, target detection is performed on each image to obtain the type of the detected target and the corresponding target frame, wherein the target is detected using a deep learning target detection network. The present invention can use an existing target detection algorithm based on deep learning, and there is no restriction on the target detection algorithm used. The target detection algorithm used in this embodiment is a CenterNet target detection network.
[0046] Image sequence I after segmentation according to fixed size i (i=1…m), m is a natural number, starting from i=1, use the target detection algorithm to detect the image sequence I i The target position in
[0047] In step 2, the target detection network is trained with samples before use. Before training the target detection network, data enhancement methods are used to process the training samples, and the training samples are randomly translated and cropped to improve the generalization ability of the target detection network, thereby enhancing the detection and recognition effect of incomplete targets at the boundaries of the image.
[0048] In step 3, an iterative search is performed for the target at the image boundary, as follows:
[0049] Set the boundary threshold t, which is used to determine whether there is a target box within the boundary threshold. When the jth target bounding box bbox in the i-th image ij (x min ,y min ,x max ,y max ) is not greater than the boundary threshold t, and k is taken l =1, k l is the number of iterative searches, and the back The image with pixel width is the same as the previous image in the i-th image. The images with pixel width are stitched together to obtain the stitched image at the left border of the i-th image. Stitch the image on the left edge of the i-th image Perform target detection. If the target is detected, continue to detect the boundary threshold t. If the left boundary of the i-th image is spliced If the distance between the right boundary of the target box and the right boundary of the image is less than the boundary threshold t, then k is reset. l =k l +1, the back of the i-1th picture The image with pixel width is the same as the previous image in the i-th image. The images of pixel width are stitched together, and the stitched image of the left border of the i-th image is updated. Repeatedly judge the left border of the i-th image to stitch the image together Is the distance between the right edge of the target box and the right edge of the image greater than t? Until the left edge of the i-th image is stitched together The distance between the right boundary of the target box and the right boundary of the image is greater than the boundary threshold t, and the rightmost boundary of the incomplete target box is obtained;
[0050] In k l = 1 is the first iterative search, the image with the width of the last 1 / 2 pixel in the i-1th picture is stitched together with the image with the width of the first 1 / 2 pixel in the i-th picture to get the left border stitched image If the left boundary is satisfied at this time, the image will be stitched If the distance between the right boundary of the target box and the right boundary of the image is greater than the boundary threshold t, no iterative search is performed and the coordinates of the target box can be output.
[0051] If after the first iteration search, the left border stitched image If the distance between the right boundary of the target box and the right boundary of the image is less than the boundary threshold t, the second iterative search is performed to stitch the image with the last 1 / 4 pixel width in the i-1th image and the image with the first 3 / 4 pixel width in the i-th image together, and the stitched image with the left boundary of the i-th image is updated. Then, target detection is performed on the image to determine whether the distance between the right boundary of the target box and the right boundary of the stitched image is greater than a threshold value t. If this condition is met, the iterative stitching operation of the left boundary of the image is stopped, and the coordinates of the rightmost boundary of the target box are obtained; if the threshold condition is not met, the iterative stitching operation of the image is continued.
[0052] For another case, if the distance between the right boundary of the target box and the right boundary of the image is less than or equal to t, take k r =1, k r is the number of iterative searches, and the back The image with pixel width is the same as the previous image in the i+1th image. The images of pixel width are stitched together to obtain the stitched image of the right border of the i-th image. Merge the image on the right edge of the i-th image Perform target detection. If the target is detected, continue to detect the boundary threshold t. If the right boundary of the i-th image is spliced The left boundary of the target box is less than or equal to the boundary threshold t, and k is reset. r =k r +1, the back of the i-th picture The image with pixel width is the same as the previous image in the i+1th image. The images of pixel width are stitched together, and the stitched image of the right border of the i-th image is updated. Repeatedly judge the right border of the i-th image to stitch the image together Is the left boundary of the target box in the image less than or equal to the boundary threshold t, until the right boundary of the i-th image is stitched together The left boundary of the target box in the image is greater than the boundary threshold t, and the leftmost boundary of the incomplete target box is obtained.
[0053] like Figure 3 As shown in Figure 2, the complete target frame is obtained after the first iterative search, and Figure 4 In the example, two iterative searches were performed to obtain the complete target frame. Figure 3 , Figure 4 This is a schematic diagram of the target found in the linear array image captured by the camera. Figure 3 , 4 A thick black frame and an arrow pointing to the target frame are also added to the target frame.
[0054] After the stitched image satisfies the requirement of containing the complete target frame, the coordinates of the detected target are converted from the image coordinate system of the stitched image to the image coordinates of the corresponding original image according to the number of image iterative stitching, and the image coordinates of the target frame in the original image are output.
[0055] Specifically, we can analyze I i_left and I i_right The detection results of the target box are fused, I i_left The rightmost boundary of the complete target box is obtained, and then according to the number of iterations k l , transform the right boundary of the target box to the original image coordinates to get the rightmost coordinates of the complete target box in the original image. i_right The leftmost boundary of the complete target box is obtained, and then according to the number of iterations k r , transform the result of the left boundary of the target frame to the original image coordinates to get the leftmost coordinates of the complete target frame in the original image. Finally, by combining the detection results of the left and right boundaries of the image and removing the duplicate target frames, the left and right coordinates of the final complete target frame can be obtained.
[0056] The coordinates of the target frame obtained in the process of step 3 above are all local image coordinates with the upper left corner of each image as the origin. They are not the global coordinates of the entire train, so in step 4, when comparing the detected targets in the left and right images adjacent to the stitched image and its original image, the coordinates of the obtained target frame are converted to the global image coordinate system of the entire train. Compare the detected target frames in the left and right images adjacent to the stitched image and its original image. If the types of the detected targets are the same and the intersection and union ratio of the target frames is greater than the specified threshold, the detected targets are considered to be the same, the target frames are fused, and the coordinates of the detected targets are output.
[0057] When the target appears near the boundary of the image, taking the right boundary of the image as an example, when the target appears near the right boundary of this image, the target detection result of this image, the iterative search result of the target at the boundary, and the target detection result of the adjacent image to the right of this image are retrieved at the same time, and the target frames of the same type and whose intersection over union (IOU) of the target frames is greater than the specified threshold in the above target detection results are merged, so as to obtain the complete target frame at the image boundary and filter the incomplete or repeated target frames.
[0058] The time complexity comparison results of the method proposed in this invention and the commonly used target detection method based on image region overlapping segmentation are as follows: Figure 5 As shown in the figure, the indicator used here to measure the time complexity of target detection is the number of times the target detection method is called. Each time an image is detected, the target detection method is called once. Figure 5 In a), the comparison of the number of times the target detection algorithm is called in different image segmentation schemes as the resolution in the scanning direction of the linear array image increases. Obviously, if repeated detection is not performed at the image block boundary, the number of times the target detection algorithm is called in the image segmentation scheme adopted by the present invention is the least. Figure 5 b) shows the difference between the number of calls to the target detection algorithm under different overlap ratios and the segmentation method used in this paper. Among them, the resolution of the image in the height direction is 2048, the resolution in the linear array scanning direction ranges from 0 to 310,000 pixels, and the segmented image block is 2048*2000. The above parameters are also typical parameters used by existing TEDS field acquisition equipment. Generally, the resolution of the image collected by an 8-carriage EMU or a linear array camera on a high-speed rail is about 310,000 pixels in the scanning direction. In addition, the three overlap ratios used are also typical block overlap ratios used in existing literature, and under this overlap ratio, the traditional method requires the size of the target to be detected to be smaller than the selected overlap ratio, while the method in this paper has no specific requirements for the target size, and under the selected three overlap ratios, the target detection at the block boundary only needs to be repeated once.
[0059] In addition, from Figure 5In b), it can be seen that when the resolution of the image collected by the linear array camera in the scanning direction is 310,000 pixels, when the overlap ratio of adjacent image blocks is 5%, the entire linear array image is divided into 163 blocks, and the segmentation method adopted in this paper will reduce the number of target detection algorithm calls by 9 times compared with the method of using the overlapping area; when the overlap ratio of adjacent image blocks is 10%, the entire linear array image is divided into 171 blocks, and the segmentation method adopted in this paper will reduce the number of target detection algorithm calls by 18 times compared with the method of using the overlapping area; when the overlap ratio of adjacent image blocks is 20%, the entire linear array image is divided into 192 blocks, and the segmentation method adopted by the present invention will reduce the number of target detection algorithm calls by 36 times compared with the method of using the overlapping area. This means that when the target does not appear at the image segmentation point, the segmentation strategy adopted by the present invention has obvious advantages in detection efficiency, and fewer target detection algorithm calls mean that the entire linear array image has faster target detection efficiency. At the same time, taking the case of 20% overlap ratio as an example, this also means that when the target appears in less than 36 boundaries, which is equivalent to the probability of the target component appearing at the image segmentation point being less than 18%, the method of the present invention still has an advantage in detection efficiency.
[0060] In an embodiment of the present invention, a target detection system for train linear array images is also provided, comprising:
[0061] An image segmentation module is used to segment the acquired linear array image without overlap with a fixed width to obtain a number of sequence images of the same size;
[0062] The target detection module is used to perform target detection on each image to obtain the type of the detected target and the corresponding target frame;
[0063] The target search module near the boundary is used to set the boundary threshold, and judge whether the distance between the boundary of the target frame and the image boundary in each image is greater than the boundary threshold. If not, based on the dichotomy method, the current image and the adjacent image are cut in half in the width direction of the image, and spliced to obtain a spliced image. For the spliced image in which the detected target is detected, it is judged whether the distance between the boundary of the target frame in the spliced image and the image boundary is greater than the boundary threshold. If not, the width of the split is reduced to half and then spliced, and the width of the spliced image is maintained unchanged. The judgment is repeated until the distance between the target boundary of the target frame and the image boundary is greater than the boundary threshold, so that each spliced image contains a complete target frame, and the coordinates of the target frame are output;
[0064] The global target fusion module is used to compare the detected target frames in the stitched image and the left and right images adjacent to the original image. If the types of the detected targets are the same and the intersection and union ratio of the target frames is greater than the specified threshold, the detected targets are considered to be the same, the target frames are fused, and the coordinates of the detected targets are output.
[0065] In an embodiment of the present invention, there is also provided a target detection device for train linear array images, which specifically includes: a processor, a memory and a program;
[0066] The program is stored in the memory, and the processor calls the program stored in the memory to execute the target detection method for train linear array images in the above embodiment.
[0067] The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a 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 and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. 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 target detection method for train linear array images is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0068] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory is used to store programs, and the processor executes the programs after receiving the execution instruction.
[0069] The processor can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor can be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as: CPU), a network processor (Network Processor, referred to as: NP), etc. The processor can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The various methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0070] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application 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.
[0071] In an embodiment of the present invention, a computer-readable storage medium is further provided, and the computer-readable storage medium is used to store a program, and the program is used to execute the above-mentioned target detection method for train linear array images.
[0072] Those skilled in the art will appreciate that the embodiments of the embodiments of the present invention may be provided as methods, computer devices, or computer program products. Therefore, the embodiments of the present invention may take the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware. Moreover, the embodiments of the present invention may take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0073] The embodiments of the present invention are described with reference to flowcharts and / or block diagrams of methods, computer devices, or computer program products according to the embodiments of the present invention. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate a device for implementing the functions specified in the flowcharts and / or.
[0074] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in the flowchart.
[0075] The above is a detailed introduction to the target detection method, computer device, and computer-readable storage medium provided by the present invention for train linear array images. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A target detection method for train linear array images, characterized in that: The following steps are involved: The acquired linear array images are divided into non-overlapping segments with a fixed width to obtain a number of sequential images of the same size; Perform target detection on each image to obtain the type of detected target and the corresponding target frame; Set a boundary threshold, and judge whether the distance between the boundary of the target frame and the image boundary in each image is greater than the boundary threshold. If not, based on the dichotomy method, cut the current image and the adjacent image in half in the width direction of the image, and splice them to obtain a spliced image. For the spliced image in which the detected target is detected, judge whether the distance between the boundary of the target frame in the spliced image and the image boundary is greater than the boundary threshold. If not, reduce the width of the split to half and then splice, keep the width of the spliced image unchanged, and repeat the judgment until the distance between the target boundary of the target frame and the image boundary satisfies the requirement of not being greater than the boundary threshold, so that each spliced image satisfies the requirement of containing the complete target frame, and output the coordinates of the target frame; Compare the detected targets in the stitched image and the left and right images adjacent to its original image. If the types of the detected targets are the same and the intersection-over-union ratio of the target frames is greater than the specified threshold, the detected targets are considered to be the same, the target frames are fused, and the coordinates of the detected targets are output.
2. The target detection method for train linear array images according to claim 1, characterized in that: The target detection on the image includes: detecting the target using a deep learning target detection network.
3. The target detection method for train linear array images according to claim 2, characterized in that: Before using the target detection network, the target detection network is trained through training samples. When training the target detection network, data enhancement operations including random translation and cropping are performed on the training samples to improve the generalization ability of the target detection network.
4. The target detection method for train linear array images according to claim 3, characterized in that: The boundary threshold is used to determine whether there is a target frame within the boundary threshold. If the distance between the left boundary of the target frame and the left boundary of the image is less than or equal to the boundary threshold t, k is taken. l = 1, the back of the i-1th picture pixels wide image and the previous image in the i-th image The images of pixel width are stitched together to obtain the first stitched image on the left border of the i-th image. Stitch the image on the left edge of the i-th image Perform target detection. If the target is detected, continue to detect the boundary threshold t. If the left boundary of the i-th image is spliced If the distance between the right boundary of the target box and the right boundary of the image is less than the boundary threshold t, then k is reset. l =k l +1, the back of the i-1th picture The image with pixel width is the same as the previous image in the i-th image. The images with pixel width are stitched together, and the kth pixel on the left edge of the i-th image is updated. l Second stitch image Repeatedly judge the left border of the i-th image to stitch the image together Is the distance between the right edge of the target box and the right edge of the image greater than t? Until the left edge of the i-th image is stitched together When the distance between the right boundary of the target box and the right boundary of the image is greater than the boundary threshold t, the rightmost boundary of the incomplete target box is obtained, and the iterative stitching operation of the left boundary image of the i-th image is stopped.
5. The target detection method for train linear array images according to claim 3, characterized in that: If the distance between the right boundary of the target box and the right boundary of the image is less than or equal to t, take k r = 1, the back of the i-th picture The image with pixel width is the same as the previous image in the i+1th image. The images of pixel width are stitched together to obtain the first stitched image on the right border of the i-th image. Merge the image on the right edge of the i-th image Perform target detection. If the target is detected, continue to detect the boundary threshold t. If the right boundary of the i-th image is spliced The left boundary of the target box is less than or equal to the boundary threshold t, and k is reset. r =k r +1, the back of the i-th picture The image with pixel width is the same as the previous image in the i+1th image. The images of width are stitched together, and the kth image on the right edge of the i-th image is updated. r Second stitch image Repeatedly judge the right border of the i-th image to stitch the image together Is the left boundary of the target box in the image less than or equal to the boundary threshold t, until the right boundary of the i-th image is stitched together The left boundary of the target box in the image is greater than the boundary threshold t, the leftmost boundary of the incomplete target box is obtained, and the iterative stitching operation of the right boundary image of the i-th image is stopped.
6. A target detection method for train linear array images according to claim 4 or 5, characterized in that: After the stitched image satisfies the requirement of containing the complete target frame, the coordinates of the detected target are converted from the image coordinate system of the stitched image to the image coordinate system of the corresponding original image according to the number of iterations of the image stitching operation, and the image coordinates of the target frame in the original image coordinate system are output.
7. The target detection method for train linear array images according to claim 1, characterized in that: The target frame of the detected object in the left and right images adjacent to the stitched image and its original image is fused, and the coordinates of the obtained target frame are converted into the global image coordinate system of the entire train.
8. A target detection system for train linear array images, characterized in that have: An image segmentation module is used to segment the acquired linear array image without overlap with a fixed width to obtain a number of sequence images of the same size; The target detection module is used to perform target detection on each image to obtain the type of the detected target and the corresponding target frame; The target search module near the boundary is used to set the boundary threshold, and judge whether the distance between the boundary of the target frame and the boundary of the image in each image is greater than the boundary threshold. If not, based on the binary method, the current image and the adjacent image are cut in half in the width direction of the image, and spliced to obtain a spliced image. For the spliced image in which the detected target is detected, it is judged whether the distance between the boundary of the target frame in the spliced image and the boundary of the image is greater than the boundary threshold. If not, the width of the split is reduced to half and then spliced, and the width of the spliced image is maintained unchanged. The judgment is repeated until the distance between the boundary of the target frame and the boundary of the image is greater than the boundary threshold, so that each spliced image contains a complete target frame, and the coordinates of the target frame are output; The global target fusion module is used to compare the detected targets in the stitched image and the left and right images adjacent to its original image. If the types of the detected targets are the same and the intersection and union ratio of the target frames is greater than the specified threshold, the detected targets are considered to be the same, the target frames are fused, and the coordinates of the detected targets are output.
9. A target detection device for train linear array images, characterized in that: It includes: Processor, memory and program; The program is stored in the memory, and the processor calls the program stored in the memory to execute the target detection method for train linear array images described in any of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a program, and the program is used to execute the target detection method for train linear array images described in any of claims 1-7.
Citation Information
Cited By
Train scene-oriented rail transit forward obstacle early warning method
CN122724538A
