Disclosure of Invention
In view of the above, embodiments of the present invention are directed to providing an image processing method, an image processing apparatus, a mobile terminal, a computer device, and a storage medium, so as to solve the problem of a decrease in a cruising time of the mobile terminal due to an increase in a resolution of a display screen.
One aspect of the present invention provides an image display method for a mobile terminal having a display screen, including: acquiring original image information; down-sampling original image information to obtain intermediate image information, and performing image processing on the intermediate image information, wherein the intermediate image information has a first resolution; expanding the intermediate image information after image processing to obtain display image information, wherein the display image information has a second resolution, and the second resolution is greater than the first resolution; and displaying according to the display image information. According to the image display method provided by the embodiment, before image display is performed, only image processing needs to be performed on the image information corresponding to a part of pixel points in the image to be displayed, and compared with the prior art in which image processing needs to be performed on complete original image information, the image display method reduces the data volume of image processing, improves the data processing speed, and reduces the energy consumption of the image processing process.
In one embodiment, before acquiring the original image information, the method further comprises: acquiring a corresponding relation between a preset second resolution and the first resolution and a resolution of a display screen, wherein the resolution of the display screen is equal to the second resolution; and calculating the first resolution according to the corresponding relation between the second resolution and the first resolution and the resolution of the display screen. According to the image display method provided by the embodiment, the first resolution can be automatically calculated according to the resolution of the display screen, so that the image display method is ensured to be suitable for the display screens with different resolutions, and the application range is expanded.
In one embodiment, before acquiring the preset correspondence between the second resolution and the first resolution, and the resolution of the display screen, the method further includes: and adding the resolution of the display screen in the initialization parameters of the mobile terminal. By adding the resolution of the display screen to the initialization parameters of the mobile terminal, subsequent calls can be used to calculate the first resolution.
In one embodiment, the first resolution is two-thirds of the second resolution; the step of expanding the intermediate image information after the image processing to obtain the display image information comprises the following steps: adding a compensation pixel point between two adjacent pixel points in the intermediate image information after image processing by adopting a compensation algorithm; and determining the color of the compensation pixel point as the intermediate color of two adjacent pixel points. The first resolution is set to be two thirds of the second resolution, and the colors of the compensation pixels are determined to be intermediate colors of two adjacent pixels, so that the compensation algorithm is simple and easy to realize, the compensation effect is good, and the picture distortion is small.
In one embodiment, the display image information includes intermediate image information and compensation image information after image processing; displaying according to the display image information, comprising: the image-processed intermediate image information and the compensated image information are separately driven for display. According to the image display method provided by the embodiment, partition control is adopted, and the flexibility of the system is enhanced.
In one embodiment, the image display method is used in a low power state of the mobile terminal. Only the image display method is used in a low-power state, so that on one hand, good display resolution in a normal state is ensured, and the user requirements are met; on the other hand, the power consumption in a low-power state is reduced, and the standby time is prolonged.
In a second aspect, the present invention provides an image display apparatus for a mobile terminal having a display screen, including: the acquisition module acquires original image information; the processing module is used for performing down-sampling on original image information to obtain intermediate image information and performing image processing on the intermediate image information, wherein the intermediate image information has a first resolution; the expansion module is used for expanding the intermediate image information after image processing to obtain display image information, wherein the display image information has a second resolution, and the second resolution is greater than the first resolution; and the display module displays according to the display image information.
The invention provides a mobile terminal in three aspects, comprising: the processor acquires original image information; down-sampling original image information to obtain intermediate image information, and performing image processing on the intermediate image information, wherein the intermediate image information has a first resolution; the driving chip is used for expanding the intermediate image information after the image processing to obtain display image information, and the display image information has a second resolution ratio which is greater than the first resolution ratio; and the display screen displays according to the display image information.
The invention provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and executed by the processor, wherein the processor executes the computer program to realize the steps of the image display method provided by any one of the embodiments.
A fifth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the image display method provided in any of the above embodiments.
According to the image processing method provided by the invention, only the image information corresponding to part of the pixel points in the image to be displayed needs to be subjected to image processing, and compared with the prior art in which the image processing needs to be carried out on the complete original image information, the data amount of the image processing is reduced, the data processing speed is improved, and the energy consumption in the image processing process is reduced.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart illustrating an image display method according to a first embodiment of the present invention. The method is suitable for mobile terminals with display screens, such as mobile phones, tablet computers, notebook computers, handheld game consoles, electronic readers and the like. As shown in fig. 1, theimage display method 100 includes:
step S110, original image information is acquired.
The original image information is image information stored in the mobile terminal or image information from a network. The original image information may be a frame-by-frame image or a video of consecutive frames.
Step S120, down-sampling the original image information to obtain intermediate image information, and performing image processing on the intermediate image information, wherein the intermediate image information has a first resolution.
The resolution of the original image information may be an arbitrary value greater than the first resolution. The original image information is subjected to down sampling, namely, data information corresponding to a part of pixel points is selected from the original image information to be used as useful information, and meanwhile, data information corresponding to the other part of pixel points is filtered out, so that the resolution ratio of the original image information is reduced. For example, the resolution of the original image information is 3840 × 2160, and the resolution of the intermediate image information obtained after down-sampling, i.e., the first resolution, is 2560 × 1440.
Performing image processing on the intermediate image information refers to extracting information, including color and position, of each pixel point from the intermediate image information to determine how the intermediate image information is presented on the display screen. Compared with the prior art, the method has the advantages that the data volume of graphic processing is reduced, the data processing speed is increased, and the energy consumption of the image processing process is reduced for image processing of complete original image information.
Step S130, expanding the intermediate image information after image processing to obtain display image information, where the display image information has a second resolution, and the second resolution is greater than the first resolution.
The process of expanding the intermediate image information after image processing is equivalent to the inverse process of down-sampling the original image information, but the two are not completely reciprocal, because the expansion process needs to compensate the intermediate image information according to a predetermined strategy, and the compensated image information is not necessarily completely identical to the image information filtered out in the sampling process.
Step S140 displays the image information.
The resolution of the displayed image information, i.e. the second resolution, is equal to the resolution of the display screen, which means that the displayed image information and the data displayable by the display screen are equal, thereby ensuring a proper display.
The display image information includes the intermediate image information and the compensation image information after image processing, and in one embodiment, the step S140 is specifically performed as: the image-processed intermediate image information and the compensated image information are separately driven for display. And the system flexibility is enhanced by adopting partition control.
It should be noted that, in this embodiment, the first resolution and the second resolution may be preset, where the second resolution depends on the resolution of the display screen, and the first resolution may be set manually.
According to the image processing method provided by the embodiment, only the image information corresponding to a part of pixel points in the image to be displayed needs to be subjected to image processing, and compared with the prior art in which the image processing needs to be performed on the complete original image information, the data size of the image processing is reduced, the data processing speed is increased, and the energy consumption of the image processing process is reduced.
Fig. 2 is a flowchart of an image display method according to a second embodiment of the present invention. As shown in fig. 2, theimage display method 200 differs from theimage display method 100 only in that theimage display method 200 further includes, before step S110:
step S210, obtaining a corresponding relationship between a preset second resolution and the first resolution, and a resolution of the display screen, where the resolution of the display screen is equal to the second resolution.
Step S220, calculating the first resolution according to the corresponding relationship between the second resolution and the first resolution and the resolution of the display screen.
According to the image display method provided by the embodiment, the first resolution can be automatically calculated according to the resolution of the display screen, so that the image display method is ensured to be suitable for the display screens with different resolutions, and the application range is expanded.
In one embodiment, as shown in fig. 2, before step S210, the method further includes:
and step S200, adding the resolution of the display screen in the initialization parameters of the mobile terminal.
The resolution of the display screen of existing mobile terminals is fixed and the system parameters related to image display in the mobile terminal are matched with it. In this case, the initialization code of the mobile terminal includes xxxx0111, xxxx0129, where 11 denotes exiting sleep and 29 denotes starting display.
According to the image display method provided by the embodiment, the resolution of the display screen can be added to the initialization parameters of the mobile terminal, and then the resolution can be adjusted to be used for calculating the first resolution. Specifically, for example, when the resolution of the display screen is 3840 × 2160, the initialization code is set to xxxx020F00, xxxx020870, xxxx0111, xxxx0129, where 0F00 indicates that the horizontal resolution is 3840 and 0870 indicates that the vertical resolution is 2160.
Fig. 3 is a flowchart of an image display method according to a third embodiment of the present invention. As shown in fig. 3, image display method 300 differs fromimage display method 200 andimage display method 100 only in that in image display method 300, the first resolution is two-thirds of the second resolution. For example, the resolution of the intermediate image information, i.e. the first resolution, is 2560 x 1440, and the resolution of the second resolution, i.e. the display screen, is 2560 x 1440. That is, the resolutions in the horizontal direction and the vertical direction of the intermediate image information are two thirds of the resolutions in the horizontal direction and the vertical direction of the display screen, respectively.
In this case, step S130 specifically includes:
step S310, adding a compensation pixel point between two adjacent pixel points in the intermediate image information after image processing by adopting a compensation algorithm.
Step S320, determining the color of the compensation pixel point as the intermediate color of two adjacent pixel points.
The color of the compensation pixel point is the intermediate color of two adjacent pixel points, namely the color value of the compensation pixel point is the average value of the color values of the two adjacent pixel points.
According to the image display method provided by the embodiment, the first resolution is set to be two thirds of the second resolution, and the color of the compensation pixel point is determined to be the intermediate color of the two adjacent pixel points, so that the compensation algorithm is simple and easy to implement, the compensation effect is good, and the picture distortion is small.
Fig. 4 is a flowchart of an image display method according to a fourth embodiment of the present invention. Generally, the operating state of the mobile terminal includes a normal state and a low power state, and in the present embodiment, theimage display method 100 shown in fig. 1 is only used for the low power state of the mobile terminal. In this case, as shown in fig. 4, before step S110, theimage display method 400 further includes:
step S410, the working state of the mobile terminal is monitored in real time, and the working state comprises a low-power state and a normal state.
Step S420, determining whether the mobile terminal is in a low power state, if so, executing theimage display method 100, i.e., step S110 to step S140; if not, go to step S430.
The monitoring of the operating state of the mobile state can be carried out by monitoring the voltage of the battery. In this case, a voltage threshold may be set for the battery, and when the voltage of the battery is lower than the voltage threshold, it is determined that the mobile terminal is in a low battery state; otherwise, the mobile terminal is determined to be in a normal state.
And step S430, acquiring original image information, performing image processing on the original image information, and displaying the image-processed original image information on a display screen. The execution process of this step is the same as the image display process in the prior art, and is not described herein again.
According to the image display method of the embodiment, different image display methods are adopted according to different working states of the mobile terminal, so that on one hand, good display resolution in a normal state is ensured, and user requirements are met; on the other hand, the power consumption in a low-power state is reduced, and the standby time is prolonged.
Fig. 5 is a block diagram of an image display device according to an embodiment of the present invention. The image display apparatus is used for a mobile terminal having a display screen, and as shown in fig. 5, the image display apparatus 50 includes an acquisition module 51, a processing module 52, an expansion module 53, and a display module 54. The obtaining module 51 is configured to obtain original image information. The processing module 52 is configured to down-sample the original image information to obtain intermediate image information, and perform image processing on the intermediate image information, where the intermediate image information has a first resolution. The expansion module 53 is configured to expand the intermediate image information after image processing to obtain display image information, where the display image information has a second resolution, and the second resolution is greater than the first resolution. The display module 54 is used for displaying according to the display image information.
In an embodiment, the obtaining module 51 is further configured to obtain a preset correspondence between the second resolution and the first resolution, and a resolution of the display screen, where the resolution of the display screen is equal to the second resolution. In this case, the image display apparatus 50 further includes a calculating module 55 for calculating the first resolution according to the corresponding relationship between the second resolution and the first resolution and the resolution of the display screen.
In one embodiment, the image display apparatus 50 further comprises an adding module 56 for adding the resolution of the display screen in the initialization parameters of the mobile terminal.
In one embodiment, the first resolution is two-thirds of the second resolution. In this case, the expansion module 53 is specifically configured to add a compensation pixel between two adjacent pixels in the intermediate image information after the image processing by using a compensation algorithm; and determining the color of the compensation pixel point as the intermediate color of two adjacent pixel points.
In one embodiment, the display image information includes image processed intermediate image information and compensation image information, and the display module 54 is specifically configured to separately drive the image processed intermediate image information and the compensation image information for display.
In one embodiment, the display device 50 further includes a detection module 57 and a determination module 58. The detection module 57 is configured to monitor an operating state of the mobile terminal in real time, where the operating state includes a low power state and a normal state. The determining module 58 is used for determining whether the mobile terminal is in a low power state, and if so, triggering the processing module 52, the expanding module 53 and the display module 54.
According to the image display device provided by the embodiment, the image display method provided by the embodiment of the invention belongs to the same inventive concept, the image display method provided by any embodiment of the invention can be executed, and the image display device has the corresponding functional modules and beneficial effects of the image display method. For details of the technology that are not described in detail in this embodiment, reference may be made to the image display method provided in this embodiment of the present invention, and details thereof are not repeated here.
Fig. 6 is a block diagram of a mobile terminal according to an embodiment of the present invention. As shown in fig. 6, the mobile terminal 60 includes a processor 61, a driving chip 62, and a display screen 63. Wherein, the processor 61 comprises an acquisition module 51 and a processing module 52 in the image display device 50; the driver chip 62 includes an expansion module 53; the display screen 63 includes a display module 54.
Fig. 7 is a block diagram of a computer device according to an embodiment of the present invention. As shown in fig. 7, the computer device 70 comprises one or more processors 71, a memory 72, and computer programs stored on the memory 72 for execution by the processors 71. The steps of the image display method provided in any of the above embodiments are implemented by the processor 71 when executing the computer program.
The processor 71 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the computer device 70 to perform desired functions.
Memory 72 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by the processor 71 to implement the sound source localization methods of the various embodiments of the present application described above and/or other desired functions. Various contents such as an input signal, a signal component, a noise component, etc. may also be stored in the computer-readable storage medium.
In one example, the computer device 70 may further include: an input device and an output device, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
For example, the input device may be a communication network connector for receiving raw image signals from a wireless network. The input device may also include, for example, a keyboard, mouse, or the like.
The output device may output various information including the determined distance information, direction information, and the like to the outside. The output devices may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
Of course, for simplicity, only some of the components of the computer device 70 relevant to the present application are shown in fig. 7, omitting components such as buses, input/output interfaces, and the like. In addition, computer device 70 may include any other suitable components depending on the particular application.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the image display method according to any of the previous embodiments. The computer storage medium may be any tangible medium, such as a floppy disk, a CD-ROM, a DVD, a hard drive, even a network medium, and the like.
It should be understood that although one implementation form of the embodiments of the present invention described above may be a computer program product, the method or apparatus of the embodiments of the present invention may be implemented in software, hardware, or a combination of software and hardware. The hardware portion may be implemented using dedicated logic; the software portions may be stored in a memory and executed by a suitable instruction execution system, such as a microprocessor or specially designed hardware. It will be appreciated by those of ordinary skill in the art that the methods and apparatus described above may be implemented using computer executable instructions and/or embodied in processor control code, such code provided, for example, on a carrier medium such as a disk, CD or DVD-ROM, programmable memory such as read only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The methods and apparatus of the present invention may be implemented in hardware circuitry, such as very large scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field programmable gate arrays, programmable logic devices, or in software for execution by various types of processors, or in a combination of hardware circuitry and software, such as firmware.
It should be understood that although several modules or units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, according to exemplary embodiments of the invention, the features and functions of two or more modules/units described above may be implemented in one module/unit, whereas the features and functions of one module/unit described above may be further divided into implementations by a plurality of modules/units. Furthermore, some of the modules/units described above may be omitted in some application scenarios.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and should not be taken as limiting the scope of the present invention, which is intended to cover any modifications, equivalents and the like included within the spirit and scope of the present invention.