Lens movement detection method and device, equipment and medium

Through automated image feature matching technology, screening and matching processes, the problem that lens movement detection in the camera monitoring area depends on human observation is solved, and timely and accurate detection of lens movement is achieved, saving labor costs and improving detection accuracy.

CN119094740APending Publication Date: 2024-12-06SUZHOU WANDIANZHANG NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411268995.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the prior art, lens movement detection in the camera monitoring area relies on human observation, resulting in high cost and difficult to guarantee the accuracy, and the lens movement cannot be detected in a timely and accurate manner.

Method used

By obtaining the initial image, filtering out the dynamic areas, selecting the areas to be matched in the standard image, performing area feature matching and overall image feature matching, determining whether the lens is moving, using fast feature point extraction and description algorithm, brute force matching algorithm, and homography Matrix and other technologies realize automated detection.

Benefits of technology

It realizes timely and accurate detection of lens movement, saves labor costs, improves detection accuracy, and avoids mistakes in manual judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094740A_ABST
    Figure CN119094740A_ABST
Patent Text Reader

Abstract

The invention discloses a lens movement detection method and device, equipment and a medium, and relates to the technical field of security and protection, and the method comprises the steps: obtaining a plurality of initial images corresponding to a target scene, and screening out a dynamic region based on the initial images; the initial image is an image collected in a non-moving state of a lens; selecting a standard image meeting a to-be-matched requirement from the initial image, and determining a plurality of to-be-matched areas from areas except the dynamic area in the standard image; obtaining a current image of the target scene, and performing region feature matching on the current image and a corresponding to-be-matched region in the standard image; if the target proportion of the number of the matched areas does not exceed the preset proportion, performing overall image feature matching on the current image and the standard image; and if the matching degree of the overall image features is smaller than a preset degree, determining that the lens moves. According to the invention, the lens movement can be timely and accurately detected through two times of feature matching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of security technology, and in particular to a lens movement detection method, device, equipment and medium. Background Art

[0002] With the development and progress of video analysis and artificial intelligence technology, more and more events can be detected and identified in real time through video surveillance. Furthermore, with the increase in the chain rate of the retail and catering industries, store management has gradually shifted from offline store inspections to online store inspections. Among them, the customer flow in the store and food hygiene are the focus of the operator. If there is abnormal movement in the area monitored by the camera, the detection effect of the relevant area will basically fail.

[0003] Currently, the more common way to detect lens movement is to use human labor to regularly observe whether the image scene changes. This method requires a lot of manpower costs and lacks standards, so the effect is difficult to guarantee.

[0004] In summary, how to detect lens movement in a timely and accurate manner is a problem that needs to be solved urgently. Summary of the invention

[0005] In view of this, the object of the present invention is to provide a lens movement detection method, device, equipment and medium, which can detect lens movement in a timely and accurate manner. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a lens movement detection method, comprising:

[0007] Acquire several initial images corresponding to the target scene, and filter out the dynamic area based on the initial images; the initial images are images captured when the lens is not moving;

[0008] Selecting a standard image that meets the requirements for matching from the initial image, and determining a plurality of areas to be matched from areas outside the dynamic area in the standard image;

[0009] Acquire a current image of the target scene, and perform regional feature matching between the current image and the corresponding to-be-matched area in the standard image;

[0010] If the target ratio of the number of matched areas does not exceed the preset ratio, performing overall image feature matching between the current image and the standard image;

[0011] If the matching degree of the overall image features is less than a preset degree, the lens movement is determined.

[0012] Optionally, screening out a dynamic area based on the initial image includes:

[0013] Compare the adjacent initial images in sequence, and determine the position coordinates of the image changes during each comparison;

[0014] Counting the number of target changes corresponding to each position coordinate, and determining the target position coordinates whose target number is greater than a preset number;

[0015] The area contour of the target position coordinates is extracted based on a contour extraction method to screen out the dynamic area.

[0016] Optionally, before performing regional feature matching between the current image and the corresponding to-be-matched region in the standard image, the method further includes:

[0017] The to-be-matched area in the current image that does not meet the preset image quality requirement is removed; wherein the preset image quality requirement includes that the scene corresponding to the to-be-matched area is not a dark scene and / or an occluded scene.

[0018] Optionally, removing the to-be-matched area in the current image that does not meet a preset image quality requirement includes:

[0019] Calculate the average brightness of each of the to-be-matched areas in the current image;

[0020] Extracting edge contour features of each of the to-be-matched regions using a Laplace operator, and calculating feature standard deviations based on the edge contour features;

[0021] The to-be-matched area in the current image whose average brightness is not greater than a preset brightness and / or whose characteristic standard deviation is greater than a first preset threshold is removed.

[0022] Optionally, performing regional feature matching between the current image and the corresponding to-be-matched region in the standard image includes:

[0023] Extracting current feature points of the to-be-matched area in the current image and standard feature points of the to-be-matched area in the standard image using a fast feature point extraction and description algorithm;

[0024] Using a brute force matching algorithm to match the current feature points and the standard feature points corresponding to the corresponding area to be matched, and determining the target number of the current feature points in each area to be matched that successfully matches the corresponding standard feature points;

[0025] If the number of targets is greater than a preset number, the feature matching of the to-be-matched region is successful, and the target ratio of the successfully matched to-be-matched region in all the to-be-matched regions in the current image is determined.

[0026] Optionally, performing overall image feature matching between the current image and the standard image includes:

[0027] Extracting current global feature points in the current image and standard global feature points in the standard image;

[0028] Matching the corresponding current global feature points with the standard global feature points, and determining the target number of the current global feature points that are successfully matched;

[0029] Correspondingly, if the matching degree of the overall image features does not exceed a preset degree, determining the lens movement includes:

[0030] If the number of targets is less than a second preset threshold, it is determined that the lens is moved.

[0031] Optionally, after matching the corresponding current global feature points with the standard global feature points and determining the target number of the current global feature points that are successfully matched, the method further includes:

[0032] If the number of targets is not less than a second preset threshold, removing the feature points in the current global feature points and the standard global feature points located in the dynamic area to obtain new current global feature points and new standard global feature points;

[0033] It is determined whether the lens moves and / or rotates by using the homography matrix and based on the new current global feature points and the new standard global feature points.

[0034] In a second aspect, the present application discloses a lens movement detection device, comprising:

[0035] A screening module is used to obtain a number of initial images corresponding to the target scene, and screen out the dynamic area based on the initial images; the initial images are images collected when the lens is not moving;

[0036] A selection module, used to select a standard image that meets the requirements to be matched from the initial image, and determine a number of areas to be matched from areas outside the dynamic area in the standard image;

[0037] A first matching module, used for acquiring a current image of the target scene, and performing regional feature matching between the current image and the corresponding to-be-matched area in the standard image;

[0038] A second matching module, configured to perform overall image feature matching between the current image and the standard image if the target proportion of the number of matched areas is less than a preset proportion;

[0039] The judgment module is used to determine the lens movement if the matching degree of the overall image features is less than a preset degree.

[0040] In a third aspect, the present application discloses an electronic device, comprising:

[0041] Memory, used to store computer programs;

[0042] The processor is used to execute the computer program to implement the lens movement detection method disclosed above.

[0043] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the lens movement detection method disclosed above is implemented.

[0044] It can be seen that the present application obtains several initial images corresponding to the target scene, and screens out the dynamic area based on the initial image; the initial image is an image when the lens is not moving; a standard image that meets the requirements to be matched is selected from the initial image, and several areas to be matched are determined from the area outside the dynamic area in the standard image; the current image of the target scene is obtained, and regional feature matching is performed on the current image and the corresponding area to be matched in the standard image; if the target proportion of the number of matched areas does not exceed the preset proportion, the current image and the standard image are matched with the overall image features; if the matching degree is less than the preset degree, the lens movement is determined. It can be seen that the present application determines whether the lens moves according to the feature matching method, and does not need human observation and judgment, which saves manpower and is conducive to improving detection accuracy; the present application determines whether the lens moves by two feature matchings, namely regional feature matching and overall image feature matching, which further avoids misjudgment and improves detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0046] Figure 1 This is a flow chart of a lens movement detection method disclosed in this application;

[0047] Figure 2 A schematic diagram of region cropping disclosed in this application;

[0048] Figure 3 A flowchart of a specific lens movement detection method disclosed in this application;

[0049] Figure 4This is a structural schematic diagram of a lens movement detection device disclosed in this application;

[0050] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] Currently, the more common way to detect lens movement is to use human labor to regularly observe whether the image scene changes. This method requires a lot of manpower costs and lacks standards, so the effect is difficult to guarantee.

[0053] To this end, an embodiment of the present application proposes a lens movement detection solution to detect lens movement in a timely and accurate manner.

[0054] The present application embodiment discloses a lens movement detection method, see Figure 1 As shown, the method includes:

[0055] Step S11: obtaining a number of initial images corresponding to the target scene, and filtering out the dynamic area based on the initial images; the initial images are images captured when the lens is not moving.

[0056] In this embodiment, the resolution of the initial image is generally 720p to 1080p; a frame of the initial image may be extracted every 25 seconds.

[0057] In this embodiment, the dynamic area changes greatly, which will affect the monitoring of lens movement, causing movement to be detected when there is no movement, so the dynamic area needs to be removed; specifically, the dynamic area is screened out based on the initial image, including: comparing the adjacent initial images in sequence, and determining the position coordinates of the image changes each time the comparison is made; counting the number of target changes corresponding to each position coordinate, and determining the target position coordinates whose target number is greater than a preset number; extracting the area contour of the target position coordinates based on the contour extraction method to screen out the dynamic area.

[0058] It should be noted that the process of obtaining a number of initial images corresponding to the target scene and screening out the dynamic area based on the initial images can be performed once every preset time to ensure that changes in the dynamic area are discovered in time.

[0059] In a specific embodiment, moving objects such as pedestrians or traffic moving under the lens are easily confused and judged as lens offset, so they need to be filtered in advance. Create a moving frame MVModel, compare frames MVModel0 and MVModel1, and initialize MVModel0 and MVModel1 to all-zero matrices. Update the moving frame frame by frame starting from the first frame, that is, assign MVModel1 to MVModel0, and then assign the data of the current frame to MVModel1. Traverse all pixels pix[i][j] of MVModel1 and compare them with MVModel0, filter out the coordinates of the moving point (x, y) and add 1 to the corresponding position count of MVModel. Count the images of 60 frames in the first 60s, retain the points with a moving frame count of more than 20, and set the remaining points to zero. Use the contour extraction method to frame non-zero points and count them as dynamic areas without subsequent moving frame judgment. Dynamic scene filtering is initialized and updated once every hour.

[0060] Step S12: selecting a standard image that meets the requirements for matching from the initial image, and determining a number of areas to be matched from areas outside the dynamic area in the standard image.

[0061] In this embodiment, the standard image is the basis for judging the movement of the lens, and is manually configured by the user, and a picture is captured when the lens moves down to a point where there are fewer objects, and is used as the standard image.

[0062] In this embodiment, see Figure 2 The figure shows a schematic diagram of region cropping. The detection region is demarcated by cropping 9 regions according to different resolutions, that is, 9 200*200pix regions are selected in each area of ​​the image for sampling and cropping. The purpose of detection region screening is to reduce the amount of calculation. If the detection region overlaps with the dynamic region, the detection region is skipped. The cropping region coordinates are:

[0063] (0,100) (w / 2-100,100) (w-200,100)

[0064] (0,h / 2-100) (w / 2-100,h / 2-100) (w-200,h / 2-100)

[0065] (0,h-200) (w / 2-100,h-200) (w-200,h-200)

[0066] Since (w / 2-100, h / 2-100) in the figure is located in the dynamic area (the largest box in the door area among the 10 boxes in the figure is the dynamic area, and the dynamic area includes the small box (w / 2-100, h / 2-100)), it is removed, leaving 8 areas to be matched (h is height and w is width).

[0067] Step S13: acquiring a current image of the target scene, and performing regional feature matching between the current image and the corresponding to-be-matched area in the standard image.

[0068] In this embodiment, the regional feature matching of the current image and the corresponding area to be matched in the standard image includes: using a fast feature point extraction and description algorithm to extract the current feature points of the area to be matched in the current image and the standard feature points of the area to be matched in the standard image; using a brute force matching algorithm to match the current feature points and the standard feature points corresponding to the corresponding area to be matched, and determining the target number of the current feature points in each area to be matched that successfully matches the corresponding standard feature points; if the target number is greater than a preset number, the feature matching of the area to be matched is successful, and the target proportion of the successfully matched area to be matched in all the areas to be matched in the current image is determined.

[0069] It should be pointed out that the fast feature point extraction and description algorithm (ORB algorithm, Oriented FAST and Rotated BRIEF) is a combination and improvement of the Fast feature detection algorithm and the Brief feature description algorithm. The feature matching effect is ideal, and it has relatively stable rotation invariance, illumination invariance, noise invariance and fast operation speed. The implementation method of the ORB algorithm to detect feature points is: for any pixel point in the image, select 4 pixels 3 pixels away from it in the x and y axis directions. If the difference between the grayscale value of 2 consecutive pixels and the point exceeds the threshold, the point is judged to be a corner point. After finding the feature point, it is necessary to establish a binary descriptor to describe its attributes. The implementation method is: randomly select a pair of pixel points around the key point, the first pixel point is a random point in the neighborhood of r from the feature point, and the second pixel point is a random point in the neighborhood of r from the first pixel point. If the value of the first point is greater than the second point, the value is assigned to 1, otherwise the value is assigned to 0. Repeat this process 256 times for each key point. The ORB algorithm also constructs an image pyramid based on the input image. Each layer of the pyramid is downsampled by 1 / 2 to achieve scale invariance in image matching.

[0070] It should be pointed out that the Brute Force Matcher (BFmatcher) algorithm matches feature points. BFmatcher calculates the distance between a single feature point of the matching graph and all feature points of the matched graph, then sorts the calculated distances and selects the point with the closest distance as the matching point. The BFmatcher method also has some incorrect matches, and the results need to be further screened. The screening method is to count the Hamming distances of all matching points, select twice the minimum Hamming distance as the threshold, and traverse all matching points again. Points with Hamming distances less than the threshold are selected as the screened matching points, otherwise they are deleted.

[0071] It should be noted that the target number can be specifically set according to actual conditions. In a specific embodiment, the matching area where the number of matching feature points between the standard image and the captured image is greater than 20 is retained, otherwise it is deleted.

[0072] Step S14: If the target proportion of the number of matching areas does not exceed the preset proportion, the current image and the standard image are matched with each other in terms of overall image features.

[0073] In this embodiment, the preset proportion can be specifically set according to actual conditions. In a specific embodiment, if the proportion of the reserved area exceeds 30% of the sampling area (target proportion), it is judged that the lens has not moved. Otherwise, it is judged to be suspected of movement, and a global comparison is required later.

[0074] Step S15: If the matching degree of the overall image features is less than a preset degree, the lens movement is determined.

[0075] In this embodiment, the overall image feature matching of the current image and the standard image includes: extracting current global feature points in the current image and standard global feature points in the standard image; matching the corresponding current global feature points with the standard global feature points, and determining the target number of the current global feature points that are successfully matched; accordingly, if the matching degree of the overall image features is less than a preset degree, determining the lens movement includes: if the target number is less than a second preset threshold, determining the lens movement.

[0076] It should be noted that the target number is set according to actual conditions and will not be specifically set here.

[0077] In this embodiment, after matching the corresponding current global feature points with the standard global feature points and determining the target number of the successfully matched current global feature points, the method further includes: if the target number is not less than a second preset threshold, removing the feature points in the current global feature points and the standard global feature points that are located in the dynamic area to obtain new current global feature points and new standard global feature points; and using a homography matrix and based on the new current global feature points and the new standard global feature points, determining whether the lens moves and / or rotates.

[0078] It is important to point out that the homography matrix is ​​as follows:

[0079] ;

[0080] Among them, the s vector (including , , , ) controls the scaling and rotation of the stitched image, a vector (including , ) controls the position of the stitched image translation, ( , ) is the standard global feature point, ( , ) is the current global feature point.

[0081] 1. There is no matching area, which means that the lens moves over a large range and cannot find the corresponding feature points;

[0082] 2. When the a vector is greater than 0, it is judged that the camera has moved slightly. The basis is that matching points can still be found in the same matching area;

[0083] 3. When the s vector is greater than 0, it is judged that the camera has a slight rotation. The basis is that the same matching area can still find a match.

[0084] In addition, users can also set the thresholds for lens movement and rotation according to their needs.

[0085] In summary, this application mainly realizes the use of image processing algorithms to solve the common lens offset detection problems in the retail industry, replacing the current situation of difficult and inefficient manual judgment, greatly improving the real-time performance of lens offset judgment, and saving labor costs; this application proposes lens movement detection based on feature point comparison, adds functions such as moving area filtering, secondary matching of feature points, and configurable moving parameters (rotation and translation range), to improve the accuracy of lens movement monitoring.

[0086] It can be seen that the present application obtains several initial images corresponding to the target scene, and screens out the dynamic area based on the initial image; the initial image is an image when the lens is not moving; a standard image that meets the requirements to be matched is selected from the initial image, and several areas to be matched are determined from the area outside the dynamic area in the standard image; the current image of the target scene is obtained, and regional feature matching is performed on the current image and the corresponding area to be matched in the standard image; if the target proportion of the number of matched areas does not exceed the preset proportion, the current image and the standard image are matched with the overall image features; if the matching degree is less than the preset degree, the lens movement is determined. It can be seen that the present application determines whether the lens moves according to the feature matching method, and does not need human observation and judgment, which saves manpower and is conducive to improving detection accuracy; the present application determines whether the lens moves by two feature matchings, namely regional feature matching and overall image feature matching, which further avoids misjudgment and improves detection accuracy.

[0087] The embodiment of the present application discloses a specific lens movement detection method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Figure 3 As shown, specifically including:

[0088] Step S21: obtaining a plurality of initial images corresponding to the target scene, and filtering out the dynamic area based on the initial images; the initial images are images captured when the lens is not moving.

[0089] Step S22: selecting a standard image that meets the requirements for matching from the initial image, and determining a number of areas to be matched from areas outside the dynamic area in the standard image.

[0090] Step S23: removing the to-be-matched area in the current image that does not meet the preset image quality requirement; wherein the preset image quality requirement includes that the scene corresponding to the to-be-matched area is not a dark scene and / or an occluded scene.

[0091] In this embodiment, removing the to-be-matched areas in the current image that do not meet the preset image quality requirements includes: calculating the average brightness of each to-be-matched area in the current image; extracting edge contour features of each to-be-matched area using a Laplace operator, and calculating a feature standard deviation based on the edge contour features; removing the to-be-matched areas in the current image whose average brightness is not greater than a preset brightness and / or whose feature standard deviation is greater than a first preset threshold.

[0092] It should be noted that the area where the average brightness is not greater than the preset brightness is a dark area and / or the area where the characteristic standard deviation is greater than the first preset threshold is an occlusion area. The dark area and the occlusion area increase the probability of detection as lens movement and reduce the detection accuracy.

[0093] Step S24: acquiring a current image of the target scene, and performing regional feature matching between the current image and the corresponding to-be-matched area in the standard image.

[0094] Step S25: if the target proportion of the number of matching areas does not exceed the preset proportion, performing overall image feature matching between the current image and the standard image;

[0095] Step S26: If the matching degree of the overall image features is less than a preset degree, the lens movement is determined.

[0096] It can be seen that the present application obtains several initial images corresponding to the target scene, and screens out the dynamic area based on the initial image; the initial image is an image captured when the lens is not moving; a standard image that meets the requirements to be matched is selected from the initial image, and several areas to be matched are determined from the area outside the dynamic area in the standard image; the areas to be matched in the current image that do not meet the preset image quality requirements are removed; wherein the preset image quality requirements include that the scene corresponding to the area to be matched is not a dark scene and / or an occluded scene; the current image of the target scene is obtained, and the current image is matched with the corresponding area to be matched in the standard image for regional features; if the target proportion of the number of matched areas does not exceed the preset proportion, the current image is matched with the standard image for overall image features; if the matching degree of the overall image features is less than the preset degree, the lens movement is determined. It can be seen that the present application removes the areas to be matched that do not meet the preset image quality requirements, avoids a significant reduction in the matching degree, causes matching errors, improves matching accuracy, and further improves the accuracy of lens movement monitoring.

[0097] Correspondingly, the embodiment of the present application also discloses a lens movement detection device, see Figure 4 As shown, the device comprises:

[0098] A screening module 11 is used to obtain a number of initial images corresponding to the target scene, and screen out the dynamic area based on the initial images; the initial images are images collected when the lens is not moving;

[0099] A selection module 12 is used to select a standard image that meets the requirements to be matched from the initial image, and determine a plurality of areas to be matched from areas outside the dynamic area in the standard image;

[0100] A first matching module 13 is used to obtain a current image of the target scene and perform regional feature matching between the current image and the corresponding to-be-matched area in the standard image;

[0101] A second matching module 14 is configured to perform overall image feature matching between the current image and the standard image if the target proportion of the number of matching regions is less than a preset proportion;

[0102] The judgment module 15 is used to determine the lens movement if the matching degree of the overall image features is less than a preset degree.

[0103] Among them, the more specific working process of each of the above modules can refer to the corresponding content disclosed in the above embodiments, which will not be repeated here.

[0104] It can be seen that the present application obtains several initial images corresponding to the target scene, and screens out the dynamic area based on the initial image; the initial image is an image when the lens is not moving; a standard image that meets the requirements to be matched is selected from the initial image, and several areas to be matched are determined from the area outside the dynamic area in the standard image; the current image of the target scene is obtained, and regional feature matching is performed on the current image and the corresponding area to be matched in the standard image; if the target proportion of the number of matched areas does not exceed the preset proportion, the current image and the standard image are matched with the overall image features; if the matching degree is less than the preset degree, the lens movement is determined. It can be seen that the present application determines whether the lens moves according to the feature matching method, and does not need human observation and judgment, which saves manpower and is conducive to improving detection accuracy; the present application determines whether the lens moves by two feature matchings, namely regional feature matching and overall image feature matching, which further avoids misjudgment and improves detection accuracy.

[0105] Furthermore, an embodiment of the present application also provides an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0106] Figure 5 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a display screen 23, an input / output interface 24, a communication interface 25, a power supply 26, and a communication bus 27. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the lens movement detection method disclosed in any of the above embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0107] In this embodiment, the power supply 26 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 24 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0108] In addition, the memory 22, as a carrier for storing resources, may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include a computer program 221, and the storage method may be temporary storage or permanent storage. In addition to including a computer program that can be used to complete the lens movement detection method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 221 may further include a computer program that can be used to complete other specific tasks.

[0109] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the lens movement detection method disclosed above is implemented.

[0110] The specific steps of the method can refer to the corresponding contents disclosed in the above embodiments, which will not be repeated here.

[0111] The various embodiments in this application are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0112] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0113] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0114] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0115] The above is a detailed introduction to a lens movement detection method, device, equipment, and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for a person skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A lens movement detection method, It is characterized in that include: Acquire a plurality of initial images corresponding to the target scene, and filter out dynamic areas based on the initial images; The initial image is an image captured when the lens is not moving; Selecting a standard image that meets the requirements for matching from the initial image, and determining a plurality of areas to be matched from areas outside the dynamic area in the standard image; Acquire a current image of the target scene, and perform regional feature matching between the current image and the corresponding to-be-matched area in the standard image; If the target ratio of the number of matched areas does not exceed the preset ratio, performing overall image feature matching between the current image and the standard image; If the matching degree of the overall image features is less than a preset degree, the lens movement is determined.

2. The lens movement detection method according to claim 1, It is characterized in that The step of screening out a dynamic area based on the initial image comprises: Compare the adjacent initial images in sequence, and determine the position coordinates of the image changes during each comparison; Counting the number of target changes corresponding to each position coordinate, and determining the target position coordinates whose target number is greater than a preset number; The area contour of the target position coordinates is extracted based on a contour extraction method to screen out the dynamic area.

3. The lens movement detection method according to claim 1, It is characterized in that Before performing regional feature matching between the current image and the corresponding to-be-matched area in the standard image, the method further includes: The to-be-matched area in the current image that does not meet the preset image quality requirement is removed; wherein the preset image quality requirement includes that the scene corresponding to the to-be-matched area is not a dark scene and / or an occluded scene.

4. The lens movement detection method according to claim 3, It is characterized in that The removing the to-be-matched area in the current image that does not meet the preset image quality requirement includes: Calculate the average brightness of each of the to-be-matched areas in the current image; Extracting edge contour features of each of the to-be-matched regions using a Laplace operator, and calculating feature standard deviations based on the edge contour features; The to-be-matched area in the current image whose average brightness is not greater than a preset brightness and / or whose characteristic standard deviation is greater than a first preset threshold is removed.

5. The lens movement detection method according to claim 1, It is characterized in that The performing regional feature matching between the current image and the corresponding to-be-matched area in the standard image includes: Extracting current feature points of the to-be-matched area in the current image and standard feature points of the to-be-matched area in the standard image using a fast feature point extraction and description algorithm; Using a brute force matching algorithm to match the current feature points and the standard feature points corresponding to the corresponding area to be matched, and determining the target number of the current feature points in each area to be matched that successfully matches the corresponding standard feature points; If the number of targets is greater than a preset number, the feature matching of the to-be-matched region is successful, and the target ratio of the successfully matched to-be-matched region in all the to-be-matched regions in the current image is determined.

6. The lens movement detection method according to any one of claims 1 to 5, It is characterized in that The performing overall image feature matching between the current image and the standard image comprises: Extracting current global feature points in the current image and standard global feature points in the standard image; Matching the corresponding current global feature points with the standard global feature points, and determining the target number of the current global feature points that are successfully matched; Correspondingly, if the matching degree of the overall image features is less than a preset degree, determining the lens movement includes: If the number of targets is less than a second preset threshold, it is determined that the lens is moved.

7. The lens movement detection method according to claim 6, It is characterized in that After matching the corresponding current global feature points with the standard global feature points and determining the target number of the current global feature points that are successfully matched, the method further includes: If the number of targets is not less than a second preset threshold, removing the feature points in the current global feature points and the standard global feature points located in the dynamic area to obtain new current global feature points and new standard global feature points; It is determined whether the lens moves and / or rotates by using the homography matrix and based on the new current global feature points and the new standard global feature points.

8. A lens movement detection device, It is characterized in that include: A screening module, used to obtain a number of initial images corresponding to the target scene, and screen out dynamic areas based on the initial images; The initial image is an image captured when the lens is not moving; A selection module, used to select a standard image that meets the requirements to be matched from the initial image, and determine a number of areas to be matched from areas outside the dynamic area in the standard image; A first matching module, used for acquiring a current image of the target scene, and performing regional feature matching between the current image and the corresponding to-be-matched area in the standard image; A second matching module, configured to perform overall image feature matching between the current image and the standard image if the target ratio of the number of matched areas does not exceed a preset ratio; The judgment module is used to determine the lens movement if the matching degree of the overall image features is less than a preset degree.

9. An electronic device, It is characterized in that include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the lens movement detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that Used to store a computer program; wherein, when the computer program is executed by a processor, the lens movement detection method according to any one of claims 1 to 7 is implemented.