Camera displacement identification method and computer equipment

By obtaining and optimizing matching point pairs of camera images, combined with similarity analysis, the problem of low accuracy of traditional camera displacement detection is solved, more efficient displacement recognition is achieved, and the monitoring effect is improved.

CN118735994AActive Publication Date: 2024-10-01E SURFING VISION TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411225441.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-10-01
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

Traditional camera displacement detection methods have poor accuracy and rely on manual inspections or regular maintenance, which affects the monitoring effect in medical insurance stores.

Method used

By obtaining the matching point pairs between the image to be detected and the reference image, image optimization processing is performed to determine the similarity, determine whether the camera has been displaced, and use comprehensive analysis of the number and similarity of matching point pairs to improve recognition accuracy.

Benefits of technology

It effectively improves the accuracy of camera displacement recognition, reduces the amount of calculation, avoids the problem of inaccurate recognition results due to insufficient matching point extraction, and improves the monitoring effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735994A_ABST
    Figure CN118735994A_ABST
Patent Text Reader

Abstract

The invention relates to a camera displacement identification method and computer equipment. The method comprises the following steps: acquiring a plurality of first matching point pairs corresponding to a to-be-detected image and a reference image; under the condition that the number of the first matching point pairs is smaller than a preset number threshold value, performing image optimization processing on the to-be-detected image to obtain a target detection image; determining a plurality of second matching point pairs corresponding to the target detection image and the reference image; if the number of the second matching point pairs is greater than or equal to a preset number threshold, determining a first similarity between the target detection image and the reference image according to the plurality of second matching point pairs; determining whether the camera has displacement according to the first similarity; the problem of inaccurate identification result caused by insufficient extraction of matching point pairs can be avoided through image optimization processing; and meanwhile, the problem of low identification accuracy caused by judging whether the camera is displaced or not by purely depending on the number of the matching point pairs can be avoided, and the accuracy of camera displacement identification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of displacement recognition technology, and in particular to a camera displacement recognition method and computer equipment. Background Art

[0002] In the retail pharmaceutical industry, such as medical insurance stores, the monitoring role of cameras is crucial. They are not only used for daily security monitoring, but also undertake important tasks to ensure the compliance of medical insurance policy implementation, such as monitoring the drug sales process, preventing the theft or abuse of drugs, etc. However, the environment in medical insurance stores is complex, and cameras may shift due to various reasons (such as human movement, accidental collision, equipment aging, etc.), resulting in monitoring blind spots or monitoring screen offset, which in turn affects the monitoring effect.

[0003] However, traditional camera displacement detection methods often rely on manual inspections or regular maintenance, and suffer from the problem of poor accuracy in camera displacement recognition. Summary of the invention

[0004] Based on this, it is necessary to provide a camera displacement recognition method and computer equipment that can improve the accuracy of camera displacement recognition in response to the above technical problems.

[0005] In a first aspect, the present application provides a camera displacement recognition method, the method comprising: Acquire a plurality of first matching point pairs corresponding to the image to be detected and the reference image; When the number of the first matching point pairs is less than a preset number threshold, performing image optimization processing on the image to be detected to obtain a target detection image; Determine a plurality of second matching point pairs corresponding to the target detection image and the reference image; If the number of the second matching point pairs is greater than or equal to the preset number threshold, determining a first similarity between the target detection image and the reference image based on a plurality of the second matching point pairs; It is determined whether the camera is displaced according to the first similarity.

[0006] In one embodiment, performing image optimization processing on the image to be detected to obtain the target detection image includes: Determine the image difference between the image to be detected and the reference image; the image difference includes brightness difference and sharpness difference; If the image difference is greater than a preset difference threshold, image optimization processing is performed on the image to be detected according to the image difference to obtain a target detection image.

[0007] In one embodiment, the determining the image difference between the image to be detected and the reference image includes: For each first matching point pair among the plurality of first matching point pairs, determining a first extended subgraph and a second extended subgraph corresponding to the first matching point pair; Determine a sub-graph difference value according to a first extended sub-graph and a second extended sub-graph corresponding to a plurality of the first matching point pairs; The sub-image difference value is used as the image difference between the image to be detected and the reference image.

[0008] In one embodiment, the first matching point pair includes a first reference matching point and a matching point to be detected; and determining the first extended subgraph and the second extended subgraph corresponding to the first matching point pair includes: Determine a first coordinate corresponding to the first reference matching point and a second coordinate corresponding to the matching point to be detected; Determine, according to the first coordinates and the reference image, a first extended sub-image corresponding to the reference matching point according to a preset extension rule; According to the second coordinates and the image to be detected, a second extended sub-image corresponding to the matching point to be detected is determined according to a preset extension rule.

[0009] In one embodiment, the second matching point pairs include second reference matching points and target detection matching points, and determining the first similarity between the target detection image and the reference image based on the plurality of second matching point pairs includes: For each second matching point pair in the plurality of second matching point pairs, determine a third coordinate corresponding to the second reference matching point in the second matching point pair and a fourth coordinate corresponding to the target detection matching point; A first similarity between the target detection image and the reference image is determined according to third coordinates corresponding to the plurality of second reference matching points and fourth coordinates corresponding to the plurality of target detection matching points.

[0010] In one embodiment, determining whether the camera is displaced according to the first similarity includes: If the first similarity is less than or equal to a preset similarity threshold, the number of displacement warnings is restored to an initial value, and it is determined that the camera has not been displaced; If the first similarity is greater than a preset similarity threshold, the number of displacement warnings is updated according to a preset step length; If the updated displacement warning number reaches the preset warning number, it is determined that the camera has been displaced.

[0011] In one embodiment, the method further comprises: When the number of the first matching point pairs is greater than or equal to a preset number threshold, determining a second similarity between the image to be detected and the reference image according to the plurality of first matching point pairs; If the second similarity is less than or equal to a preset similarity threshold, the number of displacement warnings is restored to an initial value, and it is determined that the camera has not been displaced; If the second similarity is greater than a preset similarity threshold, the displacement warning times are updated according to a preset step length; If the updated displacement warning number reaches the preset warning number, it is determined that the camera has been displaced.

[0012] In one embodiment, after determining that the camera has not moved, the method further includes: The image to be detected or the target detection image is updated as the reference image.

[0013] In one embodiment, the method further comprises: When the number of the first matching point pairs is less than a preset number threshold, performing image optimization processing on the image to be detected and the reference image respectively according to a preset optimization standard to obtain a target detection image and an optimized reference image; The determining a plurality of second matching point pairs corresponding to the target detection image and the reference image comprises: Determine a plurality of second matching point pairs corresponding to the target detection image and the optimized reference image.

[0014] In a second aspect, the present application provides a camera displacement recognition device, the device comprising: An acquisition module, used to acquire a plurality of first matching point pairs corresponding to the image to be detected and the reference image; An optimization module, configured to perform image optimization processing on the image to be detected to obtain a target detection image when the number of the first matching point pairs is less than a preset number threshold; A matching point pair determination module, used to determine a plurality of second matching point pairs corresponding to the target detection image and the reference image; a similarity determination module, configured to determine a first similarity between the target detection image and the reference image based on a plurality of the second matching point pairs if the number of the second matching point pairs is greater than or equal to the preset number threshold; The displacement recognition module is used to determine whether the camera is displaced according to the first similarity.

[0015] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in any one of the embodiments of the first aspect are implemented.

[0016] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in any one of the embodiments of the first aspect above are implemented.

[0017] In a fifth aspect, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method described in any one of the embodiments of the first aspect above.

[0018] The above-mentioned camera displacement recognition method and computer device; by comparing the number of first matching point pairs corresponding to the image to be detected and the reference image with a preset number threshold, and when the number of first matching point pairs is less than the preset number threshold, performing image optimization processing on the image to be detected to obtain a target detection image, and then determining multiple second matching point pairs corresponding to the target detection image and the reference image, based on this, not only can the calculation amount of camera displacement recognition be effectively reduced, but also the problem of inaccurate recognition results caused by insufficient extraction of matching point pairs can be effectively avoided, laying a foundation for improving the accuracy of camera displacement recognition; further, by determining the first similarity between the target detection image and the reference image when the second matching point pairs are greater than the preset number threshold, and then determining whether the camera has shifted according to the first similarity, avoiding the problem of low recognition accuracy caused by simply relying on the number of matching point pairs to judge whether the camera has shifted, thereby improving the accuracy of camera displacement recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A diagram showing an application environment of a camera displacement recognition method in an embodiment; Figure 2 Schematic diagram of the process of a camera displacement recognition method in one embodiment; Figure 3 is a schematic flow chart of an image difference determination step in one embodiment; Figure 4A schematic diagram of a flow chart of a step of determining whether a camera is displaced in one embodiment; Figure 5 A schematic diagram of a flow chart of a camera displacement recognition method in another embodiment; Figure 6 It is a flowchart of a camera displacement recognition method in a specific embodiment; Figure 7 is a structural block diagram of a camera displacement recognition device in one embodiment; Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0022] The camera displacement recognition method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and Internet of Things devices. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0023] In an exemplary embodiment, Figure 2 As shown, a camera displacement recognition method is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps: Step S201, obtaining a plurality of first matching point pairs corresponding to the image to be detected and the reference image.

[0024] Among them, the image to be detected refers to the image frame to be detected extracted from the video stream captured by the camera according to the preset frame reading strategy; the preset frame reading strategy can be but is not limited to the interval frame reading strategy; the interval frame reading strategy refers to cyclically extracting image frames with intervals of preset time within a preset time range, and the preset time range and preset time need to be set according to actual recognition needs, and are not specifically limited here; for example, the preset time range is from 8 o'clock to 18 o'clock, and the preset time is 2 hours, then the interval frame reading strategy refers to cyclically extracting image frames with intervals of 2 hours from 8 o'clock to 18 o'clock as the image to be detected; it should be noted that the use of the interval frame reading strategy can reduce the number and amount of calculations compared to real-time stream analysis, thereby improving the efficiency of camera displacement recognition.

[0025] The reference image may be an image frame pre-collected by a camera based on the same scene, or any one of multiple images to be detected, which is not specifically limited here. It should be noted that the reference image and the image to be detected are image frames collected by the same camera.

[0026] Among them, the first matching point pair is used to describe the corresponding relationship between the image to be detected and the reference image. It can be understood that based on the first matching point pair, it can help understand the spatial relationship between the same or similar features in the image to be detected and the reference image.

[0027] In an exemplary embodiment, the method for obtaining multiple first matching point pairs corresponding to the image to be detected and the reference image may be: obtaining the image to be detected and the reference image; extracting feature points from the image to be detected and the reference image respectively, determining the feature points to be detected corresponding to the image to be detected and the reference feature points corresponding to the reference image; performing matching calculations on the feature points to be detected and the reference feature points to obtain multiple first matching point pairs corresponding to the image to be detected and the reference image. The feature point extraction method may be, but is not limited to, the SIFT (Scale-Invariant Feature Transform) method, the SURF (Speeded UpRobust Features) method, or deep learning, such as the Surperpoint algorithm, which is not specifically limited here.

[0028] Optionally, obtaining the image to be detected includes: extracting multiple image frames according to the interval frame reading strategy from the video stream captured by the camera according to the preset frame reading strategy; judging the compliance of the multiple image frames according to the preset compliance standard, and screening out the image frames that meet the preset compliance standard as the image to be detected for subsequent processing. Among them, the preset compliance standard can be: using the image quality assessment algorithm to perform quality inspection and classification on each image frame to obtain a classification result; determining whether the image frame is compliant according to the classification result; specifically, if the classification result of the image frame is an abnormal classification, such as stripes, blur, too dark, too bright, black screen, flowery screen, color cast, etc., then the image frame is judged to be non-compliant; if the classification result of the image frame is a normal classification, then the image frame is judged to be compliant and can be used as the image to be detected. Among them, the image quality assessment algorithm can be but is not limited to a traditional image determination algorithm or an image classification algorithm, which will not be elaborated here.

[0029] Optionally, before extracting feature points from the image to be detected and the reference image respectively, the method includes: using a target detection algorithm to identify and record irrelevant areas of the image to be detected and the reference image, such as human-shaped areas, dynamic object areas, etc., taking the union of the irrelevant areas of the image to be detected and the reference image, and recording the obtained union as the area to be eliminated. When extracting feature points from the image to be detected and the reference image, determine whether the feature points to be detected and the reference feature points are in the area to be eliminated. If so, directly remove the feature points to be detected or the reference feature points to reduce the interference of irrelevant areas on the displacement recognition results; if not, it indicates that the feature points to be detected or the reference feature points can be used to determine the first matching point pair, based on which the false detection rate can be effectively reduced.

[0030] Optionally, before extracting feature points from the image to be detected and the reference image respectively, the method further includes: performing grayscale processing on the image to be detected and the reference image to convert the image to be detected and the reference image from color images into grayscale images; further, performing size change processing on the image to be detected and the reference image after the grayscale processing according to a preset size to ensure that the sizes of the image to be detected and the reference image remain the same, thereby ensuring the accuracy of the feature point matching calculation; wherein the preset size needs to be set according to actual needs and is not specifically limited herein. For example, the preset size may be 192×192.

[0031] Step S202: When the number of first matching point pairs is less than a preset number threshold, image optimization processing is performed on the image to be detected to obtain a target detection image.

[0032] Among them, the preset number threshold needs to be set according to the actual camera displacement recognition requirements, and is not specifically limited here. It can be understood that by setting the preset number threshold, only when the number of the first matching point pairs is less than the preset number threshold, the image to be detected is optimized to obtain the target detection image; based on this, it can not only avoid the problem of low accuracy of camera displacement recognition due to insufficient extraction of matching point pairs, but also effectively reduce the calculation amount of camera displacement recognition and improve the efficiency of camera displacement recognition.

[0033] It should be noted that, since the preset quantity threshold is set according to actual needs, the number of first matching point pairs less than the preset quantity threshold and the number of first matching point pairs less than or equal to the preset quantity threshold can be treated equivalently; for example, the number of first matching point pairs less than 3 and the number of first matching point pairs less than or equal to 2 have substantially the same numerical range, that is, the number of first matching point pairs can only be 0, 1 and 2, so they can be treated equivalently.

[0034] Among them, the target detection image refers to the image after the image to be detected is optimized. In an exemplary embodiment, the method of performing image optimization processing on the image to be detected to obtain the target detection image may be: performing brightness processing and / or sharpening processing on the image to be detected, or performing size enlargement processing on the image to be detected, which is not specifically limited here. It should be noted that performing image optimization processing on the image to be detected can help to more accurately locate the feature points in the image to be detected, so as to improve the accuracy and stability of feature point matching, and at the same time avoid the problem of low displacement recognition accuracy caused by insufficient extraction of matching point pairs.

[0035] In an exemplary embodiment, during the preprocessing stage of the image to be detected, that is, when the image to be detected and the reference image after grayscale processing are resized according to a preset size, if the image to be detected is reduced, the feature points in the image will become sparse, which may make the feature points that were originally easy to identify difficult to identify or disappear completely. The extraction of feature points depends on the local extreme points or significant change points in the image, so when the image to be detected is reduced, these feature points may become less obvious or disappear. In addition, reducing the size of the image to be detected will cause the number of pixels in the image to decrease accordingly, which will also affect the extraction of feature points. Therefore, in view of the above situation, it is possible to choose to enlarge the size of the image to be detected to obtain a target detection image to ensure that more matching point pairs can be obtained.

[0036] Step S203: determine a plurality of second matching point pairs corresponding to the target detection image and the reference image.

[0037] Among them, the second matching point pair is used to describe the corresponding relationship between the target detection image and the reference image. It can be understood that based on the second matching point pair, it can help understand the spatial relationship between the same or similar features in the target detection image and the reference image.

[0038] It should be noted that, according to the above-mentioned method of determining the first matching point pairs, multiple second matching point pairs corresponding to the target detection image and the reference image can be determined, and the specific determination process will not be repeated here.

[0039] Step S204: if the number of the second matching point pairs is greater than or equal to a preset number threshold, determining a first similarity between the target detection image and the reference image based on the plurality of second matching point pairs.

[0040] It should be noted that since the preset quantity threshold is set according to actual needs, the number of second matching point pairs greater than or equal to the preset quantity threshold and the number of second matching point pairs greater than the preset quantity threshold can be treated equivalently. For example, the number of second matching point pairs greater than or equal to 3 and the number of second matching point pairs greater than 2 have substantially the same numerical ranges defined by the two, that is, the minimum value of the number of second matching point pairs is 3.

[0041] The first similarity is used to characterize the similarity between the target detection image and the reference image.

[0042] Step S205: determining whether the camera is displaced according to the first similarity.

[0043] In an exemplary embodiment, if the first similarity is less than or equal to a preset similarity threshold, it is determined that the camera has not moved; if the second similarity is greater than the preset similarity threshold, it is determined that the camera has moved.

[0044] In this embodiment, when the number of first matching point pairs is insufficient, image optimization processing is performed on the image to be detected to obtain a target detection image; then, feature point extraction is performed on the target detection image to determine a plurality of second matching point pairs corresponding to the target detection image and the reference image, thereby avoiding the problem of insufficient extraction of matching point pairs due to the large image difference between the image to be detected and the reference image, and laying a foundation for improving the accuracy of camera displacement recognition; then, based on the second matching point pairs, a first similarity between the target detection image and the reference image is determined, and based on the first similarity, it is determined whether the camera has shifted, which can effectively avoid the problem of poor accuracy in camera displacement recognition due to simply relying on the number of matching point pairs to determine whether the camera has shifted, and by comprehensively analyzing the number of matching points and the similarity, the accuracy of camera displacement recognition can be effectively improved.

[0045] In one embodiment, performing image optimization processing on the image to be detected to obtain the target detection image includes the following steps: Step 1: Determine the image difference between the image to be detected and the reference image.

[0046] The image difference includes brightness difference and sharpness difference. The brightness difference is used to characterize the brightness difference between the image to be detected and the reference image; the sharpness difference is used to characterize the sharpness difference between the image to be detected and the reference image.

[0047] Step 2: If the image difference is greater than a preset difference threshold, the image to be detected is optimized according to the image difference to obtain a target detection image.

[0048] Among them, the preset difference threshold needs to be set according to the actual image optimization processing requirements, and is not specifically limited here; optionally, performing image optimization processing on the image to be detected according to the image difference includes: performing brightness processing and / or sharpness processing on the image to be detected according to the image difference.

[0049] It can be understood that if the image difference is less than or equal to the preset difference threshold, it indicates that the brightness difference and sharpness difference between the image to be detected and the reference image are relatively small. At this time, there is no need to perform brightness processing and / or sharpness processing on the image to be detected; if the image difference is greater than the preset difference threshold, it indicates that the brightness difference and / or sharpness difference between the image to be detected and the reference image are relatively large. It is necessary to perform image optimization processing on the image to be detected according to the image difference to obtain the target detection image, so as to solve the problem of insufficient extraction of matching point pairs due to large image differences.

[0050] It should be noted that stronger sharpening can make the feature points more prominent, making them easier to be captured by the detection algorithm; however, over-sharpening may result in too many detected feature points, which may include many false feature points caused by noise; this embodiment performs sharpness processing on the image to be detected according to the sharpening difference, which can effectively avoid the problem of poor accuracy of feature point matching caused by over-sharpening or under-sharpening of the image to be detected. In addition, an image that is too dark or too bright may increase the noise information contained in the feature point descriptor, thereby affecting the accuracy of feature point matching; if the brightness is properly adjusted, the matching process can be made more stable and accurate; on the contrary, if the brightness is improperly adjusted, it may cause an increase in the matching error rate; therefore, this embodiment performs brightness processing on the image to be detected according to the brightness difference, which can effectively avoid the problem of an increase in the matching error rate caused by the image to be detected being too dark or too bright; based on this, the image to be detected is optimized through brightness difference and sharpening difference, which lays a foundation for improving the stability and accuracy of the feature point matching process.

[0051] Exemplarily, the image difference between the image to be detected and the reference image is determined to determine whether the image difference is greater than a preset difference threshold; if the image difference is greater than the preset difference threshold, brightness processing and / or sharpness processing are performed on the image to be detected according to the image difference to obtain a target detection image. If the image difference is less than the preset difference threshold, it indicates that the brightness difference and / or sharpness difference between the image to be detected and the reference image are relatively small. In this case, the image to be detected can be optionally enlarged in size according to a preset magnification ratio to obtain a target detection image; it should be noted that the reference image needs to be enlarged at the same time according to the same preset magnification ratio to ensure that the size of the reference image and the target detection image remains the same, laying a foundation for improving the accuracy and reliability of matching point pairs.

[0052] In this embodiment, the image difference between the image to be detected and the reference image is determined, and the image optimization processing is performed on the image to be detected according to the image difference to obtain the target detection image, thereby reducing the difference between the image to be detected and the reference image; and based on the target detection image and the reference image, a foundation is laid for accurately determining the second matching point pair, which can effectively avoid the problem of insufficient extraction of matching point pairs due to image differences.

[0053] In one embodiment, Figure 3 As shown, Figure 3 The figure is a flow chart of an image difference determination step in one embodiment; determining the image difference between the image to be detected and the reference image includes the following steps: Step S301: for each first matching point pair among a plurality of first matching point pairs, determine a first extended subgraph and a second extended subgraph corresponding to the first matching point pair.

[0054] The first matching point pair includes a first reference matching point and a matching point to be detected. The first reference matching point refers to a feature point at a known position in the reference image; the matching point to be detected refers to a feature point in the image to be detected that corresponds to the first reference matching point.

[0055] Preferably, determining the first extended subgraph and the second extended subgraph corresponding to the first matching point pair comprises the following steps: Step 1: determine the first coordinates corresponding to the first reference matching point and the second coordinates corresponding to the matching point to be detected.

[0056] The first coordinate is used to represent the position of the first reference matching point in the reference image; the second coordinate is used to represent the position of the matching point to be detected in the image to be detected.

[0057] Step 2: Determine a first extended sub-image corresponding to the reference matching point according to the first coordinates and the reference image and a preset extension rule.

[0058] Step 3: Determine a second extended sub-image corresponding to the matching point to be detected according to the second coordinates and the image to be detected and a preset extension rule.

[0059] Among them, the preset extension rules need to be set according to the actual extension needs, and no specific limitation is made here; for example, the preset extension rules can be to expand the preset range around the coordinates corresponding to the matching point as the center; among them, the preset range needs to be set according to the actual extension needs, and no specific limitation is made here.

[0060] Exemplarily, it is assumed that the preset expansion rule is to expand a preset range in all directions with the coordinates corresponding to the matching point as the center; for each first matching point pair among the multiple first matching point pairs, the first coordinates corresponding to the first reference matching point and the second coordinates corresponding to the matching point to be detected are respectively determined; on the reference image, with the first coordinates corresponding to the reference matching point as the center, the preset range is expanded in all directions, and the first extended sub-graph corresponding to the reference matching point is determined; on the image to be detected, with the second coordinates corresponding to the matching point to be detected as the center, the preset range is expanded in all directions, and the second extended sub-graph corresponding to the matching point to be detected is determined; according to the above implementation process, multiple first extended sub-graphs and multiple second extended sub-graphs are determined, and the specific implementation process will not be repeated here.

[0061] It should be noted that, in order to further improve the accuracy of matching point pairs, optionally, before determining the first extended subgraph and the second extended subgraph corresponding to the first matching point pair, it also includes: for each first matching point pair in the multiple first matching point pairs, calculating the distance of each first matching point pair and the average distance of all first matching point pairs; calculating the standard deviation according to the distance of each first matching point pair and the average distance of all first matching point pairs, and eliminating the first matching point pair with the largest distance standard deviation, so as to effectively remove abnormal matching points and lay the foundation for improving the accuracy of camera displacement recognition; wherein, the calculation formula of the standard deviation is shown in formula (1). It should be noted that the distance calculation method of the first matching point pair can be implemented by, but not limited to, using Euclidean distance or other suitable measurement methods, which is not specifically limited here.

[0062] (1) in, , represents the standard deviation; , represents the mean distance of all first matching point pairs; , represents the distance of the i-th first matching point pair; n, represents the number of first matching point pairs.

[0063] Step S302: determining a sub-graph difference value according to the first extended sub-graph and the second extended sub-graph corresponding to the plurality of first matching point pairs.

[0064] Step S303: Using the sub-image difference value as the image difference between the image to be detected and the reference image.

[0065] The sub-image difference values ​​include brightness difference values ​​and sharpness difference values.

[0066] In an exemplary embodiment, a method for determining a sub-image difference value may be: respectively calculating the image difference values ​​between the first extended sub-image and the second extended sub-image corresponding to each first matching point pair; taking the average of the image difference values ​​between the first extended sub-image and the second extended sub-image corresponding to all first matching point pairs as the sub-image difference value; in another exemplary embodiment, a method for determining a sub-image difference value may also be: splicing the first extended sub-images corresponding to multiple first matching point pairs to obtain a reference sub-image, and splicing the second extended sub-images corresponding to multiple first matching point pairs to obtain a sub-image to be detected; taking the image difference value between the sub-image to be detected and the reference sub-image as the sub-image difference value; the method for determining the sub-image difference value needs to be set according to actual needs and is not specifically limited here.

[0067] In this embodiment, based on the preset extension rule, according to the first coordinate corresponding to the first reference matching point and the second coordinate corresponding to the matching point to be detected, the corresponding first extended sub-graph and the second extended sub-graph can be accurately determined; further, according to the first extended sub-graph and the second extended sub-graph corresponding to multiple first matching point pairs, the sub-graph difference value can be accurately determined, and the sub-graph difference value is used as the image difference between the image to be detected and the reference image, which lays a foundation for realizing image optimization processing of the image to be detected, avoids the problem of insufficient extraction of matching point pairs due to over-sharpening or under-sharpening or too dark or too bright of the image to be detected, and improves the stability and accuracy of matching point pair extraction.

[0068] In one embodiment, determining a first similarity between the target detection image and the reference image according to a plurality of second matching point pairs comprises the following steps: Step 1: for each second matching point pair in a plurality of second matching point pairs, determine a third coordinate corresponding to a second reference matching point in the second matching point pair and a fourth coordinate corresponding to a target detection matching point.

[0069] Among them, the second matching point pair includes a second reference matching point and a target detection matching point; among them, the second reference matching point refers to a feature point corresponding to a known position in the reference image; the target detection matching point refers to a feature point in the target detection image corresponding to the second reference matching point.

[0070] Among them, the third coordinate is used to represent the position of the second reference matching point in the reference image; the third coordinate includes the x-axis coordinate and the y-axis coordinate of the second reference matching point in the reference image; the fourth coordinate is used to represent the position of the target detection matching point in the target detection image; the fourth coordinate includes the x-axis coordinate and the y-axis coordinate of the target detection matching point in the target detection image.

[0071] Step 2: Determine a first similarity between the target detection image and the reference image based on third coordinates corresponding to the plurality of second reference matching points and fourth coordinates corresponding to the plurality of target detection matching points.

[0072] Exemplarily, according to the third coordinates corresponding to the plurality of second reference matching points and the fourth coordinates corresponding to the plurality of target detection matching points, the first similarity between the target detection image and the reference image is calculated according to formula (2).

[0073] (2) Where, d represents the first similarity between the target detection image and the reference image; , represents the x-axis coordinate of the target detection matching point in the i-th second matching point pair in the target detection image; , represents the y-axis coordinate of the target detection matching point in the i-th second matching point pair in the target detection image; , represents the x-axis coordinate of the second reference matching point in the i-th second matching point pair in the reference image; , represents the y-axis coordinate of the second reference matching point in the i-th second matching point pair in the reference image; n, represents the number of second matching point pairs.

[0074] In this embodiment, based on the third coordinates corresponding to multiple second reference matching points and the fourth coordinates corresponding to multiple target detection matching points, the first similarity between the target detection image and the reference image can be accurately determined, laying a foundation for improving the accuracy of camera displacement recognition.

[0075] In one embodiment, Figure 4 As shown, Figure 4 The flowchart of the step of determining whether the camera is displaced in one embodiment is shown in FIG. 1 . Determining whether the camera is displaced according to the first similarity includes the following steps: Step S401: if the first similarity is less than or equal to a preset similarity threshold, the number of displacement warnings is restored to an initial value, and it is determined that the camera has not been displaced.

[0076] Among them, the preset similarity threshold needs to be set according to actual needs and is not specifically limited here. It should be noted that if the target detection image is obtained by brightness processing and / or sharpening processing of the image to be detected, the first similarity is directly compared with the preset similarity threshold to determine whether the camera is displaced. If the target detection image is obtained by size enlargement processing of the image to be detected, the preset similarity threshold needs to be adjusted accordingly; for example, assuming that the preset similarity threshold is m, before the size enlargement processing, the size of the image to be detected and the reference image are both W×H, W is the width, the unit is pixel, H is the height, the unit is pixel; the size of the image to be detected and the reference image is enlarged at the same time, and the size of the target detection image and the enlarged reference image is both w×h, where w is the enlarged width, the unit is pixel, and h is the enlarged height, the unit is pixel; according to the preset similarity threshold m and the size of the image to be detected and the reference image W×H, the preset similarity threshold m is adjusted to obtain the adjusted preset similarity threshold L, as shown in formula (3).

[0077] (3) Wherein, L represents the adjusted preset similarity threshold; m represents the initial preset similarity threshold; W×H represents the size of the image to be detected and the reference image before the size enlargement process; w×h represents the size of the target detection image and the enlarged reference image after the size enlargement process. For example, assuming that the preset similarity threshold is 18, before the size enlargement process, the size of the image to be detected and the reference image is 192×192, and the image to be detected and the reference image are both enlarged, the size of the target detection image and the enlarged reference image is 384×384; according to the preset similarity threshold of 18 and the size of the image to be detected and the reference image is 192×192, the preset similarity threshold is adjusted according to formula (3), and the adjusted preset similarity threshold is 72.

[0078] The displacement warning times are used to record the number of times the camera is identified as having displacement. The initial value of the displacement warning times needs to be set according to the actual recognition requirements and is not specifically limited here. For example, the initial value of the displacement warning times can be 0 or a positive integer.

[0079] It should be noted that if the first similarity is less than or equal to the preset similarity threshold, the number of displacement warnings will be restored to the initial value, which can avoid the problem of too many alarms caused by misidentification of camera displacement, and can effectively reduce the false alarm rate, thereby improving the reliability and accuracy of camera displacement identification.

[0080] Step S402: if the first similarity is greater than a preset similarity threshold, the displacement warning times are updated according to a preset step length.

[0081] Among them, the preset step size needs to be set according to the updating method of the displacement warning number, and is not specifically limited here; illustratively, if the initial value of the displacement warning number is 0, the preset step size is self-incremented by 1.

[0082] Step S403: If the updated displacement warning number reaches the preset warning number, it is determined that the camera is displaced.

[0083] Among them, the preset number of warnings needs to be set according to the actual recognition needs, and no specific limitation is made here. It should be noted that the preset number of warnings is greater than the initial value of the displacement warning number. Exemplarily, if the initial value of the displacement warning number is 0, and the preset step size is self-added by 1, then the preset number of warnings is a positive integer greater than the initial value. It should be noted that by setting the preset number of warnings, the problem of false alarms caused by short-term fluctuations can be effectively avoided, laying the foundation for further improving the accuracy of camera displacement recognition.

[0084] In an exemplary embodiment, assuming that the initial value of the displacement warning number is 0 and the preset step size is self-incremented by 1, it is determined whether the first similarity is less than or equal to the preset similarity threshold. If the first similarity is less than or equal to the preset similarity threshold, the displacement warning number is restored to the initial value, that is, restored to 0, and it is determined that the camera has not moved, and the calculation of the next frame of the image to be detected is performed; if the first similarity is greater than the preset similarity threshold, the displacement warning number is updated according to the preset step size, that is, the displacement warning number is self-incremented by 1, and it is determined whether the updated displacement warning number reaches the preset warning number. If the updated displacement warning number reaches the preset warning number, it is determined that the camera has moved; if the updated displacement warning number does not reach the preset warning number, the calculation of the next frame of the image to be detected is performed until the updated displacement warning number reaches the preset warning number, and it is determined that the camera has moved.

[0085] In this embodiment, by comparing the first similarity with the preset similarity threshold, when the first similarity is less than or equal to the preset similarity threshold, the number of displacement warnings is restored to the initial value, which can avoid the problem of too many alarms caused by misidentification of camera displacement and effectively reduce the false alarm rate; when the first similarity is greater than the preset similarity threshold, the number of displacement warnings is updated according to the preset step size, and by judging whether the updated number of displacement warnings reaches the preset number of warnings, it is determined that the camera has been displaced. Based on this, the problem of false alarms caused by short-term fluctuations can be effectively eliminated, and the actual displacement of the camera can be discovered in time, thereby improving the reliability and accuracy of camera displacement identification.

[0086] In one embodiment, Figure 5 As shown, Figure 5FIG. 4 is a flow chart of a camera displacement recognition method in another embodiment; the camera displacement recognition method further includes the following steps: Step S501 : when the number of first matching point pairs is greater than or equal to a preset number threshold, determine a second similarity between the image to be detected and the reference image according to a plurality of first matching point pairs.

[0087] It should be noted that the method for determining the second similarity between the image to be detected and the reference image is the same as the method for determining the first similarity described in the above embodiment, and will not be described in detail here.

[0088] Step S502: if the second similarity is less than or equal to the preset similarity threshold, the number of displacement warnings is restored to the initial value, and it is determined that the camera has not been displaced.

[0089] Step S503: if the second similarity is greater than a preset similarity threshold, the displacement warning times are updated according to a preset step length.

[0090] Step S504: If the updated displacement warning number reaches the preset warning number, it is determined that the camera is displaced.

[0091] It should be noted that the method of determining whether the camera is displaced according to the second similarity is the same as the method of determining whether the camera is displaced according to the first similarity described in the above embodiment, and will not be repeated here.

[0092] It should be noted that the number of first matching point pairs is greater than or equal to the preset number threshold, indicating that there is no problem of insufficient extraction of matching point pairs. Therefore, in order to reduce the amount of calculation and improve the efficiency of camera displacement recognition, the second similarity between the image to be detected and the reference image can be directly determined, and the second similarity can be compared with the preset similarity threshold to determine whether the camera is displaced.

[0093] In an exemplary embodiment, assuming that the initial value of the displacement warning number is 0 and the preset step size is self-incremented by 1, when the number of first matching point pairs is greater than or equal to the preset number threshold, the second similarity between the image to be detected and the reference image is determined based on multiple first matching point pairs, and it is determined whether the second similarity is less than or equal to the preset similarity threshold. If the second similarity is less than or equal to the preset similarity threshold, the displacement warning number is restored to the initial value, that is, restored to 0, and it is determined that the camera has not shifted, and the next frame of the image to be detected is calculated; if the second similarity is greater than the preset similarity threshold, the displacement warning number is updated according to the preset step size, that is, the displacement warning number is self-incremented by 1, and it is determined whether the updated displacement warning number reaches the preset warning number. If the updated displacement warning number reaches the preset warning number, it is determined that the camera has shifted; if the updated displacement warning number does not reach the preset warning number, the next frame of the image to be detected is calculated until the updated displacement warning number reaches the preset warning number, and it is determined that the camera has shifted.

[0094] In this embodiment, when the number of first matching point pairs is greater than or equal to a preset number threshold, the second similarity between the image to be detected and the reference image is directly determined, and the second similarity is compared with the preset similarity threshold to determine whether the camera is displaced. Based on this, the amount of calculation is effectively reduced and the efficiency and accuracy of camera displacement recognition are improved.

[0095] In one embodiment, after determining that the camera has not moved, the method further includes: Update the image to be detected or the target detection image as the reference image.

[0096] It should be noted that by updating the reference image according to the image to be detected or the target detection image, it is ensured that the latest reference image is provided for the next frame of the image to be detected. On this basis, it can be ensured that the camera displacement recognition is always based on the most accurate reference image; based on this, the possibility of misrecognition can be effectively reduced, and the real-time and accuracy of camera displacement recognition can be further improved.

[0097] In one embodiment, the camera displacement recognition method further includes: When the number of the first matching point pairs is less than a preset number threshold, performing image optimization processing on the image to be detected and the reference image respectively according to a preset optimization standard to obtain a target detection image and an optimized reference image; Determining a plurality of second matching point pairs corresponding to the target detection image and the reference image includes: A plurality of second matching point pairs corresponding to the target detection image and the optimized reference image are determined.

[0098] Among them, the preset optimization standard needs to be set according to the actual optimization needs, and no specific limitation is made here; image optimization processing of the image to be detected and the reference image may include, but is not limited to, adjusting the brightness, contrast, sharpness or noise removal of the image to be detected and the reference image according to the preset optimization standard.

[0099] It is understandable that, according to the preset optimization standard, performing the same image optimization processing on the image to be detected and the reference image can effectively improve the image quality, making the feature points in the image to be detected and the reference image more obvious, so that more high-quality matching point pairs can be extracted. The image after image optimization processing is more resistant to environmental changes, such as changes in lighting, making the matching point pair matching process more stable and reliable, laying the foundation for improving the accuracy and reliability of camera displacement recognition.

[0100] In a specific embodiment, see Figure 6 , the camera displacement recognition method includes the following steps: Step S601: Acquire a plurality of first matching point pairs corresponding to the image to be detected and the reference image.

[0101] Step S602: determine whether the number of first matching point pairs is less than a preset number threshold.

[0102] If yes, go to step S603; if no, go to step S608.

[0103] Step S603, when the number of first matching point pairs is less than a preset number threshold, image optimization processing is performed on the image to be detected to obtain a target detection image.

[0104] Step S604: determine a plurality of second matching point pairs corresponding to the target detection image and the reference image.

[0105] Step S605: determine whether the number of second matching point pairs is greater than or equal to a preset number threshold.

[0106] If yes, go to step S606; if no, go to step S611.

[0107] Step S606: determining a first similarity between the target detection image and the reference image according to the plurality of second matching point pairs.

[0108] Step S607: determine whether the first similarity is less than or equal to a preset similarity threshold.

[0109] If yes, execute step S610; if no, execute step S611.

[0110] Step S608 : when the number of first matching point pairs is greater than or equal to a preset number threshold, determine a second similarity between the image to be detected and the reference image based on the plurality of first matching point pairs.

[0111] Step S609: determine whether the second similarity is less than or equal to a preset similarity threshold.

[0112] If yes, execute step S610; if no, execute step S611.

[0113] Step S610, restoring the displacement warning times to the initial value to determine that the camera has not been displaced; and updating the target detection image or the image to be detected as the reference image.

[0114] Step S611, updating the displacement warning times according to a preset step length; if the updated displacement warning times reaches the preset warning times, it is determined that the camera is displaced.

[0115] In the above-mentioned camera displacement recognition method, when the number of first matching point pairs is insufficient, the image to be detected is optimized to obtain the target detection image; then the target detection image is extracted with feature points to determine the multiple second matching point pairs corresponding to the target detection image and the reference image, thereby avoiding the problem of insufficient extraction of matching point pairs due to the large image difference between the image to be detected and the reference image, and laying a foundation for improving the accuracy of camera displacement recognition; then based on the second matching point pairs, the first similarity between the target detection image and the reference image is determined, and according to the first similarity, whether the camera has shifted can be determined, which can effectively avoid the problem of poor accuracy of camera displacement recognition due to the determination of whether the camera has shifted simply by relying on the number of matching point pairs, and by comprehensively analyzing the number of matching points and the similarity, the accuracy of camera displacement recognition can be effectively improved. When the number of first matching point pairs is greater than or equal to the preset number threshold, the second similarity between the image to be detected and the reference image is directly determined, and the second similarity is compared with the preset similarity threshold to determine whether the camera has shifted, based on which the amount of calculation is effectively reduced and the efficiency and accuracy of camera displacement recognition are improved.

[0116] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0117] Based on the same inventive concept, the embodiment of the present application also provides a camera displacement identification device for implementing the camera displacement identification method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more camera displacement identification device embodiments provided below can refer to the limitations of the camera displacement identification method above, and will not be repeated here.

[0118] In an exemplary embodiment, Figure 7 As shown, a camera displacement recognition device is provided, including: an acquisition module 701, an optimization module 702, a matching point pair determination module 703, a similarity determination module 704 and a displacement recognition module 705; An acquisition module 701 is used to acquire a plurality of first matching point pairs corresponding to the image to be detected and the reference image; An optimization module 702 is used to perform image optimization processing on the image to be detected to obtain a target detection image when the number of first matching point pairs is less than a preset number threshold; A matching point pair determination module 703 is used to determine a plurality of second matching point pairs corresponding to the target detection image and the reference image; A similarity determination module 704 is configured to determine a first similarity between the target detection image and the reference image based on a plurality of second matching point pairs if the number of the second matching point pairs is greater than or equal to a preset number threshold; The displacement identification module 705 is used to determine whether the camera is displaced according to the first similarity.

[0119] The above-mentioned camera displacement recognition device, when the number of first matching point pairs is insufficient, performs image optimization processing on the image to be detected to obtain a target detection image; then performs feature point extraction on the target detection image to determine multiple second matching point pairs corresponding to the target detection image and the reference image, thereby avoiding the problem of insufficient extraction of matching point pairs due to the large image difference between the image to be detected and the reference image, and laying a foundation for improving the accuracy of camera displacement recognition; then, based on the second matching point pairs, determines the first similarity between the target detection image and the reference image, and determines whether the camera has shifted according to the first similarity, which can effectively avoid the problem of poor accuracy in camera displacement recognition due to simply relying on the number of matching point pairs to determine whether the camera has shifted, and can effectively improve the accuracy of camera displacement recognition by comprehensively analyzing the number of matching points and the similarity.

[0120] In one embodiment, the optimization module 702 is also used to Determine the image difference between the image to be detected and the reference image; the image difference includes brightness difference and sharpness difference; If the image difference is greater than a preset difference threshold, the image to be detected is optimized according to the image difference to obtain a target detection image.

[0121] In one embodiment, the optimization module 702 is also used to For each first matching point pair among the plurality of first matching point pairs, determining a first extended subgraph and a second extended subgraph corresponding to the first matching point pair; Determine a sub-graph difference value according to the first extended sub-graph and the second extended sub-graph corresponding to the plurality of first matching point pairs; The sub-image difference value is used as the image difference between the image to be detected and the reference image.

[0122] In one embodiment, the first matching point pair includes a first reference matching point and a matching point to be detected; the optimization module 702 is also used to Determine a first coordinate corresponding to the first reference matching point and a second coordinate corresponding to the matching point to be detected; Determine, according to the first coordinates and the reference image, a first extended sub-image corresponding to the reference matching point according to a preset extension rule; According to the second coordinates and the image to be detected, a second extended sub-image corresponding to the matching point to be detected is determined according to a preset extension rule.

[0123] In one embodiment, the second matching point pair includes a second reference matching point and a target detection matching point, and the similarity determination module 704 is further used to For each second matching point pair in the plurality of second matching point pairs, determining a third coordinate corresponding to the second reference matching point in the second matching point pair and a fourth coordinate corresponding to the target detection matching point; A first similarity between the target detection image and the reference image is determined based on third coordinates corresponding to the plurality of second reference matching points and fourth coordinates corresponding to the plurality of target detection matching points.

[0124] In one embodiment, the displacement identification module 705 is also used to If the first similarity is less than or equal to the preset similarity threshold, the number of displacement warnings is restored to the initial value, and it is determined that the camera has not been displaced; If the first similarity is greater than a preset similarity threshold, the displacement warning times are updated according to a preset step length; If the updated displacement warning number reaches the preset warning number, it is determined that the camera has been displaced.

[0125] In one embodiment, the similarity determination module 704 is used to When the number of first matching point pairs is greater than or equal to a preset number threshold, determining a second similarity between the image to be detected and the reference image based on the plurality of first matching point pairs; The displacement recognition module 705 is also used to If the second similarity is less than or equal to the preset similarity threshold, the displacement warning times are restored to the initial value, and it is determined that the camera has not been displaced; If the second similarity is greater than the preset similarity threshold, the displacement warning times are updated according to the preset step length; If the updated displacement warning number reaches the preset warning number, it is determined that the camera has been displaced.

[0126] In one embodiment, the camera displacement recognition device further includes an updating module; The updating module is used to update the image to be detected or the target detection image to a reference image.

[0127] In one embodiment, the optimization module 702 is also used to When the number of the first matching point pairs is less than a preset number threshold, performing image optimization processing on the image to be detected and the reference image respectively according to a preset optimization standard to obtain a target detection image and an optimized reference image; The matching point pair determination module 703 is also used to A plurality of second matching point pairs corresponding to the target detection image and the optimized reference image are determined.

[0128] Each module in the above-mentioned camera displacement recognition device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0129] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store camera displacement identification related data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a camera displacement identification method is implemented.

[0130] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0131] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0132] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0133] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0134] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0135] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0136] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A camera displacement recognition method, It is characterized in that The method comprises: Acquire a plurality of first matching point pairs corresponding to the image to be detected and the reference image; When the number of the first matching point pairs is less than a preset number threshold, performing image optimization processing on the image to be detected to obtain a target detection image; Determine a plurality of second matching point pairs corresponding to the target detection image and the reference image; If the number of the second matching point pairs is greater than or equal to the preset number threshold, determining a first similarity between the target detection image and the reference image based on a plurality of the second matching point pairs; It is determined whether the camera is displaced according to the first similarity.

2. The method according to claim 1, It is characterized in that The step of performing image optimization processing on the image to be detected to obtain a target detection image includes: Determine the image difference between the image to be detected and the reference image; the image difference includes brightness difference and sharpness difference; If the image difference is greater than a preset difference threshold, image optimization processing is performed on the image to be detected according to the image difference to obtain a target detection image.

3. The method according to claim 2, It is characterized in that The determining of the image difference between the image to be detected and the reference image comprises: For each first matching point pair among the plurality of first matching point pairs, determining a first extended subgraph and a second extended subgraph corresponding to the first matching point pair; Determine a sub-graph difference value according to a first extended sub-graph and a second extended sub-graph corresponding to a plurality of the first matching point pairs; The sub-image difference value is used as the image difference between the image to be detected and the reference image.

4. The method according to claim 3, It is characterized in that The first matching point pair includes a first reference matching point and a matching point to be detected; and determining the first extended subgraph and the second extended subgraph corresponding to the first matching point pair includes: Determine a first coordinate corresponding to the first reference matching point and a second coordinate corresponding to the matching point to be detected; Determine, according to the first coordinates and the reference image, a first extended sub-image corresponding to the reference matching point according to a preset extension rule; According to the second coordinates and the image to be detected, a second extended sub-image corresponding to the matching point to be detected is determined according to a preset extension rule.

5. The method according to claim 1, It is characterized in that The second matching point pairs include second reference matching points and target detection matching points, and determining a first similarity between the target detection image and the reference image based on a plurality of the second matching point pairs includes: For each second matching point pair in the plurality of second matching point pairs, determine a third coordinate corresponding to the second reference matching point in the second matching point pair and a fourth coordinate corresponding to the target detection matching point; A first similarity between the target detection image and the reference image is determined according to third coordinates corresponding to the plurality of second reference matching points and fourth coordinates corresponding to the plurality of target detection matching points.

6. The method according to claim 1, It is characterized in that The step of determining whether the camera is displaced according to the first similarity includes: If the first similarity is less than or equal to a preset similarity threshold, the number of displacement warnings is restored to an initial value, and it is determined that the camera has not been displaced; If the first similarity is greater than a preset similarity threshold, the number of displacement warnings is updated according to a preset step length; If the updated displacement warning number reaches the preset warning number, it is determined that the camera has been displaced.

7. The method according to claim 1, It is characterized in that The method further comprises: When the number of the first matching point pairs is greater than or equal to a preset number threshold, determining a second similarity between the image to be detected and the reference image according to the plurality of first matching point pairs; If the second similarity is less than or equal to a preset similarity threshold, the number of displacement warnings is restored to an initial value, and it is determined that the camera has not been displaced; If the second similarity is greater than a preset similarity threshold, the displacement warning times are updated according to a preset step length; If the updated displacement warning number reaches the preset warning number, it is determined that the camera has been displaced.

8. The method according to claim 6 or claim 7, It is characterized in that After determining that the camera has not moved, the method further includes: The image to be detected or the target detection image is updated as the reference image.

9. The method according to claim 1, It is characterized in that The method further comprises: When the number of the first matching point pairs is less than a preset number threshold, performing image optimization processing on the image to be detected and the reference image respectively according to a preset optimization standard to obtain a target detection image and an optimized reference image; The determining a plurality of second matching point pairs corresponding to the target detection image and the reference image comprises: Determine a plurality of second matching point pairs corresponding to the target detection image and the optimized reference image.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Three-dimensional reconstruction method and device

    CN110176032A

  • Image detection method and device, electronic equipment and storage medium

    CN111476780A

  • Method and system for automatically identifying on-off state of disconnecting link of power system

    CN112308814A

  • Offset detection method for image acquisition equipment, image matching method and system and equipment

    CN113469201A

  • Target positioning method and device, equipment and medium

    CN117333686A

Cited By

  • OCR recognition method and OCR recognition device based on XR glasses and XR glasses

    CN120526442A

  • OCR recognition method based on XR glasses, OCR recognition device and XR glasses

    CN120526442B