Display method and electronic device
By acquiring and utilizing key information from images for cropping and scaling, the problem of lost main information in thumbnails displayed on electronic devices is solved, thus improving the display effect.
Patent Information
- Application Number
- PCT/CN2025/101642
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-19
- Filing Date
- 2025-06-18
- Publication Date
- 2025-12-26
AI Technical Summary
When electronic devices display thumbnails of images, they typically crop based on the image's center point, resulting in the loss of the main subject and key information, thus affecting the display quality.
By obtaining key information about the image, such as the location and type of the subject, cropping and scaling are performed to ensure that the thumbnail contains more information about the subject.
It improves the display effect of electronic devices when displaying thumbnails, enabling users to browse complete main information.
Smart Images

Figure CN2025101642_26122025_PF_FP_ABST
Abstract
Description
Display methods and electronic devices
[0001] This application claims priority to Chinese Patent Application No. 202410793972.4, filed on June 19, 2024, entitled “Display Method and Electronic Device”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of electronic technology, and more specifically, to a display method and an electronic device. Background Technology
[0003] In scenarios where electronic devices need to display media files, such as when a user browses pictures in an electronic device's gallery application, the device typically displays thumbnails of the images. However, when displaying thumbnails, electronic devices usually crop the image based on its center point. This can cause the thumbnails to lose the main subject and focus of the image, affecting the display quality. Summary of the Invention
[0004] This application provides a display method and an electronic device. This technical solution allows the electronic device to obtain key information about an image, such as subject information, when displaying a thumbnail, and then obtain a thumbnail based on that key information. This enables the displayed image thumbnail to include more subject information, thereby improving the display effect of the electronic device.
[0005] In a first aspect, a display method is provided, applied to an electronic device, comprising: acquiring key information of a target media file, the key information being used to indicate the position of a main body in the target media file; and displaying a thumbnail of the target media file based on the key information, wherein the thumbnail includes the main body.
[0006] For example, the target media file may include images, videos, animated GIFs, etc.
[0007] The scenarios in which this electronic device displays thumbnails of target media files can include gallery, system desktop display cards, and image selection scenarios.
[0008] The subject can be a key part of the image, such as a person, animal, plant, building, or object.
[0009] In some examples, the electronic device determines key information in real time when displaying a thumbnail of the target media file. Alternatively, the electronic device can pre-acquire and store key information of the target media file, and retrieve the key information from its storage location when a thumbnail of the target media file needs to be displayed later.
[0010] Based on the embodiments of this application, an electronic device can obtain key information of a media file and display a corresponding thumbnail based on the key information of the media file. The thumbnail may include a complete main body portion.
[0011] In this way, when users browse media files, the thumbnails of the media files displayed on the electronic device can include more main information, allowing users to browse the complete content and thus improving the display effect of the electronic device.
[0012] In some implementations, the thumbnail is the smallest rectangle that includes the main body. For example, this rectangle is a square.
[0013] In one implementation, obtaining the key information of the target media file includes: performing image analysis on the target media file; and determining the key information based on the results of the image analysis.
[0014] Based on the embodiments of this application, the electronic device can also perform image analysis on the target media file to determine the key information of the target media file. In this way, the electronic device does not need to additionally encode the key information of the media file when generating the media file, thereby improving the speed of media file generation.
[0015] In one implementation, the target media file is an image. Before obtaining the key information of the target media file, the method further includes: performing image analysis on the target media file; determining the key information based on the result of the image analysis; and adding the key information to a first custom field of the target media file.
[0016] It should be understood that the generated target media file can be a picture taken by an electronic device using a camera. Alternatively, it could be a picture downloaded by the electronic device from the network or received from another electronic device.
[0017] For example, the first custom field can be App8 or App9, etc., and this application embodiment does not limit it.
[0018] Based on the embodiments of this application, when generating an image, the electronic device can perform image analysis to determine key information of the image and add this key information to a custom field of the image. This technical solution allows the electronic device to add key information to the image, so that the key information can be referenced when displaying the thumbnail subsequently, thereby improving the display effect.
[0019] In one implementation, obtaining the key information of the target media file includes: obtaining the key information from the first custom field of the target media file.
[0020] Based on the embodiments of this application, electronic devices can successfully obtain key information from custom fields of images.
[0021] In one implementation, the target media file includes image data and metadata, wherein the metadata includes key information.
[0022] For example, the image data is the raw data of the target media file, and the metadata may be data that includes key information.
[0023] Understandably, this metadata may also include other data, such as storage location, size, and shooting time.
[0024] In one implementation, before displaying the thumbnail of the target media file based on the key information, the method further includes: acquiring the target media file; and acquiring the image data and the key information from the target media file.
[0025] Based on the embodiments of this application, when displaying thumbnails, the electronic device can first obtain the target media file and then obtain image data and key information from the target media file to facilitate the display of thumbnails with better effects.
[0026] In one implementation, displaying a thumbnail of the target media file based on the key information includes: cropping the target media file based on the key information to obtain a thumbnail of the target media file; and displaying the thumbnail of the target media file.
[0027] For example, when cropping a target media file, an electronic device can include all the key information in the cropped thumbnail, or include most of the key information in the cropped thumbnail.
[0028] Based on the embodiments of this application, when generating thumbnails, electronic devices can crop target media files according to key information to obtain thumbnails that include key information, thereby enabling electronic devices to have better display effects.
[0029] In one implementation, the step of cropping the target media file according to the key information to obtain a thumbnail of the target media file includes cropping the target media file according to the key information to obtain a first cropped image; and scaling the first cropped image to obtain the thumbnail.
[0030] For example, if the main body of the target problem file occupies a large proportion of the entire image, in order to present the main body more completely in the thumbnail, as much of the main body as possible can be preserved during cropping, and the whole image can be scaled.
[0031] Based on the embodiments of this application, the electronic device can also scale the first cropped image obtained after cropping according to the key information to obtain a thumbnail, so that the final displayed thumbnail can contain more main information, so as to present a better display effect to the user.
[0032] In one implementation, the target media file is a video, and the key information further includes indication information for indicating the cover image of the video, wherein displaying a thumbnail of the target media file according to the key information includes: determining the cover image of the video according to the indication information; and displaying a thumbnail of the cover image according to the key information.
[0033] For example, the indication information can be time information, such as a point in time or a specific moment.
[0034] Based on the embodiments of this application, when the target media file is a video, the key information also includes indication information for the cover image, so that the electronic device can determine the cover image of the video and display a thumbnail of the cover image according to the key information.
[0035] In one implementation, displaying a thumbnail of the cover image based on the key information includes: cropping the cover image based on the key information to obtain a thumbnail of the cover image; and displaying the thumbnail of the cover image.
[0036] Based on the embodiments of this application, the electronic device can crop the cover image according to key information to obtain the corresponding thumbnail and display the thumbnail, thereby enabling the electronic device to still display a good display effect when displaying the thumbnail of the video.
[0037] In one implementation, the subject is located at the center of the thumbnail.
[0038] Based on the embodiments of this application, the main body is located in the center of the thumbnail, which enables the electronic device to present a better display effect.
[0039] In one implementation, the method further includes: displaying an identifier for indicating the subject when displaying the target media file; and displaying the subject at the center of the display area in response to a user clicking the identifier of the subject.
[0040] For example, the identifier can be text, an icon, etc.
[0041] Based on the embodiments of this application, when displaying media files, the electronic device can also display the identifier of the main subject, thereby providing the user with an indication of the subject's location. Furthermore, the electronic device can display the main subject in the center of the display area based on the user's click on the subject's identifier, allowing for one-click access to the main subject and facilitating convenient viewing by the user.
[0042] In a second aspect, an electronic device is provided, comprising: one or more processors; one or more memories; said one or more memories storing one or more programs that, when executed by said one or more processors, cause a display method as described in the first to second aspects and any possible implementation thereof to be executed.
[0043] Thirdly, a display device is provided, including modules for implementing the display method as described in the first aspect and any possible implementation thereof.
[0044] Fourthly, a chip is provided, the chip including a processor and a communication interface, the communication interface being used to receive signals and transmit signals to the processor, the processor processing the signals such that the display method as described in the first aspect and any possible implementation thereof is executed.
[0045] Fifthly, a readable storage medium is provided, which stores instructions that, when executed on an electronic device, cause the display method described in the first aspect and any possible implementation thereof to be performed.
[0046] In a sixth aspect, a program product is provided, comprising program code that, when executed on an electronic device, causes the display method described in the first aspect and any possible implementation thereof to be performed. Attached Figure Description
[0047] Figure 1 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application.
[0048] Figure 2 is a schematic diagram of the software structure of the electronic device provided in an embodiment of this application.
[0049] Figure 3 is a schematic diagram of a thumbnail display provided in an embodiment of this application.
[0050] Figure 4 is a schematic diagram of the JPEG file format used by the Joint Group of Image Experts.
[0051] Figure 5 is a schematic flowchart illustrating the generation of a target image and the display of a thumbnail of the target image according to an embodiment of this application.
[0052] Figure 6 is a schematic diagram of a field for storing key information provided in an embodiment of this application.
[0053] Figure 7 is a schematic flowchart illustrating a method for generating a target video and displaying a cover image of the target video, according to an embodiment of this application.
[0054] Figure 8 is a schematic flowchart of a method for displaying thumbnails provided in an embodiment of this application.
[0055] Figure 9 is a schematic flowchart of another method for displaying thumbnails provided in an embodiment of this application.
[0056] Figure 10 is a schematic diagram of a thumbnail display provided in an embodiment of this application.
[0057] Figure 11 is a schematic diagram of a display image provided in an embodiment of this application.
[0058] Figure 12 is a schematic diagram of a display image provided in an embodiment of this application.
[0059] Figure 13 is a schematic flowchart of a display method provided in an embodiment of this application.
[0060] Figure 14 is a schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0061] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0062] The methods in this application embodiment can be applied to electronic devices such as smartphones, tablets, laptops, personal computers (PCs), ultra-mobile personal computers (UMPCs), netbooks, in-vehicle devices, smart TVs, wearable devices, foldable devices, and Internet of Things (IoT) devices.
[0063] Figure 1 shows a schematic diagram of the structure of electronic device 100. Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0064] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0065] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0066] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0067] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0068] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus interface, etc.
[0069] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).
[0070] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to realize communication between the processor 110 and the audio module 170.
[0071] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface.
[0072] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160.
[0073] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193.
[0074] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc.
[0075] USB interface 130 is an interface that conforms to the USB standard specification, specifically it can be a Mini USB interface, Micro USB interface, USB Type C interface, etc. USB interface 130 can be used to connect a charger to charge electronic device 100, and it can also be used for data transfer between electronic device 100 and peripheral devices.
[0076] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0077] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0078] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110.
[0079] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0080] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on electronic devices 100.
[0081] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0082] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Bluetooth low energy (BLE), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.
[0083] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with networks and other devices through wireless communication technology.
[0084] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0085] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), or a display panel made of materials selected from organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), miniled, microled, micro-oled, or quantum dot light-emitting diodes (QLEDs). In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0086] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0087] The ISP is used to process the data fed back by camera 193. Camera 193 is used to capture still images or videos.
[0088] A digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals.
[0089] Video codecs are used to compress or decompress digital video.
[0090] The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
[0091] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121.
[0092] Electronic device 100 can implement audio functions through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0093] The audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal.
[0094] The loudspeaker 170A, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals.
[0095] The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals.
[0096] The microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.
[0097] The 170D headphone jack is used to connect wired headphones.
[0098] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, an accelerometer sensor 180E, a distance sensor 180F, a fingerprint sensor 180H, a touch sensor 180K, a bone conduction sensor 180M, etc.
[0099] Button 190 includes the power button, volume buttons, etc.
[0100] Motor 191 can generate vibration alerts.
[0101] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0102] The SIM card interface 195 is used to connect the SIM card.
[0103] Figure 2 is a software structure block diagram of an electronic device 100 according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into four layers, from top to bottom: the application layer, the application framework layer, the system library, and the kernel layer. The application layer may include a series of application packages.
[0104] As shown in Figure 2, the application package may include applications (Apps) such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, and wallet.
[0105] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0106] As shown in Figure 2, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0107] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0108] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0109] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0110] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0111] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0112] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0113] The core library consists of two parts: one part contains the functionalities that the Java language needs to call, and the other part is the core library itself.
[0114] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0115] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0116] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0117] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0118] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0119] A 2D graphics engine is a graphics engine for 2D drawing.
[0120] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0121] Before introducing the technical solution of this application, the following is a brief introduction to some of the technical terms that may be involved in this application.
[0122] Thumbnail: An image obtained by compressing or cropping the original image, and its size is smaller than the original image.
[0123] In scenarios where electronic devices need to display images, such as when a user browses pictures in an electronic device's gallery application, the device typically displays thumbnails of the images. However, when displaying thumbnails, electronic devices usually crop the image based on its center point. This can cause the thumbnails to lose the main subject and focus of the image, affecting the display quality.
[0124] The following section will introduce the technical solutions for displaying thumbnails in electronic devices, with reference to Figure 3.
[0125] Figure 3 is a schematic diagram of a thumbnail display provided in an embodiment of this application. As shown in Figure 3, the illustration takes the display of thumbnails in a gallery application by an electronic device 200 as an example.
[0126] For example, the display interface 210 of the gallery application of the electronic device 200 can be used to display thumbnails of multiple images. For example, the display interface 210 may include thumbnails 211, 213, 215, etc.
[0127] For example, when a user quickly browses images in a gallery application, a thumbnail 211 of image A is displayed for image A stored in electronic device 200.
[0128] In some examples, electronic device 200 may perform full-image decoding on image A and downsample it to obtain image A1 with less information, and then crop image A1 based on its center point to obtain thumbnail 211; alternatively, electronic device 200 may first crop the image and then downsample the cropped image to obtain thumbnail 211. Electronic device 200 then displays the thumbnail 211. It should be understood that the thumbnail 211 can be a thumbnail directly obtained after cropping image A1 by electronic device, or it can be a thumbnail obtained after cropping image A1 and then enlarging or reducing the image size.
[0129] The length and width of the thumbnail 211 can be the same.
[0130] Referring to Figure 3, for the main subject, i.e., person 212, in image A, since person 212 is not located in the center of image A, it may cause part of person 212 to be cropped when the electronic device crops image A1 based on the center point. Therefore, when the electronic device 200 displays thumbnail 211, the thumbnail 211 will not include the complete person 212.
[0131] Similarly, the main body 214 in thumbnail 213 is not fully displayed, and the main body 216 in thumbnail 215 is not fully displayed.
[0132] In other examples, if image A is in an exchangeable image file format (EXIF), the header of image A may include metadata for image A, which may include a thumbnail.
[0133] Similarly, when electronic devices display thumbnails, the main body of the image is still not fully displayed.
[0134] The same problem exists in other scenarios where images are displayed, such as the system desktop image of an electronic device or the background image of an application.
[0135] This will often result in electronic devices failing to display the complete subject of an image, causing users to see incomplete or fragmented main parts when browsing images, thus affecting the display quality.
[0136] In view of this, embodiments of this application provide a display method and an electronic device. This technical solution can obtain key information about an image, such as subject information, when the electronic device displays a thumbnail of an image, and obtain the image thumbnail based on this key information. This allows the displayed image thumbnail to include more subject information, thereby improving the display effect of the electronic device.
[0137] The technical solutions in the embodiments of this application will be described below with reference to Figures 4-11.
[0138] Figure 4 is a schematic diagram of the Joint Group of Image Experts (JE) JPEG file format. As shown in Figure 4, a JPEG file generally includes a file header (startofimage, SOI), Application Markers Segment 0 (App0), Application Markers Segments 1-n (App1-n), Define Quantization Table (DQT), Define Huffman Table (DHT), Define Restart Interval (DRI), Frameof Header (SOF0), Scan of Header (SOS), and Endofimage (EOI).
[0139] The SOI consists of two bytes, with data in the bytes being FF and D8 respectively, used to identify the beginning of a JPEG file.
[0140] App0 is used to represent image recognition information. Image recognition information may include segment identifier, segment type, segment length, exchange format, major version number, minor version number, density unit, etc.
[0141] App1 is used to represent EXIF data segments. EXIF data segments can mainly include segment identifiers, segment lengths, basic image data, image metadata, thumbnail data, etc.
[0142] Among them, App2-n can be called a custom field, and n is generally less than or equal to 15. Users can add information to this custom field to enhance or expand some functions.
[0143] For example, in this embodiment of the application, the electronic device can obtain key information of the image when generating the image and add the key information to a custom field. For instance, the electronic device can add the key information of the image to App8 or App9, so that when the electronic device displays the image or a thumbnail of the image, it can obtain the key information of the image from App8 or App9 to present a better display effect to the user. The technical solution will be described in detail below with reference to specific embodiments, which will not be elaborated here.
[0144] In some other embodiments, the key information of the image can also be stored in other empty fields. Alternatively, when the image is stored in different formats, empty fields can be selected for storage.
[0145] DQT is used to define quantization tables for luminance and chrominance.
[0146] DHT is used to define four Huffman tables: luminance DC, luminance AC, chrominance DC, and chrominance AC.
[0147] SOF0 is used to represent basic image information, including segment length, sample precision, sample height, sample width, number of components, etc.
[0148] DRI is used to indicate the interval distance of reset markers.
[0149] It should be understood that the DRI field is optional and some JPEG files may not include this field.
[0150] SOS indicates that the following data is compressed image data, that is, a series of scan lines.
[0151] The EOI consists of two bytes, with the data in these two bytes being FF and D9 respectively, used to identify the end of the file as a JPEG file.
[0152] The technical solution for generating media files and displaying thumbnails of media files in embodiments of this application will be described below with reference to Figures 5-8. The media files may include videos, images, animated GIFs, etc.
[0153] For example, the media files in this application embodiment are pictures and videos.
[0154] For example, Figure 5 is a schematic flowchart illustrating the generation of a target image and the display of a thumbnail of the target image according to an embodiment of this application. As shown in Figure 5, the generation of the target image by the electronic device can be understood as the encoding stage, and the display of the thumbnail of the target image can be understood as the decoding stage.
[0155] The encoding stage may include steps 310 to 313.
[0156] 310, Electronic device detection and shooting operation.
[0157] For example, when a user uses a camera application to take a picture, the taking action is the user clicking the shooting control.
[0158] 311, Electronic device encoding of raw data.
[0159] For example, after detecting a shooting operation, the electronic device can capture an image. The electronic device can encode the raw image data using the encoding method specified in the existing JPEG protocol. For instance, the electronic device can convert the acquired image from the RGB color space to the YUV color space, perform image block processing on the obtained YUV image, perform quantization processing, and perform entropy encoding according to the Huffman table to obtain the data segment of the original image.
[0160] 312, Key information encoded in electronic devices.
[0161] This key information can be used to represent information about the main part of the image. For example, this key information may include coordinates, region, type, center point, or display size.
[0162] In this embodiment of the application, the electronic device can define syntax elements {coordinate point type, coordinate point list} based on the specifications and recommendations of ITU-T81, and store key information in Appn, for example, Appn can be App8 or App9, etc.
[0163] For example, Figure 6 is a schematic diagram of a field storing key information in an image provided in an embodiment of this application.
[0164] Referring to Figure 6, the field storing key information can be App8. The App8 field can include information such as field name, field offset, field length, identifier, TIFF identifier, byte storage order, coordinate type, and list of coordinate points.
[0165] For example, the field name is App8.
[0166] The field offset is "0x00002AF0", which can be used to indicate the offset of this field App8 in the image file, that is, the location of this field in the image file.
[0167] The field length is "36", which can be used to represent the length of the App8 field.
[0168] An identifier, such as "identifier1", can be used to identify this field.
[0169] The tag image file format (TIFF) identifier, for example, identifier 2, can be used to identify TIFF.
[0170] The byte storage order can be, for example, little-endian byte order, which is used to represent the storage format of the field App8. Little-endian byte order means that the lower bits of the data in the field App8 are stored in the lower address space.
[0171] The coordinate type can be the type of the subject mentioned above. For example, the coordinate type is a face.
[0172] This list of coordinates can be used to indicate the location of key information determined by an electronic device when taking a picture.
[0173] For example, the list of coordinate points may include two coordinate points, namely (X1, Y1) and (X2, Y2), which are the two diagonal vertices of the rectangle containing the main body.
[0174] Alternatively, the list of coordinate points may also include all coordinate points of the main body, which is not limited in this embodiment.
[0175] In other examples, this field in App8 can also include region, center point, display size, etc.
[0176] In other examples, this key information may also be stored in other custom fields or empty fields, which is not limited in this application embodiment.
[0177] It should be understood that the coordinates can be the coordinates of the main body, for example, the coordinates can be a set of coordinates or a list, through which the positional distribution of the main body in the image can be determined.
[0178] The region can be a rectangular area that includes the main body; for example, the rectangular area can be the smallest rectangle that includes the main body.
[0179] This type can be the type of subject, such as portraits, buildings, pets, flowers, objects, etc.
[0180] This center point can be the center point when an electronic device displays a thumbnail.
[0181] This display size can be the size that the electronic device needs to display the thumbnail.
[0182] It is understandable that electronic devices can determine key information before encoding it.
[0183] In some examples, this key information may be system-tagged.
[0184] When an electronic device takes a picture, it can use the subject at the focus of the camera's autofocus as the subject of the picture, and use the coordinates or area of the subject, the type of the subject, etc., as key information of the picture.
[0185] For example, when a user takes a picture of a person using an electronic device, the device will generally focus on the person. Therefore, the coordinates of the person in the picture, the rectangular area containing the person, the type of subject, etc., can be used as key information of the picture.
[0186] For example, when the camera is in portrait mode, the electronic device will generally focus on the person's face. Therefore, the coordinates of the person's face in the picture, the rectangular area containing the person's face, the type of subject, etc. can be used as key information of the picture.
[0187] For example, when an electronic device takes a picture including a human figure, it can also use the subject corresponding to the human eye's gaze point as the subject of the picture, and use the coordinates or area of the subject, the type of the subject, etc. as key information of the picture.
[0188] It should be understood that when an electronic device takes a picture, it first displays the camera viewfinder. At this time, the electronic device has already determined the key information of the preview image. When the electronic device detects that the user has clicked the shooting function button, it can add the key information of the image to the custom fields of the captured image.
[0189] In some examples, this key information can also be user-tagged.
[0190] When taking pictures, electronic devices can also determine the focus point based on the user's click operation, and take the subject at the focus point as the subject of the picture, and take the coordinates or area of the subject as the key information of the picture.
[0191] For example, when a user takes a picture of a flower with an electronic device, they will focus on the flower. The electronic device can then determine that the subject of the picture is the flower and use information such as the coordinates or area where the flower is located as key information of the picture.
[0192] In some examples, this crucial information may also be obtained by the electronic device through image recognition of the image.
[0193] It should be understood that electronic devices can have image recognition capabilities. For example, for a photograph or a picture framed by a camera, an electronic device can perform image recognition to identify the subject within the image.
[0194] For example, image recognition can include face recognition, food recognition, building recognition, car recognition, plant recognition, animal recognition, object recognition, landscape recognition, etc.
[0195] In this way, for images captured by electronic devices, the electronic devices can identify the main subject and use the subject's coordinates, the rectangular area containing the subject, or the subject's type as key information of the image.
[0196] For example, after the electronic device determines the key information in the image, it can add that key information to any one or more custom fields of the image to generate the target image. For instance, the key information can be added to App8.
[0197] In some examples, a custom field in an image may contain key information determined in multiple ways. In this case, key information determined by different methods can have different priorities. This key information may also include the method by which it was obtained.
[0198] For example, key information identified through user tagging has a higher priority than key information identified through system tagging. A captured image may contain key information confirmed by the system, as well as key information tagged by the user.
[0199] When displaying thumbnails, electronic devices can use high-priority key information as a reference, thereby improving the display effect of the electronic devices.
[0200] 313, The electronic device generates the target image.
[0201] For example, when generating a target image, the electronic device can encode not only the raw data but also key information according to the method described in step 312. For instance, the electronic device can encode the key information in a custom field of the image (such as App8). Thus, the target image can include an image data segment and a data segment indicating the key information. The image data segment includes the raw data of the target image, and the data segment indicating the key information can include the key information of the image.
[0202] Alternatively, this key information may also be included in the metadata of the target image, which is not limited in this embodiment of the application.
[0203] In this way, the target image generated by the electronic device includes not only the original image data, but also the key information of the image.
[0204] The electronic device can then store the target image or send it to other devices.
[0205] In other examples, the target image may also be obtained by the electronic device from other electronic devices. For example, the target image may be downloaded by the electronic device from a cloud server, or the target image may be received by the electronic device from other electronic devices. This application embodiment does not limit the scope of the target image.
[0206] Alternatively, if the image acquired by the electronic device does not contain key information, the electronic device needs to decode the acquired image and encode the key information into a custom field of the image.
[0207] It should be understood that when an electronic device needs to display a thumbnail of a target image in a gallery application, it can decode the target image to determine key information and determine the thumbnail to be displayed based on that key information.
[0208] The decoding stage may include steps 320 to 340.
[0209] 320. The electronic device decodes the target image and obtains key information about the target image.
[0210] For example, if an electronic device adds key information about a target image to App8, during the decoding phase, the electronic device needs to parse App8 to determine the key information it contains.
[0211] 330. The electronic device determines the thumbnail of the target image based on the key information of the target image.
[0212] It should be understood that this key information may include one or more of the following: coordinates, region, type, center point, or display size.
[0213] In one example, if the key information of the target image includes a set of coordinates, the electronic device can use the smallest rectangle in the target image that includes that coordinate set as the area where the thumbnail of the target image is located. For example, this rectangle can be a square.
[0214] In this scenario, when generating a thumbnail, the electronic device can downsample the target image to obtain a downsampled target image 2, and then crop the target image 2 based on key information to obtain the corresponding thumbnail. Alternatively, when generating a thumbnail, the electronic device can also crop the target image to obtain a target image 3, and then downsample the target image 3 to obtain the corresponding thumbnail. It should be understood that the specific order of downsampling and cropping is not limited in the embodiments of this application.
[0215] Optionally, the region containing this coordinate set is located at the center of the rectangular region.
[0216] In another example, if key information about the target image includes a region, the electronic device can use a rectangle encompassing that region as a thumbnail of the target image. For example, the rectangle could be a square.
[0217] In another example, if the key information includes a center point, the electronic device can crop and downsample the target image according to that center point to obtain a thumbnail of the target image. Alternatively, the electronic device can downsample the target image and then crop the downsampled image according to the center point to obtain a thumbnail of the target image.
[0218] In another example, this key information could also include the display size, so that the electronic device can display a thumbnail based on that display size.
[0219] In other examples, building on the examples above, the key information may also include the type of the subject in the image, such as a portrait, which helps electronic devices classify images or generate albums of clustered portraits.
[0220] 340. Electronic devices display thumbnails of target images.
[0221] Once the thumbnail of the target image is determined, the electronic device can display that thumbnail.
[0222] It should be understood that the thumbnail may be displayed in a gallery application, in a display card on the system desktop, or in an image selector; this application embodiment does not limit the display to any particular type.
[0223] In this way, since the image's custom fields include key information during the image generation stage, the thumbnail can be displayed based on this key information. This allows the thumbnail displayed on the electronic device to contain the most complete subject as much as possible, thus providing a better display effect for the user.
[0224] The following section will describe the process of generating the video and displaying a thumbnail of the video cover, with reference to Figure 7.
[0225] For example, Figure 7 is a schematic flowchart illustrating the generation of a target video and the display of a thumbnail image of the target video according to an embodiment of this application. As shown in Figure 7, the generation of the target video by the electronic device can be understood as the encoding stage, and the display of the thumbnail image of the target video's cover image can be understood as the decoding stage.
[0226] The encoding stage may include steps 410 to 413.
[0227] 410, Electronic device detection and shooting operation.
[0228] For example, when a user uses a camera application to record video, the shooting action is the user clicking the video recording control.
[0229] 411, Electronic devices encapsulate raw video files.
[0230] For example, electronic devices can encapsulate the original video according to video encapsulation format standards (such as mp4, mkv, mov, etc.).
[0231] 412, Key information encoded by electronic devices, including the cover image of the target video.
[0232] For example, the electronic device can first determine the cover image of the target video. For instance, the electronic device can use image recognition to determine the cover image. Alternatively, the electronic device can also randomly select the video frame corresponding to the target time of the video and use that video frame as the cover image of the target video.
[0233] After the cover image is determined, the electronic device can determine the key information B of the cover image.
[0234] It should be understood that the process by which the electronic device determines the key information B of the cover image can be found in the relevant description of step 312 above, and will not be repeated here for the sake of brevity.
[0235] It should be understood that, unlike step 312, the key information of the target video may include not only information used to indicate the cover image, but also key information B of the cover image.
[0236] This information is used to indicate the cover image, such as the target time. For example, if the target video is 10 seconds long and the cover image is the video frame at the 5th second, then the target time is the 5th second.
[0237] 413, The electronic device generates the target video.
[0238] In this way, the generated target video includes not only the original video file, but also the video cover image and corresponding key information.
[0239] The electronic device can then store the target video or send it to other devices.
[0240] It should be understood that when an electronic device needs to display a thumbnail of a target video in a gallery application, the target video can be decoded, and the thumbnail of the cover image to be displayed can be determined based on this key information.
[0241] The decoding stage may include steps 420 to 440.
[0242] 420, Electronic devices acquire key information from the target video.
[0243] For example, an electronic device can decode a target video to obtain key information from it.
[0244] 430. The electronic device determines a thumbnail of the cover image of the target video based on key information.
[0245] For example, the electronic device can first determine the cover image of the target video based on the information in the key information used to indicate the cover image. Then, the electronic device can also determine key information B, which is the key information used to indicate the cover image, and determine a thumbnail of the cover image based on key information B.
[0246] It should be understood that the process by which the electronic device determines the thumbnail of the cover image based on key information B can be found in the relevant description in step 330 above, and will not be repeated here for the sake of brevity.
[0247] 440. Electronic devices display a thumbnail of the cover image.
[0248] In this way, since the cover image and corresponding key information are already included in the target video generation stage, the thumbnail of the target video can be displayed based on the key information of the target video. This allows the thumbnail displayed on the electronic device to contain the complete subject as much as possible, thus providing a better display effect for the user.
[0249] The above, with reference to Figures 5 to 7, illustrates the process by which electronic devices encode key information in media files during generation and the subsequent display of thumbnails. In some cases, electronic devices may not encode key information during media file generation, but instead generate the media file using existing methods. When displaying thumbnails, the electronic device can then determine the key information through image recognition. This technical solution will be described below with reference to Figures 8 and 9.
[0250] For example, FIG8 is a schematic flowchart of a method for displaying thumbnails provided in an embodiment of this application. As shown in FIG8, the method 500 can be applied to an electronic device, and the method 500 may include steps 510 to 530.
[0251] 510. The electronic device performs image analysis on image A to determine the key information of image A.
[0252] For example, the image analysis process may include image recognition, composition data recognition, etc.
[0253] It should be understood that image recognition is as described above. Through image recognition, electronic devices can determine key information such as the type of subject in an image, as well as the coordinates or region of the subject.
[0254] Composition data recognition enables electronic devices to determine the location and distribution of a subject. For example, when the subject is a human figure, the composition data could be the region or set of coordinates where the face is located.
[0255] Understandably, when the electronic device captures image A, it does not encode the key information of the image into image A. Instead, the process of determining the key information of the image is placed in the decoding stage, and the electronic device determines the key information in image A on its own before displaying the thumbnail.
[0256] 520. The electronic device determines the thumbnail of image A based on the key information of image A.
[0257] 530, The electronic device displays a thumbnail of image A.
[0258] It should be understood that steps 520-530 can be referred to in the relevant descriptions of steps 330-340 above, and will not be repeated here for the sake of brevity.
[0259] Based on the embodiments of this application, when generating an image, the electronic device may not encode the key information of the image. Instead, when displaying a thumbnail of the image, the electronic device analyzes the image to obtain the corresponding key information, and determines and displays the thumbnail based on the key information. This technical solution also allows the electronic device to refer to the key information of the image when displaying a thumbnail, thereby presenting a better display effect to the user.
[0260] For example, FIG9 is a schematic flowchart of another method for displaying thumbnails provided in an embodiment of this application. As shown in FIG9, the method 600 can be applied to an electronic device, and the method 600 may include steps 610 to 640.
[0261] 610, The electronic device determines the keyframe image B of video B.
[0262] In one example, the file of video B may include indication information for keyframe images, which the electronic device can use to determine keyframe image B of video B.
[0263] It should be understood that the keyframe image can be the cover image of video B, or it can be multiple key images in video B.
[0264] For example, this indication information is the target time. Assuming the target video is 10 seconds long and the target time is the 5th second, it means that the video frame at the 5th second is the cover image.
[0265] In another example, if the file of video B does not include indication information for the cover image, the electronic device can perform image analysis on the images included in video B to determine the cover image B.
[0266] For example, assuming the target video is 10 seconds long and the main subject is a human figure, the electronic device can perform image analysis on the video frames of the target video to determine the frame image containing the most information about the human figure, and use it as the cover image B.
[0267] In another example, if the file of video B does not include instruction information for indicating the cover image, the electronic device may also randomly select one of the images included in video B as the cover image B.
[0268] It should be understood that the keyframe image B can be stored in the file header of the video file, such as in the video file's metadata.
[0269] 620. The electronic device performs image analysis on keyframe image B to determine the key information of keyframe image B.
[0270] For example, the image analysis process may include image recognition, composition data recognition, etc.
[0271] It should be understood that image recognition can be referred to in the preceding description. Through image recognition, electronic devices can determine key information such as the type of subject in keyframe image B, as well as the coordinates or region of the subject.
[0272] Composition data recognition enables electronic devices to determine the location and distribution of a subject. For example, when the subject is a human figure, the composition data could be the region or set of coordinates where the face is located.
[0273] Understandably, when the electronic device was recording video B, it did not encode the key information of the keyframe images into video B. Instead, the process of determining the key information of the keyframe images was placed in the decoding stage, and the electronic device determined the key information in keyframe images B on its own before displaying the thumbnail.
[0274] 630. The electronic device determines the thumbnail of keyframe image B based on the key information of keyframe image B.
[0275] It should be understood that the process by which the electronic device determines the thumbnail of keyframe image B based on the key information of keyframe image B can be found in the relevant description in step 330 above, and will not be repeated here for the sake of brevity.
[0276] 640. The electronic device displays a thumbnail of keyframe image B.
[0277] For example, if keyframe image B is the cover image, the electronic device can display the thumbnail after the cover image thumbnail has been determined.
[0278] It should be understood that the thumbnail may be displayed in a gallery application, in a display card on the system desktop, or in an image selector; this application embodiment does not limit the display to any particular type.
[0279] In some examples, an electronic device or a chip within an electronic device can control a display device to show the thumbnail.
[0280] Based on the embodiments of this application, when generating video, the electronic device may not encode the key information of the keyframe images. Instead, when the electronic device needs to display thumbnails of the keyframe images of the video, it analyzes the keyframe images to obtain the corresponding key information, and determines and displays the thumbnail based on the key information. This technical solution also allows the electronic device to refer to the key information of the image when displaying the thumbnail, thus presenting a better display effect to the user.
[0281] The following section will describe the effect of the electronic device displaying thumbnails in the embodiments of this application, with reference to Figure 10.
[0282] For example, Figure 10 is a schematic diagram of a thumbnail display provided in an embodiment of this application. As shown in Figure 10, the display interface 710 of the electronic device 700 is a display interface in a gallery application. In this display interface 710, the thumbnail contains the main body of the complete original image, presenting a better display effect.
[0283] For example, when displaying thumbnail 711, electronic device 700 can crop the original image based on key information contained in the original image to obtain thumbnail 711. It should be understood that electronic device 700 can downsample the original image and crop the downsampled image based on key information to obtain thumbnail 711. Alternatively, electronic device 700 can crop the original image to obtain a thumbnail and then display the downsampled thumbnail 711. Alternatively, electronic device 700 can first crop the original image and then downsample the cropped image to obtain thumbnail 711.
[0284] It should be understood that, in the embodiments of this application, the specific order of downsampling and cropping is not limited when obtaining thumbnails for electronic devices.
[0285] It should also be understood that when the electronic device 700 crops an image based on key information, it can use the main part indicated by the key information as the center of the thumbnail.
[0286] Referring again to Figure 10, for the thumbnail 711, the subject 712 contained therein is displayed in the center of the thumbnail 711, and the subject 712 is displayed in its entirety, so that the user can browse the complete subject information included in the original image through the thumbnail 711.
[0287] In other examples, in an album focusing on a portrait, the subject 712 may also include only the set of coordinates or region where the user's face is located. This allows the electronic device to highlight the face when the user browses the album, improving the display effect.
[0288] For example, in thumbnail 713, the subject 714 contained therein is displayed in the center of thumbnail 713 and the subject 714 is displayed in its entirety, so that users can browse the complete subject information included in the original image through the thumbnail 713.
[0289] For example, the thumbnail 715 of the video is a thumbnail of the video's cover image. Similarly, the main body 716 of the cover image in the thumbnail 715 can be fully displayed in the thumbnail 715.
[0290] In other examples, the subject in the thumbnail does not have to be located in the center of the thumbnail, as long as the thumbnail can contain the complete subject. In this way, the electronic device can still present a good display effect.
[0291] Based on the embodiments of this application, when displaying thumbnails, electronic devices can crop images by combining key information of the images, so that the cropped thumbnails can contain the complete subject (such as a complete portrait) or highlight the subject (the face), thus presenting a better display effect to the user.
[0292] The technical solutions in this application embodiment can be applied not only to thumbnails displayed in gallery applications, but also to thumbnails displayed on system cards on the desktop, and to thumbnails displayed when a user selects an image using an image picker. In some cases, the technical solutions in this application embodiment can also be applied to system backgrounds or wallpapers. This technical solution will be described below with reference to Figure 11.
[0293] For example, Figure 11 is a schematic diagram of a display image provided in an embodiment of this application. In Figure 11(a), it is a schematic diagram of the lock screen display interface in a current electronic device, and Figure 11(b) is a schematic diagram of the lock screen display interface of an electronic device in an embodiment of this application.
[0294] Referring to Figure 11(a), the lock screen display interface 810 of the electronic device 800 may include a lock screen wallpaper 811 and current time information 812.
[0295] The lock screen wallpaper 811 includes a portrait subject 813. The time information 812 obscures the face of the portrait subject 813 in the lock screen wallpaper 811, affecting the display effect.
[0296] It should be understood that the lock screen wallpaper 811 can be a picture taken by an electronic device.
[0297] In this embodiment, since the electronic device encodes key information of the image in a custom field when taking a picture, or can perform image analysis to determine the key information, when the electronic device sets the image as a lock screen wallpaper, it can determine the location of the main subject in the image based on this key information. For example, when the electronic device determines to set the image as wallpaper, the area where the time information 812 is located will obscure or partially obscure the face in the lock screen wallpaper 811. Therefore, the electronic device can adjust the position of the time information 812 to highlight the main subject in the image and present a better display effect.
[0298] For example, referring to Figure 11(b), in the lock screen display interface 820 of the electronic device 800, the electronic device adjusts the position of the time information 812 in the display interface 820 so that it does not obscure the face part of the lock screen wallpaper 811, so as to highlight the face part of the portrait subject 813.
[0299] In this way, when an electronic device displays a captured image, it can avoid obscuring the main subject of the image based on the key information in the image, so as to highlight the main subject.
[0300] In some cases, when an electronic device displays an image containing a clear subject (such as a person or building), if the user wants to view the details of that subject, they need to perform operations such as zooming in and moving the image. The user may need to perform multiple operations before the electronic device achieves the desired effect. For example, on a smartphone, the user needs to use two-finger swipes, double-tap, or drag to view the subject's details. On a smart TV or smart screen, the user needs to use the OK button on the remote control to zoom in and the left and right buttons to drag the image. The user needs to perform multiple operations on the electronic device to display the subject's details.
[0301] In this embodiment, the electronic device can provide users with a convenient function to view the main subject when browsing images. Based on key information in the image, the electronic device can further display indicator icons to indicate the location of the main subject, thus providing users with an indication of the subject's location. This technical solution will be described below with reference to Figure 12.
[0302] For example, Figure 12 is a schematic diagram of a display image provided in an embodiment of this application. As shown in Figure 12, the electronic device 900 can be a large-screen display device, such as a smart TV or a smart screen.
[0303] Referring to Figure 12(a), when displaying a target image, the electronic device 900 can determine the position of the subject 911 in the target image based on the key information in the target image, and can display an indicator icon 912 near the subject 911 to indicate the position of the subject.
[0304] It should be understood that the specific form of the indicator icon 912 is not limited in the embodiments of this application.
[0305] In some examples, the indicator icon 912 can also change depending on the type of the subject.
[0306] In other examples, the indicator icon 912 can also be text content, such as a subject or a portrait.
[0307] When the electronic device 900 detects that the user has clicked the indicator icon 912, it can display the GUI shown in Figure 12(b).
[0308] Referring to Figure 12(b), the display interface 920 of the electronic device 920 can mainly display the main body 911, so that the user can browse the main body very intuitively without having to perform zooming, sliding or other operations from the display interface 910.
[0309] In this way, electronic devices can display indicator icons to show the location of the main subject based on key information in the image. Users can then click on these icons to highlight the main subject in the image, allowing them to directly access the subject with a single click. This reduces user operations and improves the efficiency of viewing details of the main subject in the image.
[0310] Figure 13 is a schematic flowchart of a display method provided in an embodiment of this application. As shown in Figure 13, the method 1000 can be applied to an electronic device, and the method 1000 may include at least steps 1010 to 1020.
[0311] 1010, The electronic device acquires key information of the target media file, which is used to indicate the location of the main body in the target media file.
[0312] For example, the target media file may include images, videos, animated GIFs, etc.
[0313] The scenarios in which this electronic device displays thumbnails of target media files can include gallery, system desktop display cards, and image selection scenarios.
[0314] The subject can be a key part of the image, such as a person, animal, plant, building, or object, etc., and this application embodiment does not limit it.
[0315] This key information can be used to represent information about the main body of the target media file. For example, this key information may include coordinates, region, type, center point, or display size. For details, please refer to the relevant descriptions above. For the sake of brevity, it will not be repeated here.
[0316] In some examples, the electronic device can determine key information about the target media file in real time when displaying a thumbnail. Alternatively, the electronic device can pre-acquire and store key information about the target media file, and retrieve that key information from its storage location when a thumbnail of the target media file needs to be displayed later.
[0317] 1020. The electronic device displays a thumbnail of the target media file based on key information, wherein the thumbnail includes the main body.
[0318] For example, referring to Figure 10, when the electronic device displays the thumbnail 711 based on the key information of the image, the main body 712 is displayed completely and can present a good display effect.
[0319] Based on the embodiments of this application, an electronic device can obtain key information of a media file when displaying a thumbnail of a media file, and display a corresponding thumbnail based on the key information of the media file. The thumbnail may include a main body portion.
[0320] In this way, when users browse media files, the thumbnails of the media files displayed on the electronic device can include more main information, allowing users to browse the complete content and thus improving the display effect of the electronic device.
[0321] In some implementations, the thumbnail is the smallest rectangle that includes the main body. For example, this rectangle is a square.
[0322] In some embodiments, the target media file is an image, and before obtaining key information about the target media file, the method 1000 may further include:
[0323] Electronic devices perform image analysis on target media files;
[0324] Key information is determined based on the results of image analysis;
[0325] Add the key information to the first custom field of the target media file.
[0326] It should be understood that the generated target media file can be pictures, videos, etc., taken by an electronic device using a camera. Alternatively, it can be pictures, videos, etc., downloaded by the electronic device from the network or received from other electronic devices.
[0327] For example, the first custom field can be App8 or App9, etc., and this application embodiment does not limit it.
[0328] Based on the embodiments of this application, when generating an image, the electronic device can perform image analysis to determine key information of the image and add this key information to a custom field of the image. This technical solution allows the electronic device to add key information to the image, so that the key information can be referenced when displaying the thumbnail subsequently, thereby improving the display effect.
[0329] In some embodiments, the electronic device acquires key information about the target media file, including:
[0330] The electronic device retrieves key information from the first custom field of the target media file.
[0331] Based on the embodiments of this application, when an electronic device displays a thumbnail of an image, it can successfully obtain the key information of the image from the image's custom fields, which is beneficial for better display of the thumbnail in the future.
[0332] In some embodiments, the electronic device acquires key information about the target media file, including:
[0333] Electronic devices perform image analysis on target media files;
[0334] Electronic devices obtain key information based on the results of image analysis.
[0335] For example, the image analysis process may include image recognition, composition data recognition, etc.
[0336] It should be understood that image recognition is as described above. Through image recognition, electronic devices can determine key information such as the type of subject in an image, as well as the coordinates or region of the subject.
[0337] Composition data recognition enables electronic devices to determine the location and distribution of a subject. For example, when the subject is a human figure, the composition data could be the region or set of coordinates where the face is located.
[0338] Based on the embodiments of this application, the electronic device can also perform image analysis on the target media file to determine the key information of the target media file. In this way, the electronic device does not need to additionally encode the key information of the media file when generating the media file, thereby improving the speed of media file generation.
[0339] In some embodiments, the target media file includes image data and metadata, wherein the metadata includes key information.
[0340] For example, the image data is the raw data of the target media file, and the metadata may be data that includes key information.
[0341] Understandably, this metadata may also include other data, such as storage location, size, and shooting time.
[0342] In some embodiments, before displaying a thumbnail of the target media file based on the key information, the method 1000 may further include:
[0343] Electronic devices acquire target media files;
[0344] Electronic devices acquire image data and key information from target media files.
[0345] Based on the embodiments of this application, when displaying thumbnails, the electronic device can first obtain the target media file and then obtain image data and key information from the target media file to facilitate the display of thumbnails with better effects.
[0346] In some embodiments, displaying a thumbnail of the target media file based on key information includes:
[0347] The electronic device cuts the target media file based on key information to obtain a thumbnail of the target media file;
[0348] The electronic device displays a thumbnail of the target media file.
[0349] For example, when cropping a target media file, an electronic device can include all the key information in the cropped thumbnail, or include most of the key information in the cropped thumbnail.
[0350] Based on the embodiments of this application, when generating thumbnails, electronic devices can crop target media files according to key information to obtain thumbnails that include key information, thereby enabling electronic devices to have better display effects.
[0351] In some embodiments, cropping the target media file according to the key information to obtain a thumbnail of the target media file includes cropping the target media file according to the key information to obtain a first cropped image; and scaling the first cropped image to obtain the thumbnail.
[0352] For example, if the main body of the target problem file occupies a large proportion of the entire image, in order to present the main body more completely in the thumbnail, as much of the main body as possible can be preserved during cropping, and the whole image can be scaled.
[0353] Based on the embodiments of this application, the electronic device can also scale the first cropped image obtained after cropping according to the key information to obtain a thumbnail, so that the final displayed thumbnail can contain more main information, so as to present a better display effect to the user.
[0354] In some embodiments, the target media file is a video, and the key information further includes indication information for indicating the cover image of the video, wherein displaying a thumbnail of the target media file based on the key information includes:
[0355] The cover image of the video is determined according to the instruction information;
[0356] A thumbnail of the cover image is displayed based on key information.
[0357] For example, the indication information can be time information, such as a point in time or a specific moment.
[0358] Based on the embodiments of this application, when the target media file is a video, the key information also includes indication information for the cover image, so that the electronic device can determine the cover image of the video and display a thumbnail of the cover image according to the key information.
[0359] In some embodiments, displaying a thumbnail of the cover image based on key information includes:
[0360] The cover image is cropped based on key information to obtain a thumbnail of the cover image;
[0361] Showing a thumbnail of the cover image.
[0362] Based on the embodiments of this application, the electronic device can crop the cover image according to key information to obtain the corresponding thumbnail and display the thumbnail, thereby enabling the electronic device to still display a good display effect when displaying the thumbnail of the video.
[0363] In some embodiments, the subject is located at the center of the thumbnail.
[0364] Based on the embodiments of this application, the main body is located in the center of the thumbnail, which enables the electronic device to present a better display effect.
[0365] In some embodiments, the method 1000 further includes:
[0366] When displaying the target media file, an identifier is shown to indicate the subject.
[0367] In response to a user clicking on the subject's icon, the subject is displayed in the center of the display area.
[0368] For example, the identifier can be text, an icon, etc.
[0369] Based on the embodiments of this application, when displaying media files, the electronic device can also display the identifier of the main subject, thereby providing the user with an indication of the subject's location. Furthermore, the electronic device can display the main subject in the center of the display area based on the user's click on the subject's identifier, allowing for one-click access to the main subject and facilitating convenient viewing by the user.
[0370] Figure 14 is a schematic block diagram of an electronic device provided in an embodiment of this application. As shown in Figure 14, the electronic device 1100 may include one or more processors 1110; one or more memories 1120; the one or more memories 1120 store one or more instructions, which, when executed by one or more processors 1110, cause the display method as described in any of the possible implementations above to be executed.
[0371] For example, the electronic device 1100 can be the electronic device 700, electronic device 800 and electronic device 900 mentioned above.
[0372] This application also provides an apparatus including a processor and a communication interface. The communication interface is used to receive signals and transmit the signals to the processor. The processor processes the signals so that the display method described in any of the possible implementations above is executed.
[0373] The device can be a chip. For example, the chip can be a chip system or a standalone chip.
[0374] This application also provides a readable storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the aforementioned method steps to implement the display method in the above embodiments.
[0375] This application also provides a program product that, when run on an electronic device, causes the electronic device to perform the aforementioned steps to implement the display method described in the above embodiments.
[0376] This application also provides an apparatus including a module for implementing the display method as described in any of the preceding embodiments.
[0377] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store instructions, and when the apparatus is running, the processor may execute the instructions stored in the memory to cause the apparatus to perform the display methods in the above-described method embodiments.
[0378] In this embodiment, the device, readable storage medium, program product or apparatus are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.
[0379] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0380] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0381] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0382] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0383] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0384] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0385] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
A display method, characterized in that, The method is applied to an electronic device, and the method includes: Obtain key information from the target media file, wherein the key information is used to indicate the position of the main body in the target media file; A thumbnail of the target media file is displayed based on the key information, wherein the thumbnail includes the main body. The method according to claim 1, characterized in that, The key information obtained from the target media file includes: Perform image analysis on the target media file; The key information is obtained based on the results of the image analysis. The method according to claim 1 or 2, characterized in that, The target media file is an image. Before obtaining the key information of the target media file, the method further includes: Perform image analysis on the target media file; The key information is determined based on the results of the image analysis. Add the key information to the first custom field of the target media file. The method according to claim 3, characterized in that, The key information obtained from the target media file includes: The key information is obtained from the first custom field of the target media file. The method according to any one of claims 1-4, characterized in that, The target media file includes image data and metadata, and the metadata includes the key information. The method according to claim 5, characterized in that, Before displaying a thumbnail of the target media file based on the key information, the method further includes: Obtain the target media file; Obtain the image data and key information from the target media file. The method according to any one of claims 1-6, characterized in that, The step of displaying a thumbnail of the target media file based on the key information includes: The target media file is cropped based on the key information to obtain a thumbnail of the target media file; Displays a thumbnail of the target media file. The method according to claim 7, characterized in that, The step of cropping the target media file based on the key information to obtain a thumbnail of the target media file includes: The target media file is cropped based on the key information to obtain a first cropped image; The first cropped image is scaled to obtain the thumbnail. The method according to claim 1 or 2, characterized in that, The target media file is a video, and the key information also includes indication information for the video's cover image. The step of displaying a thumbnail of the target media file based on the key information includes: The cover image of the video is determined based on the indicated information; A thumbnail of the cover image is displayed based on the key information. The method according to claim 9, characterized in that, The step of displaying a thumbnail of the cover image based on the key information includes: The cover image is cropped based on the key information to obtain a thumbnail of the cover image; A thumbnail of the cover image is displayed. The method according to any one of claims 1-10, characterized in that, The main body is located at the center of the thumbnail. The method according to any one of claims 1-11, characterized in that, The method further includes: When displaying the target media file, an identifier for indicating the subject is displayed; In response to a user clicking on the icon of the subject, the subject is displayed in the center of the display area. An electronic device, characterized in that, include: One or more processors; One or more memory units; The one or more memories store one or more programs that, when executed by one or more processors, cause the display method as described in any one of claims 1-12 to be performed. A chip characterized in that, The chip includes a processor and a communication interface, the communication interface being used to receive signals and transmit the signals to the processor, the processor processing the signals such that the display method as described in any one of claims 1-12 is executed. A readable storage medium, characterized in that, The readable storage medium stores instructions that, when executed on an electronic device, cause the display method as described in any one of claims 1-12 to be performed. A program product, characterized in that, The program product includes program code that, when run on an electronic device, causes the display method as described in any one of claims 1-12 to be executed.
Citation Information
Patent Citations
Method and device for obtaining picture thumbnail
CN103927713A
Display control method and device, electronic equipment and readable storage medium
CN112822394A
Apparatus and method for providing thumnail image on digital device
KR1020090043242A