A method for integrated image stitching in spillway tower monitoring video
Through the integrated splicing method of images in the spill tower surveillance video, multiple independent video images are spliced into a unified image, which solves the problem of inconsistent viewing angles in the surveillance of abandoned ore in mines and improves surveillance efficiency and video quality.
Patent Information
- Application Number
- CN202210238771.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-03-11
AI Technical Summary
In mine excavation, surveillance video images of abandoned ore are difficult to form a unified perspective due to the existence of independent cameras and overlapping content, resulting in low surveillance efficiency.
Using the integrated splicing method of images in the spill tower surveillance video, multiple video images are spliced into a concise and unified video image through steps such as cropping, grayscale, morphological processing and template overlap, and the splicing parameters are adjusted to generate the final image.
It reduces surveillance interference, improves surveillance efficiency, ensures that staff can monitor simply and intuitively, and improves the quality of surveillance videos.
Smart Images

Figure CN114596206B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of monitoring video image integration, in particular to an image integration splicing method in a spillway tower monitoring video. Background Art
[0002] During mining and processing, waste slag continues to accumulate, which can easily lead to accidents such as landslides. In order to ensure the safety of waste ore processing, a spillway is built in the middle of the waste ore. On the one hand, it can drain the waste ore, and on the other hand, it can monitor the accumulation of waste ore to prevent accidents. For the convenience of monitoring, multiple surveillance cameras are installed on the top of the tower to monitor the accumulation of slag in real time. These surveillance cameras are independent, and the display content of the cameras has a certain correlation and some content overlaps, making it difficult for monitoring personnel to establish a complete and unified visual image. Summary of the invention
[0003] In order to address the deficiencies in the prior art, the present invention provides a method for integrated image stitching in a spillway tower monitoring video, which integrates a plurality of spillway tower monitoring video images collected in real time, and forms a final integrated view, so that a plurality of independent video images are stitched into a concise and unified video image, thereby reducing interference, facilitating simple and intuitive monitoring by staff, and improving monitoring efficiency.
[0004] In order to achieve the above-mentioned purpose, the specific scheme adopted by the present invention is: a method for integrated splicing of images in a spillway tower monitoring video, wherein a plurality of markers evenly distributed along the circumferential direction are provided on the spillway tower, and any two markers are different, comprising the following steps: S1, collecting a plurality of initial video images of the spillway tower from the spillway tower monitoring video, and cropping the collected initial video images to obtain first-level video images, each of which includes two markers; S2, extracting the markers in the first-level video image as a template, splicing all the first-level video images into a second-level video image by overlapping the same template, and obtaining the initial splicing parameters of the second-level video image; S3, adjusting the initial splicing parameters of the second-level video image, and finally generating a final image of the spillway tower monitoring video.
[0005] As a further optimization of the above-mentioned image integration stitching method in the spillway monitoring video: the S1 includes: S11, according to the monitoring range, part of the initial video image of each spillway is cropped off to obtain the initial cropped video image; S12, the initial cropped video image is converted into a grayscale video image; S13, the grayscale video image is binarized to separate the spillway and the background in the grayscale video image to obtain a binary video image; S14, the binary video image is morphologically processed to obtain a morphological video image and the boundary and shape of the spillway are obtained; S15, the contour segment video image of the morphological video image is generated; S16, the spillway boundary line is formed based on the line segments in the contour segment video image to obtain the spillway boundary video image; S17, according to the spillway boundary line and the range to be monitored, the initial cropped video image is cropped to finally obtain a first-level video image.
[0006] As a further optimization of the above-mentioned method for integrated image stitching in the spillway monitoring video: the number of the initial video images of the spillway is 6, and they are arranged in sequence along the circumference of the spillway, and the S2 includes: S21, obtaining two identifiers in each first-level video image as two templates, and calculating the center of gravity position and center of gravity angle of each template; S22, for the same template of two adjacent first-level video images, taking the overlap of the template as a reference, taking the center of gravity of the template as the overlap point of the two adjacent first-level video images, one of the first-level video images is rotated, so that the center of gravity angles of the same template on the two first-level video images are the same, and a ring-shaped second-level video image and the initial stitching parameters of the second-level video image are obtained.
[0007] As a further optimization of the above-mentioned image integration stitching method in the spillway monitoring video: the S3 includes: S31, adjusting the second-level video image, selecting the first first-level video image and the fourth first-level video image, adjusting the two to the two sides of the center of the second-level video image, and adjusting the lengths of the two first-level video images; S32, connecting the two ends of the first first-level video image with the second first-level video image and the sixth first-level video image, and connecting the two ends of the fourth first-level video image with the third first-level video image and the fifth first-level video image respectively, and determining the distance between the centers of gravity of the first-level video image templates according to the distance between the centers of gravity of the first-level video image templates. and the distance between the fourth first-level video image; S33, adjusting the angles and lengths of the second first-level video image, the third first-level video image, the sixth first-level video image and the fifth first-level video image, and determining the distance and rotation angle of all two adjacent templates; S34, connecting two adjacent adjusted first-level video images according to the distance and rotation angle of all two adjacent templates, and taking the horizontal range of the template as the boundary and the horizontal position of the center of gravity of the template as the dividing point, and fusing the adjusted first-level video images according to the weights to obtain the adjusted second-level video image; S35, using the above-mentioned adjusted second-level video image to generate the final image of the spillway tower monitoring video.
[0008] As a further optimization of the above-mentioned image integration stitching method in the spillway tower monitoring video: the S35 includes: S351, firstly determining the distance between the template connecting line and the monitoring range according to the distance and rotation angle of two adjacent templates and the video monitoring range requirements, and then determining the cutting boundary, and then allocating the distance between the cutting boundary and the second-level video image boundary, and then determining the final image size; S352, dividing the adjusted second-level video image obtained in S34, and allocating different parts according to the layout correspondence of each video image to generate the final image of the spillway tower monitoring video.
[0009] Beneficial effects:
[0010] 1) The present invention provides an integrated image splicing method in a spillway monitoring video, which splices a plurality of collected monitoring video images into a concise and unified video image, reduces interference, facilitates simple and intuitive monitoring by staff, and improves monitoring efficiency;
[0011] 2) In the present invention, the obtained second-level video image cannot be spliced into a complete image due to reasons such as the camera shooting angle, that is, the sum of the angles of adjacent video images will be less than or greater than 720°. Therefore, the initial splicing parameters of the second-level video image are adjusted to improve the quality of the final image. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 is a schematic diagram of the method of the present invention;
[0013] Figure 2 is one of the initial video images in the embodiment;
[0014] Figure 3 is the immediate neighbor in the initial video image in the embodiment Figure 2 The one on the left of the image; (modified)
[0015] Figure 4 is the immediate neighbor in the initial video image in the embodiment Figure 2 The one on the right side of the image;
[0016] Figure 5 It is a grayscale schematic diagram of a video image;
[0017] Figure 6 is a schematic diagram of a binarized video image;
[0018] Figure 7 is a schematic diagram of a video image after morphological opening operation processing;
[0019] Figure 8 is a schematic diagram of a video image after morphological closing operation processing;
[0020] Fig. 9 is a line segment schematic diagram of a contour line segment video image;
[0021] Fig.10 It is a schematic diagram of the connection of contour segments;
[0022] Fig.11 It is a schematic diagram of the spillway tower boundary line;
[0023] Fig.12 is a schematic diagram of a first level one video image;
[0024] Fig.13 is the left template of the first level video image;
[0025] Fig.14 is the right template of the second first-level video image;
[0026] Fig.15 is a schematic diagram of a second first-level video image and a third first-level video image spliced together;
[0027] Fig.16 is a schematic diagram of a fifth first-level video image and a sixth first-level video image spliced together;
[0028] Fig.17 This is a schematic diagram of the first-level video image splicing composition
[0029] Fig.18 It is a schematic diagram of adjusting the parameters of the first-level video image splicing;
[0030] Fig.19 It is a schematic diagram of splicing and allocation of video images after fusion;
[0031] Fig. 20 is the first first-level video image assigned;
[0032] Fig.21 is the second first level video image assigned;
[0033] Fig. 22 Schematic diagram of the final synthesized image. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] A method for integrating images in a spillway monitoring video. The spillway is provided with multiple marks evenly distributed along the circumference, and any two marks are different. In this embodiment, six cameras are installed on the top of the spillway, and digital marks "1", "2", "3", "4", "5" and "6" are sprayed on the crossbeam of the spillway. The group of digital marks is distributed counterclockwise around the center of the spillway, and any two adjacent cameras will capture the same digital mark. The following steps are included:
[0036] S1, collect multiple initial video images of the spillway tower from the spillway tower monitoring video, each initial video image includes two marks, and the marks are located at the left and right ends of the initial video image, that is, the splicing of the two adjacent initial video images, such as Figure 2 and Figure 3 As shown, it should be noted that Figure 2 and Figure 3 After decolorization, the actual image is a color image, and the collected initial video image is cropped, that is, the initial video image is preprocessed to obtain a first-level video image, each of which includes two identifiers;
[0037] S2, extracting the logo in the first-level video image as a template, splicing all the first-level video images into a second-level video image by overlapping the same template, and obtaining the initial splicing parameters of the second-level video image;
[0038] S3, adjusting the initial stitching parameters of the second-level video image, and finally generating a final image of the spillway tower monitoring video.
[0039] The specific cropping method of the initial video image includes: S1 includes:
[0040] S11, the shooting range of the camera is larger than the range to be monitored. Before the initial video images are spliced, they need to be simply cropped to remove unnecessary interference. At the same time, the image processing speed can also be accelerated. In this embodiment, according to the monitoring range, the upper quarter to one-third of the initial video image of each spillway is cropped to obtain the first cropped video image. Figure 4 As shown, it should be noted that Figure 4 After decolorization, the actual image is a color image.
[0041] S12, the collected video image is an RGB color image, which needs to be converted, that is, the first cropped video image is converted into a grayscale video image, such as Figure 5 As shown, in this embodiment, the conversion method can select the classic RGB to gray formula:
[0042] Pixel gray value = pixel red value × 0.3 + pixel green value × 0.59 + pixel blue value × 0.11
[0043] That is, red accounts for 30%, green accounts for 59%, blue accounts for 11%, and the pixel value of the grayscale video image is between 0 and 255.
[0044] S13, binarize the grayscale video image to separate the spillway and the background in the grayscale video image, and obtain a binarized video image, that is, each pixel value of the binarized video image is 0 or 255. In this embodiment, the binarization method is the threshold method, that is, a suitable threshold is selected, and the pixel values greater than the threshold are assigned 255, and the pixel values not greater than the threshold are assigned 0; refer to the histogram of the video image and select the threshold according to a certain ratio. In this implementation, the binarization threshold is selected according to a 50% ratio. Assuming that histogram is an array storing valid image histogram values, histogram[0] is the number of pixels with a pixel value of 0, histogram[1] is the number of pixels with a pixel value of 1, and so on, histogram
[255] is the number of pixels with a pixel value of 255, then the binarization threshold k satisfies:
[0045]
[0046]
[0047] In the above formula, totalPixelCount is the number of effective pixels of the image. In this embodiment, the image resolution of the surveillance video is 1920×1080, and the number of effective pixels is 1920×1080×2 / 3=1382400.
[0048] S14, morphological processing is performed on the binary video image to obtain a morphological video image and obtain the boundary and shape of the spillway. The purpose of the morphological processing is to eliminate those small objects in the binary video image. In this embodiment, the binary video image is firstly processed by opening operation to eliminate small white bright spots; and then the video image is processed by closing operation to eliminate small black spots, thereby forming the boundary and shape of the spillway.
[0049] S15, generating a contour line segment video image of the morphological video image using a Canny edge detection algorithm according to the boundary of the spillway formed above;
[0050] S16, forming the spillway tower boundary line based on the line segments in the contour line segment video image, and obtaining the spillway tower boundary video image. The line segments in the contour line segment video image are fragmented and messy, and cannot form the spillway tower boundary, so the messy line segments need to be removed. Specifically, each line segment is selected according to the position and direction range of the reference object boundary, and the spillway tower edge line segments are connected to determine the straight line equation of the spillway tower boundary, and the intersection of the two straight lines is determined according to the straight line equation, and the range of the straight line is formed according to the intersection. In this embodiment, the left side of the spillway tower boundary is approximately in the direction of 45° from the lower left to the upper middle, and the right side is approximately in the direction of 45° from the lower right to the upper middle. After connection, the longest line segment is selected as the spillway tower boundary.
[0051] S17, based on the spillway boundary line and the range to be monitored, in this embodiment, the range to be monitored is a range extending 100 pixels outward along the spillway boundary, the first cropped video image is cropped, the range that does not need to be monitored is cropped, and only the image within a certain range of the reference object is retained, and finally the first-level video image is obtained, such as Fig.12 As shown, it should be noted that Fig.12 After decolorization, the actual image is a color image, and the position of the lower left corner of the first-level video image is also cropped within a range of no more than 100 pixels extending outward from the spillway tower.
[0052] In this embodiment, digital logos "1", "2", "3", "4", "5" and "6" are sprayed on the beams of the spillway tower. The group of logos is distributed counterclockwise around the center of the spillway tower. Any two adjacent cameras will capture the same digital logo. There are 6 initial video images of the spillway tower, and they are arranged in sequence along the circumference of the spillway tower. Each initial video image has two digital logos. The initial video images are sorted according to the digital logos on their left, such as Figure 2 and Figure 3 As shown, it should be noted that Figure 2 and Figure 3 After decolorization, the actual image is a color image. The first initial video image has two digital identifiers, "1" on the left and "6" on the right, and the second initial video image has two digital identifiers, "2" on the left and "1" on the right. Therefore, the same number can be used to splice two adjacent video images. S2 includes:
[0053] S21, obtaining two marks in each first-level video image as two templates, and calculating the center of gravity position and center of gravity angle of each template. In this embodiment, taking the first image and the second image as an example, Fig.13 As shown, it should be noted that Fig.13 After decolorization, the actual image is a color image, and the digital mark "1" is extracted from the first first-level video image as the left template of the first first-level video image; Fig.14 As shown, it should be noted that Fig.14 After decolorization, the actual image is a color image. The digital identifier "1" is extracted from the second first-level video image as the right template of the second first-level video image. The two templates have the same center of gravity, but the center of gravity position and tilt angle of the two templates are different. The left template of the first first-level video image is tilted about 150°, and the right template of the second first-level video image is tilted about 30°.
[0054] S22, for the same template of two adjacent first-level video images, take the overlap of the template as a reference, take the center of gravity of the template as the overlap point of the two adjacent first-level video images, and rotate one of the first-level video images so that the center of gravity angles of the same template on the two first-level video images are the same. Taking the first first-level video image and the second first-level video image as an example, the two first-level video images have the same template "1". First, make the center of gravity of the left template "1" and the right template "1" overlap; then, rotate the second first-level video image counterclockwise by 120°. At this time, the "1" on the two first-level video images overlap, thereby completing the splicing of the first first-level video image and the second first-level video image. Fig.15 and Fig.16 As shown, Fig.15 is a schematic diagram of a second first-level video image and a third first-level video image spliced together; Fig.16 is a schematic diagram of the splicing of the fifth first-level video image and the sixth first-level video image; it should be noted that Fig.15 and Fig.16After decolorization, the actual image is a color image. Repeating this step, the ring-shaped second-level video image and the initial splicing parameters of the second-level video image are obtained, and the angle between any two first-level video images can be obtained.
[0055] Due to the requirements for the monitoring range, there will be requirements for the shooting angle of the camera, which will result in the cumulative sum of the angles of adjacent first-level video images being less than or greater than 720°. In this embodiment, because the camera protrudes outside the spillway and shoots toward the bottom of the spillway, the cumulative sum of the angles of two adjacent first-level video images is less than 720°, so we need to adjust the stitching and fusion parameters of the second-level video. In this embodiment, the first first-level video image is spliced and synthesized at the upper center of the second-level video image, that is, the first first-level video image is directly above the center of the second-level video image. In order to simplify the calculation, the fourth first-level video image is arranged directly below the center of the second-level video image, such as Fig.17 As shown, p1 represents the first first-level video image, p2 represents the second first-level video image, p3 represents the third first-level video image, p4 represents the fourth first-level video image, p5 represents the fifth first-level video image, and p6 represents the sixth first-level video image. a template representing a first first-level video image and a second first-level video image, a template representing a second first-level video image and a third first-level video image, a template representing a third first-level video image and a fourth first-level video image, a template representing a fourth first-level video image and a fifth first-level video image, p1p6 represents the template of the sixth first-level video image and the fifth first-level video image, and p1p6 represents the template of the first first-level video image and the sixth first-level video image. The 1 next to it indicates template "1". The 2 next to it means template "2". The 3 next to it indicates template "3". The 4 next to it indicates template "4". The 5 next to it indicates template "5". The 6 next to it indicates template "6".
[0056] Principles of parameter adjustment: Try to keep the original image's look and feel. To ensure the display effect, distribute the adjustment to each video image as evenly as possible, so that no image changes too much, causing visual abruptness and discomfort. The adjustment instructions for splicing parameters are as follows: Fig.18As shown, p1 represents the first first-level video image, p2 represents the second first-level video image, p3 represents the third first-level video image, p4 represents the fourth first-level video image, p5 represents the fifth first-level video image, and p6 represents the sixth first-level video image. Overlapping templates, a template representing a first first-level video image and a second first-level video image, a template representing a third first-level video image and a fourth first-level video image, a template representing a fourth first-level video image and a fifth first-level video image, Templates representing the first first-level video image and the sixth first-level video image; non-overlapping templates, Template "2" representing the second first-level video image, Template "2" representing the third first-level video image, The template "5" represents the fifth first-level video image, Represents the template "5" of the sixth first-level video image. length1 represents the distance between the two templates in the first first-level video image, length2 represents the distance between the two templates in the second first-level video image; xLength1 represents the horizontal distance between the two templates in the first first-level video image; yLength1 represents the vertical distance between the two templates in the first second-level video image; adjLength1 represents the adjusted distance between the two templates in the first first-level video image, and so on. angle12 represents the angle formed by the overlap of the templates of the first first-level video image and the second first-level video image, and adjAngle12 represents the angle formed by the overlap of the templates of the first first-level video image and the second first-level video image after adjustment. The specific steps include:
[0057] S31, adjust the second-level video image, select the first first-level video image and the fourth first-level video image, and adjust them to the two sides of the center of the second-level video image, that is, p1 is placed just above the center of the second-level video image, and p4 is placed just below the center of the second-level video image. And adjust the lengths of the two first-level video images, that is, adjust xLength1 and xLength4. The specific adjustment method is: assuming that xLength1 is greater than xLength2, the difference between the distance between the two templates in p1 and the distance between the two templates in p4 is:
[0058] Delta14=xLength1-xLength4
[0059] The distance between the templates after adjustment is:
[0060] adjLengh1=xlength1-deltal4 / 2
[0061] dajLengh4=xlength4+deltal4 / 2
[0062] Then the distance between the two templates in p1 is the same as the distance between the two templates in p2. If xLength1 is less than xLength2, the adjustment method is similar.
[0063] S32, the first first-level video image is connected to the second first-level video image and the sixth first-level video image at both ends, and the fourth first-level video image is connected to the third first-level video image and the fifth first-level video image at both ends, respectively, to obtain: angle angle12 between p1 and p2, angle angle16 between p1 and p6, angle angle34 between p3 and p4, angle angle45 between p4 and p5. According to the distance between the center of gravity of each first-level video image template, the distance between the first first-level video image and the fourth first-level video image is further determined. Fig.18 As shown, the left distance between p1 and p4 is the sum LH of the vertical distance between the two template gravity centers in p2 and the two template gravity centers in p3, and the right distance between p1 and p4 is the sum RH of the vertical distance between the two template gravity centers in p6 and the two template gravity centers in p5. Then the distance aveHigh between p1 and p4 is the average distance of the left distance LH and the right distance RH.
[0064] S33, adjusting the angles and lengths of the second first-level video image, the third first-level video image, the sixth first-level video image, and the fifth first-level video image, and determining the distances and rotation angles of all two adjacent templates. Fig.18As shown, the center of gravity position of template "2" in p2 is Lp2, the center of gravity position of template "2" in p3 is Lp3, these two center of gravity positions are connected to form a line segment, the center position of the line segment is Lp0, and the center of gravity of template "2" in p2 and the center of gravity of template "2" in p3 are adjusted to the position of Lp0. According to the adjusted positions, the distance adjLength2 between the centers of gravity of the two templates in p2 and the angle adjAngle12 between p2 and p1 can be calculated; the distance adjLength3 between the centers of gravity of the two templates in p3 and the angle adjAngle34 between p3 and p4 can also be calculated. The center of gravity position of template "5" in p6 is Rp6, and the center of gravity position of template "5" in p5 is Rp5. These two center of gravity positions are connected to form a line segment, and the center position of the line segment is Rp0. The center of gravity of template "5" in p6 and the center of gravity of template "5" in p5 are adjusted to the position of Rp0; based on the adjusted positions, the distance adjLength6 between the centers of gravity of the two templates in p6 and the angle adjAngle16 between p1 and p6 can be calculated, and the distance adjLength5 between the centers of gravity of the two templates in p5 and the angle adjAngle45 between p4 and p5 can also be calculated.
[0065] S34, according to the distance and rotation angle of all two adjacent templates, connect two adjacent adjusted first-level video images, and use the horizontal range of the template as the boundary and the horizontal position of the center of gravity of the template as the dividing point, and fuse the adjusted first-level video images according to the weight to obtain the adjusted second-level video image. According to the calculated adjustment parameters, first adjust the length of each first-level video image, and then the two adjacent first-level video images overlap the center of gravity of the same template, and use the center of gravity of the template as the overlapping point of the two adjacent video images, and rotate one of the first-level video images, and the rotation angle is the above-mentioned adjusted angle. On the basis of rotation splicing, the fusion of two adjacent video images should also be considered, and the horizontal range of the template is used as the boundary, and the horizontal position of the center of gravity of the template is used as the dividing point, and the fusion is performed according to the weight.
[0066] In this embodiment, assuming that the horizontal length of the template is modelLen, the starting position of the template is xStart, the current fusion point is aPoint, and the x coordinate value of aPoint is xaPoint, the fusion factor alpha is:
[0067] alpha=1-(xaPoint-xStart) / modelLen
[0068] The fusion formula is:
[0069] Left pixel × alpha + right pixel × (1-alpha)
[0070] The same template of two adjacent first-level video images is gradually merged according to the ratio.
[0071] S35, using the adjusted second-level video image, generating a final image of the spillway tower monitoring video. The process includes the following steps:
[0072] S351, first determine the distance between the template connection line and the monitoring range according to the distance and rotation angle of two adjacent templates and the video monitoring range requirements, and then determine the cutting boundary, and then allocate the distance between the cutting boundary and the boundary of the second-level video image, and then determine the size of the final image. In this embodiment, since the positions of p1 and p4 are determined, and the distance between p1 and p4 is determined, the size of the final image in the up and down directions can be determined. The connecting center point of the center position of the two template connection lines in p1 and the center position of the two template connection lines in p4 is used as the center point of the final image. Since the positions of p1 and p4 are determined, the horizontal distance from the left boundary of p2 and p3 to the center point can be calculated, and the smaller of the two horizontal distances is selected as the candidate distance; the horizontal distance from the right boundary of p5 and p6 to the center point is calculated, and the smaller of the two horizontal distances is selected as the other candidate distance. The smaller of the two candidate distances is selected as the distance from the center point to the left and right image boundaries, that is, the size of the final image in the left and right directions can be determined.
[0073] S352, segment and divide the adjusted second-level video image obtained in S34, and allocate different parts according to the layout correspondence of each video image to generate the final image of the spillway tower monitoring video. In this embodiment, the ray formed by the center point of the final image and the center of gravity of the template "1" of p1 is used as the left cutting line, and the ray formed by the center point of the final image and the center of gravity of the template "6" of p1 is used as the right cutting line. The two cutting lines form a trapezoid and are allocated to p1, such as Fig. 20 As shown in the figure, the mapping relationship is that for a point (hc_x, hc_y) assigned to p1 in the final image, the point (ys_x, ys_y) corresponding to p1 is: ys_y=hc_y, ys_x=hc_x. Among them, ys_x is the horizontal distance from the point to the center of the template, hc_x is the horizontal distance from the point to the center of the final image; ys_y is the vertical distance from the point to the center of the template, and hc_y is the vertical distance from the point to the center of the final image. Here, p1 is the fused p1.
[0074] The ray formed by the center point of the final image and the centroid of template "1" of p2 is used as a cutting line, and the ray formed by the center point of the final image and the centroid of template "2" of p2 is used as another cutting line to form a graph assigned to p2, such as Fig.21As shown. Its mapping relationship can be divided into two parts. The straight line formed by rotating the upper boundary line of p2 counterclockwise by adjAngle12 is used as the dividing line to form two areas, and the upper left area is the non-mapping area. For a point (hc_x, hc_y) in the final image of the lower right area, its corresponding point (ys_x, ys_y) of p1 is: take the template "1" in p2 as the origin, rotate the image counterclockwise by adjAngle12, and fill the corresponding point (hc_x, hc_y). Here p2 is the image after fusion.
[0075] The allocation and mapping of other images are similar, and finally the final image is formed, such as Fig. 22 As shown, it should be noted that Fig. 22 After decolorization, the actual image is a color image.
[0076] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for integrating images in a spillway monitoring video, wherein a plurality of marks evenly distributed along the circumference are arranged on the spillway, and any two marks are different, and the method is characterized in that: The following steps are involved: S1, collecting a plurality of initial video images of the spillway tower from the spillway tower monitoring video, and cropping the collected initial video images to obtain first-level video images, each of which includes two identifiers; S11, according to the monitoring range, cropping a portion of the initial video image of each spillway tower to obtain a primary cropped video image; S12, converting the first cropped video image into a grayscale video image; S13, performing binarization processing on the grayscale video image to separate the spillway and the background in the grayscale video image to obtain a binarized video image; S14, performing morphological processing on the binary video image to obtain a morphological video image and obtain the boundary and shape of the spillway; S15, generating a contour segment video image of the morphological video image; S16, forming a spillway tower boundary line based on the line segments in the contour line segment video image, and obtaining a spillway tower boundary video image; S17, cropping the primary cropped video image according to the spillway tower boundary line and the range to be monitored, and finally obtaining a first-level video image; S2, extracting the logo in the first-level video image as a template, splicing all the first-level video images into a second-level video image by overlapping the same template, and obtaining the initial splicing parameters of the second-level video image; The number of initial video images of the spillway tower is 6 and they are arranged in sequence along the circumference of the spillway tower. S2 includes: S21, obtaining two marks in each first-level video image as two templates, and calculating the center of gravity position and center of gravity angle of each template; S22, for the same template of two adjacent first-level video images, taking the overlap of the templates as a reference and the center of gravity of the template as the overlap point of the two adjacent first-level video images, one of the first-level video images is rotated so that the center of gravity angles of the same template on the two first-level video images are the same, thereby obtaining a ring-shaped second-level video image and initial stitching parameters of the second-level video image; S3, adjusting the initial stitching parameters of the second-level video image to finally generate a final image of the spillway tower monitoring video; The S3 includes: S31, adjusting the second-level video image, selecting the first first-level video image and the fourth first-level video image, adjusting the two to the two sides of the center of the second-level video image, and adjusting the lengths of the two first-level video images; S32, connecting the first first-level video image at both ends to the second first-level video image and the sixth first-level video image, connecting the fourth first-level video image at both ends to the third first-level video image and the fifth first-level video image respectively, and determining the distance between the first first-level video image and the fourth first-level video image according to the distance between the centers of gravity of the first-level video image templates; S33, adjusting the angles and lengths of the second first-level video image, the third first-level video image, the sixth first-level video image, and the fifth first-level video image, and determining the distances and rotation angles of all two adjacent templates; S34, connecting two adjacent adjusted first-level video images according to the distance and rotation angle of all two adjacent templates, and fusing the adjusted first-level video images according to the weights, using the horizontal range of the template as the boundary and the horizontal position of the center of gravity of the template as the segmentation point, to obtain an adjusted second-level video image; S35, using the adjusted second-level video image to synthesize the final image of the spillway tower monitoring video.
2. The method for integrating images in a spillway monitoring video according to claim 1, characterized in that: The S35 includes: S351, firstly, according to the distance and rotation angle of two adjacent templates and the video monitoring range requirement, the distance between the template connection line and the monitoring range is determined, and then the cutting boundary is determined, and then the distance between the cutting boundary and the boundary of the second-level video image is allocated, and then the final image size is determined; S352, segmenting and dividing the adjusted second-level video image obtained in S34, allocating different parts according to the layout correspondence of each video image, and synthesizing the final image of the spillway tower monitoring video.
