Detection method of vehicle-mounted four-direction camera and computer readable storage medium
By sampling and analyzing the YUV image data collected by the vehicle quad-direction camera, the availability of the camera is determined, and the problem of availability detection of the vehicle camera when the vehicle shakes, collisions or temperature changes is solved, fast and effective detection is achieved, and driving safety of drivers and passengers is improved.
Patent Information
- Application Number
- CN202311743319.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-18
- Publication Date
- 2025-06-27
AI Technical Summary
The availability of the vehicle quad-axis camera is affected when the vehicle shakes, crashes, or changes in temperature, making it difficult to quickly and efficiently detect its status.
By obtaining the YUV image data sent by the camera with continuous preset frames, each frame data is sampled. If the YUV values of each sampled pixel point are the same, it is determined that the camera is unavailable.
This method can quickly and effectively detect the availability of the camera, reduce the amount of data used for judgment, improve the detection speed, and thus improve the driving safety of the driver and passenger.
Smart Images

Figure CN120223871A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of camera detection, and particularly to a detection method for a vehicle-mounted four-direction camera and a computer-readable storage medium. Background Art
[0002] V2X (vehicle to everything) technology can achieve all-round connection and efficient and accurate information communication between vehicles and surrounding vehicles, people, traffic infrastructure, and networks / clouds (platforms).
[0003] By installing a vehicle-mounted four-direction camera, the driving images of the front, rear, left, and right of the vehicle can be displayed in real time on the central control screen, allowing the driver and passengers to view the road conditions around the vehicle and the actions of other traffic participants in real time, and making timely driving safety precautions to ensure safe driving of the vehicle. The vehicle central control system can collect the driving videos of the four-direction camera, record the driving conditions, provide a reliable basis for traffic accident analysis and determination, and can also be used in ADAS (Advanced Driving Assistance System) to increase driving safety. It can also be uploaded to the cloud through the central control for driving behavior analysis to improve the safe driving habits of the driver and passengers.
[0004] However, since the vehicle-mounted four-direction camera is fixed around the vehicle, vehicle jitter, collision, and temperature changes outside the vehicle will all affect the usability of the four-direction camera. Therefore, in order for the driver and passengers to promptly discover the inavailability of the vehicle-mounted four-direction camera, how to effectively detect the vehicle-mounted four-direction camera is a problem to be solved. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a detection method for a vehicle-mounted four-direction camera and a computer-readable storage medium, which can quickly and effectively detect the usability of the camera.
[0006] To solve the above technical problem, the technical solution adopted by the present invention is: a detection method for a vehicle-mounted four-direction camera, including:
[0007] Obtaining YUV image data sent by the camera for a continuous preset number of frames;
[0008] Sampling each frame of YUV image data respectively to obtain the sampled pixel points corresponding to each frame of YUV image data;
[0009] If the YUV values of all the sampled pixel points are the same, it is determined that the camera is unavailable.
[0010] The present invention also proposes a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned method is implemented.
[0011] The beneficial effects of the present invention are as follows: By analyzing the YUV values of some pixel points of the image data collected by the camera, the usability of the camera can be effectively detected, and the amount of data used for usability judgment can be reduced, thereby improving the detection speed. The present invention can quickly and effectively detect the usability of the camera, thus improving the driving safety of the driver and passengers. Brief Description of the Drawings
[0012] Figure 1 It is a flowchart of a detection method for a vehicle-mounted four-direction camera of the present invention;
[0013] Figure 2 It is a flowchart of the method of Embodiment 1 of the present invention;
[0014] Figure 3 It is a schematic diagram of the positions of the sampled pixel points in Embodiment 1 of the present invention. Detailed Embodiments
[0015] To describe in detail the technical content, achieved objectives and effects of the present invention, the following is a detailed description in conjunction with the embodiments and accompanied by the drawings.
[0016] Please refer to Figure 1 , a detection method for a vehicle-mounted four-direction camera, including:
[0017] Obtain YUV image data sent by the camera for a continuous preset number of frames;
[0018] Sample each frame of the YUV image data respectively to obtain the sampled pixel points corresponding to each frame of the YUV image data;
[0019] If the YUV values of all the sampled pixel points are the same, it is determined that the camera is unavailable.
[0020] From the above description, it can be seen that the beneficial effect of the present invention is that it can quickly and effectively detect the usability of the camera.
[0021] Further, before obtaining the YUV image data sent by the camera for a continuous preset number of frames, it further includes:
[0022] Judge whether the camera is in the inserted state;
[0023] If not, it is determined that the camera is unavailable;
[0024] If so, execute the step of obtaining the YUV image data sent by the camera for a continuous preset number of frames.
[0025] From the above description, it can be seen that by analyzing the inserted state of the camera, the unavailable situation caused by the unconnected camera can be quickly detected.
[0026] Furthermore, the sampled pixel points corresponding to the same-frame YUV image data are in a cross shape in the same-frame YUV image data.
[0027] As can be seen from the above description, the comprehensiveness of sampling can be ensured, thereby improving the reliability and accuracy of detection.
[0028] Furthermore, if the YUV values of all sampled pixel points are the same, it is determined that the camera is unavailable. Specifically:
[0029] If the Y component values of all sampled pixel points are preset values, it is determined that the camera is unavailable.
[0030] As can be seen from the above description, since the Y component values of the pixel points in a general normal image are not completely the same, only the Y component values of the pixel points need to be analyzed, further reducing the amount of data to be analyzed, thereby further improving the detection speed.
[0031] Furthermore, the preset value is 0x47.
[0032] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method described above is implemented.
[0033] Embodiment 1
[0034] Please refer to Figures 2 - 3 , Embodiment 1 of the present invention is: A detection method for a vehicle-mounted four-direction camera, which can be applied to a vehicle-mounted terminal.
[0035] As Figure 2 shown, it includes the following steps:
[0036] S1: The vehicle-mounted central control system determines whether the camera is in an inserted state. If so, step S5 is executed; if not, step S2 is executed.
[0037] After the vehicle-mounted device is powered on and started, the camera node will be mounted on the vehicle-mounted system. When the camera is in an inserted state, an insertion signal will be sent to the upper-layer application of the vehicle computer. When the camera is not in an inserted state, a removal signal will be sent to the upper-layer application of the vehicle computer. The vehicle-mounted central control system can also actively query the insertion state of the camera through an instruction.
[0038] S2: Obtain YUV image data sent by the camera for a continuous preset number of frames.
[0039] Among them, the YUV data is divided into a Y channel and a UV channel. The Y channel mainly represents the brightness of the image, that is, the gray value, and the UV channel represents the chromaticity, that is, the color. The Y component values of the pixel points in a normal image are not completely the same.
[0040] In this embodiment, YUV image data of 5 consecutive frames can be collected. Since the number of frames transmitted by the in-vehicle camera per second is mostly 30 FPS, the collection of 5-frame image data can be completed within 80 ms, so that the availability of the camera can be quickly judged.
[0041] S3: Sample each frame of YUV image data to obtain the sampled pixel points corresponding to each frame of YUV image data.
[0042] In this embodiment, each frame of YUV image data is sampled in a cross shape to obtain a set of sampled pixel points corresponding to each frame of YUV image data, that is, the sampled pixel points in the set of sampled pixel points corresponding to the same frame of YUV image data are in a cross shape in the frame of YUV image data.
[0043] For example, as Figure 3 shown, assuming that the size of a frame of YUV image data is 1280×720, then the number of sampled pixel points collected in this frame is 1280 (horizontal) + 720 (vertical) + 1468×2 (two diagonals) = 4936. Subsequently, the judgment of these pixel points can be controlled within 1 ms. This time can be ignored for the image transmission time and performance loss of the in-vehicle system, so that the data processing time in the image can be greatly reduced, and the availability of the camera can be fed back to the in-vehicle system more quickly.
[0044] By sampling in a cross shape, the data values in all directions of the upper, lower, left, right, and middle of the image can be obtained, which can not only effectively reduce the amount of data for availability judgment, but also ensure the comprehensiveness of sampling.
[0045] S4: Judge whether the YUV values of all sampled pixel points are the same. If so, execute step S5.
[0046] Since there will be a default YUV value, such as 0x47 (hexadecimal data), when the camera is in the inserted state but unable to capture images. If the camera can collect image data, the YUV values of the pixel points in the collected image data will not be the same because the colors and brightness of each pixel point will not be exactly the same.
[0047] In this embodiment, if the Y component values of all sampled pixel points in the set of sampled pixel points corresponding to each frame of YUV image data are all 0x47, it is considered that the camera is unavailable; otherwise, the camera is considered available.
[0048] S5: Determine that the camera is unavailable.
[0049] In this embodiment, by obtaining the insertion state of the camera and the image data in the insertion state, the availability of the camera can be quickly detected, improving the driving safety of the driver and passengers.
[0050] Embodiment 2
[0051] This embodiment corresponds to a computer-readable storage medium in the above embodiment, on which a computer program is stored. When the program is executed by a processor, it implements each step of a detection method for a vehicle-mounted four-direction camera in the above embodiment and can achieve the same technical effects, which will not be repeated here.
[0052] In summary, for a detection method and a computer-readable storage medium for a vehicle-mounted four-direction camera provided by the present invention, by analyzing the insertion state of the camera and the YUV values of some pixel points of the image data collected in the insertion state, the usability of the camera can be effectively detected, and the amount of data used for usability judgment can be reduced, improving the detection speed. The present invention can quickly and effectively detect the usability of the camera, thereby improving the driving safety of the driver and passengers.
[0053] The above are only the embodiments of the present invention, and do not limit the patent scope of the present invention. Any equivalent transformation made using the specification and drawings of the present invention, or directly or indirectly applied in related technical fields, shall be included in the patent protection scope of the present invention by the same token.
Claims
1. A detection method for a vehicle-mounted four-direction camera, characterized in that, Including: Obtaining YUV image data sent by a camera for a continuous preset number of frames; Sampling each frame of YUV image data respectively to obtain sampled pixel points corresponding to each frame of YUV image data; If the YUV values of all the sampled pixel points are the same, it is determined that the camera is unavailable.
2. The detection method of the vehicle-mounted four-direction camera according to claim 1, characterized in that, Before obtaining the YUV image data sent by the camera for a continuous preset number of frames, it further includes: Judging whether the camera is in an inserted state; If not, it is determined that the camera is unavailable; If so, execute the step of obtaining the YUV image data sent by the camera for a continuous preset number of frames.
3. The detection method of the vehicle-mounted four-direction camera according to claim 1, characterized in that The sampled pixel points corresponding to the same frame of YUV image data are in a cross shape in the same frame of YUV image data.
4. The detection method of the vehicle-mounted four-direction camera according to claim 1, wherein The step of if the YUV values of all the sampled pixel points are the same, it is determined that the camera is unavailable, specifically: If the Y component values of all the sampled pixel points are preset values, it is determined that the camera is unavailable.
5. The detection method of the vehicle-mounted four-direction camera according to claim 4, characterized in that, The preset value is 0x47.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the method according to any one of claims 1-5.