Camera movement detection method and device, equipment and storage medium

By obtaining and matching the feature points of adjacent image frames collected by the camera in video surveillance to determine whether the camera is moving, it solves the problem of low camera motion detection efficiency and misjudgment, and achieves high-precision motion detection.

CN118864601APending Publication Date: 2024-10-29BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411116768.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

In video surveillance scenarios, cameras may be moved or rotated maliciously, resulting in the inability to monitor normal areas. Existing detection methods are inefficient and prone to misjudgment, and cannot effectively detect camera movement.

Method used

By obtaining adjacent image frames collected by the camera, the feature points in the image frame are determined, and based on the number and position information of feature point pairs, it is judged whether the camera has moved. A feature point matching algorithm is used to improve detection accuracy and avoid misjudgment of object movement. Move for the camera.

Benefits of technology

The accuracy and efficiency of camera movement detection are improved, misjudgments are reduced, and timely and accurate detection of camera movement is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864601A_ABST
    Figure CN118864601A_ABST
Patent Text Reader

Abstract

The invention provides a camera movement detection method and device, equipment and a storage medium, and relates to the field of artificial intelligence, in particular to the field of image processing. According to the specific implementation scheme, adjacent image frames collected by a camera are obtained, and feature points of the image frames in the adjacent image frames are determined; wherein the feature points are feature points representing external features of the object in the image frame, and the feature points have position information; determining a target feature point pair according to the feature points of each image frame in the adjacent image frames; wherein the target feature point pair represents a pair of feature points with the same external features in the previous image frame and the next image frame in the adjacent image frames; and determining whether the camera moves or not according to the number of the target feature point pairs and the position information of the feature points in the target feature point pairs. By judging the number of the target feature point pairs and the positions of the feature points, it is avoided that when an object moves, the object is misjudged as camera movement, and the detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing in the field of artificial intelligence, and in particular to a camera motion detection method, device, equipment and storage medium. Background Art

[0002] In video surveillance scenarios, the camera may be maliciously moved or rotated, making it unable to monitor the normal area, thus causing the surveillance to fail.

[0003] In order to enable the camera to monitor effectively, it is necessary to determine in real time whether the camera moves during the monitoring process of the camera, so as to adjust the camera in time after the camera moves. How to detect whether the camera moves in a timely and effective manner has become an urgent problem to be solved. Summary of the invention

[0004] The present disclosure provides a camera motion detection method, device, equipment and storage medium.

[0005] According to a first aspect of the present disclosure, a method for detecting movement of a camera is provided, comprising:

[0006] Acquire adjacent image frames captured by the camera, and determine feature points of image frames in the adjacent image frames; wherein the feature points are feature points in the image frames that characterize external features of the object, and the feature points have position information;

[0007] Determine a target feature point pair according to the feature points of each image frame in the adjacent image frames; wherein the target feature point pair represents a pair of feature points having the same external features in a previous image frame and a subsequent image frame in the adjacent image frames;

[0008] Whether the camera moves is determined according to the number of the target feature point pairs and the position information of the feature points in the target feature point pairs.

[0009] According to a second aspect of the present disclosure, a camera movement detection device is provided, comprising:

[0010] An acquisition unit, used to acquire adjacent image frames captured by the camera, and determine feature points of image frames in the adjacent image frames; wherein the feature points are feature points in the image frames that characterize external features of the object, and the feature points have position information;

[0011] A determination unit, configured to determine a target feature point pair according to feature points of each image frame in the adjacent image frames; wherein the target feature point pair represents a pair of feature points having the same external features in a previous image frame and a subsequent image frame in the adjacent image frames;

[0012] The detection unit is used to determine whether the camera moves according to the number of the target feature point pairs and the position information of the feature points in the target feature point pairs.

[0013] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0014] at least one processor; and

[0015] a memory communicatively coupled to the at least one processor;

[0016] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect of the present disclosure.

[0017] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method according to the first aspect of the present disclosure.

[0018] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the steps of the method described in the first aspect of the present disclosure when executed by a processor.

[0019] According to the technology disclosed in the present invention, the detection accuracy of camera movement is improved.

[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0022] Figure 1 is a flow chart of a method for detecting camera movement according to an embodiment of the present disclosure;

[0023] Figure 2 It is a flow chart of a method for detecting camera movement according to an embodiment of the present disclosure;

[0024] Figure 3 is a schematic diagram of adjacent image frames provided according to an embodiment of the present disclosure;

[0025] Figure 4 is a flow chart of a method for detecting camera movement according to an embodiment of the present disclosure;

[0026] Figure 5is a flow chart of a method for detecting camera movement according to an embodiment of the present disclosure;

[0027] Figure 6 is a structural block diagram of a camera motion detection device provided according to an embodiment of the present disclosure;

[0028] Figure 7 is a structural block diagram of a camera motion detection device provided according to an embodiment of the present disclosure;

[0029] Figure 8 is a block diagram of an electronic device for implementing the camera motion detection method of the embodiment of the present disclosure;

[0030] Fig. 9 It is a block diagram of an electronic device used to implement the camera motion detection method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0032] In video surveillance scenarios, the camera may be maliciously moved or rotated, making it unable to monitor the normal area, thus causing monitoring failure. Currently, the monitoring status of the camera can be manually checked to determine whether the camera has moved. However, manual subjective viewing requires long-term continuous observation of the monitoring image, which is costly and inefficient. For multiple cameras, comprehensive and timely detection is impossible. Therefore, a more objective, fast, and effective camera motion detection method is needed.

[0033] In the current detection method, misjudgment is prone to occur. For example, when an object in the monitoring area moves, it will be misjudged as the camera moving, resulting in a low accuracy rate for detecting the movement of the camera, and the movement of the camera cannot be effectively detected.

[0034] The present invention provides a camera motion detection method, device, equipment and storage medium, which are applied to the image processing field in the field of artificial intelligence to improve the detection accuracy of camera motion.

[0035] It should be noted that the data in this embodiment is not targeted at a specific user and cannot reflect the personal information of a specific user. It should be noted that the data in this embodiment comes from a public data set.

[0036] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0037] In order to enable readers to more deeply understand the implementation principle of the present disclosure, the following Figure 1-Figure 9 The embodiment is further refined.

[0038] Figure 1 FIG. 1 is a flow chart of a method for detecting camera movement according to an embodiment of the present disclosure, and the method can be performed by a camera movement detection device. Figure 1 As shown, the method comprises the following steps:

[0039] S101, acquiring adjacent image frames captured by a camera, and determining feature points of image frames in the adjacent image frames; wherein the feature points are feature points in the image frames that characterize external features of an object, and the feature points have position information.

[0040] For example, the camera has its own shooting range and can shoot the area within the shooting range. When the camera does not move, the camera always shoots the scene in the same area. If the camera moves, the area that the camera can shoot changes. For example, if the camera is rotated 180°, the area shot by the camera is opposite to the direction of the original area. In order for the camera to perform effective monitoring, it is necessary to detect whether the camera moves in time.

[0041] During the monitoring process of the camera, for each camera, the adjacent image frames collected by the camera can be obtained in real time or at a fixed time. Adjacent image frames refer to two image frames collected by the camera at adjacent moments. For each of the adjacent image frames, the feature points in the image frame are determined. The feature points can be composed of one or more pixel points, which refer to the feature points in the image frame that can characterize the external features of the object. The object refers to the object in the area monitored by the camera, and the external features can be the texture features, color features, shape features, etc. of the object. For example, there is a cube object in the area, and the feature points can be the vertices of the cube in the image frame. Each feature point has its own position information, and the position information can refer to the coordinate position of the feature point in the image frame.

[0042] A preset feature point detection algorithm may be used to determine feature points from the image frame. For example, the preset feature point detection algorithm may be an ORB (Oriented FAST and Rotated BRIEF) algorithm. In this embodiment, the preset feature point detection algorithm is not specifically limited.

[0043] In this embodiment, determining feature points of image frames in adjacent image frames includes: scaling each image frame in the adjacent image frames according to a preset image size to obtain adjacent image frames after scaling; performing grayscale processing on the adjacent image frames after scaling to obtain adjacent grayscale image frames corresponding to the adjacent image frames after scaling; and determining feature points of the image frames in the adjacent grayscale image frames.

[0044] Specifically, an image size is preset, and when adjacent image frames are obtained, the adjacent image frames are scaled according to the preset image size, so that each image frame has the preset image size. In this embodiment, the scaling process may be a reduction process of the image frame.

[0045] After the scaling process is performed, the adjacent image frames after the scaling process are grayscale processed, and each image frame is converted into a grayscale image, that is, adjacent grayscale image frames are obtained. Each image frame in the adjacent grayscale image frames has been scaled and grayscale processed. After the adjacent grayscale image frames are obtained, the feature points in each image frame in the adjacent grayscale image frames are determined based on a preset feature point detection algorithm.

[0046] The beneficial effect of this setting is that image scaling and grayscale conversion will lose some information in the image, but the lost information has little impact on the detection accuracy. In addition, through scaling processing and grayscale conversion, the calculation amount of subsequent detection can be greatly reduced, effectively improving the efficiency of mobile detection.

[0047] S102, determining a target feature point pair according to feature points of each image frame in adjacent image frames; wherein the target feature point pair represents a pair of feature points having the same external features in a previous image frame and a next image frame in adjacent image frames.

[0048] Exemplarily, adjacent image frames include two image frames, namely a previous image frame and a next image frame. The previous image frame refers to an image frame collected at the previous moment in the adjacent moments, and the next image frame refers to an image frame collected at the next moment in the adjacent moments. By determining the feature points of each image frame in the adjacent image frames and matching the feature points in the two image frames, multiple pairs of target feature point pairs can be obtained. A target feature point pair refers to a pair of feature points with the same external features in the previous image frame and the next image frame in the adjacent image frames. For example, the feature points in the previous image frame include A1, A2, and A3, and the feature points in the next image frame include B1, B2, and B3, where A1 and B1 represent the same external feature of an object in the region, and A1 and B1 are a pair of target feature point pairs.

[0049] That is, a pair of target feature points includes a feature point in a previous image frame and a feature point in a subsequent image frame, and these two feature points represent the same external feature of the same object.

[0050] When determining feature points, each feature point may be labeled with the object and external features corresponding to the feature point, so that the feature points are matched according to the corresponding objects and external features. In this embodiment, a feature point matching algorithm may be preset, and the feature points in the previous image frame and the feature points in the next image frame in adjacent image frames are matched according to the preset feature point matching algorithm. In this embodiment, the preset feature point matching algorithm is not specifically limited.

[0051] S103: Determine whether the camera moves according to the number of target feature point pairs and the position information of the feature points in the target feature point pairs.

[0052] Exemplarily, after determining all the target feature point pairs in adjacent image frames, determine the number of target feature point pairs, that is, the number of pairs of target feature point pairs. Each pair of target feature point pairs includes two feature points, and each feature point corresponds to its own position information. According to the number of target feature point pairs and the position information of the feature points in the target feature point pairs, determine whether the camera has moved. There are multiple pairs of target feature point pairs. Combining the number of target feature point pairs and the position information of the feature points in all these target feature point pairs, when there is an object itself that moves and causes the position information of the feature points in the target feature point pairs to change, it will not affect the overall judgment result, thereby improving the judgment accuracy.

[0053] The judgment condition of camera movement can be preset, for example, the judgment condition can be that the number of target feature point pairs is within a preset number range, or the position information of the feature points in the target feature point pairs is within a preset coordinate range. If the number of target feature point pairs and the position information of the feature points in the target feature point pairs both meet the corresponding judgment conditions, it is determined that the camera has moved; if the number of target feature point pairs or the position information of the feature points in the target feature point pairs do not meet the corresponding judgment conditions, it is determined that the camera has not moved.

[0054] If it is determined that the camera has moved, a prompt message can be sent to the camera manager. For example, a pop-up window or other message can be sent to the terminal device bound to the manager to prompt the manager to check and adjust the camera.

[0055] In the disclosed embodiment, two adjacent image frames are obtained, and there are multiple feature points in each image frame. Feature points representing the same external features are matched from the two adjacent image frames as target feature point pairs. For example, the feature points of the upper right corner of the same box in the two image frames are matched as target feature point pairs. Compared with the current method of matching image blocks to determine whether the camera has moved, the disclosed embodiment makes judgments based on feature points and has a higher matching accuracy. The number of multiple pairs of target feature point pairs and the position information of the feature points in the target feature point pairs are combined to determine whether the camera has moved, thereby avoiding misjudging the camera as moving when the object moves. Even if individual objects move, it will not be judged as camera moving, thereby improving the accuracy of motion detection.

[0056] Figure 2 A schematic flow chart of a method for detecting camera motion provided in an embodiment of the present disclosure.

[0057] In this embodiment, whether the camera has moved is determined based on the number of target feature point pairs and the position information of the feature points in the target feature point pairs, including: determining the distance information corresponding to the target feature point pairs based on the position information of the feature points in the target feature point pairs; wherein the distance information represents the coordinate distance between two feature points in the feature point pair; determining whether the camera has moved based on the number of target feature point pairs and the distance information corresponding to the target feature point pairs.

[0058] like Figure 2 As shown, the method comprises the following steps:

[0059] S201, acquiring adjacent image frames captured by a camera, and determining feature points of image frames in the adjacent image frames; wherein the feature points are feature points in the image frames that characterize external features of an object, and the feature points have position information.

[0060] Exemplarily, this step may refer to the above-mentioned step S101 and will not be described in detail.

[0061] S202, determining a target feature point pair according to feature points of each image frame in adjacent image frames; wherein the target feature point pair represents a pair of feature points having the same external features in a previous image frame and a next image frame in adjacent image frames.

[0062] Exemplarily, this step may refer to the above-mentioned step S102 and will not be described in detail.

[0063] S203. Determine distance information corresponding to the target feature point pair according to the position information of the feature points in the target feature point pair; wherein the distance information represents the coordinate distance between two feature points in the feature point pair.

[0064] Exemplarily, for each pair of target feature points, the distance information corresponding to the target feature point pair is determined according to the position information of the two feature points in the target feature point pair. The distance information can represent the coordinate distance between the two feature points in the target feature point pair, that is, determine the distance between the coordinate positions of the two feature points.

[0065] For example, in a pair of target feature points, the position information of the two feature points is (x1, y1) and (x2, y2), and the distance between the two coordinate points is determined as the distance information corresponding to the target feature point pair. It is worth noting that in each image frame, the same coordinate system is used. For example, the midpoint of each image frame is the origin of the coordinate system, and the coordinate system is a two-dimensional coordinate system. According to the preset coordinate system, the position information of each feature point can be determined.

[0066] S204: Determine whether the camera moves according to the number of target feature point pairs and the distance information corresponding to the target feature point pairs.

[0067] Exemplarily, it is determined whether the number of target feature point pairs and the distance information corresponding to each pair of target feature point pairs meet a preset judgment condition. If so, it is determined that the camera has moved; if not, it is determined that the camera has not moved. For example, the judgment condition is to determine whether the number of target feature point pairs is within a preset number range and whether each distance information is within a preset distance range. If so, it is determined that the camera has moved; if not, it is determined that the camera has not moved.

[0068] In this embodiment, for each pair of target feature point pairs, a distance information can be determined, and the number of target feature point pairs and the distance information corresponding to each pair of target feature point pairs are combined to comprehensively judge whether the camera has moved, thereby avoiding misjudging the movement of individual objects as the movement of the camera and improving the detection accuracy of the camera movement.

[0069] In this embodiment, determining whether the camera has moved is based on the number of target feature point pairs and the distance information corresponding to the target feature point pairs, including: screening the target feature point pairs according to the distance information corresponding to the target feature point pairs to obtain a first subset and a second subset; wherein the first subset includes at least one pair of target feature point pairs, and the second subset includes at least one pair of target feature point pairs; the distance information of the target feature point pairs in the first subset is different from the distance information of the target feature point pairs in the second subset; determining whether the camera has moved is based on the number of target feature point pairs in adjacent image frames, the number of target feature point pairs in the first subset, and the number of target feature point pairs in the second subset.

[0070] Specifically, after determining the distance information corresponding to each pair of target feature point pairs, the target feature point pairs can be screened according to the distance information, and a portion of the target feature point pairs can be screened out as the first subset, and a portion of the target feature point pairs can be screened out as the second subset. The target feature point pairs in the first subset and the target feature point pairs in the second subset may be repeated. For example, the target feature point pairs whose distance information is within a preset length range are classified into the first subset, and the target feature point pairs whose distance information is within another preset length range are classified into the second subset.

[0071] The distance information may include different types. For example, the distance information may include the distance of the location information of the feature point in the horizontal direction, the distance in the vertical direction, and the straight-line distance between the location information of the feature points. Different subsets of the target feature point pairs may be screened according to different types of distance information. For example, a first subset may be screened according to a certain type of distance information in the distance information, and a second subset may be screened according to another type of distance information.

[0072] Determine the number of target feature point pairs in the first subset as the first number, and determine the number of target feature point pairs in the second subset as the second number. Determine the target feature point pairs based on the feature points of each image frame in the adjacent image frames, and determine the number of target feature point pairs in the adjacent image frames as the third number. Determine whether the camera has moved based on the first number, the second number, and the third number. For example, the average value of the first number, the second number, and the third number can be calculated. If the average value is within a preset value range, it is determined that the camera has moved, otherwise, it is determined that the camera has not moved.

[0073] The beneficial effect of such a setting is that two sets are determined from the target feature point pairs according to different distance information, and a comprehensive judgment is made based on the number of target feature point pairs in different sets, thereby improving the detection accuracy of camera movement.

[0074] In this embodiment, the distance information includes a lateral distance and a longitudinal distance; according to the distance information corresponding to the target feature point pair, the target feature point pair is screened to obtain a first subset and a second subset, including: if the lateral distance corresponding to the target feature point pair is greater than a preset first distance threshold, the target feature point pair is screened into the first subset; if the longitudinal distance corresponding to the target feature point pair is greater than a preset second distance threshold, the target feature point pair is screened into the second subset.

[0075] Specifically, the distance information may include categories such as horizontal distance and vertical distance, that is, when determining the distance information corresponding to the target feature point pair, the horizontal distance and vertical distance corresponding to the target feature point pair may be determined. The horizontal distance refers to the moving distance of the position information of the two feature points on the horizontal axis, and the vertical distance refers to the moving distance of the position information of the two feature points on the vertical axis. For example, if the position information of the feature points in the target feature point pair is (x1, y1) and (x2, y2), respectively, then the horizontal distance is (x1-x2) and the vertical distance is (y1-y2).

[0076] A first distance threshold and a second distance threshold are preset. For each pair of target feature points, it is determined whether the lateral distance is greater than the preset first distance threshold. If so, the target feature point pair is classified into the first subset; if not, it is determined that the target feature point pair is not a target feature point pair in the first subset. The lateral distance of each pair of target feature points is determined, and the first subset is obtained.

[0077] For each pair of target feature point pairs, determine whether the longitudinal distance is greater than a preset second distance threshold. If so, the target feature point pair is classified into the second subset; if not, determine that the target feature point pair is not a target feature point pair in the second subset. The longitudinal distance of each pair of target feature point pairs is determined, and the second subset is obtained. In this embodiment, the first distance threshold and the second distance threshold can be the same or different.

[0078] The beneficial effect of such a setting is that the first subset and the second subset are divided according to the moving distance along the horizontal and vertical axes, and the feature point pairs that move more in the horizontal direction and the feature point pairs that move more in the vertical direction are determined, which facilitates the subsequent camera movement detection based on the movement of the feature points in the horizontal and vertical axes, thereby improving the detection accuracy.

[0079] In this embodiment, whether the camera has moved is determined based on the number of target feature point pairs in adjacent image frames, the number of target feature point pairs in the first subset, and the number of target feature point pairs in the second subset, including: if the number of target feature point pairs in adjacent image frames is greater than a preset number threshold, a first ratio is determined based on the number of target feature point pairs in adjacent image frames and the number of target feature point pairs in the first subset, and a second ratio is determined based on the number of target feature point pairs in adjacent image frames and the number of target feature point pairs in the second subset; wherein the first ratio represents the ratio between the number of target feature point pairs in adjacent image frames and the number of target feature point pairs in the first subset, and the second ratio represents the ratio between the number of target feature point pairs in adjacent image frames and the number of target feature point pairs in the second subset; whether the camera has moved is determined based on the first ratio and the second ratio.

[0080] Specifically, the number of target feature point pairs in adjacent image frames is determined, a number threshold is preset, and the number of target feature point pairs in adjacent image frames is compared with the preset number threshold. If the number of target feature point pairs in adjacent image frames is greater than the preset number threshold, the ratio between the number of target feature point pairs in adjacent image frames and the number of target feature point pairs in the first subset is determined, that is, the ratio between the third number and the first number is determined as the first ratio. The ratio between the number of target feature point pairs in adjacent image frames and the number of target feature point pairs in the second subset can also be determined, that is, the ratio between the second number and the third number is determined as the second ratio. For example, if the first number is Nx, the second number is Ny, and the third number is N, then the first ratio Nx / N and the second ratio Ny / N can be determined.

[0081] According to the first ratio and the second ratio, it is determined whether the camera moves. For example, the average value of the first ratio and the second ratio can be determined. If the average value is within a preset ratio range, it is determined that the camera moves, otherwise, it is determined that the camera does not move.

[0082] The beneficial effect of such a setting is that it is determined whether N is greater than a preset number threshold Nt. When N is greater than Nt, the first ratio and the second ratio are continuously determined, thereby obtaining the number of target feature point pairs that move more horizontally and the number of target feature point pairs that move more vertically. In combination with the movement of each feature point pair in the horizontal and vertical directions, it is determined whether the camera is moving, thereby improving the efficiency and accuracy of motion detection.

[0083] In this embodiment, determining whether the camera moves is based on the first ratio and the second ratio, including: if the first ratio is greater than a preset first ratio threshold, and the second ratio is greater than a preset second ratio threshold, determining that the camera moves.

[0084] Specifically, a first ratio threshold and a second ratio threshold are pre-set, and the first ratio is compared with the first ratio threshold, and the second ratio is compared with the second ratio threshold. If the first ratio is greater than the preset first ratio threshold, and the second ratio is greater than the preset second ratio threshold, it is determined that the camera has moved; if the first ratio is equal to or less than the preset first ratio threshold, or the second ratio is equal to or less than the preset second ratio threshold, it is determined that the camera has not moved. In this embodiment, the first ratio threshold and the second ratio threshold may be the same or different. The first ratio threshold and the second ratio threshold may be larger numbers between 0 and 1, for example, 0.8 or 0.9. Larger numbers can avoid misjudgment caused by object movement.

[0085] In this embodiment, if the first ratio is greater than the preset first ratio threshold, or the second ratio is greater than the preset second ratio threshold, it is determined that the camera has moved; if the first ratio is equal to or less than the preset first ratio threshold, and the second ratio is equal to or less than the preset second ratio threshold, it is determined that the camera has not moved.

[0086] The beneficial effect of this setting is that the more target feature point pairs move, the more likely the camera has moved. If only a few target feature point pairs move, it may be that the object itself has moved. Determine the ratio of the number of target feature point pairs that move in the horizontal direction and the ratio of the number of points that move in the vertical direction. The larger these two ratios are, the more likely the camera has moved. By combining the ratio of the number of movements in the two directions, the accuracy of camera movement detection is effectively improved, avoiding the misjudgment of camera movement caused by object movement.

[0087] In this embodiment, it also includes: if the number of target feature point pairs in adjacent image frames is equal to or less than a preset number threshold, it is determined that the camera has moved.

[0088] Specifically, first determine whether the number of target feature point pairs in adjacent image frames is greater than a preset number threshold. If so, continue to determine the first ratio and the second ratio; if the number of target feature point pairs in adjacent image frames is equal to or less than the preset number threshold, it can be directly determined that the camera has moved without the need for subsequent ratio calculation and judgment.

[0089] The beneficial effect of this setting is that if the number of target feature point pairs in adjacent image frames is small, it means that there are few feature points that can be matched, that is, most of the objects in the adjacent image frames have moved, resulting in the inability to find the corresponding objects in the two image frames. In this case, it can be considered that the camera has moved, causing most of the objects to move, reducing the subsequent calculation process and improving the efficiency of motion detection.

[0090] Figure 3 Schematic diagram of adjacent image frames. Figure 3 In the image, each frame includes three objects, and there are twelve pairs of target feature points, namely a1 and a2, b1 and b2, c1 and c2, d1 and d2, e1 and e2, f1 and f2, g1 and g2, h1 and h2, i1 and i2, j1 and j2, k1 and k2, m1 and m2. To determine the distance information corresponding to each pair of target feature points, only the three feature points of the triangle have moved, and only in the horizontal direction, not in the vertical direction. It can be considered that the triangle itself moves, not the camera.

[0091] In the disclosed embodiment, two adjacent image frames are obtained, and there are multiple feature points in each image frame. Feature points representing the same external features are matched from the two adjacent image frames as target feature point pairs. For example, the feature points of the upper right corner of the same box in the two image frames are matched as target feature point pairs. Compared with the current method of matching image blocks to determine whether the camera has moved, the disclosed embodiment makes judgments based on feature points and has a higher matching accuracy. The number of multiple pairs of target feature point pairs and the position information of the feature points in the target feature point pairs are combined to determine whether the camera has moved, thereby avoiding misjudging the camera as moving when the object moves. Even if individual objects move, it will not be judged as camera moving, thereby improving the accuracy of motion detection.

[0092] Figure 4 A schematic flow chart of a method for detecting camera motion provided in an embodiment of the present disclosure.

[0093] In this embodiment, a target feature point pair is determined based on feature points of each image frame in adjacent image frames, including: matching feature points in a previous image frame with feature points in a subsequent image frame in adjacent image frames according to a preset feature point matching algorithm to obtain an initial feature point pair; wherein the preset feature point matching algorithm is used to match feature points representing the same external features, and the initial feature point pair represents a pair of matched feature points in the previous image frame and the subsequent image frame in adjacent image frames; and determining a target feature point pair from the initial feature point pair based on position information of the feature points in the initial feature point pair.

[0094] like Figure 4 As shown, the method comprises the following steps:

[0095] S401, acquiring adjacent image frames captured by a camera, and determining feature points of image frames in the adjacent image frames; wherein the feature points are feature points in the image frames that characterize external features of an object, and the feature points have position information.

[0096] Exemplarily, this step may refer to the above-mentioned step S101 and will not be described in detail.

[0097] S402. According to a preset feature point matching algorithm, feature points in a previous image frame in adjacent image frames are matched with feature points in a subsequent image frame to obtain an initial feature point pair; wherein the preset feature point matching algorithm is used to match feature points representing the same external features, and the initial feature point pair represents a pair of matched feature points in a previous image frame and a subsequent image frame in adjacent image frames.

[0098] Exemplarily, a feature point matching algorithm is pre-set, and the feature point matching algorithm can match feature points representing the same external features in two image frames into a pair of feature point pairs, and the feature points in the feature point pair come from different image frames. For example, the preset feature point matching algorithm can be SIFT (Scale-Invariant Feature Transform), SURF (Speeded Up Robust Features), and other algorithms. In this embodiment, the preset feature point matching algorithm is not specifically limited.

[0099] According to a preset feature point matching algorithm, feature points on a certain object in a previous image frame and feature points on the object in a subsequent image frame can be determined. If the two feature points represent the same external features, the two feature points can be matched as an initial feature point pair. In other words, the initial feature point pair represents a pair of feature points that match in the previous image frame and the subsequent image frame in adjacent image frames, and all initial feature point pairs that can match in adjacent image frames are determined.

[0100] S403 . Determine a target feature point pair from the initial feature point pair according to the position information of the feature points in the initial feature point pair.

[0101] Exemplarily, the position information of two feature points in the initial feature point pair is determined, and for each pair of initial feature point pairs, whether the initial feature point pair can be a target feature point pair is determined based on the position information of the two feature points. That is, the initial feature point pairs are screened, and a portion of the initial feature point pairs are selected as target feature point pairs. For example, if the position information of the two features is within a preset coordinate range, the initial feature point pair is determined to be a target feature point pair, otherwise, it is not a target feature point pair.

[0102] In this embodiment, feature points on adjacent image frames are matched first, unmatched feature points are screened out, and then the initial feature point pairs are screened to further reduce useless feature point pairs and improve the efficiency and accuracy of subsequent calculations.

[0103] In this embodiment, a target feature point pair is determined from the initial feature point pair based on the position information of the feature points in the initial feature point pair, including: determining the distance information corresponding to the initial feature point pair based on the position information of the feature points in the initial feature point pair; determining the target feature point pair from the initial feature point pair based on the distance information corresponding to the initial feature point pair.

[0104] Specifically, according to the position information of the two feature points in the initial feature point pair, the distance information corresponding to the initial feature point pair is determined, and the distance information can represent the coordinate distance between the two feature points in the initial feature point pair. For example, it can be the straight-line distance between the two coordinate points.

[0105] According to the distance information corresponding to the initial feature point pair, it is determined whether the initial feature point pair is the target feature point pair. A third distance threshold can be preset, and the distance information corresponding to the initial feature point pair is compared with the third distance threshold. If the distance information corresponding to the initial feature point pair is greater than the third distance threshold, it is determined that the initial feature point pair is not the target feature point pair; if the distance information corresponding to the initial feature point pair is less than or equal to the third distance threshold, it is determined that the initial feature point pair is the target feature point pair.

[0106] The beneficial effect of such a setting is that the feature points are optimized according to the distance information, and the two feature points with smaller distance information are used as the better feature point pair, that is, the target feature point pair is obtained, which reduces the subsequent calculation amount and calculation error, and improves the efficiency and accuracy of motion detection.

[0107] S404: Determine whether the camera moves according to the number of target feature point pairs and the position information of the feature points in the target feature point pairs.

[0108] Exemplarily, the number of target feature point pairs is determined. If the number of target feature point pairs is greater than a preset number threshold, the distance information corresponding to the target feature point pairs can be determined based on the position information of the feature points in the target feature point pairs. According to the distance information corresponding to the target feature point pairs, the target feature point pairs are screened to obtain a first subset and a second subset. For example, if the lateral distance corresponding to the target feature point pairs is greater than a preset first distance threshold, the target feature point pairs are screened into the first subset; if the longitudinal distance corresponding to the target feature point pairs is greater than a preset second distance threshold, the target feature point pairs are screened into the second subset.

[0109] A first ratio is determined according to the number of target feature point pairs in adjacent image frames and the number of target feature point pairs in the first subset, and a second ratio is determined according to the number of target feature point pairs in adjacent image frames and the number of target feature point pairs in the second subset. If the first ratio is greater than a preset first ratio threshold and the second ratio is greater than a preset second ratio threshold, it is determined that the camera has moved.

[0110] In this embodiment, it also includes: if the number of target feature point pairs in adjacent image frames is equal to or less than a preset number threshold, determining whether the camera has moved based on the number of initial feature point pairs and distance information corresponding to the initial feature point pairs.

[0111] Specifically, if the number of target feature point pairs in adjacent image frames is equal to or less than a preset number threshold, it can be directly determined that the camera has moved. Alternatively, the initial feature point pairs of adjacent image frames can be obtained, and the camera can be determined to have moved based on the number of initial feature point pairs and the distance information corresponding to the initial feature point pairs. It is determined whether the number of initial feature point pairs is greater than a preset number threshold. If the number of initial feature point pairs is still less than or equal to the preset number threshold, it can be determined that the camera has moved.

[0112] If the number of initial feature point pairs is greater than a preset threshold, the distance information corresponding to the initial feature point pairs can be determined based on the position information of the feature points in the initial feature point pairs, and whether the camera has moved can be determined based on the number of initial feature point pairs and the distance information corresponding to the initial feature point pairs.

[0113] Determining whether the camera has moved based on the number of initial feature point pairs and the distance information corresponding to the initial feature point pairs, including: screening the initial feature point pairs based on the distance information corresponding to the initial feature point pairs to obtain a third subset and a fourth subset; wherein the third subset includes at least one pair of initial feature point pairs, and the fourth subset includes at least one pair of initial feature point pairs; the distance information of the initial feature point pairs in the third subset is different from the distance information of the initial feature point pairs in the fourth subset; determining whether the camera has moved based on the number of initial feature point pairs in adjacent image frames, the number of initial feature point pairs in the third subset, and the number of initial feature point pairs in the fourth subset.

[0114] The distance information may include a horizontal distance and a vertical distance; based on the distance information corresponding to the initial feature point pair, the initial feature point pair is screened to obtain a third subset and a fourth subset, including: if the horizontal distance corresponding to the initial feature point pair is greater than a preset first distance threshold, the initial feature point pair is screened into the third subset; if the vertical distance corresponding to the initial feature point pair is greater than a preset second distance threshold, the initial feature point pair is screened into the fourth subset.

[0115] Determine whether the camera has moved based on the number of initial feature point pairs in adjacent image frames, the number of initial feature point pairs in the third subset, and the number of initial feature point pairs in the fourth subset, including: if the number of initial feature point pairs in adjacent image frames is greater than a preset number threshold, determine a third ratio based on the number of initial feature point pairs in the adjacent image frames and the number of initial feature point pairs in the third subset, and determine a fourth ratio based on the number of initial feature point pairs in the adjacent image frames and the number of initial feature point pairs in the fourth subset; wherein the third ratio represents the ratio between the number of initial feature point pairs in the adjacent image frames and the number of initial feature point pairs in the third subset, and the fourth ratio represents the ratio between the number of initial feature point pairs in the adjacent image frames and the number of initial feature point pairs in the fourth subset; determine whether the camera has moved based on the third ratio and the fourth ratio.

[0116] Determining whether the camera moves according to the third ratio and the fourth ratio includes: if the third ratio is greater than a preset third ratio threshold, and the fourth ratio is greater than a preset fourth ratio threshold, determining that the camera moves.

[0117] The beneficial effect of such a setting is that if the number of target feature point pairs is small, the initial feature point pairs can be used for calculation and judgment, providing a more detailed calculation basis for the final detection result and improving the accuracy of motion detection.

[0118] In the disclosed embodiment, two adjacent image frames are obtained, and there are multiple feature points in each image frame. Feature points representing the same external features are matched from the two adjacent image frames as target feature point pairs. For example, the feature points of the upper right corner of the same box in the two image frames are matched as target feature point pairs. Compared with the current method of matching image blocks to determine whether the camera has moved, the disclosed embodiment makes judgments based on feature points and has a higher matching accuracy. The number of multiple pairs of target feature point pairs and the position information of the feature points in the target feature point pairs are combined to determine whether the camera has moved, thereby avoiding misjudging the camera as moving when the object moves. Even if individual objects move, it will not be judged as camera moving, thereby improving the accuracy of motion detection.

[0119] Figure 5 A schematic flow chart of a method for detecting camera motion provided in an embodiment of the present disclosure.

[0120] like Figure 5 As shown, the method comprises the following steps:

[0121] S501 , acquiring adjacent image frames, performing scaling and grayscale processing on each of the adjacent image frames, and obtaining adjacent grayscale image frames.

[0122] S502: Using a preset feature point detection algorithm, determine feature points of image frames in adjacent grayscale image frames.

[0123] S503 , matching and optimizing feature points of image frames in adjacent grayscale image frames to obtain target feature point pairs.

[0124] S504: Determine the moving distance of the feature point in each pair of target feature points along the X-axis and Y-axis directions.

[0125] S505, determining the total number N of target feature point pairs, and determining the number Nx of feature point pairs with a larger moving distance along the X-axis direction and the number Ny of feature point pairs with a larger moving distance along the Y-axis direction among the target feature point pairs.

[0126] S506, determine whether N is greater than a preset quantity threshold, and whether Nx / N is greater than a preset first ratio threshold, and whether Ny / N is greater than a preset second ratio threshold. If so, execute S507; if not, execute S508.

[0127] S507: Determine whether the camera moves.

[0128] S508: Determine that the camera has not moved.

[0129] In the disclosed embodiment, the feature point matching method is adopted, so that the detection accuracy is higher than that of the image block matching detection method. And when the object in the area moves, it will not be misjudged as the camera moving, which further improves the detection accuracy.

[0130] Figure 6 This is a structural block diagram of a camera motion detection device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 6 The camera motion detection device 600 includes: an acquisition unit 601, a determination unit 602 and a detection unit 603.

[0131] The acquisition unit 601 is used to acquire adjacent image frames captured by the camera and determine feature points of the image frames in the adjacent image frames; wherein the feature points are feature points in the image frames that characterize the external features of the object, and the feature points have position information;

[0132] A determination unit 602 is used to determine a target feature point pair according to the feature points of each image frame in the adjacent image frames; wherein the target feature point pair represents a pair of feature points having the same external features in a previous image frame and a next image frame in the adjacent image frames;

[0133] The detection unit 603 is used to determine whether the camera moves according to the number of the target feature point pairs and the position information of the feature points in the target feature point pairs.

[0134] Figure 7 A structural block diagram of a camera motion detection device provided in an embodiment of the present disclosure, such as Figure 7 As shown, the camera motion detection device 700 includes an acquisition unit 701 , a determination unit 702 and a detection unit 703 , wherein the detection unit 703 includes a distance determination module 7031 and a motion detection module 7032 .

[0135] The distance determination module 7031 is used to determine the distance information corresponding to the target feature point pair according to the position information of the feature points in the target feature point pair; wherein the distance information represents the coordinate distance between the two feature points in the feature point pair;

[0136] The motion detection module 7032 is used to determine whether the camera moves according to the number of the target feature point pairs and the distance information corresponding to the target feature point pairs.

[0137] In one example, the mobile detection module 7032 includes:

[0138] A screening submodule, configured to screen the target feature point pairs according to the distance information corresponding to the target feature point pairs to obtain a first subset and a second subset; wherein the first subset includes at least one pair of target feature point pairs, and the second subset includes at least one pair of target feature point pairs; and the distance information of the target feature point pairs in the first subset is different from the distance information of the target feature point pairs in the second subset;

[0139] The detection submodule is used to determine whether the camera moves according to the number of target feature point pairs in the adjacent image frames, the number of target feature point pairs in the first subset, and the number of target feature point pairs in the second subset.

[0140] In one example, the distance information includes a horizontal distance and a vertical distance; the screening submodule is specifically used for:

[0141] If the lateral distance corresponding to the target feature point pair is greater than a preset first distance threshold, the target feature point pair is filtered into the first subset;

[0142] If the longitudinal distance corresponding to the target feature point pair is greater than a preset second distance threshold, the target feature point pair is filtered into the second subset.

[0143] In one example, the detection submodule is specifically used to:

[0144] If the number of target feature point pairs in the adjacent image frames is greater than a preset number threshold, a first ratio is determined according to the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the first subset, and a second ratio is determined according to the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the second subset; wherein the first ratio represents the ratio between the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the first subset, and the second ratio represents the ratio between the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the second subset;

[0145] Whether the camera moves is determined according to the first ratio and the second ratio.

[0146] In one example, the detection submodule is specifically used to:

[0147] If the first ratio is greater than a preset first ratio threshold, and the second ratio is greater than a preset second ratio threshold, it is determined that the camera has moved.

[0148] In one example, it also includes:

[0149] The first judgment unit is used to determine that the camera has moved if the number of target feature point pairs in the adjacent image frames is equal to or less than a preset number threshold.

[0150] In one example, the determining unit 702 includes:

[0151] An initial matching module, used to match the feature points in the previous image frame and the feature points in the next image frame in the adjacent image frames according to a preset feature point matching algorithm to obtain an initial feature point pair; wherein the preset feature point matching algorithm is used to match feature points representing the same external features, and the initial feature point pair represents a pair of matched feature points in the previous image frame and the next image frame in the adjacent image frames;

[0152] The target determination module is used to determine the target feature point pair from the initial feature point pair according to the position information of the feature points in the initial feature point pair.

[0153] In one example, the target determination module includes:

[0154] A first determination submodule, configured to determine distance information corresponding to the initial feature point pair according to position information of feature points in the initial feature point pair;

[0155] The second determination submodule is used to determine the target feature point pair from the initial feature point pair according to the distance information corresponding to the initial feature point pair.

[0156] In one example, it also includes:

[0157] The second judgment unit is used to determine whether the camera moves according to the number of initial feature point pairs and the distance information corresponding to the initial feature point pairs if the number of target feature point pairs in the adjacent image frames is equal to or less than a preset number threshold.

[0158] In one example, the acquisition unit 701 includes:

[0159] An image scaling module, used for scaling each of the adjacent image frames according to a preset image size to obtain adjacent image frames after scaling;

[0160] A grayscale processing module, used for performing grayscale processing on the adjacent image frames after the scaling processing to obtain adjacent grayscale image frames corresponding to the adjacent image frames after the scaling processing;

[0161] The feature point determination module is used to determine the feature points of the image frames in the adjacent grayscale image frames.

[0162] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device.

[0163] Figure 8 A structural block diagram of an electronic device provided in an embodiment of the present disclosure, such as Figure 8 As shown, the electronic device 800 includes: at least one processor 802; and a memory 801 communicatively connected to the at least one processor 802; wherein the memory stores instructions executable by the at least one processor 802, and the instructions are executed by the at least one processor 802 so that the at least one processor 802 can execute the camera motion detection method disclosed in the present invention.

[0164] The electronic device 800 further includes a receiver 803 and a transmitter 804. The receiver 803 is used to receive instructions and data sent by other devices, and the transmitter 804 is used to send instructions and data to external devices.

[0165] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0166] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.

[0167] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0168] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0169] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0170] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as the motion detection method of the camera. For example, in some embodiments, the motion detection method of the camera may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the motion detection method of the camera described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the motion detection method of the camera in any other appropriate manner (e.g., by means of firmware).

[0171] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0172] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0173] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0174] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0175] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0176] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0177] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0178] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A camera motion detection method, comprising: Acquire adjacent image frames captured by the camera, and determine feature points of image frames in the adjacent image frames; wherein the feature points are feature points in the image frames that characterize external features of the object, and the feature points have position information; Determine a target feature point pair according to the feature points of each image frame in the adjacent image frames; wherein the target feature point pair represents a pair of feature points having the same external features in a previous image frame and a subsequent image frame in the adjacent image frames; Whether the camera moves is determined according to the number of the target feature point pairs and the position information of the feature points in the target feature point pairs.

2. The method according to claim 1, wherein: The determining whether the camera moves according to the number of the target feature point pairs and the position information of the feature points in the target feature point pairs includes: Determine the distance information corresponding to the target feature point pair according to the position information of the feature point in the target feature point pair; wherein the distance information represents the coordinate distance between two feature points in the feature point pair; Whether the camera moves is determined according to the number of the target feature point pairs and the distance information corresponding to the target feature point pairs.

3. The method according to claim 2, wherein: The determining whether the camera moves according to the number of the target feature point pairs and the distance information corresponding to the target feature point pairs includes: According to the distance information corresponding to the target feature point pairs, the target feature point pairs are screened to obtain a first subset and a second subset; wherein the first subset includes at least one pair of target feature point pairs, and the second subset includes at least one pair of target feature point pairs; the distance information of the target feature point pairs in the first subset is different from the distance information of the target feature point pairs in the second subset; Whether the camera moves is determined according to the number of target feature point pairs in the adjacent image frames, the number of target feature point pairs in the first subset, and the number of target feature point pairs in the second subset.

4. The method according to claim 3, wherein: The distance information includes a horizontal distance and a vertical distance; the target feature point pairs are screened according to the distance information corresponding to the target feature point pairs to obtain a first subset and a second subset, including: If the lateral distance corresponding to the target feature point pair is greater than a preset first distance threshold, the target feature point pair is filtered into the first subset; If the longitudinal distance corresponding to the target feature point pair is greater than a preset second distance threshold, the target feature point pair is filtered into the second subset.

5. The method according to claim 4, wherein: The determining whether the camera moves according to the number of target feature point pairs in the adjacent image frames, the number of target feature point pairs in the first subset, and the number of target feature point pairs in the second subset includes: If the number of target feature point pairs in the adjacent image frames is greater than a preset number threshold, a first ratio is determined according to the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the first subset, and a second ratio is determined according to the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the second subset; wherein the first ratio represents the ratio between the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the first subset, and the second ratio represents the ratio between the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the second subset; Whether the camera moves is determined according to the first ratio and the second ratio.

6. The method according to claim 5, wherein: The determining, according to the first ratio and the second ratio, whether the camera moves includes: If the first ratio is greater than a preset first ratio threshold, and the second ratio is greater than a preset second ratio threshold, it is determined that the camera has moved.

7. The method according to claim 6, further comprising: If the number of target feature point pairs in the adjacent image frames is equal to or less than a preset number threshold, it is determined that the camera has moved.

8. The method according to any one of claims 1 to 7, wherein: The step of determining a target feature point pair according to the feature points of each image frame in the adjacent image frames comprises: According to a preset feature point matching algorithm, feature points in a previous image frame and feature points in a subsequent image frame in the adjacent image frames are matched to obtain an initial feature point pair; wherein the preset feature point matching algorithm is used to match feature points representing the same external features, and the initial feature point pair represents a pair of matched feature points in the previous image frame and the subsequent image frame in the adjacent image frames; The target feature point pair is determined from the initial feature point pair according to the position information of the feature point in the initial feature point pair.

9. The method according to claim 8, wherein: The step of determining the target feature point pair from the initial feature point pair according to the position information of the feature point in the initial feature point pair comprises: Determining distance information corresponding to the initial feature point pair according to position information of the feature point in the initial feature point pair; The target feature point pair is determined from the initial feature point pair according to the distance information corresponding to the initial feature point pair.

10. The method according to claim 9, further comprising: If the number of target feature point pairs in the adjacent image frames is equal to or less than a preset number threshold, it is determined whether the camera moves according to the number of initial feature point pairs and distance information corresponding to the initial feature point pairs.

11. The method according to claim 1, wherein: The determining of feature points of the image frames in the adjacent image frames comprises: According to a preset image size, scaling is performed on each of the adjacent image frames to obtain scaled adjacent image frames; Performing grayscale processing on the adjacent image frames after the scaling process to obtain adjacent grayscale image frames corresponding to the adjacent image frames after the scaling process; Determine feature points of image frames in the adjacent grayscale image frames.

12. A camera motion detection device, comprising: An acquisition unit, used to acquire adjacent image frames captured by the camera, and determine feature points of image frames in the adjacent image frames; wherein the feature points are feature points in the image frames that characterize external features of the object, and the feature points have position information; A determination unit, configured to determine a target feature point pair according to feature points of each image frame in the adjacent image frames; wherein the target feature point pair represents a pair of feature points having the same external features in a previous image frame and a subsequent image frame in the adjacent image frames; The detection unit is used to determine whether the camera moves according to the number of the target feature point pairs and the position information of the feature points in the target feature point pairs.

13. The device according to claim 12, wherein: The detection unit comprises: A distance determination module, used to determine the distance information corresponding to the target feature point pair according to the position information of the feature points in the target feature point pair; wherein the distance information represents the coordinate distance between the two feature points in the feature point pair; The motion detection module is used to determine whether the camera moves according to the number of the target feature point pairs and the distance information corresponding to the target feature point pairs.

14. The device according to claim 13, wherein: The mobile detection module comprises: A screening submodule, configured to screen the target feature point pairs according to the distance information corresponding to the target feature point pairs to obtain a first subset and a second subset; wherein the first subset includes at least one pair of target feature point pairs, and the second subset includes at least one pair of target feature point pairs; and the distance information of the target feature point pairs in the first subset is different from the distance information of the target feature point pairs in the second subset; The detection submodule is used to determine whether the camera moves according to the number of target feature point pairs in the adjacent image frames, the number of target feature point pairs in the first subset, and the number of target feature point pairs in the second subset.

15. The device according to claim 14, wherein: The distance information includes a horizontal distance and a vertical distance; the screening submodule is specifically used for: If the lateral distance corresponding to the target feature point pair is greater than a preset first distance threshold, the target feature point pair is filtered into the first subset; If the longitudinal distance corresponding to the target feature point pair is greater than a preset second distance threshold, the target feature point pair is filtered into the second subset.

16. The device according to claim 15, wherein: The detection submodule is specifically used for: If the number of target feature point pairs in the adjacent image frames is greater than a preset number threshold, a first ratio is determined according to the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the first subset, and a second ratio is determined according to the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the second subset; wherein the first ratio represents the ratio between the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the first subset, and the second ratio represents the ratio between the number of target feature point pairs in the adjacent image frames and the number of target feature point pairs in the second subset; Whether the camera moves is determined according to the first ratio and the second ratio.

17. The device according to claim 16, wherein: The detection submodule is specifically used for: If the first ratio is greater than a preset first ratio threshold, and the second ratio is greater than a preset second ratio threshold, it is determined that the camera has moved.

18. The apparatus according to claim 17, further comprising: The first judgment unit is used to determine that the camera has moved if the number of target feature point pairs in the adjacent image frames is equal to or less than a preset number threshold.

19. The device according to any one of claims 12 to 18, wherein: The determining unit comprises: An initial matching module, used to match the feature points in the previous image frame and the feature points in the next image frame in the adjacent image frames according to a preset feature point matching algorithm to obtain an initial feature point pair; wherein the preset feature point matching algorithm is used to match feature points representing the same external features, and the initial feature point pair represents a pair of matched feature points in the previous image frame and the next image frame in the adjacent image frames; The target determination module is used to determine the target feature point pair from the initial feature point pair according to the position information of the feature points in the initial feature point pair.

20. The device according to claim 19, wherein The target determination module comprises: A first determination submodule, configured to determine distance information corresponding to the initial feature point pair according to position information of feature points in the initial feature point pair; The second determination submodule is used to determine the target feature point pair from the initial feature point pair according to the distance information corresponding to the initial feature point pair.

21. The apparatus according to claim 20, further comprising: The second judgment unit is used to determine whether the camera moves according to the number of initial feature point pairs and the distance information corresponding to the initial feature point pairs if the number of target feature point pairs in the adjacent image frames is equal to or less than a preset number threshold.

22. The device according to claim 12, wherein: The acquisition unit comprises: An image scaling module, used for scaling each of the adjacent image frames according to a preset image size to obtain adjacent image frames after scaling; A grayscale processing module, used for performing grayscale processing on the adjacent image frames after the scaling processing to obtain adjacent grayscale image frames corresponding to the adjacent image frames after the scaling processing; The feature point determination module is used to determine the feature points of the image frames in the adjacent grayscale image frames.

23. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.

24. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-11.

25. A computer program product, wherein: The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 11 when being executed by a processor.