Image processing method and device, storage medium and electronic equipment
By providing candidate images with multiple resolutions in advance and selecting the target image matching the display resolution when displaying, the problem of inconvenience between image resolution and display resolution is solved, and the adaptability of images on different devices is achieved.
Patent Information
- Application Number
- CN202311171223.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-11
- Publication Date
- 2025-03-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, when an electronic device displays an image, it is more likely that the resolution of the image is not matched with the display resolution.
By providing candidate images with multiple resolutions with the same image content in advance, when display is required, a target image with a resolution matching the display resolution is determined to be displayed.
It effectively avoids the problem of inconsistent image resolution and display resolution, and ensures that the image can be displayed appropriately on multiple electronic devices.
Smart Images

Figure CN119603559A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of electronic technology, and in particular, relates to an image processing method, device, computer-readable storage medium and electronic device. Background Art
[0002] With the development of electronic device technology, the use of electronic devices such as smartphones or tablets is becoming more and more popular. Most electronic devices have built-in cameras, and with the enhancement of electronic device processing capabilities and the development of camera technology, the quality of captured images is getting higher and higher. In daily life, more and more users use electronic devices such as smartphones and tablets to capture images.
[0003] In the related art, an electronic device acquires one or more frames of images through a camera and obtains an image with a fixed resolution after processing. Different electronic devices may have different display resolutions, so the resolution of the image is often incompatible with the display resolution of many electronic devices. It can be seen that in the related art, the image resolution is more likely to be incompatible with the display resolution. Summary of the invention
[0004] The embodiments of the present application provide an image processing method, device, storage medium and electronic device, which make it less likely that the image resolution will not match the display resolution.
[0005] In a first aspect, an embodiment of the present application provides an image processing method, comprising:
[0006] Acquire candidate images of multiple resolutions, wherein the candidate images have the same image content;
[0007] Determine a target image whose resolution matches the display resolution from the candidate images;
[0008] The target image is displayed.
[0009] In a second aspect, an embodiment of the present application provides an image processing device, including:
[0010] An image acquisition module, used to acquire candidate images of multiple resolutions, wherein the candidate images have the same image content;
[0011] An image determination module, used to determine a target image whose resolution matches the display resolution from the candidate images;
[0012] An image display module is used to display the target image.
[0013] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed on a computer, the computer executes the image processing method provided by the embodiment of the present application.
[0014] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the processor is used to execute the image processing method provided in the embodiment of the present application by calling a computer program stored in the memory.
[0015] In an embodiment of the present application, by providing candidate images of multiple resolutions with the same image content in advance, when the candidate images need to be displayed, a target image whose resolution matches the display resolution can be determined from the candidate images with multiple resolutions for display. Since candidate images of multiple resolutions can be provided in advance, and the resolutions of candidate images with different resolutions can be adapted to the display resolution of electronic devices that support different display resolutions, it is less likely that the image resolution will not match the display resolution. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The technical solution and beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.
[0017] Figure 1 It is a flowchart of the image processing method provided in the embodiment of the present application.
[0018] Figure 2 This is a schematic diagram of the first scenario of the image processing method provided in an embodiment of the present application.
[0019] Figure 3 This is a schematic diagram of a second scenario of the image processing method provided in an embodiment of the present application.
[0020] Figure 4 This is a schematic diagram of the third scenario of the image processing method provided in the embodiment of the present application.
[0021] Figure 5 This is a schematic diagram of the fourth scenario of the image processing method provided in the embodiment of the present application.
[0022] Figure 6 This is a fifth scenario schematic diagram of the image processing method provided in an embodiment of the present application.
[0023] Figure 7 This is a sixth scenario schematic diagram of the image processing method provided in an embodiment of the present application.
[0024] Figure 8 It is a structural schematic diagram of the image processing device provided in an embodiment of the present application.
[0025] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] It should be noted that the terms "first", "second" and "third" in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but some embodiments also include steps or modules that are not listed, or some embodiments also include other steps or modules inherent to these processes, methods, products or devices.
[0027] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0028] The embodiments of the present application provide an image processing method, an image processing device, a storage medium, and an electronic device. The execution subject of the image processing method may be the image processing device provided in the embodiments of the present application, or an electronic device integrating the image processing device, wherein the image processing device may be implemented in hardware or software. The electronic device may be a device such as a smart phone, a tablet computer, a PDA, a laptop computer, etc. that is equipped with a processor and has image processing capabilities.
[0029] See also Figure 1 , Figure 1 : is a schematic diagram of the process of the image processing method provided in the embodiment of the present application, and the process may include:
[0030] In 101, candidate images with multiple resolutions are obtained, and the image contents of the candidate images are the same.
[0031] The candidate images may include YUV images or RGB images.
[0032] For example, in scenarios such as image preview scenarios or scenarios where a user actively views an image, the electronic device usually needs to display a corresponding image, such as an image captured by a camera or an image actively viewed by a user.
[0033] In the related art, when it is necessary to preview an image captured by a camera or display an image actively viewed by a user, the camera is usually used to capture the scene, obtain one or more frames of images, and after processing, obtain a frame of image with a fixed resolution for display. The resolution of the frame image is usually only compatible with the display resolution of an electronic device with the same display resolution as the frame image, and is not compatible with the display resolution of an electronic device with a different display resolution from the frame image. As can be seen from the above, in the related art, the phenomenon of image resolution not matching the display resolution is more likely to occur.
[0034] In this embodiment, candidate images with multiple resolutions and the same image content are provided in advance. Then, when the candidate images need to be displayed, the candidate images with the multiple resolutions can be obtained.
[0035] For example, an electronic device uses a camera to shoot a scene. After obtaining the captured image, the captured image is sampled multiple times to obtain candidate images with multiple resolutions.
[0036] For another example, when an external electronic device uses a camera to shoot a scene, after obtaining an image, it will also sample the image multiple times to obtain images with multiple resolutions. Subsequently, the external electronic device will encode the images with multiple resolutions respectively, obtain encoded images with multiple resolutions and send them to the electronic device. After receiving the encoded images with multiple resolutions, the electronic device will decode the encoded images with multiple resolutions respectively to obtain candidate images with multiple resolutions.
[0037] Among them, after starting a shooting application (such as the system application "camera" of an electronic device) according to user operation, the scene that the camera is aimed at is the shooting scene. For example, after the user clicks the icon of the "camera" application on the electronic device to start the "camera application", if the user uses the camera of the electronic device to aim at a scene including XX object, then the scene including XX object is the shooting scene. According to the above description, those skilled in the art should understand that the shooting scene does not refer to a specific scene, but the scene that is aimed at in real time following the direction of the camera.
[0038] In 102, a target image having a resolution matching the display resolution is determined from the candidate images.
[0039] The display resolution is the display resolution supported by the display screen of the electronic device.
[0040] For example, when the resolution of the image is the same as the display resolution, it is determined that the resolution of the image matches the display resolution.
[0041] For example, assuming that the candidate images of multiple resolutions are candidate image M1 with resolution P1, candidate image M2 with resolution P2, candidate image M3 with resolution P3 and candidate image M4 with resolution P4, then if the display resolution is P1, the target image can be determined to be candidate image M1; if the display resolution is P2, the target image can be determined to be candidate image M2; if the display resolution is P4, the target image can be determined to be candidate image M4.
[0042] In 103, the target image is displayed.
[0043] For example, since the resolution of the target image is the same as the display resolution, after the target image is determined, the electronic device can directly display the target image without adjusting the resolution of the target image.
[0044] Optionally, the target image may be displayed by a player having an image processing method provided by the embodiment of the present application built in.
[0045] In this embodiment, by providing candidate images of multiple resolutions with the same image content in advance, when the candidate images need to be displayed, a target image whose resolution matches the display resolution can be determined from the candidate images of multiple resolutions for display. Since candidate images of multiple resolutions can be provided in advance, and the resolutions of candidate images of different resolutions can be adapted to the display resolution of electronic devices that support different display resolutions, it is less likely that the image resolution will not match the display resolution.
[0046] In an optional embodiment, obtaining candidate images of multiple resolutions includes:
[0047] Shooting a shooting scene to obtain a shooting image;
[0048] The captured image is sampled multiple times to obtain candidate images with multiple resolutions.
[0049] For example, when a user starts a camera application on an electronic device and enters a preview interface, the electronic device will shoot a shooting scene to obtain a shot image.
[0050] Optionally, when the user starts the camera application on the electronic device and enters the preview interface, the electronic device will shoot the shooting scene through the camera to obtain a RAW image; the electronic device then processes the RAW image through an image signal processor (Image Signal Processing, ISP) to obtain a YUV image or an RGB image. The YUV image or the RGB image can be used as the shot image.
[0051] Subsequently, the electronic device samples the captured image multiple times to obtain candidate images with multiple resolutions, wherein the candidate images with multiple resolutions may include the captured image or may not include the captured image.
[0052] For example, Figure 2 As shown, the electronic device can upsample the captured image L22 to obtain the candidate image L21, downsample the captured image L22 to obtain the candidate image L23, and downsample the captured image L22 again to obtain the candidate image L24. The resolutions of the candidate images L21, L22, L23 and L24 are different. The resolutions of the candidate images L21, L22, L23 and L24 constitute candidate images of multiple resolutions.
[0053] After obtaining candidate images with multiple resolutions, the electronic device may determine a target image with a resolution matching the display resolution of the electronic device from the candidate images with multiple resolutions, and display the target image to achieve image preview.
[0054] In an optional embodiment, the electronic device may also save the candidate images of the multiple resolutions, and generate thumbnails based on the candidate images of any resolution. Subsequently, when the user opens an image viewing application, such as an album application, the electronic device may display the thumbnail. When the user clicks on the thumbnail, the electronic device receives a viewing operation for the image corresponding to the thumbnail. In response to the viewing operation, the electronic device may determine a target image whose resolution matches the display resolution of the electronic device from the candidate images of the multiple resolutions, and display the target image to enable viewing of the image corresponding to the thumbnail.
[0055] Among them, the number of sampling times, sampling multiples and sampling methods can be determined according to actual needs and are not specifically limited here.
[0056] For example, in order to make the image quality of candidate images with different resolutions relatively high, the captured images may be sampled multiple times in a sampling manner that has less impact on the image quality.
[0057] For another example, since captured images usually need to be displayed on a local electronic device, the display resolution of the local electronic device can be acquired in advance so that when sampling is performed, the resolution of the image obtained from a certain sampling can match the display resolution of the electronic device.
[0058] For another example, the number of samplings may be appropriately set to be larger, and the captured images may be sampled according to the display resolution of a display screen that is currently in high use, so that the resolution of the candidate images can be adapted to the display resolution of more electronic devices.
[0059] In an optional embodiment, after obtaining candidate images with multiple resolutions, the electronic device may store the candidate images with multiple resolutions in a memory for subsequent use.
[0060] In an optional embodiment, after sampling the captured image multiple times to obtain candidate images with multiple resolutions, the method further includes:
[0061] determining a first image and a second image from the candidate images;
[0062] Encoding the first image to obtain a first encoded image, and decoding the first encoded image to obtain a first decoded image;
[0063] Sampling the first decoded image multiple times to obtain multiple first sampled images, wherein the resolution of each first sampled image is the same as the resolution of a second image;
[0064] Determine a first difference image according to difference information between a second image having the same resolution and the first sampled image;
[0065] The first difference image is encoded to obtain a first encoded difference image, and the first encoded image and the first encoded difference image are sent to an external device.
[0066] In this embodiment, the first image and the second image may be first determined from candidate images of multiple resolutions.
[0067] For example, the candidate images may be sorted in descending order of resolution, and the candidate image in the middle may be determined as the first image, and the remaining candidate images may be determined as the second image.
[0068] For example, assuming that candidate images L21, L22, L23 and L24 of multiple resolutions are respectively candidate images L21, L22, L23 and L24 in descending order of resolution, then candidate image L22 can be used as the first image, and candidate images L21, L23 and L24 can be used as the second image; or candidate image L23 can be used as the first image, and candidate images L21, L22 and L24 can be used as the second image.
[0069] For another example, any candidate image among candidate images with multiple resolutions may be used as the first image, and the remaining candidate images may be used as the second image.
[0070] For example, assuming that the candidate images of multiple resolutions are candidate images L21, L22, L23 and L24, then candidate image L22 can be used as the first image, and candidate images L21, L23 and L24 can be used as the second image; or candidate image L24 can be used as the first image, and candidate images L21, L22 and L23 can be used as the second image.
[0071] In an optional embodiment, the candidate images of multiple resolutions include a captured image, and the captured image may be used as the first image, and the remaining images may be used as the second image.
[0072] For example, assuming that the candidate images of multiple resolutions are candidate images L21, L22, L23 and L24, wherein candidate image L21 is a captured image, then candidate image L21 can be used as the first image, and candidate images L22, L23 and L24 can be used as the second images.
[0073] For example, Figure 3 As shown, assuming that the first image is the candidate image L22, and the second image is the candidate images L21, L23 and L24, after obtaining the first image L22, the first image L22 can be encoded to obtain the first encoded image B22, and the first encoded image B22 can be decoded to obtain the first decoded image R22.
[0074] It should be noted that the embodiments of the present application do not limit the encoding and decoding methods of the image, and the corresponding encoding and decoding methods can be selected for encoding and decoding based on actual needs.
[0075] After the first decoded image is obtained, the first decoded image may be sampled multiple times, and the resolution of the first sampled image obtained by each sampling is made the same as the resolution of the second image.
[0076] For example, Figure 3 As shown, assuming that the second images are second images L21, L23 and L24, wherein the resolution of the second image L21 is P1, the resolution of the second image L23 is P3, and the resolution of the second image L24 is P4, then the first decoded image R22 can be upsampled so that the resolution of the obtained first sampled image R21 is P1, the first decoded image R22 can be downsampled so that the resolution of the obtained first sampled image R23 is P3, and the first sampled image can be downsampled again so that the resolution of the obtained first sampled image R24 is P4.
[0077] After the first sampled images with multiple resolutions are obtained, the first difference image may be determined according to difference information between the second image with the same resolution and the second sampled image.
[0078] For example, the difference between the pixel values at the corresponding pixel positions of the second image and the first sampling image having the same resolution may be used as the pixel value at the corresponding pixel position of the first difference image to obtain the first difference image.
[0079] For example, Figure 4As shown, the difference between the pixel values of the corresponding pixel positions of the second image L21 and the first sampling image R21 can be used as the pixel value of the corresponding pixel position of the first difference image D21 to obtain the first difference image D21; the difference between the pixel values of the corresponding pixel positions of the second image L23 and the first sampling image R23 can be used as the pixel value of the corresponding pixel position of the first difference image D23 to obtain the first difference image D23; the difference between the pixel values of the corresponding pixel positions of the second image L24 and the first sampling image R24 can be used as the pixel value of the corresponding pixel position of the first difference image D24 to obtain the first difference image D24.
[0080] The corresponding pixel positions of the second image and the first sampling image with the same resolution and the corresponding pixel positions of the first difference image refer to the same pixel positions in the second image, the first sampling image and the first difference image with the same resolution.
[0081] For example, for the second image L21, the first sampling image R21 and the first difference image D21 with the same resolution, if the corresponding pixel position of the second image L21 is (0,0), the corresponding pixel position of the first sampling image R21 and the corresponding pixel position of the first difference image D21 are also (0,0); if the corresponding pixel position of the second image L21 is (1,1), the corresponding pixel position of the first sampling image R21 and the corresponding pixel position of the first difference image D21 are also (1,1).
[0082] For example, Figure 5 As shown in the figure, taking the first difference image D21 obtained based on the second image L21 and the first sampling image R21 with the same resolution as an example, for the second image L21 and the first sampling image R21 with the same resolution, the difference between the pixel value at the pixel position P11 and the pixel value at the pixel position P21 can be used as the pixel value at the pixel position P31 of the difference image, the difference between the pixel value at the pixel position P12 and the pixel value at the pixel position P22 can be used as the pixel value at the pixel position P32 of the difference image, and the difference between the pixel value at the pixel position P13 and the pixel value at the pixel position P14 can be used as the pixel value at the pixel position P15. The difference of the pixel value of P23 is used as the pixel value of the pixel position P33 of the difference image, the difference of the pixel value of the pixel position P14 and the pixel value of the pixel position P24 is used as the pixel value of the pixel position P34 of the difference image, the difference of the pixel value of the pixel position P15 and the pixel value of the pixel position P25 is used as the pixel value of the pixel position P35 of the difference image, and the difference of the pixel value of the pixel position P16 and the pixel value of the pixel position P26 is used as the pixel value of the pixel position P36 of the difference image, to obtain the first difference image D21. By analogy, the first difference images D23 and D24 can be obtained in the same manner as above.
[0083] After the first difference image is obtained, the first difference image may be encoded to obtain a first encoded difference image, and then the first encoded image and the first encoded difference image may be sent to an external device.
[0084] For example, Figure 6 As shown, after obtaining the first difference image D21, the first difference image D21 can be encoded to obtain the first encoded difference image B21; the first difference image D23 can be encoded to obtain the first encoded difference image B23; the first difference image D24 can be encoded to obtain the first encoded difference image B24. After obtaining the first encoded difference images B21, B23 and B24, the first encoded image B22 and the first encoded difference images B21, B23 and B23 can be sent to an external device.
[0085] In an optional embodiment, after the first coded difference image and the first coded image are obtained, the first coded difference image and the first coded image may be packaged into code streams and then sent to an external device.
[0086] After receiving the first coded difference image and the first coded image, the external device may directly store the first coded difference image and the first coded image in the memory. When it is necessary to display the image corresponding to the first coded image and the first coded difference image later, a matching image whose resolution matches the display resolution of the external device may be determined from the first coded image and the first coded difference image. If the matching image is the first coded image, the external device may decode the first coded image to obtain a fifth decoded image, and then display the fifth decoded image. If the matching image is the first coded difference image, the external device may decode the first coded image to obtain a fifth decoded image, and decode the first coded difference image to obtain a first decoded difference image, and then sample the fifth decoded image to obtain a fourth sampled image, wherein the resolution of the fourth sampled image is the same as the resolution of the first decoded difference image. Then, the external device determines a sixth decoded image based on the first coded difference image and the fourth sampled image, and displays the sixth decoded image.
[0087] Optionally, the external device determines a sixth decoded image based on the first encoded difference image and the fourth sampling image, including: determining the sum of the pixel value of the corresponding pixel position in the first decoded difference image and the pixel value of the corresponding pixel position in the fourth sampling image as the pixel value of the corresponding pixel position in the sixth decoded image, to obtain the sixth decoded image.
[0088] In an optional embodiment, after obtaining the first coded difference image and the first coded image, the electronic device may also store the first coded difference image and the first coded image in a memory for subsequent use. The specific implementation can refer to the previous embodiment, which will not be repeated here.
[0089] After receiving the first coded image and the first coded difference image, the external device may also first decode the first coded image to obtain the fifth decoded image, and decode the first coded difference image to obtain the first decoded difference image, and then sample the fifth decoded image to obtain the fourth sampled image, wherein the resolution of the fourth sampled image is the same as the resolution of the first decoded difference image. Then, the external device determines the sixth decoded image based on the first coded difference image and the fourth sampled image, and stores the fifth decoded image and the sixth decoded image in a memory. Subsequently, the fifth decoded image or the sixth decoded image can be directly displayed when needed.
[0090] Since the coding loss of the first image causes a small difference between the second image with the same resolution and the first sampled image, most of the pixel values of the calculated first difference image are near 0. These first difference images are encoded, such as after entropy coding, and the bit stream generated is very small, so this method helps to save storage space.
[0091] For another example, the absolute value of the difference between the pixel values at the corresponding pixel positions of the second image and the first sampling image having the same resolution may be used as the pixel value at the corresponding pixel position of the first difference image to obtain the first difference image.
[0092] In an optional embodiment, when the difference between the pixel values of corresponding pixel positions of the second image and the first sampled image having the same resolution (the pixel value of the corresponding pixel position in the second image - the pixel value of the corresponding pixel position in the first sampled image) is used as the pixel value of the corresponding pixel position of the first difference image, if the difference is a positive value, 1 is used as the pixel value of the corresponding pixel position of the recorded image; if the difference is a negative value, 0 is used as the pixel value of the corresponding pixel position of the recorded image, to obtain a first recorded image, and then the first recorded image is encoded to obtain a first encoded recorded image, and the first encoded recorded image is sent to an external device along with the first encoded difference image and the first encoded image as an image corresponding to the first encoded difference image having the same resolution as the first encoded difference image.
[0093] After receiving the first coded image and the first coded difference image, the external device may directly store the first coded image and the first coded difference image in the memory. When it is necessary to display the image corresponding to the first coded image and the first coded difference image later, a matching image whose resolution matches the display resolution of the external device may be determined from the first coded image and the first coded difference image. If the matching image is the first coded image, the external device may decode the first coded image to obtain a fifth decoded image, and then display the fifth decoded image. If the matching image is the first coded difference image, the external device may decode the first coded image to obtain a fifth decoded image, and decode the first coded difference image to obtain a first decoded difference image, and then sample the fifth decoded image to obtain a fourth sampled image, wherein the resolution of the fourth sampled image is the same as the resolution of the first decoded difference image. Then, the external device determines a sixth decoded image based on the first decoded difference image and its corresponding recorded image, and the fourth sampled image, and displays the sixth decoded image.
[0094] Optionally, the external device determines a sixth decoded image based on the first decoded difference image and its corresponding recorded image, and the fourth sampled image, including: if the pixel value of the corresponding pixel position in the recorded image is 0, updating the pixel value of the corresponding pixel position in the first decoded difference image to the opposite of the pixel value; if the pixel value of the corresponding pixel position in the recorded image is 1, keeping the pixel value of the corresponding pixel position in the first decoded difference image unchanged to obtain a second decoded difference image; determining the sum of the pixel value of the corresponding pixel position in the second decoded difference image and the pixel value of the corresponding pixel position in the fourth sampled image as the pixel value of the corresponding pixel position in the sixth decoded image to obtain a sixth decoded image.
[0095] After receiving the first coded image and the first coded difference image, the external device may also first decode the first coded image to obtain the fifth decoded image, and decode the first coded difference image to obtain the first decoded difference image, and then sample the fifth decoded image to obtain the fourth sampled image, wherein the resolution of the fourth sampled image is the same as the resolution of the first decoded difference image. Then, the external device determines the sixth decoded image based on the first decoded difference image and its corresponding recorded image, and the fourth sampled image, and then stores the fifth decoded image and the sixth decoded image in the memory, and then can directly display the fifth decoded image or the sixth decoded image when needed.
[0096] In an optional embodiment, after sampling the captured image multiple times to obtain candidate images with multiple resolutions, the method further includes:
[0097] Encoding the candidate image to obtain an encoded image;
[0098] Send the encoded image to an external device.
[0099] For example, after obtaining candidate images of multiple resolutions, each candidate image may be encoded to obtain encoded images of multiple resolutions, and the encoded images of multiple resolutions may be sent to an external device.
[0100] For example, Figure 7 As shown, after obtaining candidate images L31, L32, L33 and L34 of multiple resolutions, the electronic device can encode candidate image L31 to obtain encoded image B31; encode candidate image L32 to obtain encoded image B32; encode candidate image L33 to obtain encoded image B33; and encode candidate image L34 to obtain encoded image B34.
[0101] For example, a user who has a smartphone or tablet computer with different display resolutions can click on the camera application on the smartphone to enter the photo interface and click on the photo button, so that the smartphone can take a photo of the shooting scene to obtain a captured image. After obtaining the captured image, the smartphone can sample the captured image multiple times to obtain candidate images with multiple resolutions. The smartphone can store candidate images with multiple resolutions and generate a thumbnail corresponding to any candidate image. The thumbnail can be displayed in the album application of the smartphone. Then, the user can start the album application, find the thumbnail, and trigger the thumbnail to be sent to the tablet computer. The smartphone can encode each candidate image to obtain encoded images with multiple resolutions, and send the encoded images with multiple resolutions to the tablet computer. After the tablet computer receives the encoded images with multiple resolutions, it can decode each encoded image to obtain and store decoded images with multiple resolutions, and generate a thumbnail corresponding to any decoded image. The thumbnail can be displayed in the album application of the tablet computer. The user can start the photo album application on the tablet computer, find the thumbnail, and trigger the display of the image corresponding to the thumbnail. Then, the tablet computer can determine the decoded image with a resolution matching the display resolution of the tablet computer from decoded images of multiple resolutions for display.
[0102] In an optional embodiment, after obtaining the coded images of multiple resolutions, the electronic device may also package the coded images of multiple resolutions into a file, and then send the file to an external device. After the external device receives the file, it can obtain the coded images of multiple resolutions from the file, and then decode each coded image to obtain the decoded images of multiple resolutions and store them in the memory. The corresponding decoded images can be obtained and displayed later when needed.
[0103] In an optional embodiment, obtaining candidate images of multiple resolutions includes:
[0104] Acquire external coded images of multiple resolutions sent by an external device, where the external coded images are obtained by encoding images captured by the external device through multiple sampling;
[0105] The outer coded image is decoded to obtain candidate images of multiple resolutions.
[0106] It is understandable that the external device may also perform multiple sampling on the image captured by the external device to obtain a corresponding image, then encode the corresponding image to obtain an externally encoded image, and then send the externally encoded image to the electronic device, and the electronic device receives the externally encoded image. The corresponding image may include the image captured by the external device, or may not include the image captured by the external device.
[0107] After receiving the external coded image, the electronic device can store the external coded image and decode the external coded image to obtain candidate images of multiple resolutions when display is required.
[0108] In an optional embodiment, after receiving the external coded image, the electronic device may first decode the external coded image to obtain and store candidate images of multiple resolutions. Later, when needed, the candidate images of multiple resolutions may be directly obtained.
[0109] In an optional embodiment, obtaining candidate images of multiple resolutions includes:
[0110] Acquire a second coded image and second coded difference images of multiple resolutions sent by an external device, wherein the second coded difference images of multiple resolutions are obtained by respectively encoding the second difference images of multiple resolutions by the external device, the second difference image is determined by the external device according to difference information between a fourth image having the same resolution and the second sampled image, the second sampled image is obtained by sampling the second decoded image by the external device, the second decoded image is obtained by decoding the second coded image by the external device, the second coded image is obtained by encoding the third image by the external device, the third image and the fourth image are determined by the external device from external candidate images of multiple resolutions, and the external candidate image is obtained by sampling an image captured by the external device;
[0111] Decoding the second coded image to obtain a third decoded image, and decoding the second coded difference image to obtain a decoded difference image;
[0112] Sampling the third decoded image multiple times to obtain third sampled images with multiple resolutions, wherein the resolution of each third sampled image is the same as the resolution of a decoded difference image;
[0113] A fourth decoded image is determined according to the third sampled image and the decoded difference image having the same resolution, and the third decoded image and the fourth decoded image are used as candidate images of multiple resolutions.
[0114] It is understandable that the external device may also obtain the second coded image and the second coded difference images of multiple resolutions according to the process of how the electronic device specifically obtains the first coded image and the first coded difference image, and then send the second coded image and the second coded difference images of multiple resolutions to the electronic device. After the electronic device receives the second coded image and the second coded difference images of multiple resolutions, it may also obtain candidate images of multiple resolutions according to the process of the external device processing the first coded image and the first coded difference image. For specific implementation, please refer to the previous embodiment, which will not be repeated here.
[0115] In an optional embodiment, after displaying the target image, the method further includes:
[0116] In response to a zoom-in operation on a target image, determining a magnification factor and a magnified area of the zoom-in operation;
[0117] According to the resolution and magnification of the target image, the image to be cropped is determined from the candidate images;
[0118] Cropping a target area corresponding to the enlarged area from the image to be cropped;
[0119] Displays the target area.
[0120] For example, the preset mapping relationship between the corresponding candidate images and the magnification can be determined according to the number of candidate images with a resolution greater than that of the target image. For example, assuming that the number of candidate images with a resolution greater than that of the target image is 3, and the candidate images M1, M2, and M3 are in order of resolution from small to large, and the target image can be magnified up to 3 times, then, the magnification within 1 times (including 1 times) corresponds to the candidate image M1, the magnification between 1 times and 2 times (including 2 times) corresponds to the candidate image M2, and the magnification between 2 times and 3 times (including 3 times) corresponds to the candidate image M3. If the magnification is 0.5, it is determined that the image to be cropped is the candidate image M1, and the target area corresponding to the magnified area can be cropped from the candidate image M1, and the target area can be displayed in full screen.
[0121] Optionally, the zoom operation may be an operation in which the user presses and slides outwards with two fingers on a corresponding area of the target image, and the zoom area is an area within a first preset range including the area where the user's two fingers act, and the zoom multiple is determined based on the degree to which the user's two fingers are pulled apart. The first preset range may be determined based on actual needs and is not specifically limited here.
[0122] In an optional embodiment, determining a target image having a resolution matching a display resolution from candidate images having multiple resolutions includes:
[0123] In response to a viewing operation on the candidate images, a target image having a resolution matching the display resolution is determined from the candidate images.
[0124] It is understandable that after obtaining candidate images of multiple resolutions, the electronic device can generate a thumbnail corresponding to any candidate image. The thumbnail can be displayed in the album application of the electronic device. The user can start the album application on the electronic device, find the thumbnail, and trigger the display of the image corresponding to the thumbnail, so that the electronic device receives a viewing operation for the candidate image. In response to the viewing operation for the candidate image, the electronic device can determine a target image whose resolution matches the display resolution from the candidate images of multiple resolutions.
[0125] In an optional embodiment, after displaying the target image, the method further includes:
[0126] In response to a zoom-out operation on a target image, determining a zoom-out factor of the zoom-out operation;
[0127] Determine the image to be displayed from the candidate images according to the resolution and reduction factor of the target image;
[0128] Determine the display size of the image to be displayed according to the reduction factor;
[0129] Display the image to be displayed according to the display size.
[0130] For example, the preset mapping relationship between the corresponding candidate images and the reduction factor can be determined according to the number of candidate images with a resolution smaller than that of the target image. For example, assuming that the number of candidate images with a resolution smaller than that of the target image is 3, and in descending order of resolution, they are candidate images M1, M2, and M3, and can be reduced by up to 3 times, then, a reduction within 1 times (including 1 times) corresponds to candidate image M1, a reduction between 1 times and 2 times (including 2 times) corresponds to candidate image M2, and a reduction between 2 times and 3 times (including 3 times) corresponds to candidate image M3. If the reduction factor is 1.2, the image to be displayed is determined to be candidate image M2.
[0131] The electronic device may also set a preset mapping relationship between the reduction factor and the display size. After determining the image to be displayed, the display size of the image to be displayed may be determined based on the preset mapping relationship, and then the image to be displayed may be displayed according to the display size.
[0132] Optionally, the zoom-out operation may be an operation in which the user presses and slides two fingers inwards in a corresponding area of the target image, and the zoom-out area is an area of a second preset range including the area acted on by the two fingers of the user, and the zoom-out multiple is determined based on the degree of proximity of the two fingers of the user. The second preset range may be determined based on actual needs and is not specifically limited here.
[0133] In an optional embodiment, multiple cameras may be used to capture images with different resolutions to obtain candidate images with multiple resolutions.
[0134] For example, many current electronic devices have cameras with different focal lengths, such as main camera, wide-angle camera and telephoto camera, which can output images of different resolutions at the same time, and these images can also be used as candidate images of multiple resolutions; or these images can be used as candidate images of multiple resolutions after alignment and other processing.
[0135] See also Figure 8 , Figure 8 The image processing device 200 includes an image acquisition module 201 , an image determination module 202 and an image display module 203 .
[0136] The image acquisition module 201 is used to acquire candidate images of multiple resolutions, where the candidate images have the same image content.
[0137] The image determination module 202 is used to determine a target image whose resolution matches the display resolution from the candidate images.
[0138] The image display module 203 is used to display the target image.
[0139] In an optional embodiment, the image acquisition module 201 may be used to: photograph a shooting scene to obtain a photographed image; and perform multiple sampling on the photographed image to obtain candidate images of multiple resolutions.
[0140] In an optional embodiment, the image processing device 200 may further include an image sending module, which may be used to: determine a first image and a second image from the candidate images; encode the first image to obtain a first encoded image, and decode the first encoded image to obtain a first decoded image; sample the first decoded image multiple times to obtain multiple first sampled images, wherein the resolution of each first sampled image is the same as the resolution of one of the second images; determine a first difference image based on difference information between the second image with the same resolution and the first sampled image; encode the first difference image to obtain a first encoded difference image, and send the first encoded image and the first encoded difference image to an external device.
[0141] In an optional embodiment, the image sending module may be used to: encode the candidate image to obtain an encoded image; and send the encoded image to an external device.
[0142] In an optional embodiment, the image acquisition module 201 can be used to: acquire external coded images of multiple resolutions sent by an external device, wherein the external coded image is obtained by encoding an image obtained by multiple samplings of an image captured by the external device; and decode the external coded image to obtain candidate images of multiple resolutions.
[0143] In an optional embodiment, the image acquisition module 201 can be used to: acquire a second coded image and second coded difference images of multiple resolutions sent by an external device, the second coded difference images of multiple resolutions are obtained by the external device encoding the second difference images of multiple resolutions respectively, the second difference image is determined by the external device according to difference information between a fourth image with the same resolution and the second sampled image, the second sampled image is obtained by the external device sampling the second decoded image, the second decoded image is obtained by the external device decoding the second coded image, the second coded image is obtained by the external device encoding a third image, the third image and The fourth image is determined by the external device from external candidate images of multiple resolutions, and the external candidate image is obtained by sampling the image captured by the external device; the second encoded image is decoded to obtain a third decoded image, and the second encoded difference image is decoded to obtain a decoded difference image; the third decoded image is sampled multiple times to obtain third sampled images of multiple resolutions, wherein the resolution of each of the third sampled images is the same as the resolution of one of the decoded difference images; a fourth decoded image is determined based on the third sampled image and the decoded difference image with the same resolution, and the third decoded image and the fourth decoded image are used as candidate images of multiple resolutions.
[0144] In an optional embodiment, the image display module 203 can be used to: determine the magnification factor and magnification area of the magnification operation in response to the target image; determine the image to be cropped from the candidate images according to the resolution of the target image and the magnification factor; crop a target area corresponding to the magnification area from the image to be cropped; and display the target area.
[0145] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed on a computer, the computer executes the image processing method provided in the embodiment.
[0146] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the processor is used to execute the image processing method provided in the present embodiment by calling a computer program stored in the memory.
[0147] For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Fig. 9 , Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0148] The electronic device 300 may include components such as a processor 301 and a memory 302. Those skilled in the art will appreciate that Fig. 9 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the electronic device 300 may also include a screen.
[0149] The processor 301 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing applications stored in the memory 302 and calling data stored in the memory 302, thereby monitoring the electronic device as a whole.
[0150] The memory 302 may be used to store applications and data. The applications stored in the memory 302 include executable codes. The applications may be composed of various functional modules. The processor 301 executes various functional applications and data processing by running the applications stored in the memory 302.
[0151] In this embodiment, the processor 301 in the electronic device will load the executable code corresponding to the process of one or more application programs into the memory 302 according to the following instructions, and the processor 301 will run the application program stored in the memory 302, thereby achieving:
[0152] Acquire candidate images of multiple resolutions, wherein the candidate images have the same image content;
[0153] Determine a target image whose resolution matches the display resolution from the candidate images;
[0154] The target image is displayed.
[0155] In an optional embodiment, when the processor 401 executes the step of acquiring candidate images of multiple resolutions, the following steps may be performed: photographing a shooting scene to obtain a photographed image; and sampling the photographed image multiple times to obtain candidate images of multiple resolutions.
[0156] In an optional embodiment, after the processor 401 executes the multiple sampling of the captured image to obtain candidate images of multiple resolutions, it can also execute: determining a first image and a second image from the candidate images; encoding the first image to obtain a first encoded image, and decoding the first encoded image to obtain a first decoded image; sampling the first decoded image multiple times to obtain multiple first sampled images, wherein the resolution of each first sampled image is the same as the resolution of one of the second images; determining a first difference image based on difference information between the second image and the first sampled image with the same resolution; encoding the first difference image to obtain a first encoded difference image, and sending the first encoded image and the first encoded difference image to an external device.
[0157] In an optional embodiment, after the processor 401 performs the multiple sampling of the captured image to obtain candidate images of multiple resolutions, it can also perform: encoding the candidate image to obtain an encoded image; and sending the encoded image to an external device.
[0158] In an optional embodiment, when the processor 401 executes the acquisition of candidate images of multiple resolutions, it can execute: acquiring external coded images of multiple resolutions sent by an external device, wherein the external coded images are encoded by the external device on an image obtained by multiple sampling of an image captured by the external device; decoding the external coded images to obtain candidate images of multiple resolutions.
[0159] In an optional embodiment, when the processor 401 executes the acquisition of candidate images with multiple resolutions, the processor 401 may execute: acquiring a second coded image and second coded difference images with multiple resolutions sent by an external device, wherein the second coded difference images with multiple resolutions are obtained by the external device encoding the second difference images with multiple resolutions respectively, the second difference image is determined by the external device according to difference information between a fourth image with the same resolution and the second sampled image, the second sampled image is obtained by the external device sampling the second decoded image, the second decoded image is obtained by the external device decoding the second coded image, and the second coded image is obtained by the external device encoding the third image, The third image and the fourth image are determined by the external device from external candidate images of multiple resolutions, and the external candidate images are obtained by sampling the images captured by the external device; the second encoded image is decoded to obtain a third decoded image, and the second encoded difference image is decoded to obtain a decoded difference image; the third decoded image is sampled multiple times to obtain third sampled images of multiple resolutions, wherein the resolution of each of the third sampled images is the same as the resolution of one of the decoded difference images; a fourth decoded image is determined based on the third sampled image and the decoded difference image with the same resolution, and the third decoded image and the fourth decoded image are used as candidate images of multiple resolutions.
[0160] In an optional embodiment, after the processor 401 executes the display of the target image, it can also execute: in response to a zoom-in operation on the target image, determining the magnification factor and the magnification area of the zoom-in operation; determining the image to be cropped from the candidate images according to the resolution of the target image and the magnification factor; cropping a target area corresponding to the magnification area from the image to be cropped; and displaying the target area.
[0161] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the image processing method above, and will not be repeated here.
[0162] The image processing device provided in the embodiment of the present application belongs to the same concept as the image processing method in the above embodiment. Any method provided in the image processing method embodiment can be run on the image processing device. The specific implementation process is detailed in the image processing method embodiment and will not be repeated here.
[0163] It should be noted that, for the image processing method of the embodiment of the present application, a person skilled in the art can understand that the implementation of all or part of the process of the image processing method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and the execution process may include the process of the embodiment of the image processing method. Among them, the computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), etc.
[0164] It is understandable that in the specific implementation of this application, user information is involved, such as application usage behavior data, logs and other related data. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0165] For the image processing device of the embodiment of the present application, each functional module can be integrated into a processing chip, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk.
[0166] The above is a detailed introduction to an image processing method, device, storage medium and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An image processing method, characterized in that: include: Acquire candidate images of multiple resolutions, wherein the candidate images have the same image content; Determine a target image whose resolution matches the display resolution from the candidate images; The target image is displayed.
2. The image processing method according to claim 1, characterized in that: The step of obtaining candidate images with multiple resolutions includes: Shooting a shooting scene to obtain a shooting image; The captured image is sampled multiple times to obtain candidate images with multiple resolutions.
3. The image processing method according to claim 2, characterized in that: After the captured image is sampled multiple times to obtain candidate images with multiple resolutions, the method further includes: determining a first image and a second image from the candidate images; Encoding the first image to obtain a first encoded image, and decoding the first encoded image to obtain a first decoded image; Sampling the first decoded image multiple times to obtain multiple first sampled images, wherein a resolution of each of the first sampled images is the same as a resolution of one of the second images; Determine a first difference image according to difference information between a second image having the same resolution and the first sampled image; The first difference image is encoded to obtain a first encoded difference image, and the first encoded image and the first encoded difference image are sent to an external device.
4. The image processing method according to claim 2, characterized in that: After the captured image is sampled multiple times to obtain candidate images with multiple resolutions, the method further includes: Encoding the candidate image to obtain an encoded image; The encoded image is sent to an external device.
5. The image processing method according to claim 1, characterized in that: The step of obtaining candidate images with multiple resolutions includes: Acquire external coded images of multiple resolutions sent by an external device, where the external coded images are obtained by encoding images obtained by the external device through multiple sampling of images captured by the external device; The externally encoded image is decoded to obtain candidate images of multiple resolutions.
6. The image processing method according to claim 1, characterized in that: The step of obtaining candidate images with multiple resolutions includes: Acquire a second coded image and second coded difference images of multiple resolutions sent by an external device, wherein the second coded difference images of multiple resolutions are obtained by the external device respectively encoding the second difference images of multiple resolutions, the second difference image is determined by the external device according to difference information between a fourth image with the same resolution and the second sampled image, the second sampled image is obtained by the external device sampling a second decoded image, the second decoded image is obtained by the external device decoding the second coded image, the second coded image is obtained by the external device encoding a third image, the third image and the fourth image are determined by the external device from external candidate images of multiple resolutions, and the external candidate image is obtained by sampling an image captured by the external device; decoding the second coded image to obtain a third decoded image, and decoding the second coded difference image to obtain a decoded difference image; Sampling the third decoded image multiple times to obtain third sampled images with multiple resolutions, wherein the resolution of each of the third sampled images is the same as the resolution of one of the decoded difference images; A fourth decoded image is determined according to a third sampled image and a decoded difference image having the same resolution, and the third decoded image and the fourth decoded image are used as candidate images of multiple resolutions.
7. The image processing method according to any one of claims 1 to 6, characterized in that: After displaying the target image, the method further comprises: In response to a zoom-in operation on the target image, determining a magnification factor and a magnified area of the zoom-in operation; Determining an image to be cropped from the candidate images according to the resolution of the target image and the magnification; Cutting out a target area corresponding to the enlarged area from the image to be cut; The target area is displayed.
8. An image processing device, characterized in that: include: An image acquisition module, used to acquire candidate images of multiple resolutions, wherein the candidate images have the same image content; An image determination module, used to determine a target image whose resolution matches the display resolution from the candidate images; An image display module is used to display the target image.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed on a computer, the computer is enabled to execute the image processing method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein a computer program is stored in the memory, and the processor is used to execute the image processing method according to any one of claims 1 to 7 by calling the computer program stored in the memory.
Citation Information
Patent Citations
Method for downloading image and server
CN106210401A
Method of spatial and snr picture compression
CN1985514A
Monitoring system
JP2010124381A
Image output device and program therefor
JP2013025426A