Image Processing Method and Device
Abstract
An image processing method performed by image processing device having an operating system includes receiving, by an image processing module of the operating system, an instruction of a first application program to call the image processing module of the operating system, where the instruction carries a to-be-displayed image and a resolution of the to-be-displayed image. The image processing method further includes when the resolution of the to-be-displayed image is less than a first threshold, performing, by the image processing module, super-resolution processing on the to-be-displayed image, and displaying an image obtained after the super-resolution processing.
Claims
exact text as granted — not AI-modified1 . An image processing method performed by an image processing device comprising an operating system, wherein the image processing method comprises:
receiving, by the operating system, a to-be-displayed image from a first application program; performing, by the operating system and when the first application program has an image optimization permission, image optimization processing on the to-be-displayed image to obtain a processed image; and displaying the processed image.
2 . The image processing method of claim 1 , wherein performing the image optimization processing on the to-be-displayed image comprises performing super-resolution processing on the to-be-displayed image, and wherein the image optimization permission is a super-resolution processing permission.
3 . The image processing method of claim 2 , wherein performing the super-resolution processing on the to-be-displayed image comprises performing the super-resolution processing on the to-be-displayed image when a resolution of the to-be-displayed image is less than a first threshold.
4 . The image processing method of claim 1 , further comprising determining, by the operating system, that the first application program has the image optimization permission based on an identifier of the first application program.
5 . The image processing method of claim 4 , wherein determining that the first application program has the image optimization permission comprises:
determining whether a preset whitelist includes the identifier of the first application program; and determining, when the preset whitelist includes the identifier of the first application program, that the first application program has the image optimization permission.
6 . The image processing method of claim 2 , wherein performing the super-resolution processing on the to-be-displayed image comprises:
adding the to-be-displayed image to a task queue as a task object; determining, based on a resolution of the to-be-displayed image, an image optimization algorithm corresponding to the to-be-displayed image; and performing, using the image optimization algorithm corresponding to the to-be-displayed image, super-resolution processing on the task object.
7 . The image processing method of claim 6 , further comprising after the super-resolution processing on the task object is completed, releasing, by the operating system, memory space corresponding to the task object.
8 . The image processing method of claim 6 , wherein a first task in the task queue is allocated to a first processor to perform super-resolution processing, and wherein a second task in the task queue is allocated to a second processor to perform super-resolution processing.
9 . The image processing method of claim 1 , wherein the operating system is an Android operating system that comprises an ImageView class at a framework layer of the Android operating system, and wherein the image processing method further comprises:
receiving, by the ImageView class, an instruction of the first application program, wherein the instruction indicates a width and a height of the to-be-displayed image; and determining, by the ImageView class, after receiving the instruction, and before performing the image optimization processing, that the width of the to-be-displayed image and the height of the to-be-displayed image satisfy a specified condition, wherein the specified condition comprises that a first difference between a height of a screen of the image processing device and the height of the to-be-displayed image is less than a first threshold, that a second difference between a width of the screen of the image processing device and the width of the to-be-displayed image is less than a second threshold, or that both the first difference is less than the first threshold and the second difference is less than the second threshold.
10 . The image processing method of claim 1 , wherein the operating system is an Android operating system that comprises a BitmapFactory class at a framework layer of the Android operating system, and wherein the image processing method further comprises:
receiving, by the BitmapFactory class, an instruction of the first application program; and decoding, by the BitmapFactory class, after receiving the instruction, and before performing the image optimization processing, the to-be-displayed image.
11 . The image processing method of claim 1 , wherein receiving the to-be-displayed image from the first application program comprises receiving an instruction of the first application program, and wherein the instruction carries the to-be-displayed image.
12 . An image processing device, comprising:
a first processor configured to implement an operating system, wherein the operating system is configured to:
obtain a to-be-displayed image from a first application program; and
perform, when the first application program has an image optimization permission, image optimization processing on the to-be-displayed image to obtain a processed image; and
a display coupled to the first processor and configured to display the processed image.
13 . The image processing device of claim 12 , wherein the operating system is further configured to perform super-resolution processing on the to-be-displayed image, and wherein the image optimization permission is a super-resolution processing permission.
14 . The image processing device of claim 13 , wherein the operating system is configured to perform the super-resolution processing on the to-be-displayed image when a resolution of the to-be-displayed image is less than a first threshold.
15 . The image processing device of claim 12 , wherein the operating system is further configured to:
receive an instruction of the first application program, wherein the instruction comprises an identifier of the first application program; and determine, based on the identifier, that the first application program has the image optimization permission.
16 . The image processing device of claim 15 , wherein the operating system is further configured to:
determine whether a preset whitelist includes the identifier; and determine that the first application program has the image optimization permission when the preset whitelist includes the identifier.
17 . The image processing device of claim 13 , wherein the operating system is further configured to:
add the to-be-displayed image to a task queue as a task object; determine, based on a resolution of the to-be-displayed image, an image optimization algorithm corresponding to the to-be-displayed image; and perform, using the image optimization algorithm corresponding to the to-be-displayed image, super-resolution processing on the task object.
18 . The image processing device of claim 17 , wherein the operating system is further configured to release memory space corresponding to the task object after the super-resolution processing on the task object is completed.
19 . The image processing device of claim 17 , wherein the image processing device further comprises multiple processors, and wherein a first task in the task queue is allocated to a different processor of the multiple processors than a second task in the task queue to perform super-resolution processing.
20 . A computer program product comprising instructions that are stored on a computer-readable medium and that, when executed by a processor, cause a device comprising an operating system to:
obtain a to-be-displayed image from a first application program; perform, when the first application program has an image optimization permission, image optimization processing on the to-be-displayed image to obtain a processed image; and display the processed image.Join the waitlist — get patent alerts
Track US2022058772A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.