UI switching method and device for vehicle-mounted application and storage medium
By using the on-board camera to obtain environmental images in on-board applications, determining the average image grayscale value and switching the UI mode, the problem of single UI switching mode of existing on-board applications is solved, adaptive switching is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202510113044.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-30
AI Technical Summary
The UI switching method of existing on-board applications is relatively single, lacks humanized design, and it is impossible to switch adaptively based on the environmental information around the car body.
The on-board camera obtains the environment image around the car body, determines the grayscale average of the image, and switches the UI mode of the on-board application based on the grayscale average and the current time, adjusts the screen brightness to improve the user experience.
It realizes adaptive switching of on-board application UI, improves user experience, reduces user learning costs, and improves operational convenience.
Smart Images

Figure CN120066647A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of in-vehicle applications, and particularly to a method, device, and storage medium for UI (User Interface) switching of in-vehicle applications. Background Art
[0002] With the rapid development of the automotive industry, the number of in-vehicle applications is increasing continuously, and users' requirements for the usage experience of in-vehicle applications are also rising day by day. The UI of in-vehicle applications greatly affects users' feelings. Currently, most in-vehicle applications only support the method of manually clicking the switching button for UI switching, which is relatively single and lacks humanized design considerations. Summary of the Invention
[0003] In view of this, this application provides a method, device, and storage medium for UI switching of in-vehicle applications, which can adaptively switch the UI mode of in-vehicle applications according to the environmental information around the vehicle body.
[0004] In a first aspect, an embodiment of the present invention provides a method for switching the user interface UI of in-vehicle applications, the method including: Obtaining an environmental image around the vehicle body through an in-vehicle camera; Determining the average image gray value of the environmental image; Determining a comfortable screen brightness value according to the average image gray value; Adjusting the screen brightness of the vehicle-mounted device according to the comfortable screen brightness value; Switching the UI mode of in-vehicle applications according to the average image gray value and the current time.
[0005] In some embodiments, the determining the average image gray value of the environmental image includes: Selecting target pixel points from the environmental image; Calculating a first gray value of the environmental image according to the target pixel points by using a first gray algorithm; Calculating a second gray value of the environmental image according to the target pixel points by using a second gray algorithm; Determining the average image gray value of the environmental image according to the first gray value and the second gray value.
[0006] In some embodiments, the selecting target pixel points from the environmental image includes: Determining the brightness value of each pixel point in the environmental image; Selecting pixel points with a brightness value greater than a first threshold from the environmental image as the target pixel points; or, Select the top N percent with the largest brightness values from the environmental image as the target pixel points.
[0007] In some embodiments, calculating the first grayscale value of the environmental image according to the target pixel points by using a first grayscale algorithm includes: Determine the average pixel values of the R channel, G channel, and B channel of the target pixel points; Perform linear weighting on the average pixel values of the R channel, the G channel, and the B channel to obtain the first grayscale value of the environmental image.
[0008] In some embodiments, calculating the second grayscale value of the environmental image according to the target pixel points by using a second grayscale algorithm includes: Determine the average pixel values of the R channel, G channel, and B channel of the target pixel points; Take the logarithm and weight the average pixel values of the R channel, the G channel, and the B channel respectively to obtain a grayscale value to be processed; Determine the maximum grayscale value and the minimum grayscale value according to the pixel values of each target pixel point; Normalize the grayscale value to be processed according to the maximum grayscale value and the minimum grayscale value to obtain the second grayscale value of the environmental image.
[0009] In some embodiments, determining the maximum grayscale value and the minimum grayscale value according to the pixel values of each target pixel point includes: Take the logarithm and weight the R channel pixel value, G channel pixel value, and B channel pixel value of each target pixel point respectively to obtain the grayscale logarithm value of each target pixel point; Determine the maximum grayscale value and the minimum grayscale value according to the grayscale logarithm values of each target pixel point.
[0010] In some embodiments, determining the comfortable screen brightness value according to the average image grayscale value includes: Determine the comfortable screen brightness value according to the average image grayscale value and the brightness value when the screen displays white.
[0011] In some embodiments, switching the UI mode of the in-vehicle application according to the average image grayscale value and the current time includes: If the average image grayscale value is within a preset first grayscale interval and the current time is within a preset first time range, then switch the UI of the in-vehicle application to the night mode; Otherwise, switch the UI of the in-vehicle application to the day mode.
[0012] In a second aspect, an embodiment of the present invention provides a UI switching device for in-vehicle applications, including: An image acquisition module, configured to acquire an environmental image around the vehicle body through an in-vehicle camera; A grayscale value determination module, configured to determine the average image grayscale value of the environmental image; A screen comfortable brightness determination module, configured to determine a screen comfortable brightness value according to the average image grayscale value; A screen brightness adjustment module, configured to adjust the screen brightness of the vehicle-mounted device according to the screen comfortable brightness value; A UI mode switching module, configured to switch the UI mode of the in-vehicle application according to the average image grayscale value and the current time.
[0013] In a third aspect, an embodiment of the present invention provides a vehicle-mounted device, including: A memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the vehicle-mounted device where it is located executes the method described in the first aspect or any item of the first aspect.
[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, the computer-readable storage medium includes a stored program, wherein when the program runs, it controls the device where the computer-readable storage medium is located to execute the method described in the first aspect or any item of the first aspect.
[0015] The UI switching method, device and storage medium for in-vehicle applications according to the embodiments of the present invention at least have the following beneficial effects: In the embodiment of the present invention, an environmental image around the vehicle body is acquired through a camera. By processing the environmental image around the vehicle body, the average image grayscale value and the screen comfortable brightness value can be determined. According to the average image grayscale value and the screen comfortable brightness value, the UI mode of the in-vehicle application can be adaptively switched, effectively improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flowchart of a UI switching method for in-vehicle applications provided by an embodiment of the present invention; Figure 2 It is a flowchart of another UI switching method for in-vehicle applications provided by an embodiment of the present invention; Figure 3 It is a schematic structural diagram of a UI switching device for in-vehicle applications provided by an embodiment of the present invention; Figure 4 It is a schematic structural diagram of a vehicle-mounted device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0018] It should be clear that the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of this application.
[0019] The terms used in the embodiments of this application are only for the purpose of describing specific embodiments, and are not intended to limit this application. The singular forms "a", "the", and "said" used in the embodiments of this application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0020] The embodiment of the present invention provides a method for switching the UI of in-vehicle applications. This method obtains the environmental image around the vehicle body through a camera. By processing the environmental image around the vehicle body, the average image gray value and the screen comfortable brightness value can be determined. According to the average image gray value and the screen comfortable brightness value, the UI mode of in-vehicle applications can be adaptively switched, effectively improving the user experience.
[0021] See Figure 1 , which is a flowchart of a method for switching the UI of in-vehicle applications provided by the embodiment of the present invention. The execution subject of this method is a vehicle-mounted device, such as Figure 1 shown. The processing steps of this method include: 101. Obtain the environmental image around the vehicle body through an in-vehicle camera. This environmental image can be an RGB color image.
[0022] 102. Determine the average image gray value of the above environmental image. In some embodiments, the method for determining the gray value of the environmental image may include: selecting target pixel points from the environmental image and determining the gray value of the environmental image based on the target pixel points.
[0023] Among them, selecting target pixel points from the environmental image may include: determining the brightness value of each pixel point in the environmental image and selecting the pixel points with a brightness value greater than the first threshold as target pixel points from the environmental image. Or, select the top N percent of the pixel points with the largest brightness values from the environmental image as target pixel points. Specifically, the brightness values of the pixel points in the environmental image can be sorted in descending order, and the top N percent of the sorted values can be selected as target pixel points. For example, select the top 70% of the sorted values as target pixel points. That is, select the area with higher brightness in the environmental image for calculating the average image gray value.
[0024] After selecting target pixel points from the environmental image, the first grayscale algorithm and the second grayscale algorithm can be used to calculate the first grayscale value and the second grayscale value of the environmental image respectively, and the grayscale value of the entire environmental image can be determined through the first grayscale value and the second grayscale value. In the method of the embodiment of the present invention, the grayscale value of the entire environmental image is finally determined through the grayscale values calculated by different algorithms, which can enhance the robustness of the image grayscale mean value and make the result more accurate.
[0025] 103. Determine the screen comfortable brightness value according to the image grayscale mean value of the environmental image.
[0026] 104. Adjust the screen brightness of the vehicle-mounted device according to the screen comfortable brightness value.
[0027] 105. Switch the UI mode of the in-vehicle application according to the image grayscale mean value of the environmental image and the current time.
[0028] In the method of the embodiment of the present invention, the environmental image around the vehicle body is collected, and the screen comfortable brightness and the UI mode can be adjusted according to the environmental image around the vehicle body, so that the screen brightness and the UI mode are more in line with the user's eye use requirements and improve the user experience. Moreover, in the method of the embodiment of the present invention, the UI mode of the in-vehicle application is automatically adjusted according to the environmental brightness around the vehicle body and the current time, without the user manually clicking a button, reducing the user's learning cost and improving the operation convenience.
[0029] See Figure 2 , which is another flowchart of the UI switching method for in-vehicle applications provided by the embodiment of the present invention. As Figure 2 shown, the processing steps of this method include: 201. Obtain the environmental image around the vehicle body through the vehicle-mounted camera.
[0030] The environmental image around the vehicle body can be a color image in RGB format. After obtaining the environmental image around the vehicle body, the environmental image can be cropped to obtain an effective image with a width of W and a height of H. The pixel points in the environmental image can be represented as , representing the position coordinates of the pixel points.
[0031] 202. Traverse each pixel point in the environmental image and perform RGB three-channel separation.
[0032] Red channel: ; Green channel: ; Blue channel: .
[0033] Among them, , ) and respectively represent the values of the three colors red (R), green (G), and blue (B) at ), and the intensity values of , , and are usually in the integer range of 0 - 255.
[0034] 203, traverse each pixel point in the environmental image and calculate the brightness value of each pixel point .
[0035] Among them, .
[0036] 204, select target pixel points from the environmental image.
[0037] Among them, sort according to the brightness value from large to small, and select the top 70% of the n pixel points as target pixel points. That is, identify the area with higher brightness from the environmental image.
[0038] 205, determine the average value of the R-channel pixels, the average value of the G-channel pixels, and the average value of the B-channel pixels of the target pixel points.
[0039] Calculate the average value of the R-channel, G-channel, and B-channel of the selected n pixel points to obtain the average value of the R-channel pixels , the average value of the G-channel pixels , and the average value of the B-channel pixels .
[0040] ; ; .
[0041] 206, according to the target pixel points, calculate the first grayscale value of the environmental image using the first grayscale algorithm.
[0042] Among them, the first grayscale algorithm includes: for the average value of the R-channel pixels of the environmental image , the average value of the G-channel pixels , and the average value of the B-channel pixels perform linear weighting to obtain the first grayscale value .
[0043] In a specific example, . Among them, 0.299, 0.587, and 0.114 are linear weighting coefficients, which are set according to actual needs.
[0044] 207, according to the target pixel points, calculate the second grayscale value of the environmental image using the second grayscale algorithm.
[0045] Among them, the second grayscale algorithm includes: taking the mean value of the R-channel pixels of the environmental image , the mean value of the G-channel pixels , and the mean value of the B-channel pixels , respectively taking logarithms and weighting them to obtain the grayscale value to be processed .
[0046] Among them, .
[0047] Taking the logarithms and weighting the R-channel pixel value, G-channel pixel value, and B-channel pixel value of each target pixel point respectively to obtain the grayscale logarithm value of each target pixel point. Sorting the grayscale logarithm values of n pixel points to obtain the maximum grayscale value and the minimum grayscale value .
[0048] After that, according to the maximum grayscale value and the minimum grayscale value , normalizing the grayscale value to be processed to obtain the second grayscale value of the environmental image .
[0049] Among them, the following formula can be used to normalize the grayscale value to be processed , including: .
[0050] 208. Determine the image grayscale mean value of the environmental image according to the first grayscale value and the second grayscale value of the environmental image.
[0051] Among them, the average value of and can be calculated to obtain the image grayscale mean value Y: .
[0052] 209. Determine the screen comfortable brightness value according to the image grayscale mean value.
[0053] Among them, the screen comfortable brightness value can be determined according to the image grayscale mean value and the brightness value when the screen shows white.
[0054] In an example, the screen comfortable brightness value can be determined according to the formula .
[0055] is the brightness value when the current screen shows white, in lux. The screens of different manufacturers will be different.
[0056] 210. Adjust the screen brightness of the in-vehicle device according to the screen comfortable brightness value.
[0057] Send the screen comfortable brightness value L to the bottom layer of the in-vehicle device, so as to adaptively adjust the brightness of the in-vehicle screen according to the brightness of the vehicle body environment to the most comfortable screen brightness for the human eye; 211. Switch the UI mode of the in-vehicle application according to the average image gray value and the current time.
[0058] A. When the average image gray value Y satisfies L1 ≤ Y ≤ L2 and the current time T is in the interval of 18:00 - 6:00, it is considered that the application should be switched to the UI of the night mode at this time.
[0059] B. When the average image gray value Y and the time T are not within the threshold range defined above, the application will default to the UI of the day mode at this time.
[0060] The values of L1 and L2 need to depend on the specific application scenario and the required visual effect.
[0061] Compared with the traditional manual adjustment of the UI, the embodiment of the present invention can automatically adjust the UI mode of the in-vehicle application according to the change of the vehicle body environment brightness and the change of the current time. The user does not need to manually click a button to switch the UI, reducing the user's learning cost and improving the operation convenience. Moreover, the embodiment of the present invention can reduce the time consumed by the user to adjust the UI state when using the in-vehicle application, improving the overall use efficiency. The method of adaptively adjusting the brightness of the in-vehicle screen in the embodiment of the present invention can protect the human eye and at the same time reduce unnecessary energy consumption, such as reducing the screen brightness when the light around the vehicle body is sufficient, thereby improving the energy efficiency. Further, the method of the embodiment of the present invention does not need to make large-scale modifications or rewrites to the existing in-vehicle applications, and can be directly integrated into some in-vehicle applications that have already accessed the camera, such as reverse image, 360 panoramic image, automatic parking, etc., saving development time and cost.
[0062] Corresponding to the above method, the embodiment of the present invention provides a UI switching device for an in-vehicle application. As Figure 3 shown, the device includes: An image acquisition module 301, configured to acquire an environmental image around the vehicle body through an in-vehicle camera.
[0063] A gray value determination module 302, configured to determine the average image gray value of the environmental image.
[0064] A screen comfortable brightness determination module 303, configured to determine a screen comfortable brightness value according to the average image gray value.
[0065] A screen brightness adjustment module 304, configured to adjust the screen brightness of the in-vehicle device according to the screen comfortable brightness value.
[0066] The UI mode switching module 305 is configured to switch the UI mode of the in-vehicle application according to the average image gray value and the current time.
[0067] The UI switching device of the in-vehicle application according to the embodiments of the present invention can execute the UI switching method of the in-vehicle application in the above-described embodiments. For parts not described in detail in the embodiments of the present invention, reference may be made to the relevant descriptions in the method embodiments. The execution process and technical effects of this technical solution can be seen in the description of the method embodiments and will not be elaborated here.
[0068] See Figure 4 , which is a schematic structural diagram of a vehicle-mounted device provided by an embodiment of the present invention. As Figure 4 shown, the vehicle-mounted device 400 may include: a processor 401, a memory 402, and a communication unit 403. These components communicate through one or more buses. Those skilled in the art can understand that the structure of the vehicle-mounted device shown in the figure does not constitute a limitation on the embodiments of the present application. It can be a bus structure, a star structure, and may also include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0069] Among them, the communication unit 403 is configured to establish a communication channel, so that the vehicle-mounted device can communicate with other devices. Receive user data sent by other devices or send user data to other devices.
[0070] The processor 401 is the control center of the vehicle-mounted device, and connects various parts of the entire fault processing device through various interfaces and lines. By running or executing software programs, instructions, and / or modules stored in the memory 402, and calling data stored in the memory, it executes various functions and / or processes data of the vehicle-mounted device. The processor may be composed of an integrated circuit (IC). For example, it may be composed of a single packaged IC, or may be composed of multiple packaged ICs with the same or different functions connected together. For example, the processor 401 may include a central processing unit (CPU), a microcontroller unit (MCU), etc.
[0071] The memory 402 is used to store the execution instructions of the processor 401. The memory 402 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0072] When the execution instructions in the memory 402 are executed by the processor 401, the in-vehicle device 400 can execute the UI switching method of the in-vehicle application in the embodiments of the present invention.
[0073] In a specific implementation, the present application also provides a computer storage medium. The computer storage medium can store a program, and when the program is executed, it can include some or all of the steps of the UI switching method of the in-vehicle application provided by the present application. The storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), a random access memory (RAM), or the like.
[0074] In a specific implementation, the present application also provides a computer program product. The computer program product includes executable instructions, and when the executable instructions are executed on a computer, the computer is caused to execute some or all of the steps in the embodiments of the UI switching method of the in-vehicle application provided by the present application.
[0075] The embodiments of the present application also provide a non-transitory computer-readable storage medium. The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the UI switching method of the in-vehicle application provided by the embodiments of the present application.
[0076] The above non-transitory computer-readable storage medium can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having 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), or a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0077] Those skilled in the art can clearly understand that the technologies in the embodiments of the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solutions in the embodiments of the present application, in essence or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present application.
[0078] For the same or similar parts among the various embodiments in this specification, reference can be made to each other. In particular, for the device embodiments and the terminal embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the descriptions in the method embodiments.
Claims
1. A method for switching a user interface UI of an in-vehicle application, characterized in that: The method comprises: Acquire the environment image around the vehicle body through the vehicle-mounted camera; Determining an image grayscale mean value of the environment image; Determining a comfortable screen brightness value according to the image grayscale mean value; Adjusting the screen brightness of the vehicle equipment according to the comfortable screen brightness value; The UI mode of the vehicle-mounted application is switched according to the image grayscale mean value and the current time.
2. The method according to claim 1, characterized in that The step of determining the image grayscale mean of the environment image comprises: Selecting a target pixel from the environment image; Calculating a first grayscale value of the environment image using a first grayscale algorithm according to the target pixel; Calculating a second grayscale value of the environment image using a second grayscale algorithm according to the target pixel; An image grayscale mean value of the environment image is determined according to the first grayscale value and the second grayscale value.
3. The method according to claim 2, characterized in that The selecting a target pixel point from the environment image comprises: Determine the brightness value of each pixel in the environment image; Selecting a pixel whose brightness value is greater than a first threshold from the environment image as the target pixel; or, The first N percent of the pixels with the largest brightness values are selected from the environment image as the target pixels.
4. The method according to claim 2, characterized in that The step of calculating the first grayscale value of the environment image according to the target pixel using a first grayscale algorithm includes: Determine the mean value of the R channel pixels, the mean value of the G channel pixels and the mean value of the B channel pixels of the target pixel point; The R channel pixel mean, the G channel pixel mean, and the B channel pixel mean are linearly weighted to obtain the first grayscale value of the environment image.
5. The method according to claim 2, characterized in that: The step of calculating the second grayscale value of the environment image according to the target pixel using a second grayscale algorithm includes: Determine the mean value of the R channel pixels, the mean value of the G channel pixels and the mean value of the B channel pixels of the target pixel point; Taking logarithms of the R channel pixel mean, the G channel pixel mean, and the B channel pixel mean, and weighting them respectively to obtain a grayscale value to be processed; According to the pixel value of each target pixel point, determine the maximum grayscale value and the minimum grayscale value; The grayscale value to be processed is normalized according to the grayscale maximum value and the grayscale minimum value to obtain a second grayscale value of the environment image.
6. The method according to claim 5, characterized in that Determining the maximum grayscale value and the minimum grayscale value according to the pixel value of each target pixel point includes: Taking the logarithm of the R channel pixel value, the G channel pixel value and the B channel pixel value of each target pixel point and weighting them respectively to obtain the grayscale logarithm value of each target pixel point; According to the grayscale logarithmic value of each target pixel point, a grayscale maximum value and a grayscale minimum value are determined.
7. The method according to claim 1, characterized in that Determining the comfortable brightness value of the screen according to the image grayscale mean value includes: The comfortable brightness value of the screen is determined according to the grayscale mean value of the image and the brightness value when the screen is displayed in white.
8. The method according to claim 1, characterized in that: The switching of the UI mode of the vehicle-mounted application according to the image grayscale mean value and the current time includes: If the grayscale mean of the image is within a preset first grayscale interval and the current time is within a preset first time range, switching the UI of the in-vehicle application to night mode; Otherwise, switch the car app's UI to day mode.
9. A UI switching device for an in-vehicle application, characterized in that: include: An image acquisition module is used to acquire an image of the environment around the vehicle body through a vehicle-mounted camera; A grayscale value determination module, used to determine the image grayscale mean value of the environment image; A screen comfortable brightness determination module, used to determine a screen comfortable brightness value according to the image grayscale mean; A screen brightness adjustment module, used to adjust the screen brightness of the vehicle equipment according to the comfortable screen brightness value; The UI mode switching module is used to switch the UI mode of the vehicle-mounted application according to the image grayscale mean value and the current time.
10. A vehicle machine device, characterized in that: include: A memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the vehicle equipment where the computer program instructions are located executes the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 8.