Vehicle-mounted camera video image display method, device, equipment and medium
By using vehicle information listener and GPU rendering in the on-board camera video image display system, the problems of slow startup speed and high resource dependence in the prior art are solved, and the effects of fast startup and stable frame rate are achieved.
Patent Information
- Application Number
- CN202510183577.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-05-23
AI Technical Summary
The existing methods of on-board camera video image display rely on Android virtual machines, resulting in slow startup speed and difficulty in meeting the needs of fast reversing. It also has a high dependence on CPU resources and Binder resources, which may lead to unstable frame rate and system performance burden.
Monitor the event of the target vehicle through the vehicle information listener, open the camera after the related event to obtain the target camera image of the current frame, and render the image through the GPU, using C++ to avoid dependence on Android virtual machines.
It improves the startup speed and meets the needs of fast reversing, avoids the occupation of CPU resources and Binder resources, reduces the dependence on Android platform and Binder resources, and avoids the problems of callback delay and unstable frame rate.
Smart Images

Figure CN120034625A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle computer technology, and more specifically, to a method, device, equipment and medium for displaying video images from a vehicle-mounted camera. Background Art
[0002] With the rapid development of Internet technology, especially the substantial increase in network bandwidth, vehicle-mounted video surveillance systems have been able to achieve high frame rate and high image quality video data transmission, which involves the display of vehicle-mounted camera video images.
[0003] Currently, the Android native EVS camera is mainly used for streaming and rendering display. Image transmission relies on shared memory and Binder callback notifications, which takes up system Binder resources.
[0004] However, the EVS solution relies on the Android virtual machine or runtime environment to execute, resulting in a slow startup speed, which is difficult to meet the needs of fast reversing. In addition, since image rendering requires CPU resources, some CPU performance issues may occur. In addition, the EVS solution is highly dependent on the Android platform and Binder resources, which will cause callback delays and unstable frame rates. At the same time, the high Binder resource usage will also increase the burden on system performance. Summary of the invention
[0005] In view of this, the purpose of this application is to provide a method, device, equipment and medium for displaying video images from a vehicle camera, which monitors the events of the target vehicle through a vehicle information listener, and opens the camera after the relevant event to obtain the target camera image of the current frame, and renders the image through the GPU. Since it is implemented in C++, it does not rely on the Android virtual machine or runtime environment to execute, which improves the startup speed and can meet the needs of fast reversing. Moreover, the image rendering through the GPU will not occupy CPU resources and will not have CPU performance problems. In addition, it can be used on the Linux platform, reducing the dependence on the Android platform, and at the same time, it also reduces the dependence on Binder resources, avoiding callback delays and unstable frame rates, and reducing the burden on system performance.
[0006] In a first aspect, an embodiment of the present application provides a method for displaying a video image of a vehicle-mounted camera, the method comprising:
[0007] For a target vehicle, a vehicle information listener is created based on the vehicle computer of the target vehicle;
[0008] The vehicle information listener monitors the current target vehicle information of the target vehicle based on the target inter-process communication means of Android; wherein the target vehicle information at least includes the gear position information and the ignition switch status of the vehicle body;
[0009] In response to the ignition switch state not being ACC OFF and the gear position information being a reverse gear position, sending a camera-on instruction to the camera, and acquiring a target camera image of a current frame based on the camera after the camera is turned on;
[0010] The target camera image is rendered in a first display area on the touch screen of the vehicle computer based on a graphics processing unit.
[0011] In a possible implementation, acquiring a target camera image of a current frame based on the camera includes:
[0012] Querying image parameters supported by the camera, and setting parameters of the camera based on the image parameters; wherein the categories of the image parameters include at least image format and image resolution;
[0013] In response to the camera successfully performing parameter setting, applying for a corresponding image buffer, allocating image memory to the camera, and in response to the image memory being allocated successfully, acquiring a target camera image based on the image buffer.
[0014] In a possible implementation, the setting parameters of the camera based on the image parameters includes:
[0015] Based on a first query instruction VIDIOC_ENUM_FMT of a preset target video frame, query the image parameters supported by the camera, and select the target image parameters therefrom;
[0016] Sending the first acquisition instruction VIDIOC_G_FMT under the target video framework to the camera to query the current image parameters of the camera;
[0017] Based on the current image parameters and the target image parameters, parameters of the camera are set.
[0018] In a possible implementation, rendering the target camera image includes:
[0019] Creating a corresponding OES texture according to the image buffer;
[0020] The target camera image is rendered based on the OES texture.
[0021] In a possible implementation, the method further includes:
[0022] Creating a touch screen listener, and monitoring the touch events of the touch screen based on the touch screen listener; wherein the touch events at least include pressing and lifting; and the touch events represent the touch events of the buttons on the touch screen;
[0023] In response to receiving the touch callback, obtaining corresponding touch event information;
[0024] The touch event information is rendered in a second display area of the touch screen of the vehicle computer based on the graphics processing unit.
[0025] In a possible implementation, the method further includes:
[0026] In response to receiving that the ignition switch state is ACC OFF or the gear position information is a reverse gear position, stopping monitoring the touch event of the touch screen.
[0027] In a possible implementation, the method further includes:
[0028] In response to the completion of rendering the target camera image of the current frame, the camera is notified to obtain the target camera image of the next frame.
[0029] In a second aspect, an embodiment of the present application further provides a vehicle-mounted camera video image display device, the device comprising:
[0030] A creation module, used for creating a vehicle information listener for a target vehicle based on the vehicle computer of the target vehicle;
[0031] A first monitoring module is used to monitor the current target vehicle information of the target vehicle through the vehicle information monitor based on the target inter-process communication means of Android; wherein the target vehicle information at least includes the gear position information and the ignition switch status of the vehicle body;
[0032] a first acquisition module, configured to send a camera-on instruction to the camera in response to the ignition switch state not being ACC OFF and the gear position information being a reverse gear position, and to acquire a target camera image of a current frame based on the camera after the camera is turned on;
[0033] The first rendering module is used to render the target camera image based on a first display area of the touch screen of the vehicle computer based on a graphics processing unit.
[0034] In a possible implementation manner, the first acquisition module is specifically configured to:
[0035] Querying image parameters supported by the camera, and setting parameters of the camera based on the image parameters; wherein the categories of the image parameters include at least image format and image resolution;
[0036] In response to the camera successfully performing parameter setting, applying for a corresponding image buffer, allocating image memory to the camera, and in response to the image memory being allocated successfully, acquiring a target camera image based on the image buffer.
[0037] In a possible implementation manner, the first acquisition module is specifically configured to:
[0038] Based on a first query instruction VIDIOC_ENUM_FMT of a preset target video frame, query the image parameters supported by the camera, and select the target image parameters therefrom;
[0039] Sending the first acquisition instruction VIDIOC_G_FMT under the target video framework to the camera to query the current image parameters of the camera;
[0040] Based on the current image parameters and the target image parameters, parameters of the camera are set.
[0041] In a possible implementation manner, the first rendering module is specifically configured to:
[0042] Creating a corresponding OES texture according to the image buffer;
[0043] The target camera image is rendered based on the OES texture.
[0044] In a possible implementation manner, the vehicle-mounted camera video image display device further includes:
[0045] A second monitoring module is used to create a touch screen monitor and monitor the touch event of the touch screen based on the touch screen monitor; wherein the touch event at least includes pressing and lifting; the touch event represents the touch event of the button on the touch screen;
[0046] A second acquisition module, configured to acquire corresponding touch event information in response to receiving a touch callback;
[0047] The second rendering module is used to render the touch event information in a second display area of the touch screen of the vehicle computer based on the graphics processing unit.
[0048] In a possible implementation manner, the vehicle-mounted camera video image display device further includes:
[0049] The third monitoring module is used for stopping monitoring the touch event of the touch screen in response to receiving the ignition switch state as ACC OFF or the gear position information as a reverse gear position.
[0050] In a possible implementation manner, the vehicle-mounted camera video image display device further includes:
[0051] The third acquisition module is used to notify the camera to acquire the next frame of the target camera image in response to the completion of rendering the target camera image of the current frame.
[0052] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the vehicle-mounted camera video image display method as described in any one of the first aspects.
[0053] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the vehicle-mounted camera video image display method described in any one of the first aspects are executed.
[0054] The embodiment of the present application provides a method, device, equipment and medium for displaying video images of a vehicle camera. For a target vehicle, a vehicle information listener is created based on the vehicle computer of the target vehicle. Through the vehicle information listener, the current target vehicle information of the target vehicle is monitored based on the target inter-process communication means of Android. In response to the ignition switch state not being ACCOFF and the gear information being the reverse gear, a command to turn on the camera is sent to the camera, and after the camera is turned on, the target camera image of the current frame is obtained based on the camera, and the target camera image is rendered based on the first display area of the touch screen of the vehicle computer by the graphics processing unit. In the present application, the event of the target vehicle is monitored through the vehicle information listener, and the camera is turned on after the relevant event to obtain the target camera image of the current frame, and the image is rendered through the GPU. Since it is implemented in C++, it does not rely on the virtual machine or runtime environment of Android to execute, which improves the startup speed, can meet the needs of fast reversing, and the image rendering through the GPU will not occupy CPU resources, and there will be no problems with CPU performance. In addition, it can be used on the Linux platform, reducing the dependence on the Android platform, and at the same time, it also reduces the dependence on Binder resources, avoids the problems of callback delay and unstable frame rate, and reduces the burden on system performance.
[0055] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 is a flow chart of a method for displaying a video image of a vehicle-mounted camera provided in an embodiment of the present application;
[0058] Figure 2 It is a flowchart of the video image display process of the vehicle camera;
[0059] Figure 3 is a flow chart of a method for displaying video images of a vehicle-mounted camera provided according to another embodiment of the present application;
[0060] Figure 4 is a structural schematic diagram of a vehicle-mounted camera video image display device provided according to an embodiment of the present application;
[0061] Figure 5 It is a structural schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0062] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0063] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0064] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0065] Taking into account the rapid development of Internet technology, especially the substantial increase in network bandwidth, the vehicle-mounted video surveillance system has been able to achieve high frame rate and high image quality video data transmission, which involves the display of vehicle-mounted camera video images.
[0066] Currently, the Android native EVS camera is mainly used for streaming and rendering display. Image transmission relies on shared memory and Binder callback notifications, which takes up system Binder resources.
[0067] However, the EVS solution relies on the Android virtual machine or runtime environment to execute, resulting in a slow startup speed, which is difficult to meet the needs of fast reversing. In addition, since image rendering requires CPU resources, some CPU performance issues may occur. In addition, the EVS solution is highly dependent on the Android platform and Binder resources, which will cause callback delays and unstable frame rates. At the same time, the high Binder resource usage will also increase the burden on system performance.
[0068] In response to this problem, the present application provides a method, device, equipment and medium for displaying video images from a vehicle camera. The vehicle information listener monitors the events of the target vehicle, and after the relevant event, the camera is opened to obtain the target camera image of the current frame, and the image is rendered by the GPU. Since it is implemented in C++, it does not rely on the Android virtual machine or runtime environment to execute, which improves the startup speed and can meet the needs of fast reversing. The GPU performs image rendering, which does not occupy CPU resources and does not have CPU performance issues. In addition, it can be used on the Linux platform, reducing the dependence on the Android platform. At the same time, it also reduces the dependence on Binder resources, avoids callback delays and unstable frame rates, and reduces the burden on system performance.
[0069] Figure 1 FIG. 1 is a flow chart of a method for displaying a video image of a vehicle-mounted camera according to an embodiment of the present application. Figure 1 As shown, the vehicle camera video image display method of the embodiment of the present application may specifically include:
[0070] S101. For a target vehicle, create a vehicle information listener based on the vehicle computer of the target vehicle.
[0071] S102, monitoring the current target vehicle information of the target vehicle through the vehicle information monitor based on the target inter-process communication means of Android.
[0072] S103: In response to the ignition switch state not being ACC OFF and the gear information being the reverse gear, sending a camera-on instruction to the camera, and acquiring a target camera image of a current frame based on the camera after the camera is turned on.
[0073] S104: Rendering the target camera image in a first display area on the touch screen of the vehicle computer based on the graphics processing unit.
[0074] In the above-mentioned vehicle-mounted camera video image display method, the event of the target vehicle is monitored by the vehicle information listener, and the camera is opened after the relevant event to obtain the target camera image of the current frame, and the image is rendered by the GPU. Since it is implemented in C++, it does not rely on the Android virtual machine or runtime environment to execute, which improves the startup speed and can meet the needs of fast reversing. The image rendering by the GPU will not occupy CPU resources and will not have CPU performance problems. In addition, it can be used on the Linux platform, reducing the dependence on the Android platform. At the same time, it also reduces the dependence on Binder resources, avoids the problems of callback delay and unstable frame rate, and reduces the burden on system performance.
[0075] The above exemplary steps of the embodiment of the present application are described below with reference to specific examples:
[0076] S101, for a target vehicle, creating a vehicle information listener based on the vehicle computer of the target vehicle.
[0077] In the embodiment of the present application, the target vehicle is the vehicle that displays the video image of the vehicle camera, and the vehicle information listener is the event listener that listens to the event information of the vehicle. The vehicle information listener is created according to the vehicle computer of the target vehicle for subsequent processing, for example, Figure 2 As shown, create an event listener to listen for events.
[0078] S102, monitoring target vehicle information of a target vehicle through a vehicle information monitor based on the target inter-process communication means of Android.
[0079] In the embodiment of the present application, the inter-process communication means is the inter-process communication means of Android, such as Binder, Socket, etc., which can be selected according to the specific situation; the target vehicle information is the current vehicle information of the target vehicle, wherein the target vehicle information is the message of the current vehicle information process, including at least the gear information of the vehicle body and the ignition switch status; the gear information of the vehicle body is the gear of the vehicle body, such as reverse; the vehicle information listener created in step S101 monitors the current target vehicle information of the target vehicle according to the target inter-process communication means of Android, that is, monitors the events of the target vehicle for subsequent processing. For example, Figure 2 As shown, the event listener listens for events.
[0080] S103, in response to the ignition switch state not being ACC OFF and the gear information being the reverse gear, sending a camera-on instruction to the camera, and acquiring a target camera image of a current frame based on the camera after the camera is turned on.
[0081] It is understood by those skilled in the art that ACC OFF indicates a state in which the vehicle is turned off and all electrical devices stop operating.
[0082] In the embodiment of the present application, the target camera image is the image of the current frame acquired by the camera, and the camera is the onboard camera of the target vehicle. When the ignition switch state is not ACC OFF and the gear information is the reverse gear, a command to turn on the camera is sent to the camera, and after the camera is turned on, the target camera image of the current frame is acquired based on the camera for subsequent processing. For example, Figure 2 As shown, after a relevant event is monitored (the ignition switch state is not ACC OFF and the gear information is the reverse gear), a camera opening instruction is issued to turn on the camera, so as to subsequently obtain an image based on the camera.
[0083] S104: Rendering the target camera image in a first display area on the touch screen of the vehicle computer based on the graphics processing unit.
[0084] In the embodiment of the present application, the graphics processing unit (GPU) is a graphics processing unit on the vehicle computer, and the first display area is an area on the touch screen for displaying the camera image. The target camera image is rendered in the first display area on the touch screen of the vehicle computer according to the GPU on the vehicle computer. Figure 2 As shown, after obtaining the camera image, the rendering is notified and the camera image is rendered.
[0085] Optionally, when rendering the target camera image, a corresponding OES texture may be created according to the image buffer; and the target camera image is rendered based on the OES texture. Figure 2 As shown, an OES texture is created based on the buffer and rendered after waiting for the target camera image to be passed in.
[0086] It should be noted that before creating the corresponding OES texture according to the image buffer, a shader and a corresponding UI texture are created based on the graphics processing unit. Figure 2 As shown, 1. Initialize the OpenGL (Open Graphics Library) environment, create a shader, create the required UI texture, and wait for the camera image. Those skilled in the art can understand that the shader runs on the GPU and processes a large amount of data in parallel through the GPU. The UI texture usually refers to the image used for user interface elements, such as buttons, backgrounds, icons, etc.
[0087] It should be noted that the corresponding implementation of this application is implemented in C++.
[0088] The vehicle-mounted camera video image display method provided by the embodiment of the present application, for the target vehicle, creates a vehicle information listener based on the vehicle machine of the target vehicle, and through the vehicle information listener, monitors the current target vehicle information of the target vehicle based on the target inter-process communication means of Android, in response to the ignition switch state is not ACC OFF and the gear information is the reverse gear, then sends a command to turn on the camera to the camera, and after the camera is turned on, the target camera image of the current frame is obtained based on the camera, and the target camera image is rendered based on the first display area of the touch screen of the vehicle machine of the graphics processing unit. The vehicle-mounted camera video image display method of the present application monitors the event of the target vehicle through the vehicle information listener, and opens the camera to obtain the target camera image of the current frame after the relevant event, and renders the image through the GPU. Since it is implemented in C++, it does not rely on the virtual machine or runtime environment of Android to execute, which improves the startup speed, can meet the needs of fast reversing, and through the GPU to render the image, it will not occupy CPU resources, and there will be no problems in CPU performance. In addition, it can be used on the Linux platform, reducing the dependence on the Android platform, and at the same time, it also reduces the dependence on Binder resources, avoids the problems of callback delay and unstable frame rate, and reduces the burden on system performance.
[0089] Further, such as Figure 3 As shown, the “obtaining a target camera image of the current frame based on the camera” in step S103 in the above embodiment may specifically include the following steps:
[0090] S301, querying image parameters supported by a camera, and setting parameters of the camera based on the image parameters.
[0091] In the embodiment of the present application, the image parameters are various parameters supported by the camera, and the categories of image parameters include at least image format and image resolution; the image parameters supported by the camera are queried, and the camera parameters are set based on the image parameters for subsequent processing.
[0092] It should be noted that after the camera is turned on, the camera is operated through the V4L2 (Video for Linux 2) framework.
[0093] Optionally, based on the first query instruction of the preset target video frame, query the image parameters supported by the camera and select the target image parameters therefrom; send the first acquisition instruction VIDIOC_G_FMT under the target video frame to the camera to query the current image parameters of the camera; and set the parameters of the camera based on the current image parameters and the target image parameters.
[0094] Among them, the current image parameters are the current image parameters of the camera, and the target image parameters are the image parameters selected from the image parameters supported by the queried camera. For example, the image resolutions supported by the queried camera are 720P and 1080P. When we choose 1080P, this is the target image parameter; the target video framework can be the V4L2 (Video for Linux 2) framework. This application uses this as an example for description, but it does not constitute a limitation to this. At this time, the first query instruction is VIDIOC_ENUM_FMT, and the first acquisition instruction is VIDIOC_G_FMT. For example, Figure 2 As shown, after opening the camera, use the VIDIOC_ENUM_FMT instruction to query the image parameters supported by the camera, such as image format, image resolution, etc. After querying the parameters supported by the camera, select the required parameters and set them to the camera through the VIDIOC_S_FMT instruction.
[0095] It should be noted that the VIDIOC_G_FMT command can be sent to the camera to query the current image parameters of the camera to determine whether the camera's current command VIDIOC_S_FMT is the same as the selected camera image parameters. If they are the same, it means that the parameter setting is successful, and if they are not the same, it means that the parameter setting fails.
[0096] S302, in response to the camera successfully performing parameter setting, applying for a corresponding image buffer, allocating image memory to the camera, and in response to the image memory being allocated successfully, acquiring a target camera image based on the image buffer.
[0097] In the embodiment of the present application, when the camera parameters are successfully set, the corresponding image buffer is applied for, image memory is allocated to the camera, and in response to the successful allocation of image memory, the target camera image is acquired based on the image buffer for subsequent processing. Figure 2 As shown in the figure, after successfully setting the parameters, use the VIDIOC_REQBUFS instruction to apply for the image buffer and allocate image memory to the camera.
[0098] It should be noted that after successfully allocating the image memory, the camera image can be obtained through VIDIOC_DQBUF and VIDIOC_QBUF.
[0099] Furthermore, a touch screen listener is created, and the touch events of the touch screen are listened to based on the touch screen listener; in response to receiving the touch callback, the corresponding touch event information is obtained; based on the graphics processing unit, the touch event information is rendered in the second display area of the touch screen of the vehicle computer. Among them, the touch event includes at least pressing and lifting; the touch event represents the touch event of the button on the touch screen; the touch event information is the information of the touch screen button; the second display area is the area on the touch screen that displays the user's touch screen button. For example, Figure 2 As shown, create a touch screen button touch monitor to monitor screen touches, and render the interface when a touch callback is received.
[0100] Optionally, the touch event information is rendered in the second display area of the touch screen of the vehicle computer based on the UI texture through a graphics processing unit.
[0101] Further, in response to receiving that the ignition switch state is ACC OFF or the gear position information is a reverse gear position, the touch event of the touch screen is stopped from being monitored. It should be noted that after receiving the information of ACC OFF or exiting the reverse gear position, the touch event monitoring is stopped, the OpenGL image rendering is stopped, and the camera is turned off.
[0102] Furthermore, in response to the completion of rendering the target camera image of the current frame, the camera is notified to obtain the target camera image of the next frame. Figure 2 As shown, after the rendering is completed, the camera is notified to obtain the next frame of the target camera image so as to render the next frame.
[0103] Further, the acquisition time limit of the camera for the target camera image is obtained; in response to the camera failing to acquire the target camera image within the acquisition time limit, the camera is turned on and off again. In short, a timeout is set when acquiring the camera image, and the camera can be turned on and off again if no image is acquired for more than a certain period of time.
[0104] Furthermore, in response to the camera failing to turn on, the camera is powered on and off again.
[0105] Therefore, through the mechanism of detecting camera failure and attempting recovery, bugs in the camera program itself or software bugs in the platform can be recovered, ensuring that the camera can work normally and obtain camera images.
[0106] It should be noted that the two threads of stream acquisition and rendering need to be thread synchronized, that is, image acquisition and rendering need to be thread synchronized.
[0107] Figure 4 is a structural schematic diagram of a vehicle-mounted camera video image display device provided according to an embodiment of the present application; Figure 4 As shown, the vehicle-mounted camera video image display device 400 of the embodiment of the present application may specifically include:
[0108] A creation module 401 is used to create a vehicle information listener for a target vehicle based on the vehicle computer of the target vehicle;
[0109] The first monitoring module 402 is used to monitor the current target vehicle information of the target vehicle through the vehicle information monitor based on the target inter-process communication means of Android; wherein the target vehicle information at least includes the gear position information and the ignition switch status of the vehicle body;
[0110] A first acquisition module 403 is used for sending a camera-on instruction to the camera in response to the ignition switch state not being ACC OFF and the gear position information being a reverse gear position, and acquiring a target camera image of a current frame based on the camera after the camera is turned on;
[0111] The first rendering module 404 is used to render the target camera image based on the first display area of the touch screen of the vehicle computer by the graphics processing unit.
[0112] In a possible implementation manner, the first acquisition module is specifically configured to:
[0113] Querying image parameters supported by the camera, and setting parameters of the camera based on the image parameters; wherein the categories of the image parameters include at least image format and image resolution;
[0114] In response to the camera successfully performing parameter setting, applying for a corresponding image buffer, allocating image memory to the camera, and in response to the image memory being allocated successfully, acquiring a target camera image based on the image buffer.
[0115] In a possible implementation manner, the first acquisition module is specifically configured to:
[0116] Based on a first query instruction VIDIOC_ENUM_FMT of a preset target video frame, query the image parameters supported by the camera, and select the target image parameters therefrom;
[0117] Sending the first acquisition instruction VIDIOC_G_FMT under the target video framework to the camera to query the current image parameters of the camera;
[0118] Based on the current image parameters and the target image parameters, parameters of the camera are set.
[0119] In a possible implementation manner, the first rendering module is specifically configured to:
[0120] Creating a corresponding OES texture according to the image buffer;
[0121] The target camera image is rendered based on the OES texture.
[0122] In a possible implementation manner, the vehicle-mounted camera video image display device further includes:
[0123] A second monitoring module is used to create a touch screen monitor and monitor the touch event of the touch screen based on the touch screen monitor; wherein the touch event at least includes pressing and lifting; the touch event represents the touch event of the button on the touch screen;
[0124] A second acquisition module, configured to acquire corresponding touch event information in response to receiving a touch callback;
[0125] The second rendering module is used to render the touch event information in a second display area of the touch screen of the vehicle computer based on the graphics processing unit.
[0126] In a possible implementation manner, the vehicle-mounted camera video image display device further includes:
[0127] The third monitoring module is used for stopping monitoring the touch event of the touch screen in response to receiving the ignition switch state as ACC OFF or the gear position information as a reverse gear position.
[0128] In a possible implementation manner, the vehicle-mounted camera video image display device further includes:
[0129] The third acquisition module is used to notify the camera to acquire the next frame of the target camera image in response to the completion of rendering the target camera image of the current frame.
[0130] The vehicle-mounted camera video image display device provided by the embodiment of the present application, for the target vehicle, creates a vehicle information listener based on the vehicle machine of the target vehicle, and through the vehicle information listener, monitors the current target vehicle information of the target vehicle based on the target inter-process communication means of Android, responds to the ignition switch state is not ACC OFF and the gear information is the reverse gear, then sends a command to turn on the camera to the camera, and after the camera is turned on, the target camera image of the current frame is obtained based on the camera, and the target camera image is rendered based on the first display area of the touch screen of the vehicle machine of the graphics processing unit. The vehicle-mounted camera video image display device of the present application monitors the event of the target vehicle through the vehicle information listener, and opens the camera to obtain the target camera image of the current frame after the relevant event, and renders the image through the GPU. Since it is implemented in C++, it does not rely on the virtual machine or runtime environment of Android to execute, which improves the startup speed, can meet the needs of fast reversing, and through the GPU to render the image, it will not occupy CPU resources, and there will be no problems in CPU performance. In addition, it can be used on the Linux platform, reducing the dependence on the Android platform, and at the same time, it also reduces the dependence on Binder resources, avoids the problems of callback delay and unstable frame rate, and reduces the burden on system performance.
[0131] like Figure 5 As shown, an electronic device 500 provided in an embodiment of the present application includes: a processor 501, a memory 502 and a bus, wherein the memory 502 stores machine-readable instructions executable by the processor 501. When the electronic device is running, the processor 501 communicates with the memory 502 through the bus, and the processor 501 executes the machine-readable instructions to perform the steps of the above-mentioned vehicle-mounted camera video image display method.
[0132] Specifically, the above-mentioned memory 502 and processor 501 can be general-purpose memories and processors, which are not specifically limited here. When the processor 501 runs the computer program stored in the memory 502, it can execute the above-mentioned vehicle-mounted camera video image display method.
[0133] Corresponding to the above-mentioned vehicle-mounted camera video image display method, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned vehicle-mounted camera video image display method are executed.
[0134] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0135] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0136] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0137] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the deployment method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0138] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for displaying a video image of a vehicle-mounted camera, characterized in that: The method comprises: For a target vehicle, a vehicle information listener is created based on the vehicle computer of the target vehicle; The vehicle information listener monitors the current target vehicle information of the target vehicle based on the target inter-process communication means of Android; wherein the target vehicle information at least includes the gear position information and the ignition switch status of the vehicle body; In response to the ignition switch state not being ACCOFF and the gear information being a reverse gear, sending a camera-on instruction to the camera, and acquiring a target camera image of a current frame based on the camera after the camera is turned on; The target camera image is rendered in a first display area on the touch screen of the vehicle computer based on a graphics processing unit.
2. The method according to claim 1, characterized in that The step of acquiring a target camera image of a current frame based on the camera includes: Querying image parameters supported by the camera, and setting parameters of the camera based on the image parameters; wherein the categories of the image parameters include at least image format and image resolution; In response to the camera successfully performing parameter setting, applying for a corresponding image buffer, allocating image memory to the camera, and in response to the image memory being allocated successfully, acquiring a target camera image based on the image buffer.
3. The method according to claim 2, characterized in that The step of setting parameters of the camera based on the image parameters includes: Based on a first query instruction VIDIOC_ENUM_FMT of a preset target video frame, query the image parameters supported by the camera, and select the target image parameters therefrom; Sending the first acquisition instruction VIDIOC_G_FMT under the target video framework to the camera to query the current image parameters of the camera; Based on the current image parameters and the target image parameters, parameters of the camera are set.
4. The method according to claim 3, characterized in that The rendering of the target camera image comprises: Creating a corresponding OES texture according to the image buffer; The target camera image is rendered based on the OES texture.
5. The method according to claim 4, characterized in that The method further comprises: Creating a touch screen listener, and monitoring the touch events of the touch screen based on the touch screen listener; wherein the touch events at least include pressing and lifting; and the touch events represent the touch events of the buttons on the touch screen; In response to receiving the touch callback, obtaining corresponding touch event information; The touch event information is rendered in a second display area of the touch screen of the vehicle computer based on the graphics processing unit.
6. The method according to claim 5, characterized in that The method further comprises: In response to receiving that the ignition switch state is ACC OFF or the gear position information is a reverse gear position, stopping monitoring the touch event of the touch screen.
7. The method according to claim 6, characterized in that The method further comprises: In response to the completion of rendering the target camera image of the current frame, the camera is notified to obtain the target camera image of the next frame.
8. A vehicle-mounted camera video image display device, characterized in that: The device comprises: A creation module, used for creating a vehicle information listener for a target vehicle based on the vehicle computer of the target vehicle; A first monitoring module is used to monitor the current target vehicle information of the target vehicle through the vehicle information monitor based on the target inter-process communication means of Android; wherein the target vehicle information at least includes the gear position information and the ignition switch status of the vehicle body; a first acquisition module, configured to send a camera-on instruction to the camera in response to the ignition switch state not being ACC OFF and the gear position information being a reverse gear position, and to acquire a target camera image of a current frame based on the camera after the camera is turned on; The first rendering module is used to render the target camera image based on a first display area of the touch screen of the vehicle computer based on a graphics processing unit.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the vehicle-mounted camera video image display method as described in any one of claims 1 to 7 are performed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the vehicle-mounted camera video image display method as described in any one of claims 1 to 7.