CN112685125B - Theme switching method and device of application program and computer readable storage medium - Google Patents

Theme switching method and device of application program and computer readable storage medium Download PDF

Info

Publication number
CN112685125B
CN112685125B CN202110023760.4A CN202110023760A CN112685125B CN 112685125 B CN112685125 B CN 112685125B CN 202110023760 A CN202110023760 A CN 202110023760A CN 112685125 B CN112685125 B CN 112685125B
Authority
CN
China
Prior art keywords
theme
illumination intensity
scene type
current environment
environment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110023760.4A
Other languages
Chinese (zh)
Other versions
CN112685125A (en
Inventor
孙中阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110023760.4A priority Critical patent/CN112685125B/en
Publication of CN112685125A publication Critical patent/CN112685125A/en
Application granted granted Critical
Publication of CN112685125B publication Critical patent/CN112685125B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The application provides a theme switching method and device of an application program and a computer readable storage medium, wherein the method comprises the following steps: displaying a first theme of an application; and switching to a second theme of the display application program in response to a theme switching instruction, wherein the theme switching instruction is generated when the illumination intensity and the scene type of the current environment meet preset conditions, and the display brightness of the first theme is different from that of the second theme. According to the scheme, the illumination intensity and the scene type of the current environment are used as the theme switching basis, so that the theme switching is more flexible, the switched theme is more matched with the illumination intensity of the current environment, and better use experience is brought to a user.

Description

Theme switching method and device of application program and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for switching themes of an application program, and a computer-readable storage medium.
Background
The theme of the application program, also called a skin package, is a combination of some fixed resources, and the application program can realize different display effects under the same code by replacing different resource combinations. For example, many application programs are provided with a day theme and a night theme, the display brightness of the day theme is higher than that of the night theme, and an application program developer wants to switch the day theme and the night theme so that the application program displays the day theme with higher brightness in the daytime and the user does not feel unclear and the application program displays the night theme with lower brightness in the night and the user does not feel dazzled.
However, the theme switching of the application program is currently performed according to the time period, that is, the theme with specific display brightness is displayed in a specific time period, which makes the theme switching inflexible, and the switching theme may not match the illumination intensity of the environment.
Disclosure of Invention
The purpose of this application is to solve at least one of the above technical defects, and the technical solution provided by this application embodiment is as follows: .
In a first aspect, an embodiment of the present application provides a method for switching a theme of an application, including:
displaying a first theme of an application;
and switching to a second theme of the display application program in response to a theme switching instruction, wherein the theme switching instruction is generated when the illumination intensity and the scene type of the current environment meet preset conditions, and the display brightness of the first theme is different from that of the second theme.
In an optional embodiment of the present application, the method further comprises:
receiving automatic switching operation of a theme sent by a user;
responding to automatic theme switching operation, and acquiring at least two frames of environment images of the environment at intervals of first preset time;
and acquiring the illumination intensity and the scene type of the current environment based on at least two frames of environment images of the current environment.
In an optional embodiment of the present application, the determining that the illumination intensity and the scene type of the current environment satisfy the preset condition includes:
comparing the illumination intensity and the scene type of the current environment with the illumination intensity and the scene type of the environment at the last image acquisition moment respectively to obtain a comparison result;
and if the comparison result indicates that at least one of the illumination intensity of the current environment or the scene type is changed compared with the last image acquisition time, determining that the illumination intensity of the current environment and the scene type meet preset conditions.
In an optional embodiment of the present application, in response to the theme switching instruction, switching to the second theme of the display application includes:
and responding to the theme switching instruction, and switching to display the second theme after continuously displaying the first theme for a second preset time.
In an optional embodiment of the present application, the second preset duration is less than the first preset duration.
In an optional embodiment of the present application, the obtaining a scene type of a current environment based on at least two frames of environment images of the current environment includes:
inputting at least two frames of environment images of the current environment into a preset classification network model, and outputting at least one corresponding initial scene type;
voting is carried out based on at least one initial scene type to obtain a corrected scene type, and the corrected scene type is verified;
and if the corrected scene type passes the verification, taking the corrected scene type as the scene type of the current environment.
In an optional embodiment of the present application, the checking the modified scene type includes:
acquiring position information of a current environment;
determining a scene type set in a preset geographic range based on the position information;
and if the scene type set contains the corrected scene type, determining that the corrected scene type passes the check, otherwise, determining that the corrected scene type fails the check.
In an optional embodiment of the present application, the obtaining the illumination intensity of the current environment based on at least two frames of environment images of the current environment includes:
inputting at least two frames of environment images of the current environment into a preset regression network model, and outputting at least one corresponding illumination intensity;
acquiring average illumination intensity of at least one illumination intensity, and checking the average illumination intensity;
and if the average illumination intensity passes the verification, taking the average illumination intensity as the illumination intensity of the current environment.
In an optional embodiment of the present application, the verifying the average illumination intensity includes:
acquiring an illumination intensity measured value of an illumination sensor under the current environment;
acquiring a corresponding illumination intensity range based on the illumination intensity measured value;
if the illumination intensity range contains the average illumination intensity, the average illumination intensity is checked to be passed, otherwise, the average illumination intensity is checked not to be passed.
In an optional embodiment of the present application, the method further comprises:
and in response to the theme switching instruction, determining a second theme based on the illumination intensity of the current environment and the scene type.
In an optional embodiment of the present application, the determining the second theme based on the illumination intensity of the current environment and the scene type includes:
acquiring a corresponding illumination scene combination based on the illumination intensity and the scene type of the current environment;
and determining a second theme from a preset theme library based on the illumination scene combination, wherein the preset theme library stores corresponding relations between themes with different display brightness of the application program and the illumination scene combinations.
In an optional embodiment of the present application, in the preset subject library, for each illumination scene combination with the same illumination intensity, the display brightness of the subject corresponding to the illumination scene combination corresponding to the scene type with the larger light-dark difference or the smaller visibility is higher.
In a second aspect, an embodiment of the present application provides an apparatus for switching themes of an application, including:
the first theme display module is used for displaying a first theme of the application program;
and the second theme display module is used for responding to a theme switching instruction and switching to a second theme of the display application program, wherein the theme switching instruction is generated when the illumination intensity and the scene type of the current environment meet preset conditions, and the display brightness of the first theme is different from that of the second theme.
In an optional embodiment of the present application, the apparatus may further include an illumination scene acquiring module, including:
the automatic switching triggering operation receiving submodule is used for receiving the theme automatic switching triggering operation sent by the user;
the environment image acquisition sub-module is used for responding to the theme automatic switching triggering operation and acquiring at least two frames of environment images of the environment at intervals of first preset time;
and the illumination scene acquisition sub-module is used for acquiring the illumination intensity and the scene type of the current environment based on at least two frames of environment images of the current environment.
In an optional embodiment of the present application, the apparatus may further include a preset condition determining module, configured to:
comparing the illumination intensity and the scene type of the current environment with the illumination intensity and the scene type of the environment at the last image acquisition moment respectively to obtain a comparison result;
and if the comparison result indicates that at least one of the illumination intensity of the current environment or the scene type is changed compared with the last image acquisition time, determining that the illumination intensity of the current environment and the scene type meet preset conditions.
In an optional embodiment of the present application, the second theme display module is specifically configured to:
and responding to the theme switching instruction, and switching to display the second theme after continuously displaying the first theme for a second preset time.
In an optional embodiment of the present application, the second preset duration is less than the first preset duration.
In an optional embodiment of the present application, the illumination scene acquisition sub-module is specifically configured to:
inputting at least two frames of environment images of the current environment into a preset classification network model, and outputting a corresponding initial scene type;
voting is carried out on each initial scene type to obtain a corrected scene type, and the corrected scene type is verified;
and if the corrected scene type passes the verification, taking the corrected scene type as the scene type of the current environment.
In an optional embodiment of the present application, the illumination scene acquisition sub-module is further configured to:
acquiring position information of a current environment;
determining a scene type set in a preset geographic range based on the position information;
and if the scene type set contains the corrected scene type, checking the corrected scene type to pass, otherwise, checking the corrected scene type to fail.
In an optional embodiment of the present application, the illumination scene acquisition sub-module is specifically configured to:
inputting at least two frames of environment images of the current environment into a preset regression network model, and outputting corresponding illumination intensity;
acquiring the average illumination intensity of each illumination intensity, and verifying the average illumination intensity;
and if the average illumination intensity passes the verification, taking the average illumination intensity as the illumination intensity of the current environment.
In an optional embodiment of the present application, the illumination scene acquisition sub-module is further configured to:
acquiring an illumination intensity measured value of an illumination sensor under the current environment;
acquiring a corresponding illumination intensity range based on the illumination intensity measured value;
if the illumination intensity range contains the average illumination intensity, the average illumination intensity is checked to be passed, otherwise, the average illumination intensity is checked not to be passed.
In an optional embodiment of the present application, the apparatus may further comprise a second topic determination module configured to:
and in response to the theme switching instruction, determining a second theme based on the illumination intensity of the current environment and the scene type.
In an optional embodiment of the present application, the second topic determination module is specifically configured to:
acquiring a corresponding illumination scene combination based on the illumination intensity and the scene type of the current environment;
and determining a second theme from a preset theme library based on the illumination scene combination, wherein the preset theme library stores corresponding relations between themes with different display brightness of the application program and the illumination scene combinations.
In an optional embodiment of the present application, in the preset subject library, for each illumination scene combination with the same illumination intensity, the display brightness of the subject corresponding to the illumination scene combination corresponding to the scene type with the larger light-dark difference or the smaller visibility is higher.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor;
the memory has a computer program stored therein;
a processor configured to execute a computer program to implement the method provided in the embodiment of the first aspect or any optional embodiment of the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program, when executed by a processor, implements the method provided in the embodiment of the first aspect or any optional embodiment of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product or a computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device when executing implements the method provided in the embodiment of the first aspect or any optional embodiment of the first aspect.
The beneficial effect that technical scheme that this application provided brought is:
the method comprises the steps that when the application program determines that the illumination intensity and the scene type of the current environment meet preset conditions, a theme switching instruction is generated, so that the application program responds to the theme switching instruction and is switched from a first theme to a second theme which is more suitable for the illumination intensity and the scene type of the current environment.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a theme switching method for an application according to an embodiment of the present application;
FIG. 2a is a schematic diagram of a vehicle map displaying a daytime theme in one example of an embodiment of the present application;
FIG. 2b is a schematic diagram of a vehicle map displaying a night theme in an example of an embodiment of the present application;
FIG. 3 is a diagram illustrating automatic switching of application settings in an example of an embodiment of the present application;
fig. 4a is a schematic diagram of an architecture of theme switching of an on-board map in an example of the embodiment of the present application;
fig. 4b is a schematic flowchart of theme switching performed on the vehicle-mounted map in an example of the embodiment of the present application;
fig. 5 is a block diagram illustrating a theme switching apparatus of an application according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In the prior art, an application takes a current time period as a theme switching basis, that is, a developer sets a theme switching time point for the application, and the application is applied to terminal devices such as a vehicle-mounted device and a handheld device. For example, taking an in-vehicle map as an example, a developer considers that the illumination intensity of the environment in which the vehicle is located is strong in the daytime during a time period from sunrise to sunset, and defaults to display a daytime theme in order to prevent a user from blinding the map, and that the illumination intensity of the environment in which the vehicle is located is weak in the night period from sunset to sunrise, and defaults to display a nighttime theme in order to prevent the user from glaring when looking at the map. Specifically, the sunset time and the sunrise time are respectively used as theme switching time points, and the daytime theme is switched to the display of the night theme at the sunset time, and the night theme is switched to the display of the day theme at the sunrise time. However, for the case that the day weather is cloudy (although the day is daytime but the illumination intensity is weak) or the case that the day is in a parking lot (although the night is night but the illumination intensity is strong), it is obvious that the theme displayed in the corresponding case by the switching scheme is not matched with the illumination intensity of the environment where the switching scheme is located, and the use experience of the user is reduced. In view of the above problem, an embodiment of the present application provides a theme switching method for an application, and the method will be described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a theme switching method for an application provided in an embodiment of the present application, where an execution main body of the method may be an application, and as shown in fig. 1, the method may include:
step S101, displaying a first theme of the application program.
The application program can be preset with a plurality of themes with different display brightness for switching use. For example, as shown in fig. 2a and 2b, fig. 2a is a schematic diagram of a vehicle-mounted map displaying a day theme, and fig. 2b is a schematic diagram of the vehicle-mounted map displaying a night theme.
Step S102, responding to a theme switching instruction, and switching to a second theme of the display application program, wherein the theme switching instruction is generated when the illumination intensity and the scene type of the current environment meet preset conditions, and the display brightness of the first theme is different from that of the second theme.
The scene types may include scene types divided based on various different weather conditions, urban or outdoor environments, and various visibility, for example, there may be a cloudy scene type, a parking lot scene type, and the like. It can be understood that a plurality of scene types can be preset according to requirements and actual conditions.
Specifically, the application program judges whether the illumination intensity and the scene type of the current environment meet preset conditions, if so, a corresponding theme switching instruction is generated, meanwhile, a second theme more suitable for the illumination intensity and the scene type of the current environment is determined according to the illumination intensity and the scene type of the current environment, and then the application program responds to the theme switching instruction and switches from the displayed first theme to the displayed second theme.
According to the scheme, the application program generates the theme switching instruction when the illumination intensity and the scene type of the current environment meet the preset conditions, so that the application program responds to the theme switching instruction and switches from the first theme to the second theme which is more suitable for the illumination intensity and the scene type of the current environment.
In an optional embodiment of the present application, the method may further comprise:
receiving automatic switching operation of a theme sent by a user;
responding to automatic theme switching operation, and acquiring at least two frames of environment images of the environment at intervals of first preset time;
and acquiring the illumination intensity and the scene type of the current environment based on at least two frames of environment images of the current environment.
The theme automatic switching operation may be an instruction for automatically switching themes, which is sent to the application program by the user, and the application program may switch themes according to the theme switching scheme provided in the present application after receiving the instruction. In practical applications, as shown in fig. 3, a corresponding theme automatic switching button 301 may be set on a setting page of an application program, and a user may issue an instruction to automatically switch a theme to the application program by triggering the button, and at the same time, the user may also issue an instruction to continuously display the first theme or the second theme to the application program by triggering a first theme (for example, a day theme) button 302 or a second theme (for example, a night theme) button 303.
Wherein the application program can acquire at least two frames of environment images from the corresponding image acquisition devices. The image acquisition equipment needs to be capable of shooting color images with enough definition, and for vehicle-mounted application programs, the image acquisition equipment can be a vehicle event data recorder camera positioned below the middle top end of a windshield, can also be a panoramic (360-degree view) camera positioned around a vehicle body, and the shooting content is environment information and the like near the vehicle.
Specifically, after receiving an instruction for automatically switching themes, the application program needs to acquire the illumination intensity and the scene type of the environment where the application program is located. The first preset duration can be set according to actual requirements, and can also be set according to the frame rate of the image acquisition device. That is, the program obtains the environment image of the environment without interruption, that is, at least two frames of images of the environment are obtained at each image obtaining time, and two adjacent image obtaining times are separated by a first preset time.
In an optional embodiment of the present application, the determining that the illumination intensity and the scene type of the current environment satisfy the preset condition includes:
comparing the illumination intensity and the scene type of the current environment with the illumination intensity and the scene type of the environment at the last image acquisition moment respectively to obtain a comparison result;
and if the comparison result indicates that at least one of the illumination intensity of the current environment or the scene type is changed compared with the last image acquisition time, determining that the illumination intensity of the current environment and the scene type meet preset conditions.
Specifically, at least two frames of environment images of the current environment are acquired at the current image acquisition time, the illumination intensity and the scene type of the current environment are acquired based on the at least two frames of environment images, and the illumination intensity and the scene type are compared with the illumination intensity and the scene type of the environment at the previous image acquisition time. If the illumination intensity corresponding to the current image acquisition time is changed, or the scene type is changed, or both the illumination intensity and the scene type are changed relative to the previous image acquisition time, the preset condition is met; and if the illumination intensity and the scene type corresponding to the current image acquisition moment are not changed relative to the last image acquisition moment, the preset condition is not met. If the preset condition is met, switching to displaying the second theme, and if the preset condition is not met, continuing to display the first theme.
It should be noted that in the above-mentioned scheme, the illumination intensity is changed, specifically, the illumination intensity is changed to a certain degree, for example, the illumination intensity of the current environment is 3 levels (assuming a total of 10 levels), if the illumination intensity corresponding to the previous image acquisition time is 5 levels or 1 levels, that is, the difference between the current environment and the previous image acquisition time is 2 levels, it is determined that the situation satisfies the preset condition, if the illumination intensity corresponding to the previous image acquisition time is 4 levels or 2 levels, that is, the difference between the current environment and the previous image acquisition time is 1 level, it is determined that the difference between the current environment and the previous image acquisition time is not large, in order to avoid too frequent theme switching, it is determined that the situation does not satisfy the preset condition, that is, in other words, the preset condition is satisfied only if the illumination intensity change reaches 2 levels. It is understood that the degree of the change required to determine whether the debate occurs may be set, for example, according to the preference or actual requirement of the user, which is not limited in the present application.
In an optional embodiment of the present application, in response to the theme switching instruction, switching to the second theme of the display application includes:
and responding to the theme switching instruction, and switching to display the second theme after continuously displaying the first theme for a second preset time.
Specifically, after the application program obtains the theme switching instruction, in order to provide an adaptation time for the eyes of the user, the application program may continue to display the first theme for a second preset time period, and then switch to display the second theme. Furthermore, the display of the first theme for the second preset time can be continued, and then the second theme is smoothly switched to be displayed, that is, the display brightness of the theme is slowly changed during the process of switching from the first theme to the second theme, so as to give the eyes of the user another adaptive time.
For example, for a vehicle-mounted map, a user drives into a garage with better illumination at night, and then switches to display a corresponding brighter theme (or slowly switches to a corresponding brighter theme) after continuing to display a period of darker theme in order to give the user a suitable time for the eyes of the user.
Further, the second preset time is shorter than the first preset time.
Specifically, the second preset time length is shorter than the first preset time length, so that the theme switching is completed before the next theme switching comes.
In an optional embodiment of the present application, the obtaining a scene type of a current environment based on at least two frames of environment images of the current environment includes:
inputting at least two frames of environment images of the current environment into a preset classification network model, and outputting at least one corresponding initial scene type;
voting is carried out based on at least one initial scene type to obtain a corrected scene type, and the corrected scene type is verified;
and if the corrected scene type passes the verification, taking the corrected scene type as the scene type of the current environment.
The input of the preset classification network model is an environment image, and the output is a corresponding scene type, such as cloudy days, rainy days, parking lots, tunnels and the like.
In one or more embodiments, the preset classification network model selects a lightweight model according to a specific scene applied to a vehicle-mounted end or a mobile end, and in the model, the calculation amount is reduced by technologies such as deep separable convolution and Channel Shuffle. In one or more embodiments, acceleration of certain hardware platforms is achieved through model pruning, quantization, and other methods in combination with ARM assembly.
In one or more embodiments, the specific structure of the preset classification network model is as follows: the MobileNet series or ShuffleNet and the like are selected as the front end of the model, and YOLO (young Only Look Once convolution operation) or full convolution layer with jump connection is selected as the back end of the model. And inputting the environment image into a front-end network for processing, and outputting the initial scene type through back-end operation. Through the preset classification network model structure, the accuracy of a processing result can be improved while the calculation amount is reduced.
In one or more embodiments, the output of the preset classification network model may specifically be a certain preset scene type, or may also be probability values corresponding to multiple preset scene types.
In one or more embodiments, a plurality of frames of environment images of the current environment are input into a preset classification network model, a plurality of scene types are output, the scene types are voted, the scene type with the highest vote is used as a corrected scene type, then the corrected scene type is verified, if the scene type passes the verification, the corrected scene type is used as the scene type of the current environment, and if the scene type does not pass the verification, the corrected scene type is discarded.
In one or more embodiments, the voting scheme may adopt a minority-compliant majority rule, that is, a result with the highest occurrence number in a plurality of results output by the preset classification network model is used as a result with the highest vote, in other words, a scene type with the highest occurrence number is used as a modified scene. Furthermore, in the process of voting, each result can be given a corresponding weight, and then the weighting times of each result can be calculated. It is understood that, when assigning the weight corresponding to each result, the acquiring time of the environment image corresponding to each result may be considered, specifically, the weight value assigned to the result corresponding to the environment image whose acquiring time is closer to the current time is larger, and if each result is a probability value, the weight value assigned to the result is larger as the probability value is larger.
In one or more embodiments, further checking the modified scene type includes:
acquiring position information of a current environment;
determining a scene type set in a preset geographic range based on the position information;
and if the scene type set contains the corrected scene type, determining that the corrected scene type passes the check, otherwise, determining that the corrected scene type fails the check.
Specifically, the corrected scene type is verified through other data sources, and the corrected scene type can be verified through the position information of the current environment, specifically, firstly, all scene types in the peripheral preset geographic range of the current environment are obtained through the position information (for example, GPS position information) of the current environment in combination with a map, and a scene type set is formed. And then, judging whether the acquired scene type set contains the corrected scene type, if so, checking to pass, otherwise, checking not to pass.
In one or more embodiments, the scene type result may be corrected in conjunction with information about the current environment location, weather, etc. For example, according to the position information of the current environment and the weather condition of the area corresponding to the position information, if the current weather is sunny and the illumination condition is good, it is determined that a tunnel exists in the corresponding area, and the modified scene type determined by the method is a cloudy scene, the modified scene is checked by the method and is not passed, and the current environment is determined to be possibly in the tunnel by comprehensive judgment, so that the current scene type can be corrected to be tunnel driving, and the theme switching operation of the subsequent application program is completed. By the method, the accuracy of scene recognition in specific occasions (such as tunnels) can be further overcome, and the user experience is further improved.
In an optional embodiment of the present application, the obtaining the illumination intensity of the current environment based on at least two frames of environment images of the current environment includes:
inputting at least two frames of environment images of the current environment into a preset regression network model, and outputting at least one corresponding illumination intensity;
acquiring average illumination intensity of at least one illumination intensity, and checking the average illumination intensity;
and if the average illumination intensity passes the verification, taking the average illumination intensity as the illumination intensity of the current environment.
The input of the preset regression network model is an environment image, the output of the preset regression network model is corresponding illumination intensity, the illumination intensity can be preset to be a certain value from 1 to 100, and the preset classification network model can be obtained through training of a sample image marked with the illumination intensity in advance. The regression model is preset as a regressor with the image as input. In one or more embodiments, the output of the regressor has only one-dimensional vector, and the front end of the preset regression model is similar to the preset classification network model, for example, MobileNet is adopted, so as to reduce the amount of calculation and improve the processing efficiency.
Specifically, inputting a plurality of frames of environment images of the current environment into a preset regression network model, outputting a plurality of illumination intensities, calculating average illumination intensities corresponding to the plurality of illumination intensities, then verifying the average illumination intensities, taking the average illumination intensities as the scene type of the current environment if the average illumination intensities pass the verification, and discarding the average illumination intensities if the average illumination intensities do not pass the verification.
Further, the average illumination intensity is checked, including:
acquiring an illumination intensity measured value of an illumination sensor under the current environment;
acquiring a corresponding illumination intensity range based on the illumination intensity measured value;
if the illumination intensity range contains the average illumination intensity, the average illumination intensity is checked to be passed, otherwise, the average illumination intensity is checked not to be passed.
Specifically, the average illumination intensity is verified through other data sources, and the average illumination intensity can be verified through the illumination intensity measurement measured by the illumination sensor. And then, judging whether the acquired illumination intensity range contains the average illumination intensity, if so, passing the verification, otherwise, failing to pass the verification.
It should be noted that, in the case that the average illumination intensity check is not passed, the illumination intensity provided by other data sources such as the illumination sensor may be regarded as a reference, and the current illumination intensity is corrected, for example, the calculation result is adjusted according to a difference between the illumination intensity provided by other data sources such as the illumination sensor and the calculation result, and the adjusted result is taken as the current illumination intensity, so as to complete the theme switching operation of the subsequent application program.
For a vehicle-mounted map, implementation of the theme switching scheme provided in the embodiment of the present application depends on the architecture shown in fig. 4a, and at each image acquisition time, the vehicle-mounted camera 401 acquires multiple frames of environment images and sends the acquired environment images to the vehicle-mounted application program. In the in-vehicle application, the scene analysis unit 402 and the illumination analysis unit 403 respectively analyze the input environment image to obtain a corresponding scene type and illumination intensity, and send the scene type and illumination intensity to the instruction generation unit 404. The instruction generating unit 404 analyzes whether the received scene type and the received illumination intensity satisfy a preset condition, generates a corresponding theme switching instruction if the scene type and the illumination intensity satisfy the preset condition, and sends the theme switching instruction to the instruction executing unit 405. The instruction execution unit 405 switches from displaying the second theme to the first theme based on the received theme switching instruction. Meanwhile, in the case that it is determined that the preset condition is satisfied, the instruction generating unit 404 further determines a corresponding second theme based on the received scene type and the illumination intensity, and sends the second theme to the instruction executing module 405. Fig. 4b is a schematic diagram of an implementation process of theme switching of the vehicle-mounted map in this example, where the left side in the diagram is a flow of a scene type determination process, and the right side in the diagram is a flow of an illumination intensity determination process.
In particular, the theme switching process may include the following steps:
step S401, at each image acquisition moment, acquiring multiple frames of environment images by the vehicle-mounted camera, and sending the acquired environment images to the scene analysis unit and the illumination analysis unit of the vehicle-mounted application program.
Step S402, the scene analysis unit and the illumination analysis unit respectively analyze the input environment image to obtain an analysis result.
The process of the left-side scene type determination process comprises the following steps:
s4021, inputting multi-frame environment images into a preset classification network model, and outputting corresponding multi-frame scene type results;
step S4022, voting based on the multi-frame scene type to obtain a corrected scene type;
step S4023, checking the corrected scene type based on the position information of the current environment to obtain a scene analysis result.
The right side illumination intensity determination process comprises the following steps:
s4021', inputting a plurality of frames of environment images into a preset regression network model, and outputting corresponding multi-frame illumination intensity results;
step S4022', averaging the illumination intensities of the multiple frames to obtain the corrected illumination intensity.
And S4023', verifying the corrected illumination intensity based on the illumination intensity measurement value to obtain an illumination intensity analysis result.
Step S403, based on the scene analysis result and the illumination intensity analysis result, determining whether a preset condition is satisfied, and if the preset condition is satisfied, switching the theme.
In an optional embodiment of the present application, the method may further comprise:
and in response to the theme switching instruction, determining a second theme based on the illumination intensity of the current environment and the scene type.
Specifically, in order to make the theme displayed by switching the application program more match with the illumination intensity of the current environment, after the theme switching instruction is generated, the theme to be switched and displayed, that is, the second theme, may be determined according to the illumination intensity and the scene type of the current environment.
In an optional embodiment of the present application, the determining the second theme based on the illumination intensity of the current environment and the scene type includes:
acquiring a corresponding illumination scene combination based on the illumination intensity and the scene type of the current environment;
and determining a second theme from a preset theme library based on the illumination scene combination, wherein the preset theme library stores corresponding relations between themes with different display brightness of the application program and the illumination scene combinations.
In the preset theme library, for each illumination scene combination with the same illumination intensity, the display brightness of the theme corresponding to the illumination scene combination corresponding to the scene type with larger light-dark difference or smaller visibility is higher. It can be understood that, the illumination scene is divided into a plurality of combinations, and the number of corresponding themes with different display brightness is larger, so that the theme switching is more sensitive; the fewer the illumination scene combination partitions, the fewer the number of corresponding themes with different display brightness, and the more stable the theme switching.
Specifically, in the embodiment of the application, the illumination intensity and the scene type of the current environment are adopted to jointly determine the corresponding theme, that is, the corresponding theme is determined based on the illumination scene combination, and the preset theme library is constructed, so that not only is the influence of the illumination intensity on the visual sense of the application program used by the user considered, but also the influence of the scene type on the visual sense of the application program used by the user considered, and the preset theme library is closer to the actual use environment of the user.
Fig. 5 is a block diagram of a theme switching apparatus for an application according to an embodiment of the present application, and as shown in fig. 5, the apparatus 500 may include: a first theme display module 501 and a second theme display module 502, wherein:
the first theme display module 501 is used for displaying a first theme of an application program;
the second theme display module 502 is configured to switch to a second theme of the display application in response to a theme switching instruction, where the theme switching instruction is generated when it is determined that the illumination intensity and the scene type of the current environment meet preset conditions, and the display brightness of the first theme is different from that of the second theme.
According to the scheme, the application program generates the theme switching instruction when the illumination intensity and the scene type of the current environment meet the preset conditions, so that the application program responds to the theme switching instruction and is switched from the first theme to the second theme which is more suitable for the illumination intensity and the scene type of the current environment, the illumination intensity and the scene type of the current environment are used as the theme switching basis, the theme switching is more flexible, the switched theme is more matched with the illumination intensity of the current environment, and better use experience is brought to a user.
In an optional embodiment of the present application, the apparatus may further include an illumination scene acquiring module, including:
the automatic switching operation receiving submodule is used for receiving automatic switching operation of a theme sent by a user;
the environment image acquisition sub-module is used for responding to automatic theme switching operation and acquiring at least two frames of environment images of the environment at intervals of first preset time;
and the illumination scene acquisition sub-module is used for acquiring the illumination intensity and the scene type of the current environment based on at least two frames of environment images of the current environment.
In an optional embodiment of the present application, the apparatus may further include a preset condition determining module, configured to:
comparing the illumination intensity and the scene type of the current environment with the illumination intensity and the scene type of the environment at the last image acquisition moment respectively to obtain a comparison result;
and if the comparison result indicates that at least one of the illumination intensity of the current environment or the scene type is changed compared with the last image acquisition time, determining that the illumination intensity of the current environment and the scene type meet preset conditions.
In an optional embodiment of the present application, the second theme display module is specifically configured to:
and responding to the theme switching instruction, and switching to display the second theme after continuously displaying the first theme for a second preset time.
In an optional embodiment of the present application, the second preset duration is less than the first preset duration.
In an optional embodiment of the present application, the illumination scene acquisition sub-module is specifically configured to:
inputting at least two frames of environment images of the current environment into a preset classification network model, and outputting at least one corresponding initial scene type;
voting is carried out based on at least one initial scene type to obtain a corrected scene type, and the corrected scene type is verified;
and if the corrected scene type passes the verification, taking the corrected scene type as the scene type of the current environment.
In an optional embodiment of the present application, the illumination scene acquisition sub-module is further configured to:
acquiring position information of a current environment;
determining a scene type set in a preset geographic range based on the position information;
and if the scene type set contains the corrected scene type, determining that the corrected scene type passes the check, otherwise, determining that the corrected scene type fails the check.
In an optional embodiment of the present application, the illumination scene acquisition sub-module is specifically configured to:
inputting at least two frames of environment images of the current environment into a preset regression network model, and outputting at least one corresponding illumination intensity;
acquiring average illumination intensity of at least one illumination intensity, and checking the average illumination intensity;
and if the average illumination intensity passes the verification, taking the average illumination intensity as the illumination intensity of the current environment.
In an optional embodiment of the present application, the illumination scene acquisition sub-module is further configured to:
acquiring an illumination intensity measured value of an illumination sensor under the current environment;
acquiring a corresponding illumination intensity range based on the illumination intensity measured value;
if the illumination intensity range contains the average illumination intensity, the average illumination intensity is checked to be passed, otherwise, the average illumination intensity is checked not to be passed.
In an optional embodiment of the present application, the apparatus may further comprise a second topic determination module configured to:
and in response to the theme switching instruction, determining a second theme based on the illumination intensity of the current environment and the scene type.
In an optional embodiment of the present application, the second topic determination module is specifically configured to:
acquiring a corresponding illumination scene combination based on the illumination intensity and the scene type of the current environment;
and determining a second theme from a preset theme library based on the illumination scene combination, wherein the preset theme library stores corresponding relations between themes with different display brightness of the application program and the illumination scene combinations.
In an optional embodiment of the present application, in the preset subject library, for each illumination scene combination with the same illumination intensity, the display brightness of the subject corresponding to the illumination scene combination corresponding to the scene type with the larger light-dark difference or the smaller visibility is higher.
Based on the same principle, an embodiment of the present application further provides an electronic device, where the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method provided in any optional embodiment of the present application is implemented, and specifically, the following situations are implemented:
displaying a first theme of an application; and switching to a second theme of the display application program in response to a theme switching instruction, wherein the theme switching instruction is generated when the illumination intensity and the scene type of the current environment meet preset conditions, and the display brightness of the first theme is different from that of the second theme.
The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the method shown in any embodiment of the present application.
It is understood that the medium may store a computer program corresponding to the interactive method in the live broadcast.
Fig. 6 is a schematic structural diagram of an electronic device to which the embodiment of the present application is applied, and as shown in fig. 6, the electronic device 600 shown in fig. 6 includes: a processor 601 and a memory 603. The processor 601 is coupled to the memory 603, such as via a bus 602. Further, the electronic device 600 may further include a transceiver 604, and the electronic device 600 may interact with other electronic devices through the transceiver 604. It should be noted that the transceiver 604 is not limited to one in practical applications, and the structure of the electronic device 600 is not limited to the embodiment of the present application.
The processor 601 applied in the embodiment of the present application may be used to implement the function of the theme switching apparatus of the application program shown in fig. 5.
The processor 601 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 601 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs and microprocessors, and the like.
Bus 602 may include a path that transfers information between the above components. The bus 602 may be a PCI bus or an EISA bus, etc. The bus 602 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 6, but this is not intended to represent only one bus or type of bus.
Memory 603 may be, but is not limited to, ROM or other types of static storage devices that can store static information and instructions, RAM or other types of dynamic storage devices that can store information and instructions, EEPROM, CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 603 is used for storing application program codes for executing the scheme of the application, and the processor 601 controls the execution. The processor 601 is configured to execute the application program code stored in the memory 603 to implement the actions of the theme switching apparatus of the application program provided in the embodiment shown in fig. 5.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device realizes the following when executed:
displaying a first theme of an application; and switching to a second theme of the display application program in response to a theme switching instruction, wherein the theme switching instruction is generated when the illumination intensity and the scene type of the current environment meet preset conditions, and the display brightness of the first theme is different from that of the second theme.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (15)

1. A theme switching method of an application program is characterized by comprising the following steps:
displaying a first theme of the application;
switching to displaying a second theme of the application program in response to a theme switching instruction, wherein the theme switching instruction is generated when the illumination intensity and the scene type of the current environment meet preset conditions, and the display brightness of the first theme is different from that of the second theme;
the scene type is obtained in the following manner: voting is carried out on at least one initial scene type output based on a preset classification network model to obtain the initial scene type; and inputting the preset classification network model into at least two frames of environment images of the current environment.
2. The method of claim 1, further comprising:
receiving automatic switching operation of a theme sent by a user;
responding to the automatic theme switching operation, and acquiring at least two frames of environment images of the environment at intervals of first preset time;
and acquiring the illumination intensity and the scene type of the current environment based on at least two frames of environment images of the current environment.
3. The method of claim 2, wherein determining that the illumination intensity and the scene type of the current environment satisfy the preset condition comprises:
comparing the illumination intensity and the scene type of the current environment with the illumination intensity and the scene type of the environment at the last image acquisition moment respectively to obtain a comparison result;
and if the comparison result indicates that at least one of the illumination intensity and the scene type of the current environment is changed compared with the last image acquisition moment, determining that the illumination intensity and the scene type of the current environment meet the preset condition.
4. The method of claim 2, wherein the switching to displaying the second theme of the application in response to the theme switching instruction comprises:
and responding to the theme switching instruction, and switching to display the second theme after continuously displaying the first theme for a second preset time.
5. The method of claim 4, wherein the second predetermined duration is less than the first predetermined duration.
6. The method according to claim 2, wherein the obtaining the scene type of the current environment based on at least two frames of environment images of the current environment comprises:
inputting at least two frames of environment images of the current environment into a preset classification network model, and outputting at least one corresponding initial scene type;
voting based on the at least one initial scene type to obtain a corrected scene type, and checking the corrected scene type;
and if the corrected scene type passes the verification, taking the corrected scene type as the scene type of the current environment.
7. The method of claim 6, wherein the checking the revised scene type comprises:
acquiring the position information of the current environment;
determining a scene type set in a preset geographic range based on the position information;
and if the scene type set comprises the corrected scene type, determining that the corrected scene type passes the check, otherwise, determining that the corrected scene type fails the check.
8. The method according to claim 2, wherein said obtaining the illumination intensity of the current environment based on at least two frames of environment images of the current environment comprises:
inputting at least two frames of environment images of the current environment into a preset regression network model, and outputting at least one corresponding illumination intensity;
acquiring the average illumination intensity of the at least one illumination intensity, and checking the average illumination intensity;
and if the average illumination intensity passes the verification, taking the average illumination intensity as the illumination intensity of the current environment.
9. The method of claim 8, wherein said verifying the average illumination intensity comprises:
acquiring an illumination intensity measured value of an illumination sensor under the current environment;
acquiring a corresponding illumination intensity range based on the illumination intensity measured value;
if the illumination intensity range contains the average illumination intensity, the average illumination intensity is checked to be passed, otherwise, the average illumination intensity is checked not to be passed.
10. The method of claim 1, further comprising:
and in response to the theme switching instruction, determining the second theme based on the illumination intensity of the current environment and the scene type.
11. The method of claim 10, wherein determining the second theme based on the illumination intensity of the current environment and the scene type comprises:
acquiring a corresponding illumination scene combination based on the illumination intensity and the scene type of the current environment;
and determining the second theme from a preset theme library based on the illumination scene combination, wherein the preset theme library stores corresponding relations between themes with different display brightness of the application program and the illumination scene combinations.
12. The method according to claim 11, wherein in the preset subject library, for each illumination scene combination with the same illumination intensity, the display brightness of the subject corresponding to the illumination scene combination corresponding to the scene type with larger light-dark difference or smaller visibility is higher.
13. An apparatus for switching theme of an application, comprising:
the first theme display module is used for displaying a first theme of the application program;
the second theme display module is used for responding to a theme switching instruction and switching to display a second theme of the application program, wherein the theme switching instruction is generated when the illumination intensity and the scene type of the current environment meet preset conditions, and the display brightness of the first theme is different from that of the second theme;
the scene type is obtained in the following manner: voting is carried out on at least one initial scene type output based on a preset classification network model to obtain the initial scene type; and inputting the preset classification network model into at least two frames of environment images of the current environment.
14. An electronic device comprising a memory and a processor;
the memory has stored therein a computer program;
the processor for executing the computer program to implement the method of any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method of any one of claims 1 to 12.
CN202110023760.4A 2021-01-08 2021-01-08 Theme switching method and device of application program and computer readable storage medium Active CN112685125B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110023760.4A CN112685125B (en) 2021-01-08 2021-01-08 Theme switching method and device of application program and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110023760.4A CN112685125B (en) 2021-01-08 2021-01-08 Theme switching method and device of application program and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112685125A CN112685125A (en) 2021-04-20
CN112685125B true CN112685125B (en) 2021-11-26

Family

ID=75456509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110023760.4A Active CN112685125B (en) 2021-01-08 2021-01-08 Theme switching method and device of application program and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112685125B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112413828A (en) * 2020-12-09 2021-02-26 珠海格力电器股份有限公司 Display picture adjusting method and device of air conditioning equipment
CN113382296A (en) * 2021-06-08 2021-09-10 海信视像科技股份有限公司 Display device and brightness adjusting method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874021A (en) * 2015-12-11 2017-06-20 腾讯科技(深圳)有限公司 terminal visual interface automatic switching method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874021A (en) * 2015-12-11 2017-06-20 腾讯科技(深圳)有限公司 terminal visual interface automatic switching method and device

Also Published As

Publication number Publication date
CN112685125A (en) 2021-04-20

Similar Documents

Publication Publication Date Title
CN112685125B (en) Theme switching method and device of application program and computer readable storage medium
DE112018004847T5 (en) INFORMATION PROCESSING DEVICE, INFORMATION PROCESSING PROCESS, PROGRAM AND MOBILE OBJECT
CN110135302B (en) Method, device, equipment and storage medium for training lane line recognition model
CN112307978B (en) Target detection method and device, electronic equipment and readable storage medium
CN109726678B (en) License plate recognition method and related device
CN112733672B (en) Three-dimensional target detection method and device based on monocular camera and computer equipment
EP3954568B1 (en) Screen control method, screen control apparatus, in-vehicle screen and vehicle
CN113762209A (en) Multi-scale parallel feature fusion road sign detection method based on YOLO
CN106161984B (en) Video image highlight suppression, contour and detail enhancement processing method and system
CN111476192B (en) Intercepted image synthesis method based on intelligent traffic and big data cloud server
CN111142402B (en) Simulation scene construction method, device and terminal
CN112132216B (en) Vehicle type recognition method and device, electronic equipment and storage medium
US20180191949A1 (en) Method and system for image-based dynamic feature enhancement
CN110316206A (en) Vehicle-mounted panoramic image shows automatic control method, device and computer equipment
CN113095194A (en) Image classification method and device, storage medium and electronic equipment
CN115908618B (en) Method, device, equipment and medium for generating reconstructed image based on pulse data
CN116258756B (en) Self-supervision monocular depth estimation method and system
CN109766799B (en) Parking space recognition model training method and device and parking space recognition method and device
CN111177878B (en) Derived simulation scene screening method, device and terminal
CN111611835A (en) Ship detection method and device
CN116188587A (en) Positioning method and device and vehicle
CN111310660B (en) Target detection false alarm suppression method and device for ADAS scene
CN114584839A (en) Clipping method and device for shooting vehicle-mounted video, electronic equipment and storage medium
CN110659384B (en) Video structured analysis method and device
CN113947747B (en) Method, device and equipment for processing monitoring image of vehicle

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40041965

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant