A multi-viewpoint stitching method and system for large-field-of-view monitoring scenes
By using wide-angle cameras and fixed-focus cameras for depth-of-field fusion in large-field surveillance scenes, combined with feature point matching and de-distortion processing, the problems of parallax and distortion in multi-viewpoint splicing are solved, and low-distortion, non-dislocation image splicing is achieved. and high-definition effects.
Patent Information
- Application Number
- CN202410447392.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-04-15
AI Technical Summary
In large-field surveillance scenarios, it is difficult for existing technologies to avoid parallax and distortion problems caused by multi-viewpoint splicing while ensuring image quality.
A wide-angle camera and multiple fixed-focus cameras with the same focal length are used to shoot, the images are spliced through depth-of-field fusion, feature point matching and affine transformation are used to eliminate parallax, and low distortion and no misalignment are generated through de-distortion processing and weighted fusion algorithms. Final image.
It achieves low-distortion, non-dislocation image splicing in large field of view monitoring scenes, while improving the clarity of the overall image and solving the parallax problem caused by multi-viewpoint splicing.
Smart Images

Figure CN118247142B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a multi-viewpoint stitching method and system applied to a large-field-of-view monitoring scene. Background Art
[0002] In the field of large-scene monitoring, there are generally two solutions for monitoring scenes with a large field of view. One is a solution similar to a compound eye camera or a panoramic camera. Multiple cameras are integrated inside a device, which is equivalent to all cameras being located at the same viewpoint. However, the image stitched out by this solution has large distortion. Although anti-distortion algorithms can be added later, the image quality will be lost to a large extent. The other solution is to arrange all cameras in a distributed manner and place them at different viewpoints. This solution does not have distortion and the image quality after stitching is better, but the problem is that there is parallax between cameras at different viewpoints. The same object is photographed by different cameras at different positions, resulting in misalignment of the objects after stitching.
[0003] Therefore, the present invention proposes a multi-viewpoint stitching method and system for large-field-of-view monitoring scenes, which adopts a wide-angle camera plus several fixed-focus cameras with the same focal length for shooting, and adopts a depth-of-field fusion method for stitching to solve the parallax problem caused by stitching pictures taken from different viewpoints, thereby ensuring both the stitching effect (low distortion, no dislocation) and the clarity of the overall image. Summary of the invention
[0004] The purpose of the present invention is to propose a multi-viewpoint stitching method and system for large-field-of-view monitoring scenes, to ensure that the stitched images have low distortion and no dislocation, and to solve the parallax problem caused by multi-viewpoint stitching in large-scene monitoring.
[0005] The purpose of the present invention is to achieve a multi-viewpoint stitching method for large field of view monitoring scenes through the following technical scheme, characterized in that: the acquisition device includes a plurality of fixed-focus cameras with the same focal length for capturing different viewing angles, and the acquisition device also includes a wide-angle camera for capturing the full viewing angle; the method includes the following steps:
[0006] Acquire a plurality of first images of a target scene, wherein the plurality of first images are taken by a plurality of fixed-focus cameras at a plurality of viewpoints, wherein the first images taken by adjacent fixed-focus cameras have overlapping parts;
[0007] Stitching the multiple first images to obtain a stitched image;
[0008] Acquire a second image of the target scene, where the second image is a panoramic image captured by a wide-angle camera;
[0009] performing a dedistortion process on the second image to obtain a reference image;
[0010] The stitched image is fused with the reference image to obtain a final image.
[0011] Furthermore, the step of stitching the plurality of first images to obtain a stitched image includes:
[0012] S201: Acquire feature point sets of multiple first images;
[0013] S202: performing feature point matching;
[0014] S203: using the matched feature point pairs, calculate the transformation matrix H;
[0015] S204: performing affine transformation on the multiple first images according to the transformation matrix H, mapping all the first images to the same coordinate system, completing the image affine transformation, and obtaining an affine image;
[0016] S205: finding the best stitching line between the affine images by a dynamic programming algorithm, and stitching the affine images according to the best stitching line to obtain a multi-plane image;
[0017] S206: Using an optical flow method to make pixel positions of objects in the stitching area on the multi-plane image correspond to each other, so as to ensure multi-plane alignment;
[0018] S207: performing exposure processing on the multi-plane image, and adjusting the brightness and contrast of the multi-plane image;
[0019] S208: Fusing the foreground object in the multi-plane image into the background of the multi-plane image through an image fusion algorithm to obtain a spliced image.
[0020] Furthermore, the S201 preferably uses a scale-invariant feature transformation algorithm to calculate feature point sets of the plurality of first images in different scale spaces.
[0021] Furthermore, S202 includes using a FLANN algorithm to perform feature point matching through approximate nearest neighbor search to obtain feature point pairs.
[0022] Furthermore, S203 includes calculating a transformation matrix H, using a RANSAC algorithm to randomly sample feature point pairs, and iteratively calculating the transformation matrix, and calculating the transformation matrix H by setting an error threshold, where the threshold is set to 3.
[0023] Further, performing dedistortion processing on the second image to obtain a reference image includes:
[0024] S401: extracting corner point information on the second image;
[0025] S402: further extracting sub-pixel information according to the corner point information;
[0026] S403: calibrating the wide-angle camera according to the sub-pixel information to obtain a calibration result;
[0027] S404: Evaluate the calibration result using a reprojection error method to obtain a new calibration result;
[0028] S405: performing a dedistortion operation on the second image according to the new calibration result to obtain a reference image after the distortion is corrected.
[0029] Furthermore, S403 includes calibrating the wide-angle camera using the calibrateCamera function to obtain a camera calibration result; the calibration result includes: an intrinsic parameter matrix, an extrinsic parameter matrix and a distortion coefficient of the wide-angle camera.
[0030] Furthermore, fusing the stitched image with the reference image to obtain a final image includes:
[0031] S501: Acquire an overlapping area of a stitched image and a reference image, wherein the overlapping area on the stitched image is a first overlapping area L1, and the overlapping area on the reference image is a second overlapping area L2;
[0032] S502: Calculate the clarity Lap of each pixel in the first overlap area L1, and calculate the clarity Lap of each pixel in the second overlap area L2 w , the formula for calculating clarity is:
[0033] Lap(x,y)=Im g(x+1,y)+Im g(x,y+1)+Im g(x-1,y)+Im g(x,y-1)-4×Im g(x,y)+C
[0034] Lap w (x,y)=Im g w (x+1,y)+Im g w (x,y+1)+Im g w (x-1,y)+Im g w (x,y-1)-4×Im g w (x,y)+C
[0035] Where:
[0036] Im g(x,y) is the image pixel value at the position with coordinates (x,y) in the first overlap area L1;
[0037] Im g w (x, y) is the image pixel value at the position with coordinates (x, y) in the second overlap area L2
[0038] Lap(x,y) is the Laplace sharpness value of the pixel with coordinates (x,y) in the first overlap area L1;
[0039] Lap w (x, y) is the Laplace sharpness value of the pixel with coordinates (x, y) in the second overlap area L2;
[0040] c is a constant;
[0041] S503: according to the clarity of each pixel calculated in S502, a fusion weight of the first overlapped area L1 and a fusion weight of the second overlapped area L2 are calculated;
[0042] The fusion weight formula is:
[0043]
[0044] WildWeight(x,y)=1-BlendWeight(x,y)
[0045] Where:
[0046] FeatherWeight(x,y) is the feathering value obtained after Gaussian blurring of the fusion mask;
[0047] BlendWeight(x,y) is the fusion weight of the first overlapping area L1;
[0048] WildWeight(x,y) is the fusion weight of the second overlapping area L2.
[0049] S504: performing weighted fusion on the stitched image and the reference image according to the fusion weight of the first overlapped area L1 and the fusion weight of the second overlapped area L2;
[0050] The weighted fusion formula is:
[0051] Im g blend =Im g L1 ×BlendWeight+Img L2 ×WildWeight
[0052] in:
[0053] Im g L1 is the pixel value on the first overlapping area L1;
[0054] Im g L2 is the pixel value on the second overlapping area L2;
[0055] Im g blend is the pixel value of the fused image;
[0056] The fused Im g blend The pixel value is replaced to the corresponding coordinate position of the reference image to obtain the final image Im g all .
[0057] Furthermore, the constant C=20. When c is 20, the flickering problem of the fused video caused by a large change in the definition ratio is effectively avoided.
[0058] The present invention also provides a multi-viewpoint splicing system applied to a large-field-of-view monitoring scene, characterized in that it comprises:
[0059] An image acquisition module is configured to acquire a plurality of first images of a target scene, wherein the first images are taken by a plurality of fixed-focus cameras at a plurality of viewpoints, and the first images taken by adjacent fixed-focus cameras have overlapping parts; and acquire a second image of the target scene, wherein the second image is a panoramic image taken by a wide-angle camera;
[0060] A stitching module stitches the multiple first images to obtain a stitched image;
[0061] A dedistortion module performs dedistortion processing on the second image to obtain a reference image;
[0062] A fusion module is used to fuse the stitched image with the reference image to obtain a final image.
[0063] The present invention has the following advantages:
[0064] (1) The present invention uses a wide-angle camera and a fixed-focus camera at multiple viewpoints to obtain multiple images with a certain degree of overlap, and stitches the multiple images together to obtain a larger image of a complete scene. The weighted fusion is used to solve the parallax problem when stitching images taken by cameras at multiple viewpoints.
[0065] (2) In the present invention, the stitched image retains the part without parallax at the focal plane position, and the other images with parallax are replaced with the reference image to ensure that the stitched image has low distortion and no misalignment. At the same time, the depth of field fusion processing is added to increase the clarity of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is a diagram of the method steps of the present invention;
[0067] Figure 2 This is a schematic diagram of the placement of a fixed-focus camera;
[0068] Figure 3 is a schematic diagram of step S2;
[0069] Figure 4 is a schematic diagram of step S4;
[0070] Figure 5 A schematic diagram of the final image. DETAILED DESCRIPTION
[0071] The present invention is further described below in conjunction with the accompanying drawings, but the protection scope of the present invention is not limited to the following description.
[0072] It should be noted that the directions or positional relationships indicated by "left", "right", etc. are based on the directions or positional relationships shown in the accompanying drawings, or are the directions or positional relationships in which the inventive product is usually placed when in use, or are the directions or positional relationships commonly understood by those skilled in the art. Such terms are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention.
[0073] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features and technical solutions in the embodiments may be combined with each other.
[0074] Embodiment 1
[0075] like Figure 1 As shown, the present invention proposes a multi-viewpoint stitching method for a large field of view monitoring scene, the method comprising the following steps: The following steps are numbered, but the order of the numbers does not mean that they must be performed in this order;
[0076] S1: Acquire multiple first images of a target scene, where the multiple first images are taken by multiple fixed-focus cameras at multiple viewpoints, wherein first images taken by adjacent fixed-focus cameras have overlapping parts;
[0077] The present invention provides a plurality of fixed-focus cameras with the same focal length and a wide-angle camera, and places the plurality of fixed-focus cameras at different viewpoints, such as Figure 2 As shown, there is overlap in the contents of the images taken by adjacent fixed-focus cameras.
[0078] S2: stitching the multiple first images to obtain a stitched image;
[0079] In this embodiment, if Figure 3 As shown, step S2 specifically includes the following steps:
[0080] S201: Acquire feature point sets of multiple first images; in some specific embodiments, a scale-invariant feature transformation algorithm is preferably used to calculate feature point sets of multiple first images located in different scale spaces;
[0081] S202: Perform feature point matching; in some specific embodiments, the FLANN algorithm is preferably used, for example, to match feature points in the first image A, take the first image B adjacent to the first image A as the image to be matched, query the feature points of the first image A and the most similar feature points in the feature point set on the first image B through approximate nearest neighbor search, and perform matching to obtain matching points based on the distance between the feature points of the first image A and the most similar feature points, and obtain feature point matching results, namely, feature point pairs;
[0082] S203: Using the matched feature point pairs, a transformation matrix H is calculated. The transformation matrix H is calculated by using the RANSAC algorithm to randomly sample the feature point pairs and iteratively calculate the transformation matrix H. The transformation matrix H is calculated by setting an error threshold, and the threshold is set to 3.
[0083] S204: performing affine transformation on multiple original images according to the transformation matrix H, mapping all original images to the same coordinate system, completing image affine transformation, and obtaining an affine image;
[0084] S205: finding the best stitching line between the affine images by a dynamic programming algorithm, and stitching the affine images according to the best stitching line to obtain a multi-plane image;
[0085] S206: Using an optical flow method to make pixel positions of objects in the stitching area on the multi-plane image correspond to each other, so as to ensure multi-plane alignment;
[0086] S207: performing exposure processing on the multi-plane image, and adjusting the brightness and contrast of the spliced multi-plane image;
[0087] S208: Fusing the foreground object in the multi-plane image into the background of the multi-plane image by using an image fusion algorithm to obtain a spliced image. The image fusion algorithm preferably adopts pyramid fusion.
[0088] The first images obtained from multiple perspectives are matched and aligned according to the overlapping parts between the first images, and a fusion algorithm is added to stitch these first images together to form a seamless, high-definition stitched image; the stitched image has a wider field of view than a single image.
[0089] In addition to acquiring images with a fixed-focus camera, panoramic images are also acquired through a wide-angle camera. The viewing range of a wide-angle camera is larger than that of a fixed-focus camera, and a larger field of view can be acquired.
[0090] S3: Acquire a second image of the target scene, where the second image is a panoramic image captured by a wide-angle camera;
[0091] S4: performing dedistortion processing on the second image to obtain a reference image;
[0092] In this embodiment, if Figure 4 As shown, step S4 specifically includes the following steps:
[0093] S401: extracting corner point information on the second image;
[0094] S402: further extracting sub-pixel information according to the corner point information;
[0095] S403: Obtaining calibration results; performing camera calibration on the wide-angle camera using the calibrateCamera function according to the sub-pixel information to obtain the camera calibration results; the calibration results include: an intrinsic parameter matrix, an extrinsic parameter matrix and a distortion coefficient of the wide-angle camera;
[0096] S404: using the reprojection error to evaluate the calibration result to obtain a new calibration result;
[0097] S405: performing a dedistortion operation on the second image according to the new calibration result to obtain a reference image after the distortion is corrected.
[0098] S5: fusing the stitched image with the reference image to obtain a final image;
[0099] S501: Acquire an overlapping area of a stitched image and a reference image, wherein the overlapping area on the stitched image is a first overlapping area L1, and the overlapping area on the reference image is a second overlapping area L2;
[0100] S502: Calculate the clarity Lap of each pixel in the first overlap area L1, and calculate the clarity Lap of each pixel in the second overlap area L2 w , the formula for calculating clarity is:
[0101] Lap(x,y)=Im g(x+1,y)+Im g(x,y+1)+Im g(x-1,y)+Im g(x,y-1)-4×Im g(x,y)+C
[0102] Lap w (x,y)=Im g w (x+1,y)+Im g w (x,y+1)+Im g w (x-1,y)+Im g w (x,y-1)-4×Im g w (x,y)+C
[0103] Where:
[0104] Im g(x,y) is the image pixel value at the position with coordinates (x,y) in the first overlap area L1;
[0105] Im g w (x, y) is the image pixel value at the position with coordinates (x, y) in the second overlap area L2
[0106] Lap(x,y) is the Laplace sharpness value of the pixel with coordinates (x,y) in the first overlap area L1;
[0107] Lap w (x, y) is the Laplace sharpness value of the pixel with coordinates (x, y) in the second overlap area L2;
[0108] c is a constant, preferably C=20; when c is 20, the flickering problem of the fused video caused by a large change in the definition ratio can be effectively avoided;
[0109] S503: according to the clarity of each pixel calculated in S502, a fusion weight of the first overlapped area L1 and a fusion weight of the second overlapped area L2 are calculated;
[0110] The fusion weight formula is:
[0111]
[0112] WildWeight(x,y)=1-BlendWeight(x,y)
[0113] Where:
[0114] FeatherWeight(x,y) is the feathering value obtained after Gaussian blurring of the fusion mask;
[0115] BlendWeight(x,y) is the fusion weight of the first overlapping area L1;
[0116] WildWeight(x,y) is the fusion weight of the second overlapping area L2.
[0117] S504: performing weighted fusion on the stitched image and the reference image according to the fusion weight of the first overlapped area L1 and the fusion weight of the second overlapped area L2;
[0118] The weighted fusion formula is:
[0119] Im g blend =Im g L1 ×BlendWeight+Img L2 ×WildWeight
[0120] in:
[0121] Im g L1 is the pixel value on the first overlapping area L1;
[0122] Img L2 is the pixel value on the second overlapping area L2;
[0123] Im g blend is the pixel value of the fused image;
[0124] The fused Im g blend The pixel value is replaced to the corresponding coordinate position of the reference image to obtain the final image Im g all .
[0125] In implementation, steps S1, S2 and steps S3, S4 may be performed simultaneously, or steps S1, S2 or steps S3, S4 may be performed first;
[0126] The present invention provides a plurality of fixed-focus cameras with the same focal length and a wide-angle camera, and places the plurality of fixed-focus cameras at different viewpoints, such as Figure 2 As shown, there are overlapping parts in the pictures taken by adjacent fixed-focus cameras; the first images taken are stitched together to obtain a stitched image;
[0127] A wide-angle camera is used to capture the global image to obtain a panoramic image, and the panoramic image is subjected to anti-distortion processing to obtain a reference image; the stitched image and the reference image are fused, and the stitched image has no parallax at the focal plane position, and has parallax at the foreground and background positions. The part without parallax at the focal plane position on the stitched image is retained, and the other images with parallax are replaced with the reference image, thereby completing the fusion of the stitched image and the reference image to obtain the following: Figure 5 The final image shown in the figure ensures low image distortion and no misalignment, and uses the images stitched together by medium focus and short focus to ensure the depth of field of the entire field of view, and also solves the parallax problem when stitching images taken by cameras at different viewpoints.
[0128] Embodiment 2
[0129] The present invention also provides a multi-viewpoint splicing system applied to a large-field-of-view monitoring scene, comprising:
[0130] An image acquisition module is configured to acquire a plurality of first images of a target scene, wherein the first images are taken by a plurality of fixed-focus cameras at a plurality of viewpoints, and the first images taken by adjacent fixed-focus cameras have overlapping parts; and acquire a second image of the target scene, wherein the second image is a panoramic image taken by a wide-angle camera;
[0131] A stitching module stitches the multiple first images to obtain a stitched image;
[0132] A dedistortion module performs dedistortion processing on the second image to obtain a reference image;
[0133] A fusion module is used to fuse the stitched image with the reference image to obtain a final image. The final image is as follows: Figure 3 shown.
[0134] After the image acquisition module in the present invention acquires the multiple first images and the second image, the multiple first images are transmitted to the stitching module, and the second image is transmitted to the dedistortion module;
[0135] The stitching module stitches multiple first images to obtain a stitched image; the dedistortion module dedistorts the second image to obtain a reference image; the stitched image and the reference image are simultaneously input into the fusion module, the fusion module retains the part without parallax in the stitched image, and replaces the foreground and background parts with the reference image, and finally obtains a complete, parallax-free, low-distortion final image.
[0136] The above embodiments only express preferred implementation modes, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention. It should be pointed out that, for ordinary technicians in this field, several modifications and improvements can be made without departing from the invention, and these all belong to the protection scope of the invention.
Claims
1. A multi-viewpoint stitching method applied to a large field of view monitoring scene, characterized in that: The steps include: Acquire a plurality of first images of a target scene, where the plurality of first images are taken by a plurality of fixed-focus cameras at a plurality of viewpoints, wherein the first images taken by adjacent fixed-focus cameras have overlapping parts; Stitching the multiple first images to obtain a stitched image; Acquire a second image of the target scene, where the second image is a panoramic image captured by a wide-angle camera; performing a dedistortion process on the second image to obtain a reference image; Fusing the stitched image with the reference image to obtain a final image; The specific steps of fusing the stitched image with the reference image to obtain the final image include: S501: Acquire an overlapping area of a stitched image and a reference image, wherein the overlapping area on the stitched image is a first overlapping area L1, and the overlapping area on the reference image is a second overlapping area L2; S502: Calculate the clarity Lap of each pixel in the first overlap area L1, and calculate the clarity Lap w of each pixel in the second overlap area L2. The clarity calculation formula is: Lap(x,y)=Img(x+1,y)+Img(x,y+1)+Img(x-1,y)+Img(x,y-1)-4×Img(x,y)+C Lap w(x,y)=Img w(x+1,y)+Img w(x,y+1)+Img w(x-1,y)+Img w(x,y-1)-4×Img w(x,y)+C Where: Img(x,y) is the image pixel value at the position with coordinates (x,y) in the first overlap area L1; Img w(x, y) is the image pixel value at the position with coordinates (x, y) in the second overlap area L2; Lap(x, y) is the Laplace sharpness value of the pixel with coordinates (x, y) in the first overlap area L1; Lap w(x,y) is the Laplacian sharpness value of the pixel with coordinates (x,y) in the second overlap area L2; c is a constant; S503: according to the clarity of each pixel calculated in S502, a fusion weight of the first overlapped area L1 and a fusion weight of the second overlapped area L2 are calculated; WildWeight(x,y)=1-BlendWeight(x,y) FeatherWeight(x,y) is the feathering value obtained after Gaussian blurring of the fusion mask of the spliced image; BlendWeight(x,y) is the fusion weight of the first overlapping area L1; WildWeight(x,y) is the fusion weight of the second overlapping area L2; S504: performing weighted fusion on the stitched image and the reference image according to the fusion weight of the first overlapped area L1 and the fusion weight of the second overlapped area L2; The weighted fusion formula is: Img blend=Img L1×BlendWeight+Img L2×WildWeight in: Img L1 is the pixel value on the first overlapping area L1; Img L2 is the pixel value on the second overlapping area L2; Img blend is the pixel value of the fused image; Replace the fused Img blend pixel values with the corresponding coordinate positions of the reference image to obtain the final image Img all.
2. According to claim 1, a multi-viewpoint stitching method applied to a large field of view monitoring scene is characterized in that: The specific steps of stitching the multiple first images to obtain a stitched image include: S201: Acquire feature point sets of multiple first images; S202: performing feature point matching to obtain matched feature point pairs; S203: using the matched feature point pairs, calculate the transformation matrix H; S204: performing affine transformation on the multiple first images according to the transformation matrix H, mapping all the first images to the same coordinate system, completing the image affine transformation, and obtaining an affine image; S205: finding the best stitching line between the affine images by a dynamic programming algorithm, and stitching the affine images according to the best stitching line to obtain a multi-plane image; S206: Using an optical flow method to make pixel positions of objects in the stitching area on the multi-plane image correspond to each other, so as to ensure multi-plane alignment; S207: performing exposure processing on the multi-plane image, and adjusting the brightness and contrast of the multi-plane image; S208: Fusing the foreground object in the multi-plane image into the background of the multi-plane image through an image fusion algorithm to obtain a spliced image.
3. According to claim 2, a multi-viewpoint stitching method applied to a large field of view monitoring scene is characterized in that: The step S201 includes using a scale-invariant feature transformation algorithm to calculate feature point sets of multiple first images located in different scale spaces.
4. According to claim 2, a multi-viewpoint stitching method applied to a large field of view monitoring scene is characterized in that: The S202 includes using the FLANN algorithm to perform feature point matching through approximate nearest neighbor search to obtain feature point pairs.
5. According to claim 2, a multi-viewpoint stitching method applied to a large field of view monitoring scene is characterized in that: The S203 includes calculating a transformation matrix H, using a RANSAC algorithm to randomly sample feature point pairs, and iteratively calculating the transformation matrix, and calculating the transformation matrix H by setting an error threshold, where the threshold is set to 3.
6. According to claim 1, a multi-viewpoint stitching method applied to a large field of view monitoring scene is characterized in that: The specific steps of performing dedistortion processing on the second image to obtain a reference image include: S401: extracting corner point information on the second image; S402: further extracting sub-pixel information according to the corner point information; S403: calibrating the wide-angle camera according to the sub-pixel information to obtain a calibration result; S404: Evaluate the calibration result using a reprojection error method to obtain a new calibration result; S405: performing a dedistortion operation on the second image according to the new calibration result to obtain a reference image after the distortion is corrected.
7. According to claim 6, a multi-viewpoint stitching method applied to a large field of view monitoring scene is characterized in that: The S403 includes calibrating the wide-angle camera using the calibrateCamera function to obtain a camera calibration result; The calibration results include: the intrinsic parameter matrix, extrinsic parameter matrix and distortion coefficients of the wide-angle camera.
8. According to claim 1, a multi-viewpoint stitching method applied to a large field of view monitoring scene is characterized in that: The constant C=20.
9. A multi-viewpoint stitching system applied to large field of view monitoring scenes, characterized in that: include: An image acquisition module is configured to acquire a plurality of first images of a target scene, wherein the first images are taken by a plurality of fixed-focus cameras at a plurality of viewpoints, and the first images taken by adjacent fixed-focus cameras have overlapping parts; and acquire a second image of the target scene, wherein the second image is a panoramic image taken by a wide-angle camera; A stitching module stitches the multiple first images to obtain a stitched image; A dedistortion module performs dedistortion processing on the second image to obtain a reference image; A fusion module, fusing the stitched image with the reference image to obtain a final image; The specific steps of fusing the stitched image with the reference image to obtain the final image include: S501: Acquire an overlapping area of a stitched image and a reference image, wherein the overlapping area on the stitched image is a first overlapping area L1, and the overlapping area on the reference image is a second overlapping area L2; S502: Calculate the clarity Lap of each pixel in the first overlap area L1, and calculate the clarity Lap w of each pixel in the second overlap area L2. The clarity calculation formula is: Lap(x,y)=Img(x+1,y)+Img(x,y+1)+Img(x-1,y)+Img(x,y-1)-4×Img(x,y)+C Lap w(x,y)=Img w(x+1,y)+Img w(x,y+1)+Img w(x-1,y)+Img w(x,y-1)-4×Img w(x,y)+C Where: Img(x,y) is the image pixel value at the position with coordinates (x,y) in the first overlap area L1; Img w(x, y) is the image pixel value at the position with coordinates (x, y) in the second overlap area L2; Lap(x, y) is the Laplace sharpness value of the pixel with coordinates (x, y) in the first overlap area L1; Lap w(x,y) is the Laplacian sharpness value of the pixel with coordinates (x,y) in the second overlap area L2; c is a constant; S503: according to the clarity of each pixel calculated in S502, a fusion weight of the first overlapped area L1 and a fusion weight of the second overlapped area L2 are calculated; WildWeight(x,y)=1-BlendWeight(x,y) FeatherWeight(x,y) is the feathering value obtained after Gaussian blurring of the fusion mask of the spliced image; BlendWeight(x,y) is the fusion weight of the first overlapping area L1; WildWeight(x,y) is the fusion weight of the second overlapping area L2; S504: performing weighted fusion on the stitched image and the reference image according to the fusion weight of the first overlapped area L1 and the fusion weight of the second overlapped area L2; The weighted fusion formula is: Img blend=Img L1×BlendWeight+Img L2×WildWeight in: Img L1 is the pixel value on the first overlapping area L1; Img L2 is the pixel value on the second overlapping area L2; Img blend is the pixel value of the fused image; Replace the fused Img blend pixel values with the corresponding coordinate positions of the reference image to obtain the final image Img all.
