Detection method for shielding of piano room camera, storage medium and device
By using the central processing module in the piano room camera to process image regions and feature vectors, camera occlusion can be detected in real time, which solves the problem of resource waste, achieves efficient and real-time detection and feedback, and improves the response speed of the system.
Patent Information
- Application Number
- CN202310608576.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-27
- Publication Date
- 2024-09-10
AI Technical Summary
The piano room camera is blocked, resulting in a waste of resources. It is difficult to effectively detect and solve this problem with existing technology.
The central processing module reads the standard image and performs regional feature vector processing. It compares the cosine similarity with the real-time image. When the matching value is greater than the threshold, it is determined that the camera is blocked. The SIFT feature detection algorithm and MATH matching are used to quickly determine the camera status.
It achieves efficient and real-time detection of camera occlusion in specific environments, reduces image processing resource usage, improves judgment and response time, and avoids waste of resources.
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart piano rooms, and in particular to a method, storage medium and device for detecting occlusion of a piano room camera. Background Art
[0002] Installing cameras in the piano room can ensure automatic detection of the equipment and placement in the piano room, and prevent students in the piano room from doing things that are not related to piano practice, especially college couples chatting privately in the piano room, which leads to a waste of piano room resources. In order to avoid being captured by the camera, they block the camera; they even stick double-sided tape on the camera lens, affecting the normal operation of the camera.
[0003] In view of this, it is necessary to provide a method for detecting camera occlusion in a piano room. Summary of the invention
[0004] The invention provides a method for detecting camera occlusion in a piano room, aiming to solve the technical problem of camera occlusion.
[0005] The technical solution adopted by the present invention to solve the problem is: a method for detecting camera occlusion in a piano room, comprising the following steps: Step 1: The central processing module reads the standard image, divides the standard image into regions, and performs feature vector processing on the standard image to obtain a feature vector of the standard image; Step 2: The central processing module obtains the real-time image captured by the camera, divides the real-time image into regions of the same size as the standard image, processes the regions and feature vectors, and obtains a feature vector of the real-time image; Step 3: Perform cosine similarity matching between the standard image feature vector and the real-time image feature vector. When the cosine similarity matching value is greater than a threshold, the camera is blocked, otherwise the camera works normally.
[0006] Compared with the prior art, the camera occlusion detection method provided by the present invention has the following characteristics compared to the conventional camera shooting environment: the shooting distance is relatively fixed, the focal length is single, the light is controllable, the background and environment are specific, etc. When the camera shoots an image, it is almost unaffected by changes in light, temperature and humidity, and the image boundary changes slightly. Therefore, the present invention creates an image matching in a digital form by dividing the image into regions and processing feature vectors in an environment with single light, temperature and humidity. The image comparison efficiency is high, and it can detect and feedback whether the video is working normally in real time without occupying too much image processing resources.
[0007] The standard image described in step 1 is stored in the central processing unit when the image is first captured.
[0008] The sub-regions described in step 1 are to divide the standard image into a plurality of square image regions of equal size; the sub-regions described in step 2 are to divide the real-time image into a plurality of rectangular regions of equal size to the standard image.
[0009] In one implementation, the feature vector records the RGB values of pixels in each area of the image in sequence.
[0010] The threshold value described in step 3 is between 12 and 55.
[0011] The threshold value described in step 3 is 37. Implementation
[0012] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0013] In order to solve the technical problem of camera occlusion, the present invention provides a method for detecting camera occlusion in a piano room, which is suitable for a piano room. The daily environment of the piano room is a closed environment with good shooting conditions where light can be used for fill-in light when light is insufficient. In the piano room, the piano is installed close to one of the side walls of the piano room, and the camera is installed above the piano in the piano room. The camera's shooting direction is from the side wall where the piano is set to the side opposite to the aforementioned side wall. The central processing unit determines whether the camera is blocked through image information fed back by the camera.
[0014] The camera occlusion detection method comprises the following steps: step 1, the central processing module reads the standard image, divides the standard image into regions, and performs feature vector processing on the standard image to obtain the standard image feature vector; step 2, the central processing module obtains the real-time image captured by the camera, divides the real-time image into regions of the same size as the standard image, performs region division and feature vector processing to obtain the real-time image feature vector; step 3, performs cosine similarity matching on the standard image feature vector and the real-time image feature vector, when the cosine similarity matching value is greater than a threshold value, the camera is blocked, otherwise the camera works normally.
[0015] When the central processing module divides the image into regions, it divides the image into equal numbers of regions, such as: dividing the standard image and the real-time image into 5 blocks of images; dividing the standard image and the real-time image into 6 blocks of images; dividing the standard image and the real-time image into 7 blocks of images; dividing the standard image and the real-time image into 8 blocks of images; dividing the standard image and the real-time image into 9 blocks of images, etc. Or, according to the image size, pixel height, etc., the image is split by pixel, such as: 120×120; 240×240; 640×640; 600×600, etc. Or, a threshold is set and the region is divided according to the set threshold.
[0016] After the standard image and real-time image feature vector processing are performed after the area division, the image is processed into digital form, that is, the image features are obtained through the SIFT feature detection algorithm with the RGB value of each pixel, and then the image features are matched through MATH; when the feature matching degree is higher than the set threshold, it is not blocked; otherwise, it is blocked.
[0017] Preferably, feature extraction is performed on each standard image after regionalization and the real-time image after regionalization that uniquely corresponds to it through SIFT, and then feature matching is performed through MATH to feedback the matching degree; the difference from the prior art is that it is not necessary to display the matching of features; corresponding feature matching is performed between small images, the matching amount is greatly reduced, and the judgment and response time are exponentially improved. Taking the 3685 board processing a 1024×1024 pixel image as an example, the judgment and response time is generally about 3-5 seconds through ordinary algorithms, and the response time processed by this algorithm is less than 300 microseconds after the judgment time, and the larger the image, the more obvious the difference in response time.
[0018] The standard image described in step 1 is stored in the central processing unit when the image is first captured.
[0019] The technical solution provided by the present invention performs image matching in digital form by dividing the image into regions and processing feature vectors. The image comparison efficiency is high, and it is possible to detect and provide feedback in real time on whether the video is working normally without occupying too many image processing resources.
[0020] The sub-regions described in step 1 are to divide the standard image into a plurality of square image regions of equal size; the sub-regions described in step 2 are to divide the real-time image into a plurality of rectangular regions of equal size to the standard image.
[0021] The feature vector records the RGB values of pixels in each area of the image in sequence.
[0022] The threshold value described in step 3 is between 12 and 55. The threshold value described in step 3 is 37.
[0023] When a person enters the piano room, the occlusion range is generally small. When sitting down to play the piano, it is generally less than 12%, and when standing, it is generally no more than 30%. When a person is in the piano room, both the face and the body will be captured, but the corresponding image features cannot be matched.
[0024] When part of the standard image behind the partial area can correspond to part of the real-time image, and the real-time image of the part that cannot correspond has no image features, the camera is partially blocked. When the real-time image has no image features at all, the camera is completely blocked.
[0025] Whether it is blocked by double-sided tape or other abnormal blockages, when the blocked area is large and exceeds the normal blockage value range, it is considered abnormal blockage.
[0026] The invention provides a medium storing a method for detecting occlusion of a piano room camera.
[0027] The invention provides a device assembled from a storage medium storing a method for detecting occlusion of a piano room camera.
[0028] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer execution instruction is loaded and executed on the computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with the medium. Available media can be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid state drives (SSDs)), etc.
[0029] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for detecting camera occlusion in a piano room, comprising the following steps: Step 1: The central processing module reads the standard image, divides the standard image into regions, and performs feature vector processing on the standard image to obtain a feature vector of the standard image; Step 2: The central processing module obtains the real-time image captured by the camera, divides the real-time image into regions of the same size as the standard image, processes the regions and feature vectors, and obtains a feature vector of the real-time image; Step 3: Perform cosine similarity matching between the standard image feature vector and the real-time image feature vector. When the cosine similarity matching value is greater than a threshold, the camera is blocked, otherwise the camera works normally.
2. The piano room camera occlusion detection method as claimed in claim 1, characterized in that: The standard image described in step 1 is stored in the central processing unit when the image is first captured.
3. The piano room camera occlusion detection method as claimed in claim 1, characterized in that: The sub-regions described in step 1 are to divide the standard image into a plurality of square image regions of equal size; the sub-regions described in step 2 are to divide the real-time image into a plurality of rectangular regions of equal size to the standard image.
4. The piano room camera occlusion detection method as claimed in claim 1, characterized in that: The feature vector records the RGB values of pixels in each area of the image in sequence.
5. The piano room camera occlusion detection method as claimed in claim 1, characterized in that: The threshold value described in step 3 is between 12 and 55.
6. The piano room camera occlusion detection method as claimed in claim 1, characterized in that: The threshold value described in step 3 is 37.
7. A medium storing the piano room camera occlusion detection method according to any one of claims 1 to 6.
8. A device assembled using the storage medium according to claim 6.
