Camera lens shift detection method, device, electronic equipment and storage medium

By sub-region division, encoding and neural network feature extraction of camera image, combined with the implicit feature extraction of deep neural networks, the false alarm problem of lens shift detection in complex scenes in the prior art is solved, and the detection accuracy is improved Sex and applicability.

CN114092884BActive Publication Date: 2025-02-21CHINA POST INFORMATION TECH (BEIJING CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111409819.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2025-02-21
Estimated Expiration
2041-11-25

AI Technical Summary

Technical Problem

The prior art is prone to false alarms when detecting camera lens shifts, especially in complex scenarios, and the calculations are complex, with high requirements for image quality and applicable scenarios, and lacks universality.

Method used

By acquiring the image image and dividing it into sub-region images, encoding and neural network feature extraction are performed, and image implicit features are extracted using deep neural networks, and combining the encoding results and feature extraction results to determine whether the lens is shifted.

Benefits of technology

It improves the accuracy of lens shift detection, reduces the false alarm rate, simplifies the calculation process, and enhances the applicability to complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114092884B_ABST
    Figure CN114092884B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention disclose a camera lens shift detection method, device, electronic device and storage medium. The method comprises: obtaining a camera screen image captured by the camera lens to be detected, and dividing the obtained camera screen image into at least two sub-region images; encoding the at least two sub-region images and extracting neural network features to obtain encoding results and feature extraction results; determining whether the camera lens to be detected is shifted based on the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image. The technical solution of the embodiment of the present invention makes up for the shortcomings of manually setting features, improves the accuracy of judgment, reduces the false alarm rate, and can set different image extraction time intervals, sub-region image sizes and distance thresholds according to the needs of different scenes, thereby improving the accuracy of camera lens shift detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of security monitoring technology, and in particular to a camera lens shift detection method, device, electronic equipment and storage medium. Background Art

[0002] In recent years, cameras have been installed in companies, enterprises, factories, homes and public places for monitoring. This is a very effective security measure. However, this method still has some loopholes. For example, the surveillance camera may be maliciously or unconventionally moved, resulting in the inability to monitor the original target location.

[0003] Most of the existing solutions are based on conventional image pixel transformation to determine whether the camera lens has moved. However, when encountering complex scenes or large objects in the picture change, false alarms are very likely to occur. Judging by conventional features inherent in the image is relatively complex in calculation and has certain requirements on image quality and applicable scenarios. It is not very universal, especially for complex scenes.

[0004] Therefore, how to improve the accuracy of camera lens shift detection is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0005] The embodiments of the present invention provide a camera lens shift detection method, device, electronic device and storage medium to improve the accuracy of camera lens shift detection.

[0006] In a first aspect, an embodiment of the present invention provides a camera lens shift detection method, comprising:

[0007] Acquire a camera screen image captured by a camera lens to be detected, and divide the acquired camera screen image into at least two sub-area images;

[0008] Encoding the at least two sub-region images and extracting neural network features to obtain encoding results and feature extraction results;

[0009] Whether the camera lens to be detected is displaced is determined based on the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image.

[0010] In a second aspect, an embodiment of the present invention further provides a camera lens shift detection device, comprising:

[0011] A sub-region image acquisition module, used to acquire a camera screen image captured by a camera lens to be detected, and divide the acquired camera screen image into at least two sub-region images;

[0012] A result determination module, used for encoding the at least two sub-region images and extracting neural network features to obtain encoding results and feature extraction results;

[0013] The shift determination module is used to determine whether the camera lens to be detected is shifted based on the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image.

[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0015] one or more processors;

[0016] A storage device for storing one or more programs;

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the camera lens shift detection method described in any embodiment of the present invention.

[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the camera lens shift detection method described in any embodiment of the present invention.

[0019] The embodiment of the present invention provides a camera lens shift detection method, device, electronic device and storage medium, which obtains a camera screen image captured by a camera lens to be detected, and divides the obtained camera screen image into at least two sub-area images; encodes the at least two sub-area images and extracts neural network features to obtain encoding results and feature extraction results; determines whether the camera lens to be detected is shifted based on the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image. Through the technical solution of the embodiment of the present invention, based on the conventional pixel value change judgment method, a new pixel information feature extraction algorithm is designed, which uses semantic information with deeper levels and wider widths as judgment indicators respectively; a deep neural network is used to extract the implicit features of the image, which makes up for the shortcomings of manually set features, improves the accuracy of judgment, reduces the false alarm rate, and has a simple calculation process. The method can set different time intervals for picture extraction, image sub-area sizes and distance thresholds according to the needs of different scenes, thereby changing the sensitivity of algorithm perception and enhancing universality. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Other features, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are only for the purpose of illustrating preferred embodiments and are not to be considered as limiting the present invention. Also, the same reference symbols are used throughout the drawings to represent the same parts. In the drawings:

[0021] Figure 1 is a flow chart of a camera lens shift detection method provided by Embodiment 1 of the present invention;

[0022] Figure 2A is a flow chart of a camera lens shift detection method provided by Embodiment 2 of the present invention;

[0023] Figure 2B is a flow chart of another camera lens shift detection method provided by Embodiment 2 of the present invention;

[0024] Figure 3 It is a structural schematic diagram of a camera lens shift detection device provided by Embodiment 3 of the present invention;

[0025] Figure 4 It is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0026] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0027] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations (or steps) therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0028] Embodiment 1

[0029] Figure 1This is a flow chart of a camera lens shift detection method provided by the first embodiment of the present invention. This embodiment is applicable to the case of detecting camera lens shift. The method of this embodiment can be executed by a camera lens shift detection device, which can be implemented in hardware and / or software. The device can be configured in a camera lens shift detection server. The method specifically includes the following steps:

[0030] S110: Acquire a camera screen image captured by a camera lens to be detected, and divide the acquired camera screen image into at least two sub-area images.

[0031] Most of the existing solutions are based on conventional image pixel transformation to determine whether the camera lens has moved, such as based on the pixel changes between two images, the distribution of pixel features, etc.; another part is based on detecting the inherent conventional features in the image to determine the camera shift, such as based on edge features.

[0032] The traditional method of judging whether the lens is shifted based on the change of pixel values ​​is prone to false alarms, such as when encountering complex scenes or when large targets in the picture change. However, judging by the conventional features inherent in the image requires feature extraction of the background and foreground targets in the image, which is relatively complex to calculate, or requires manual design of features in the image, and the need to pre-set the background image, which is relatively complex to implement. It has certain requirements for image quality and applicable scenarios, especially for complex scenes, and is not universal. Therefore, the present application provides a camera lens shift detection method.

[0033] The camera screen image may refer to a screen image captured by the camera lens to be detected, for example, a real-time screen of a surveillance video of the camera lens to be detected, and the screen image in the video is obtained. At least two camera screen images are obtained from the camera lens to be detected at regular intervals, and the camera screen images are scaled according to a preset size.

[0034] The sub-region image may refer to dividing the acquired camera screen image into several sub-region images according to set parameters, for example, dividing the camera screen image into m*n sub-regions according to preset parameters.

[0035] S120, encoding the at least two sub-region images and extracting neural network features to obtain encoding results and feature extraction results.

[0036] Among them, encoding can refer to converting the pixel points of each sub-region image into digital data, for example, grayscale processing is performed on at least two sub-region images, image noise is removed, each sub-region is encoded, and higher-level feature information is extracted to obtain abstract semantic features, thereby judging each sub-region image and obtaining the encoding result.

[0037] Neural network feature extraction may refer to extracting features of pixel points of each sub-region image using a neural network, for example, extracting pixel features of each processed sub-region image using a convolutional neural network, extracting implicit features of the image, calculating feature values, and obtaining the feature extraction results.

[0038] By using coding and neural network feature extraction, the lens shift of the camera to be detected is comprehensively judged, which makes up for the shortcomings of manually set features and improves the accuracy of detection.

[0039] S130, determining whether the lens of the camera to be detected is displaced according to the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image.

[0040] Among them, the previous camera screen image may refer to a camera screen image captured at the last acquisition moment according to a preset time interval, for example, it may refer to a camera screen image taken by the lens of the camera to be detected and obtained at the last acquisition moment according to the preset time interval, and the acquired previous camera screen image is divided into at least two sub-area images; the at least two sub-area images are encoded and neural network features are extracted to obtain encoding results and feature extraction results.

[0041] The number of sub-region images that have changed is determined based on the encoding result and feature extraction result of the current sub-region image and the encoding result and feature extraction result of the previous sub-region image; and whether the camera lens to be detected is displaced is determined based on the number of sub-regions that have changed. For example, if the number of sub-region images that have changed exceeds the preset number of sub-region images, it is determined that the camera lens to be detected is displaced, wherein the preset number of sub-region images may refer to 80% of the sub-region images in the camera screen image, for example, the current camera screen image is divided into 10*9 sub-region images with a total of 90 images, and if the number of sub-region images that have changed exceeds 72, it is determined that the camera lens to be detected is displaced.

[0042] The embodiment of the present invention provides a camera lens shift detection method, which obtains a camera screen image taken by a camera lens to be detected, and divides the obtained camera screen image into at least two sub-area images; encodes the at least two sub-area images and extracts neural network features to obtain encoding results and feature extraction results; determines whether the camera lens to be detected is shifted based on the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image. Through the technical solution of the embodiment of the present invention, a new pixel information feature extraction algorithm is designed based on the conventional pixel value change judgment method, and semantic information with deeper levels and wider widths are used as judgment indicators respectively; a deep neural network is used to extract the implicit features of the image, which makes up for the shortcomings of manually set features, improves the accuracy of judgment, reduces the false alarm rate, and has a simple calculation process.

[0043] Embodiment 2

[0044] Figure 2A The flowchart of a camera lens shift detection method provided in the second embodiment of the present invention. The embodiment of the present invention further optimizes the above embodiment on the basis of the above embodiment, and the embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments. Figure 2A As shown, the camera lens shift detection method provided in the embodiment of the present invention may include the following steps:

[0045] S210, obtaining at least two camera screen images taken by a camera lens to be detected with a preset time interval, and scaling the camera screen images to a preset size.

[0046] Among them, obtaining the camera image depends on the real-time streaming image of the surveillance video. First, you need to connect the camera and obtain continuous frames of the video. Since you need to judge the changes in the image, you need to obtain two pictures with a certain time interval. Therefore, you need to regularly obtain pictures with a time interval from the continuous video frames. According to different scene requirements, different time intervals can be set to enhance universality.

[0047] The at least two acquired camera screen images are preprocessed to change the height and width of the images and scale the image size to a preset fixed height and width.

[0048] S220: Divide the scaled camera screen image into at least two sub-region images according to preset parameters.

[0049] Among them, in order to solve the problem of false detection caused by pixel changes in large areas of the image in complex scenes, which affects the detection accuracy, this solution proposes a detection method based on pixel sub-region division, which adopts a block feature detection mechanism to reduce the algorithm's sensitivity to the characteristics of large-area pixel area changes in the image, reduce the granularity of feature change analysis, and reduce the false alarm rate. The image with a uniform fixed height and width obtained after size scaling is divided into m*n sub-region images according to the set parameters. Different sub-region image sizes are set according to different scene requirements to enhance universality.

[0050] S230: Encode the at least two sub-region images to obtain an encoding result.

[0051] Optionally, grayscale processing is performed on the pixel information of the at least two sub-region images to remove the influence of the RGB channel pixel information on the features;

[0052] Extracting higher-level feature information from the at least two sub-region images in an encoding manner to obtain an encoding result;

[0053] The encoding methods include average hash algorithm, perceptual hash algorithm and difference hash algorithm.

[0054] First, the pixel information of the sub-region image is gray-processed to eliminate the influence of the original RGB channel pixel information on the features. The use of gray-scale values ​​is more conducive to feature smoothing, more unified, and convenient for feature encoding calculation, reducing complexity.

[0055] When an image changes, the difference between its pixel values ​​varies greatly, and it is impossible to accurately determine whether the required changes have occurred in the image. Misjudgment is likely to occur. Therefore, it is necessary to extract higher-level feature information to obtain abstract semantic features, so as to make an accurate judgment on the image changes. The encoding method of this step includes but is not limited to the average hash algorithm, perceptual hash algorithm, and difference hash algorithm.

[0056] Based on the conventional judgment method of pixel value changes, a new pixel information feature extraction algorithm was designed, which used deeper and wider semantic information as judgment indicators, reducing the false alarm rate.

[0057] S240: Perform neural network feature extraction on the at least two sub-region images to obtain feature extraction results.

[0058] Optionally, scaling the at least two sub-region images to a fixed size, and performing normalization processing on pixel information of the at least two sub-region images;

[0059] Using a convolutional neural network to extract features from pixel information of the at least two sub-region images to obtain feature extraction results;

[0060] The normalization process includes calculating the mean and standard deviation of the pixel information of the at least two sub-region images.

[0061] In order to extract more balanced pixel information and reduce the interference of outliers on the overall feature vector, it is necessary to unify the dimensions of the values. The processing method for this step is to scale the sub-region image to a fixed size, then calculate the mean and standard deviation, and use the mean and standard deviation to normalize the pixel values ​​of the sub-region image.

[0062] Using only the image features set in the conventional way cannot meet the requirements for accurate judgment of image changes. In order to obtain the implicit deep image features, this method uses a convolutional neural network for feature extraction. Since this solution has high requirements on the processing efficiency of the algorithm, a shallow neural network is designed. This network is pre-trained using a large number of classification data sets to obtain converged network weights. Then, the sub-region image that needs to extract features after preprocessing is sent to this convolutional neural network to calculate the eigenvalues.

[0063] A deep neural network is used to extract the implicit features of the image, which makes up for the shortcomings of manually set features and improves the accuracy of judgment.

[0064] S250, determining whether the lens of the camera to be detected is displaced based on the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image.

[0065] Optionally, if the difference between the encoding result of the current camera screen image sub-region and the encoding result of the previous camera screen image sub-region exceeds a preset distance, it is determined that the sub-region has changed;

[0066] If the distance difference between the feature extraction result of the current camera screen image sub-region and the feature extraction result of the previous camera screen image sub-region exceeds a preset distance, it is determined that the sub-region has changed;

[0067] According to the change of each sub-area, it is determined whether the camera lens is shifted.

[0068] Each sub-region in the two images is encoded and extracted by neural network features, and the encoding results and feature extraction results are calculated. Then the distance is calculated respectively, and finally the displacement is judged according to the thresholds set for the two indicators. Different distance thresholds are set according to different scene requirements to enhance universality.

[0069] Optionally, if the changes in each sub-area exceed the number of changes in a preset sub-area, it is determined that the camera lens is shifted;

[0070] If the changes in the sub-areas do not exceed the preset number of sub-area changes, it is determined that the camera lens has not shifted.

[0071] By comprehensively judging whether displacement occurs based on the changes of the two features, the accuracy of displacement feature detection is improved and the false alarm rate is reduced.

[0072] In an optional solution of the embodiment of the present application, Figure 2B is a flow chart of another camera lens shift detection method provided by Embodiment 2 of the present invention. Figure 2B As shown, the camera lens shift detection method provided in the embodiment of the present invention may include the following steps:

[0073] A1. Obtaining camera images;

[0074] A2, pre-processing the camera image;

[0075] A3, dividing the camera image into regions;

[0076] A4, encoding the sub-region image and performing neural network processing;

[0077] A5, calculating the similarity of the sub-region images;

[0078] A6. Determine the displacement of the camera lens to be inspected.

[0079] The embodiment of the present invention provides a camera lens shift detection method. According to different scene requirements, different time intervals are set to obtain at least two camera screen images taken by a camera lens to be detected, and the size of the camera screen image is scaled to a preset size; according to preset parameters, the camera screen image after the size scaling is divided into at least two sub-region images; grayscale processing is performed on the pixel information of the at least two sub-region images to eliminate the influence of the original RGB channel pixel information on the features, and higher-level feature information is extracted to obtain abstract semantic features for encoding to obtain encoding results, thereby reducing the false alarm rate; the sub-region images are scaled to a fixed size, and then the mean and standard deviation are calculated, and the pixel values ​​of the sub-region images are normalized using the mean and standard deviation, and the sub-region images with extracted features are sent to a convolutional neural network to calculate the feature values, and the implicit features of the image are extracted, thereby making up for the shortcomings of manually setting features and improving the accuracy of judgment; whether a shift occurs is comprehensively judged by the changes in the two features, thereby improving the accuracy of shift feature detection and reducing the false alarm rate. This method sets different time intervals for image extraction, sub-region image sizes, and distance thresholds according to the needs of different scenarios, thereby changing the sensitivity of the algorithm's perception and enhancing universality.

[0080] Embodiment 3

[0081] Figure 3 3 is a schematic diagram of the structure of a camera lens shift detection device provided in Embodiment 3 of the present invention. The device comprises: a sub-region image acquisition module 310, a result determination module 320 and a shift determination module 330.

[0082] in:

[0083] The sub-region image acquisition module 310 is used to acquire a camera screen image captured by the camera lens to be detected, and divide the acquired camera screen image into at least two sub-region images;

[0084] A result determination module 320, configured to perform encoding and neural network feature extraction on the at least two sub-region images to obtain encoding results and feature extraction results;

[0085] The shift determination module 330 is used to determine whether the camera lens to be detected is shifted according to the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image.

[0086] Based on the above embodiment, optionally, the sub-region image acquisition module 310 includes:

[0087] Acquire at least two camera screen images taken by the camera lens to be detected with a preset time interval, and scale the camera screen image size to a preset size;

[0088] According to preset parameters, the scaled camera screen image is divided into at least two sub-area images.

[0089] Based on the above embodiment, optionally, the result determination module 320 includes:

[0090] Performing grayscale processing on the pixel information of the at least two sub-region images to remove the influence of the RGB channel pixel information on the features;

[0091] Extracting higher-level feature information from the at least two sub-region images in an encoding manner to obtain an encoding result;

[0092] The encoding methods include average hash algorithm, perceptual hash algorithm and difference hash algorithm.

[0093] Based on the above embodiment, optionally, the result determination module 320 further includes:

[0094] Scaling the at least two sub-region images to a fixed size, and performing normalization processing on pixel information of the at least two sub-region images;

[0095] Using a convolutional neural network to extract features from pixel information of the at least two sub-region images to obtain feature extraction results;

[0096] The normalization process includes calculating the mean and standard deviation of the pixel information of the at least two sub-region images.

[0097] Based on the above embodiment, optionally, the shift determination module 330 includes:

[0098] If the difference between the encoding result of the current camera screen image sub-region and the encoding result of the previous camera screen image sub-region exceeds a preset distance, it is determined that the sub-region has changed;

[0099] If the distance difference between the feature extraction result of the current camera screen image sub-region and the feature extraction result of the previous camera screen image sub-region exceeds a preset distance, it is determined that the sub-region has changed;

[0100] According to the change of each sub-area, it is determined whether the camera lens is shifted.

[0101] Based on the above embodiment, optionally, determining whether the camera lens is shifted according to the change of each sub-area includes:

[0102] If the changes in each sub-area exceed the preset number of sub-area changes, it is determined that the camera lens is displaced;

[0103] If the changes in the sub-areas do not exceed the preset number of sub-area changes, it is determined that the camera lens has not shifted.

[0104] The above-mentioned device can execute the camera lens shift detection method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the camera lens shift detection method.

[0105] Embodiment 4

[0106] Figure 4 Schematic diagram of the structure of an electronic device provided in the fourth embodiment of the present application. The present embodiment of the present application provides an electronic device, in which the interactive device for detecting the shift of the camera lens provided in the embodiment of the present application can be integrated. Figure 4 As shown, this embodiment provides an electronic device 400, which includes: one or more processors 420; a storage device 410, which is used to store one or more programs. When the one or more programs are executed by the one or more processors 420, the one or more processors 420 implement the camera lens shift detection method provided in the embodiment of the present application. The method includes:

[0107] Acquire a camera screen image captured by a camera lens to be detected, and divide the acquired camera screen image into at least two sub-area images;

[0108] Encoding the at least two sub-region images and extracting neural network features to obtain encoding results and feature extraction results;

[0109] Whether the camera lens to be detected is displaced is determined based on the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image.

[0110] Of course, those skilled in the art can understand that the processor 420 also implements the technical solution of the camera lens shift detection method provided in any embodiment of the present application.

[0111] Figure 4 The electronic device 400 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0112] like Figure 4 As shown, the electronic device 400 includes a processor 420, a storage device 410, an input device 430, and an output device 440; the number of the processor 420 in the electronic device can be one or more. Figure 4 A processor 420 is taken as an example; the processor 420, the storage device 410, the input device 430 and the output device 440 in the electronic device can be connected via a bus or other means. Figure 4The connection via bus 450 is taken as an example.

[0113] The storage device 410 is a computer-readable storage medium that can be used to store software programs, computer executable programs, and module units, such as program instructions corresponding to the camera lens shift detection method in the embodiment of the present application.

[0114] The storage device 410 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the storage device 410 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the storage device 410 may further include a memory remotely arranged relative to the processor 420, and these remote memories may be connected via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0115] The input device 430 may be used to receive input numbers, character information or voice information, and generate key signal input related to user settings and function control of the electronic device. The output device 440 may include electronic devices such as a display screen and a speaker.

[0116] The electronic device provided by the embodiment of the present application can achieve the technical effect of effectively improving the accuracy of camera lens shift detection.

[0117] Embodiment 5

[0118] Embodiment 5 of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a camera lens shift detection method when executed by a computer processor, the method comprising:

[0119] Acquire a camera screen image captured by a camera lens to be detected, and divide the acquired camera screen image into at least two sub-area images;

[0120] Encoding the at least two sub-region images and extracting neural network features to obtain encoding results and feature extraction results;

[0121] Whether the camera lens to be detected is displaced is determined based on the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image.

[0122] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the above. The computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.

[0123] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to: electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0124] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the above.

[0125] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0126] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0127] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A camera lens shift detection method, characterized in that: The method comprises: Acquire a camera screen image captured by a camera lens to be detected, and divide the acquired camera screen image into at least two sub-area images; Encoding the at least two sub-region images and extracting neural network features to obtain encoding results and feature extraction results; Determine whether the camera lens to be detected is displaced according to the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image; Determining whether the camera lens to be detected is displaced based on the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image includes: If the difference between the encoding result of the current camera screen image sub-region and the encoding result of the previous camera screen image sub-region exceeds a preset distance, it is determined that the sub-region has changed; If the distance difference between the feature extraction result of the current camera screen image sub-region and the feature extraction result of the previous camera screen image sub-region exceeds a preset distance, it is determined that the sub-region has changed; According to the change of each sub-area, it is determined whether the camera lens is shifted.

2. The method according to claim 1, characterized in that The step of acquiring a camera screen image captured by a camera lens to be detected and dividing the acquired camera screen image into at least two sub-area images comprises: Acquire at least two camera screen images taken by the camera lens to be detected with a preset time interval, and scale the camera screen image size to a preset size; According to preset parameters, the scaled camera screen image is divided into at least two sub-area images.

3. The method according to claim 1, characterized in that The encoding of the at least two sub-region images and the neural network feature extraction to obtain the encoding result and the feature extraction result include: Performing grayscale processing on the pixel information of the at least two sub-region images to remove the influence of the RGB channel pixel information on the features; Extracting higher-level feature information from the at least two sub-region images in an encoding manner to obtain an encoding result; The encoding methods include average hash algorithm, perceptual hash algorithm and difference hash algorithm.

4. The method according to claim 1, characterized in that: The encoding of the at least two sub-region images and the neural network feature extraction to obtain the encoding result and the feature extraction result include: Scaling the at least two sub-region images to a fixed size, and performing normalization processing on pixel information of the at least two sub-region images; Using a convolutional neural network to extract features from pixel information of the at least two sub-region images to obtain feature extraction results; The normalization process includes calculating the mean and standard deviation of the pixel information of the at least two sub-region images.

5. The method according to claim 1, characterized in that The determining whether the camera lens is shifted according to the change of each sub-area includes: If the changes in each sub-area exceed the preset number of sub-area changes, it is determined that the camera lens is displaced; If the changes in the sub-areas do not exceed the preset number of sub-area changes, it is determined that the camera lens has not shifted.

6. A camera lens shift detection device, characterized in that: The device comprises: A sub-region image acquisition module, used to acquire a camera screen image captured by a camera lens to be detected, and divide the acquired camera screen image into at least two sub-region images; A result determination module, used for encoding the at least two sub-region images and extracting neural network features to obtain encoding results and feature extraction results; A shift determination module, used to determine whether the camera lens to be detected is shifted according to the encoding result and feature extraction result of the current camera screen image and the encoding result and feature extraction result of the previous camera screen image; The shift determination module is further used to determine that the sub-region has changed if the distance difference between the encoding result of the current camera screen image sub-region and the encoding result of the previous camera screen image sub-region exceeds a preset distance; If the distance difference between the feature extraction result of the current camera screen image sub-region and the feature extraction result of the previous camera screen image sub-region exceeds a preset distance, it is determined that the sub-region has changed; According to the change of each sub-area, it is determined whether the camera lens is shifted.

7. The device according to claim 6, characterized in that The sub-region image acquisition module comprises: Acquire at least two camera screen images taken by the camera lens to be detected with a preset time interval, and scale the camera screen image size to a preset size; According to preset parameters, the scaled camera screen image is divided into at least two sub-area images.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the camera lens shift detection method as described in any one of claims 1-5 is implemented.

9. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to perform the camera lens shift detection method according to any one of claims 1 to 5 when executed by a computer processor.

Citation Information

Patent Citations

  • Lens offset detection method and device, electronic equipment and readable storage medium

    CN113239937A