Image switching method, device and storage medium
By acquiring image size and color depth to generate suitable transition frames and combining them with vertical synchronization technology, the problem of high image switching latency is solved, achieving high-quality image switching effects and adapting to image switching needs under different device conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN ZHIXIAN VISION SOFTWARE TECHNOLOGY CO LTD
- Filing Date
- 2026-04-13
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies suffer from high latency and jarring visuals during image switching. They also tend to cause loading delays and excessive memory usage when switching between large 4K and 8K images. Furthermore, transition frames generated by traditional interpolation methods are prone to dynamic distortions such as blurring and tearing, failing to guarantee the display quality of transition images.
By acquiring the size and color depth of the current frame image and the target frame image, an adapted transition frame is generated, and image switching is achieved by combining vertical synchronization technology to reduce switching latency. This method includes using interpolation strategies to generate transition frames under high load or low power conditions, and using generative adversarial networks to generate high-quality transition frames.
It achieves reduced switching latency while ensuring image switching quality, improves the smoothness of image switching and the power efficiency of the device, and adapts to the image switching needs under different device conditions.
Smart Images

Figure CN122492436A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image display technology, and in particular to image switching methods, devices and storage media. Background Technology
[0002] Currently, with the widespread application of large-size high-definition images such as 4K and 8K in smart devices, seamless image switching technology has become an important research direction in the field of smart display. Existing solutions mainly improve the visual effect of image switching by means of buffering and interpolation to generate transition frames. For example, double buffering technology is used to reduce screen interruptions during the switching process, and then interpolation is used to fill the transition screen between the current frame and the target frame.
[0003] However, traditional double-buffering switching mechanisms suffer from high latency, resulting in noticeable screen jumps and visual stuttering. Furthermore, switching between large images such as 4K and 8K can lead to loading delays and excessive memory usage. Meanwhile, transition frames generated by traditional interpolation methods are prone to blurring, tearing, and other dynamic distortions, failing to guarantee the display quality of the transition frames. Therefore, reducing switching latency while maintaining image quality remains a crucial challenge.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this application is to provide an image switching method, device, and storage medium, aiming to solve the technical problem of how to reduce switching latency while ensuring the quality of the switched image.
[0006] To achieve the above objectives, this application proposes an image switching method, which includes: Respond to the image switching request and obtain the current frame image and the target frame image; Obtain the image dimensions of the target frame; Generate a transition frame to be displayed based on the image size, the current frame image, and the target frame image; Image switching is completed based on the transition frame to be displayed.
[0007] Furthermore, to achieve the above objectives, this application also proposes an image switching device, which includes: The data acquisition module is used to respond to image switching requests and acquire the current frame image and the target frame image; The data processing module is used to obtain the image size of the target frame image; The transition frame generation module is used to generate a transition frame to be displayed based on the image size, the current frame image, and the target frame image. The image switching module is used to switch images based on the transition frame to be displayed.
[0008] In addition, to achieve the above objectives, this application also proposes an image switching device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the image switching method described above.
[0009] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the image switching method described above.
[0010] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the image switching method described above. Attached Figure Description
[0011] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0012] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart illustrating an embodiment of the image switching method of this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the image switching method of this application; Figure 3 This is a schematic diagram of the complete timeline of image switching provided in Embodiment 2 of the image switching method of this application; Figure 4 A simplified flowchart illustrating the image switching method provided in Embodiment 2 of this application; Figure 5 This is a schematic diagram of the module structure of the image switching device according to an embodiment of this application; Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the image switching method in the embodiments of this application.
[0014] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0015] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0016] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0017] The main solution of this application embodiment is: responding to an image switching request, obtaining the current frame image and the target frame image; obtaining the image size of the target frame image; generating a transition frame to be displayed based on the image size, the current frame image, and the target frame image; and completing the image switching based on the transition frame to be displayed.
[0018] With the widespread application of large-size high-definition images such as 4K and 8K in smart devices, seamless image switching technology has become an important research direction in the field of smart display. Existing solutions mainly improve the visual effect of image switching by means of buffering and interpolation to generate transition frames. For example, double buffering technology is used to reduce screen interruptions during the switching process, and then interpolation is used to fill the transition screen between the current frame and the target frame.
[0019] However, traditional double-buffering switching mechanisms suffer from high latency, resulting in noticeable screen jumps and visual stuttering. Furthermore, switching between large images such as 4K and 8K can lead to loading delays and excessive memory usage. Meanwhile, transition frames generated by traditional interpolation methods are prone to blurring, tearing, and other dynamic distortions, failing to guarantee the display quality of the transition frames. Therefore, reducing switching latency while maintaining image quality remains a crucial challenge.
[0020] This application provides a solution that obtains the current frame image and the target frame image in response to an image switching request, obtains the image size of the target frame image and uses it as a basis to match and adapt the transition frame generation method, generates a transition frame to be displayed by combining the current frame image and the target frame image, and completes the image switching based on the transition frame. This achieves seamless connection between images of different sizes from the starting screen to the target screen, and can reduce switching latency while ensuring the quality of image switching.
[0021] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or image switching device capable of performing the above functions. The following description uses an image switching device as an example to illustrate this embodiment and the subsequent embodiments.
[0022] Based on this, embodiments of this application provide an image switching method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the image switching method of this application.
[0023] In this embodiment, the image switching method includes steps S10 to S40: Step S10: Respond to the image switching request and obtain the current frame image and the target frame image.
[0024] It should be noted that the image switching request is an instruction that triggers the image to switch from the currently displayed screen to another screen. This instruction can be automatically triggered by the timed carousel or directly triggered by the user's manual operation.
[0025] Additionally, the current frame image is the screen that is being displayed when the image switching operation occurs; it is the starting visual screen of the image switching process. The target frame image is the screen that needs to be presented after the image switching operation is completed; it is the ending visual screen of the image switching process.
[0026] It should be understood that upon receiving an image switching request, the corresponding current frame image and target frame image will be obtained to provide basic image materials for the subsequent generation of transition frames.
[0027] Step S20: Obtain the image size of the target frame image; It should be noted that image size is a parameter characterizing the size of the target frame image, specifically a combination of the image's width and height in pixels. Different combinations of pixel values correspond to different image resolution levels, and different image resolution levels correspond to different transition frame generation strategies. Specifically, common image sizes include 1920×1080 (1080P), 3840×2160 (4K), and 7680×4320 (8K), among others.
[0028] It should be understood that resolution detection is performed on the target frame image, and the pixel values corresponding to the width and height of the image are extracted and obtained to determine the image size of the target frame image, providing a basis for subsequent selection of an appropriate transition frame generation strategy.
[0029] Step S30: Generate a transition frame to be displayed based on the image size, the current frame image, and the target frame image; It should be noted that the transition frame to be displayed is an intermediate visual image that connects the current frame image and the target frame image, which can achieve a natural connection between the two frames and avoid visual discontinuity during the switching process.
[0030] It should be understood that the image resolution level of the target frame image is first determined based on the acquired image size, and then the corresponding transition frame generation strategy is matched. The visual feature information of the current frame image and the target frame image is combined for processing to generate a transition frame to be displayed that meets the image quality standard and is resolution-adapted.
[0031] Step S40: Complete image switching based on the transition frame to be displayed.
[0032] It should be noted that image switching is a visual display process that gradually replaces the currently displayed frame image with the target frame image through transitional images.
[0033] It should be understood that the generated transition frame to be displayed can be prepared for screen output through a double buffering mechanism. Combined with Vertical Synchronization (VSYNC) technology, the transition frame is output synchronously with the refresh rate of the display. With the natural connection of the transition frame, a smooth display from the current frame image to the target frame image is achieved, and the entire image switching operation is finally completed.
[0034] In one feasible implementation, the method may further include steps A11 to A14: Step A11: Obtain the color depth of the target frame image; It should be noted that color depth is a parameter that characterizes the number of colors that each pixel in an image can display. The higher the bit depth, the richer the colors that can be displayed and the smoother the transitions. Commonly used color depths include 8-bit color depth and 10-bit color depth. Different color depths correspond to different color reproduction capabilities and data storage requirements.
[0035] It should be understood that performing color depth analysis on the target frame image, extracting and obtaining the corresponding color depth parameters of the image, provides a basis for subsequent memory allocation and quality specification settings.
[0036] In addition, while acquiring the color depth of the target frame image, edge density calculation can be performed simultaneously to extract and record edge density-related data, providing data support for subsequent targeted quality optimization operations. Edge density calculation is an image feature analysis method that detects the complexity of object edges in the target frame image. The analysis results will serve as an important reference for subsequent transition frame quality optimization, forming a complete image feature analysis together with image size and color depth.
[0037] Step A12: Determine the memory allocation format and preset qualified threshold based on color depth; It should be noted that the memory allocation format refers to the color data storage format pre-defined in the video memory for storing transition frame data, raw image data, and intermediate image processing data. Different color depths will be matched with different storage formats to adapt to color performance requirements.
[0038] Additionally, the preset pass threshold is a pre-set peak signal-to-noise ratio (PSNR) value used to determine whether the quality of the transition frame image meets the display requirements. Specifically, it refers to the pass threshold for the PSNR. When the PSNR of the generated transition frame and the target frame image is greater than or equal to the preset pass threshold, the image quality of the transition frame is determined to be acceptable. The pass threshold for determining the quality of the transition frame image differs for target frame images with different color depths.
[0039] It should be understood that, based on the color depth of the acquired target frame image, a suitable memory allocation format is matched, and a preset acceptable threshold is determined for the corresponding color depth. The larger the bit depth, the larger the storage capacity of the corresponding memory allocation format, and the larger the preset acceptable threshold.
[0040] In practical implementation, when the target frame image has an 8-bit color depth, the appropriate storage format is RGB8, with a preset acceptable threshold of 35 dB. When the target frame image has a 10-bit color depth, the appropriate storage format is RGB10_A2, with a preset acceptable threshold of 38 dB. The RGB10_A2 format offers nearly one-third more storage capacity than the RGB format, and for 10-bit color depth images, a High Dynamic Range (HDR) perceptual Generative Adversarial Network (GAN) model can be used as the corresponding transition frame generation model.
[0041] Furthermore, the current frame-target frame image pair and the corresponding standard high-quality transition frame can be used as training data. The training data needs to include 10-bit color depth image samples. During training, the encoder based on the generative adversarial network architecture extracts visual features and semantic information, and the generator synthesizes the transition frame. The peak signal-to-noise ratio of the generated transition frame and the standard frame is used as the optimization objective. The encoder and generator parameters are iteratively optimized, and the color space and brightness features of the HDR image are incorporated as training constraints. The initial GAN model is trained to obtain the transition frame generation model, so as to output a high-quality transition frame adapted to the corresponding color depth.
[0042] Step A13: Determine the buffer memory and corresponding transition frame generation strategy based on the image size; It should be noted that the buffer memory is a pre-allocated video memory space in the shared texture pool for storing image data related to transition frames, ensuring efficient storage and fast retrieval of image data. The shared texture pool is a video memory area specifically built for image data storage, enabling efficient retrieval and resource sharing of image data between different image processing stages.
[0043] It should be understood that, based on the image size of the acquired target frame image, a corresponding buffer memory is allocated according to the preset size and memory matching rules, reserving dedicated and suitable space for the storage of transition frame data.
[0044] In addition, the transition frame generation strategy is a specific implementation method used to guide the transition frame generation operation. Different transition frame generation strategies can be determined based on whether the image size of the target frame image is less than or equal to the preset image specifications.
[0045] In practice, images can be divided into small, medium, and large images based on the total number of pixels in the image size. Figure 3 There are three target frame types: small images (≤2MP), medium images (2MP-8MP), and large images (>8MP). If the target frame image is determined to be small, 64MB of buffer memory is allocated in the shared texture pool; if it's medium, 128MB; and if it's large, 256MB. By allocating video memory space before all image processing and transition frame generation operations begin, sufficient and dedicated memory resources are provided for subsequent image data storage and transition frame generation. Allocating buffer memory based on the shared texture pool also ensures efficient use of video memory resources and reduces overall memory usage. After determining the target frame image size, it is compared with preset image specifications, and the corresponding transition frame generation strategy is determined based on the comparison result.
[0046] Step A14: The transition frame to be displayed is generated based on the memory allocation format, the preset qualified threshold, and the buffer memory storage transition frame generation strategy.
[0047] It should be understood that the quality of the transition frames generated by the transition frame generation strategy is checked according to the preset qualified threshold. When the generated transition frame meets the quality requirements, it is determined as a transition frame to be displayed. The data of the transition frame to be displayed is stored in the pre-allocated buffer memory in an orderly manner according to the determined memory allocation format.
[0048] In one feasible implementation, the method may further include steps A21 to A23: Step A21: Obtain the graphics processor load and device battery level; It should be noted that GPU load refers to the proportion of resources used by the graphics processing unit (GPU) when performing image processing operations such as transition frame generation and image feature analysis. The value of this metric reflects the remaining computing resources of the GPU; a higher value indicates that more computing resources are being used, and continuing to perform high-computational image processing operations can easily lead to processing lag and decreased efficiency.
[0049] Additionally, device battery level refers to the remaining battery power of the smart device that performs image processing operations, and can be measured as a percentage. The real-time value of the device battery level determines whether the device can continuously provide power support for high-computational-power transition frame generation operations. Continuous high-computational-power operations in a low-battery state will quickly consume the remaining battery power, significantly shortening the device's battery life.
[0050] It should be understood that the operation status of the graphics processor of the image switching device is monitored in real time, its current load data is extracted and obtained to obtain the graphics processor load, and the power supply status of the image switching device is detected to obtain the corresponding remaining device power data to obtain the device power.
[0051] Step A22: When the graphics processor load is greater than the preset load or the device battery power is less than the preset battery power, generate a transition frame to be displayed through an interpolation strategy. It should be noted that the preset load is a pre-set threshold used to determine whether the graphics processor is in a high-load operating state. This threshold is the value that distinguishes between normal operation and high-load operation of the graphics processor.
[0052] Additionally, the preset power level is a pre-set threshold used to determine whether the device is in a low power state. This threshold is a value that distinguishes between normal power supply and low power supply.
[0053] Alternatively, interpolation strategies generate transition frames by interpolating pixel data between the current and target frames. This method eliminates the need for computationally intensive neural network operations or complex optical flow estimation and fusion, resulting in low computational complexity, minimal hardware resource consumption, and fast data processing. While the quality of transition frames generated through interpolation strategies is slightly lower, it ensures smooth transition frame generation and low-power device operation, making it a lightweight transition frame generation solution suitable for high-load or low-power conditions.
[0054] It should be understood that the obtained graphics processor load is compared with the preset load, and the device power is compared with the preset power. If either the graphics processor load is greater than the preset load or the device power is less than the preset power, the interpolation strategy is used as the transition frame generation strategy. The relevant image pixel data is calculated and the transition frame to be displayed is generated through this strategy.
[0055] In practical implementation, the interpolation strategy can be to switch to the fast bilateral interpolation mode. In this mode, by simultaneously calculating the spatial distance weight and value domain color similarity weight between pixels, the physical contour of the object can be effectively identified and protected when generating transition frames. Thus, without relying on high-energy-consuming AI computing power, the ghosting artifacts common in traditional linear interpolation can be suppressed, ensuring the continuity of visual switching. That is, while ensuring that the image delay is within the acceptable range for the human eye, power consumption is reduced.
[0056] Alternatively, users can manually set a performance mode or a power saving mode. In performance mode, priority is given to ensuring the quality of transition frames, while in power saving mode, priority is given to reducing device power consumption.
[0057] Step A23: Complete the image switching based on the transition frame to be displayed.
[0058] It should be understood that the transition frame to be displayed, generated through interpolation strategy, completes all preparations before output. Based on double buffering synchronization, combined with vertical synchronization technology, it ensures that the newly generated frame is only output during the vertical retrace of the display, thus completing the display preparation and synchronous output of the transition frame. With the help of the transition frame's image connection function, a smooth replacement from the current frame image to the target frame image is achieved, and finally the entire image switching operation is completed.
[0059] This embodiment provides an image switching method. By responding to an image switching request, the current frame image and the target frame image are obtained. The image size of the target frame image is obtained and a suitable transition frame generation method is matched based on it. The current frame image and the target frame image are combined to generate a transition frame to be displayed, and the image switching is completed based on the transition frame. This achieves seamless connection between images of different sizes from the starting screen to the target screen, and can reduce switching latency while ensuring the quality of image switching.
[0060] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Step S30 may include steps S31 to S32: Step S31: When the image size is less than or equal to the preset image size, input the current frame image and the target frame image into the transition frame generation model to obtain the transition frame to be displayed; It should be noted that the transition frame generation model is a lightweight model built on generative adversarial networks. It is used to extract deep features of images and synthesize high-quality visual images, and can be adapted to the transition frame generation needs of small-sized images.
[0061] Additionally, the preset image specification is a pre-defined critical standard for image size. For example, this standard can be set to 1920×1080. Target frame images larger than the preset image specification and target frame images smaller than or equal to the preset image specification are adapted to different transition frame generation strategies.
[0062] It should be understood that the image size of the target frame image is numerically compared with the preset image specifications. If the result is that the image size is less than or equal to the preset image specifications, the current frame image and the target frame image are simultaneously input into the transition frame generation model. After the model completes image feature extraction and deep semantic understanding, the transition frame is synthesized to obtain a transition frame that meets the image quality requirements.
[0063] In one feasible implementation, the transition frame generation model includes an encoder and a generator; step S31 may include steps S311 to S315: Step S311: When the image size is less than or equal to the preset image specification, input the current frame image and the target frame image into the encoder to obtain visual features and semantic information; It should be noted that the encoder is the component in the transition frame generation model responsible for extracting the core information of the image. It can filter out representative features from the original pixel data of the image for image feature extraction.
[0064] In addition, visual features are various types of data that characterize the external visual attributes of an image, including image attribute-related information such as edges, colors, and textures. Semantic information is information that characterizes the deeper meaning of an image, including deeper data such as the category and relative position of objects in the image, and the content logic of the scene.
[0065] It should be understood that after determining that the image size is less than or equal to the preset image specifications, the current frame image and the target frame image are simultaneously input into the encoder. The encoder performs feature extraction and data parsing on the two images, extracting and obtaining the corresponding visual features and semantic information from the images, providing a data basis for subsequent transition frame synthesis.
[0066] Step S312: Input visual features and semantic information into the generator to obtain the initial transition frame; It should be noted that the generator is the core component of the transition frame generation model. It is used to synthesize images based on the input feature information and can transform abstract feature data into concrete image frames.
[0067] In addition, the initial transition frame is a transition frame image that the generator initially synthesizes based on the input visual features and semantic information.
[0068] It should be understood that the visual features and semantic information obtained from the encoder are transmitted to the generator as input data. The generator then synthesizes and constructs the image based on these features, generating and obtaining the initial transition frame that connects the current frame image and the target frame image.
[0069] Step S313: Obtain the peak signal-to-noise ratio (PSNR) of the initial transition frame and the target frame image to obtain the first PSNR; It should be noted that peak signal-to-noise ratio (PSNR) is an objective indicator that measures the similarity between two images and the image quality. The higher the value of this indicator, the better the image quality and the higher the degree of fit with the reference image.
[0070] Additionally, the first peak signal-to-noise ratio is a peak signal-to-noise ratio value used to characterize the similarity between the initial transition frame and the target frame image.
[0071] It should be understood that, using the target frame image as a reference image, the peak signal-to-noise ratio (PSNR) between the initial transition frame and the target frame image is calculated, and the calculated PSNR value is used as the first PSNR to complete the preliminary quality quantification assessment of the initial transition frame.
[0072] Step S314: When the first peak signal-to-noise ratio is less than the preset qualified threshold, the initial transition frame is quality optimized to obtain the first optimized transition frame, and the peak signal-to-noise ratio of the first optimized transition frame and the target frame image is updated to the first peak signal-to-noise ratio. The quality optimization includes at least one of edge enhancement, color space correction and generator model parameter adjustment. It should be noted that the preset pass threshold is the indicator for distinguishing between acceptable and unacceptable quality in transition frames. Quality optimization is a series of image enhancement operations performed on initial transition frames that do not meet the quality standards. Edge enhancement is a processing method that uses algorithms to detect image edges and sharpen edge contours to improve the clarity of image details. Color space correction is a processing method that adjusts image color parameters in a specific color space to make the image colors consistent with those of the target frame.
[0073] Additionally, generator model parameter adjustment involves modifying the generator's internal computational parameters, allowing the generator to optimize the image synthesis effect based on the adjusted parameters. The first optimized transition frame is the transition frame image with improved image quality obtained after performing quality optimization operations on the initial transition frame.
[0074] It should be understood that after determining the corresponding preset pass threshold based on the color depth of the target frame image, the first peak signal-to-noise ratio (PSNR) of the initial transition frame is compared with the preset pass threshold. If the first PSNR is greater than or equal to the preset pass threshold, the initial transition frame is determined to be a transition frame to be displayed. If the first PSNR is less than the preset pass threshold, a quality optimization operation is performed on the initial transition frame, including at least one of edge enhancement, color space correction, and generator model parameter adjustment, to improve the image quality of the initial transition frame and obtain the first optimized transition frame. The PSNR of this first optimized transition frame and the target frame image is calculated, and this value is updated as the new first PSNR.
[0075] Step S315: When the first peak signal-to-noise ratio is greater than or equal to the preset qualified threshold, the first optimized transition frame is determined as the transition frame to be displayed.
[0076] It should be understood that the first peak signal-to-noise ratio of the first optimized transition frame is compared with a preset qualified threshold. If the first peak signal-to-noise ratio is determined to be greater than or equal to the preset qualified threshold, it means that the image quality of the first optimized transition frame after quality optimization meets the display requirements. At this time, the first optimized transition frame is determined as the transition frame to be displayed, providing a usable transition frame image for subsequent image switching.
[0077] In practical implementation, when the first peak signal-to-noise ratio (SNR) is less than a preset acceptable threshold, such as 35dB, edge enhancement and color space correction can be performed sequentially on the initial transition frame. In the edge enhancement stage, the Sobel operator identifies and sharpens the edge contours in the image to improve image clarity. In the color correction stage, the color histogram of the current frame is extracted, and color matching and adjustment are performed in the YUV space to ensure that the hue of the transition frame is highly consistent with the original image. After completing the above optimization, the first optimized transition frame is obtained. A second quality check is performed on the first optimized transition frame. If the first peak SNR is determined to be greater than or equal to the preset acceptable threshold, the first optimized transition frame is determined to be the transition frame to be displayed. If the first peak SNR still does not meet the standard, a warning log is recorded for background diagnosis while forced output is performed to ensure the real-time performance and image continuity of the display link. The Sobel operator is a classic differential operator for image edge detection, and YUV is a color space model that independently represents luminance information Y and color information U and V.
[0078] In another implementation, when the first peak signal-to-noise ratio is less than a preset qualified threshold such as 35dB, the generator model parameters of the transition frame generation model can be adjusted, and then the step of inputting visual features and semantic information into the generator to obtain the initial transition frame can be returned until the first peak signal-to-noise ratio is greater than or equal to the preset qualified threshold; or when the generator model parameters are adjusted to a preset number of times, a warning log is recorded for background diagnosis while forced output is performed to ensure the real-time performance and screen continuity of the display link.
[0079] Step S32: When the image size is larger than the preset image specification, the target frame image is divided into blocks, and optical flow estimation is performed on the block-based target frame image based on the current frame image and the target frame image to obtain the transition frame to be displayed.
[0080] It should be noted that segmentation is a process of breaking down a large target frame image into multiple independent image blocks according to a preset size standard. Optical flow estimation is a computer vision technique used to estimate the motion patterns of objects in an image. It can accurately analyze the motion characteristics of the segmented image blocks to support the generation of transition frames.
[0081] It should be understood that, when comparing the image size of the target frame image with the preset image specifications, if the result is that the image size is greater than or equal to the preset image specifications, the target frame image is first divided into blocks according to the preset block size. Then, by combining the current frame image and the complete target frame image, optical flow estimation is performed on each block of the image. After fusing the optical flow vector information of each block, a transition frame is synthesized, and finally, a transition frame that meets the requirements for display is obtained.
[0082] In one feasible implementation, step S32 may include steps S321 to S324: Step S321: When the image size is larger than the preset image specification, determine the block size based on the image size; It should be noted that the block size is the pixel size parameter of a single image block when a large target frame image is broken down. Different overall image sizes will be matched with corresponding block sizes to adapt to the computational efficiency and memory usage requirements of optical flow estimation.
[0083] It should be understood that after determining that the image size is greater than or equal to the preset image specifications, the matching block size is selected from the preset correspondence between resolution and block size based on the specific pixel value of the target frame image size, so as to provide a unified size standard for subsequent image block operations.
[0084] In practical implementation, assuming there are two block sizes, 256×256 and 512×512, for target frame images with a preset image specification such as 1080P, the block size corresponding to the target frame image with a resolution of 1080P to 4K can be determined to be 256×256; the block size corresponding to the target frame image with a resolution of 4K to 8K can be determined to be 512×512, so as to reduce the boundary processing overhead after block division.
[0085] Step S322: Divide the target frame image into blocks based on the block size, and set an overlapping area of a preset number of pixels between adjacent blocks to obtain the block-divided target frame image. It should be noted that the preset number of pixels is a pre-defined number of pixels used to establish a connection area between adjacent image blocks. This number can effectively reduce the abrupt boundary problem when merging subsequent block transition frames. Specifically, the specific value of the preset number of pixels can be 8 pixels, but this embodiment does not impose a specific limitation on this.
[0086] In addition, the overlapping area is the pixel overlap area set between two adjacent image blocks. It is a transition area connecting different image blocks and can ensure the continuity of the complete image after block fusion.
[0087] It should be understood that the complete target frame image is uniformly divided according to the determined block size, and a pre-set number of overlapping pixels are set between every two adjacent image blocks to obtain a block-based target frame image composed of multiple independent image blocks with overlapping areas.
[0088] Step S323: Based on the current frame image and the target frame image, perform optical flow estimation on the segmented target frame image to obtain multiple segmented transition frames; It should be noted that the segmented transition frame is the corresponding transition frame generated for each small image block in the segmented target frame image after optical flow estimation is performed separately. It is the basic visual unit that constitutes the complete transition frame.
[0089] It should be understood that, by combining the overall feature information of the complete current frame image and the target frame image, optical flow estimation is performed in parallel for each image block in the segmented target frame image. After analyzing the motion features of each block, optical flow vector fusion is performed, and a transition frame is generated separately for each block, resulting in multiple segmented transition frames corresponding to the number of image blocks.
[0090] Step S324: Determine the transition frame to be displayed based on multiple segmented transition frames.
[0091] It should be understood that the overlapping areas of adjacent transition frames in multiple segmented transition frames are feathered and blended to eliminate boundary traces between different segmented transition frames. The visual images of all segmented transition frames are merged to synthesize a complete transition frame image. After passing the quality inspection, the complete transition frame is determined as the transition frame to be displayed.
[0092] In one feasible implementation, step S324 may include steps S3241 to S3245: Step S3241: Synthesize a complete transition frame based on multiple segmented transition frames; It should be noted that a complete transition frame is a continuous and complete transition frame image obtained by merging and splicing multiple independent block transition frames. It is a complete visual carrier connecting the current frame image and the target frame image.
[0093] It should be understood that feathering and blending are performed on the overlapping areas of adjacent blocks in multiple block transition frames to eliminate the boundary traces between different block transition frames. Then, the images of all block transition frames are spliced and merged as a whole to synthesize a complete transition frame with a coherent image.
[0094] Step S3242: Obtain the peak signal-to-noise ratio (PSNR) of the complete transition frame and the target frame image to obtain the second PSNR; It should be noted that the second peak signal-to-noise ratio is a peak signal-to-noise ratio value used to characterize the similarity between the complete transition frame and the target frame image.
[0095] It should be understood that, using the target frame image as a reference image, the peak signal-to-noise ratio (PSNR) between the complete transition frame and the target frame image is calculated, and the calculated PSNR value is used as the second PSNR to complete the preliminary quality quantification assessment of the complete transition frame.
[0096] Step S3243: When the updated second peak signal-to-noise ratio is greater than or equal to the preset qualified threshold, the complete transition frame is determined as the transition frame to be displayed. It should be understood that after determining the corresponding preset qualified threshold based on the color depth of the target frame image, the second peak signal-to-noise ratio of the complete transition frame will be compared with the preset qualified threshold. If the second peak signal-to-noise ratio is determined to be greater than or equal to the preset qualified threshold, the complete transition frame will be determined as the transition frame to be displayed.
[0097] Step S3244: When the second peak signal-to-noise ratio is less than the preset qualified threshold, the quality of the complete transition frame is optimized to obtain the second optimized transition frame, and the peak signal-to-noise ratio of the second optimized transition frame and the target frame image is updated to the second peak signal-to-noise ratio. The quality optimization includes at least one of edge enhancement, color space correction and adjustment of the number of optical flow estimation iterations. It should be noted that adjusting the number of optical flow estimation iterations is a processing operation that increases the number of computational iterations in the optical flow estimation process to improve the accuracy of optical flow vector calculation. The second optimized transition frame is the transition frame with improved image quality obtained after performing quality optimization operations on the complete transition frame with substandard image quality.
[0098] It should be understood that if the second peak signal-to-noise ratio (PSNR) is determined to be less than a preset acceptable threshold, a quality optimization operation is performed on the complete transition frame. This involves executing at least one of the following operations: edge enhancement, color space correction, and adjustment of the number of optical flow estimation iterations. This process improves the image quality of the complete transition frame, resulting in a second optimized transition frame. The PSNR of this second optimized transition frame and the target frame image is calculated, and this value is updated as the new second PSNR.
[0099] Step S3245: When the updated second peak signal-to-noise ratio is greater than or equal to the preset qualified threshold, the second optimized transition frame is determined as the transition frame to be displayed.
[0100] It should be understood that the updated second peak signal-to-noise ratio, i.e. the second peak signal-to-noise ratio of the second optimized transition frame, is compared with the preset qualified threshold. If the second peak signal-to-noise ratio is determined to be greater than or equal to the preset qualified threshold, it means that the image quality of the second optimized transition frame after quality optimization meets the display requirements. At this time, the second optimized transition frame is determined as the transition frame to be displayed, providing a usable transition frame image for subsequent image switching.
[0101] In practice, when the second peak signal-to-noise ratio (PSNR) is less than a preset acceptable threshold (e.g., 35dB), edge enhancement and color space correction can be performed sequentially on the initial transition frame. In the edge enhancement stage, the Sobel operator is used to identify and sharpen the edge contours in the image to improve image clarity. In the color correction stage, the color histogram of the current frame is extracted, and color matching and adjustment are performed in the YUV space to ensure that the hue of the transition frame is highly consistent with the original image. After completing the above optimizations, a second optimized transition frame is obtained. A second quality check is performed on the second optimized transition frame. If the second PSNR is determined to be greater than or equal to the preset acceptable threshold, the second optimized transition frame is determined to be the transition frame to be displayed. If the second PSNR still does not meet the standard at this time, a warning log is recorded for background diagnosis while forced output is performed to ensure the real-time performance and image continuity of the display link.
[0102] In another implementation, when the second peak signal-to-noise ratio (SNR) is less than a preset acceptable threshold, such as 35 dB, the number of optical flow estimation iterations can be adjusted. Specifically, the number of optical flow estimation iterations can be increased, and then the process of estimating the optical flow of the segmented target frame image based on the current frame image and the target frame image can be returned to obtain multiple segmented transition frames. This process is repeated to recalculate the optical flow until the second peak SNR is greater than or equal to the preset acceptable threshold. Alternatively, when the number of optical flow estimation iterations reaches a preset number, a warning log can be recorded for background diagnosis, while forced output can be performed to ensure the real-time performance and image continuity of the display link. For example, if the initial value of the number of optical flow estimation iterations is 3, when optimizing the quality of the complete transition frame and selecting to adjust the number of optical flow estimation iterations, the number of iterations can be increased from 3 to 5, and optical flow estimation can be performed again to generate transition frames, thereby improving the image quality of the complete transition frames.
[0103] In one feasible implementation, step S40 may include steps S41 to S44: Step S41: Write the transition frame to be displayed into the back buffer; It's important to note that the double-buffering mechanism maintains two buffer areas simultaneously: a front buffer and a back buffer. The front buffer stores and displays the current content, directly visible to the user; while the back buffer silently performs the writing of new transition frames in the background, a process invisible to the user. The back buffer stores the image data to be displayed, while the front buffer establishes a direct data transmission link with the display device. Image data in the front buffer is transmitted to the display device in real time for visualization. The back buffer works in conjunction with the front buffer to preload image data, preventing screen flickering or data transmission interruptions during image output.
[0104] It should be understood that the data of the determined transition frames to be displayed is written into the back buffer according to the preset image data storage, completing the preloading operation of the transition frame data, and making sufficient data preparation for the subsequent screen output stage.
[0105] Step S42: In response to the vertical synchronization signal, the pointers of the front buffer and the back buffer are swapped, and the transition frame to be displayed in the front buffer is output to the display device; It should be noted that the vertical sync signal is a signal generated by the display device to synchronize the image output rhythm with the monitor refresh rate. It allows the output timing of image frames to match the vertical retrace cycle of the monitor, thus avoiding screen tearing at its source.
[0106] In addition, pointer swapping allows for the exchange of access pointers between the front and back buffers, enabling fast switching between the two buffers without the need for extensive image data copying, thus significantly improving buffer switching efficiency.
[0107] In addition, a display device is a hardware device used to receive image data and convert it into a visual image; it is the final image presentation carrier for image switching.
[0108] It should be understood that when the vertical synchronization signal sent by the display device is received, the access pointers of the front buffer and the back buffer are swapped, so that the back buffer storing the transition frame to be displayed becomes the new front buffer. Then the transition frame data to be displayed in the front buffer is transmitted and output to the display device, and the display device completes the real-time display of the transition frame.
[0109] Step S43: Predict the image motion trend based on the optical flow vector information of the historical transition frames, and generate an updated transition frame to be displayed based on the motion trend. It should be noted that historical transition frames are transition frames that have been generated and output before the current transition frame to be displayed, containing image change feature data from the earlier stages of the image switching process. Optical flow vector information is obtained through optical flow estimation technology, representing the direction and amplitude of pixel movement in the image, and can intuitively reflect the overall motion change characteristics of the image. Specifically, when generating the first transition frame to be displayed, the current frame image is used as the historical transition frame. Based on the current frame image and the target frame image, the initial optical flow vector is obtained through the first optical flow estimation. This initial optical flow vector is used as the optical flow vector information of the historical transition frame to predict the image motion trend and generate the transition frame to be displayed, which serves as the historical transition frame for subsequent generation of transition frames to be displayed.
[0110] In addition, the image motion trend is extracted from the optical flow vector information of historical transition frames, indicating the direction and pattern of subsequent changes in the image. The updated transition frame to be displayed is generated based on the predicted image motion trend, adapting to the subsequent image switching process, and serves as the frame connecting the current transition frame and the target frame.
[0111] It should be understood that the optical flow vector information corresponding to the historical transition frames is retrieved and deeply analyzed. From this information, the change pattern of the image is summarized, thereby predicting the subsequent motion trend of the image. Then, combined with the core features of the current frame image and the target frame image, an updated transition frame to be displayed is generated based on the motion trend to adapt to the subsequent switching process.
[0112] In practice, when analyzing the optical flow vector information of historical transition frames, the optical flow vector information of the three most recent frames maintained in the optical flow vector cache can be retrieved to more accurately predict the image motion trend. At the same time, updated transition frames to be displayed can be generated in advance in the background based on the predicted motion trend, reducing the real-time computing pressure during image switching and ensuring the smoothness of image switching.
[0113] Step S44: Return to the step of writing the transition frame to be displayed to the back buffer until the image on the display device is switched to the target frame image, and the image switching is completed.
[0114] It should be understood that the newly generated and updated transition frame to be displayed is written to the buffer again, and the entire process of buffer pointer swapping, transition frame output, image motion trend prediction and updated transition frame generation is repeated. The transition frame is continuously output to the display device until the image displayed on the display device is completely switched to the target frame image. At this time, the entire loop process is terminated and all image switching operations are completed.
[0115] For example, please refer to Figure 3 , Figure 3 This is a schematic diagram of the complete timeline of image switching provided in Embodiment 2 of the image switching method of this application. Figure 3 As shown, the preprocessing stage (T1-T2) sequentially performs feature analysis and memory pre-allocation. Feature analysis is used to extract core features such as color depth and edge density of the target frame image, while memory pre-allocation pre-divides an appropriate buffer memory according to the image size. The transition frame generation strategy selection stage (T2-T4) first compares the image size with the preset specifications by resolution determination to classify the size type, and then distributes the images of different sizes to match differentiated transition frame generation strategies. The transition frame generation stage (T5-T6) accelerates the operation by leveraging the parallel processing capability of the graphics processor. Large-sized images need to be processed by block segmentation first, and then the transition frames of each block are stitched together into a complete transition frame by block merging. Boundary feathering is used to eliminate block boundary traces and ensure the continuity of the image. In the consistency and quality optimization stage (T6-T7), the similarity and image quality between the transition frame and the target frame are first quantitatively evaluated by peak signal-to-noise ratio detection. If the standard is not met, edge enhancement is performed sequentially to sharpen details and color correction is performed to match the color of the target frame. After optimization, the detection is performed again until the image quality meets the standard. In the synchronous output stage (T7-T8), double buffer preparation is performed first, and the qualified transition frame is pre-written into the back-end buffer. Then, the vertical synchronization signal is responded to. This signal is used to synchronize the image output rhythm with the display refresh rate to avoid screen tearing. The pointers of the front and back-end buffers are swapped and the transition frame is output to the display device. Finally, the user perception stage (T8) is entered. The screen switching is completed, and the user can perceive a smooth and lag-free image switching effect. The display device finally presents the target frame image.
[0116] In specific implementation, assuming the preset image specification is 1080P, i.e., 1920x1080, when the image size of the target frame image, i.e., width × height ≤ 1920x1080, the current frame image and the target frame image are input into the transition frame generation model to obtain the transition frame to be displayed. This image switching path is mainly applicable to mobile devices with high requirements for local details, such as mobile wallpaper switching, tablet photo albums, and small-sized digital photo frames. When the image size of the target frame image, i.e., width × height > 1920x1080, the target frame image is divided into blocks, and optical flow estimation is performed on the block-based target frame image based on the current frame image and the target frame image to obtain the transition frame to be displayed. This image switching path is mainly applicable to professional display devices with extremely high requirements for screen scale and overall motion smoothness, such as 4K art TVs, 8K commercial displays, and large-size advertising screens.
[0117] This embodiment provides an image switching method that matches differentiated transition frame generation methods to images of different sizes based on preset image specifications. For small-sized images, the transition frame generation model ensures the image quality of the transition frames. For large-sized images, the computational difficulty is reduced by segmentation combined with optical flow estimation. This avoids the problems of excessive computational pressure and high memory consumption caused by directly processing large-sized images, while maintaining high-quality visual transition effects for small-sized images. It balances the speed and image quality of transition frame generation, achieving efficient generation of transition frames for full-size images and providing a data foundation for subsequent seamless image switching.
[0118] For example, to help understand the implementation flow of the image switching method obtained by combining this embodiment with the above embodiment one, please refer to... Figure 4 , Figure 4 A simplified flowchart of an image switching method is provided, specifically: First, the target frame image is input, and then it is determined whether the image size is less than or equal to the preset image size. If the determination result is yes, a generative adversarial network model is used to generate a transition frame to extract deep features of the image and synthesize a high-quality transition frame image. If the determination result is no, block optical flow estimation is performed to generate a transition frame. The large image is decomposed into small blocks, and the pixel motion trend is analyzed through optical flow estimation technology. Then, the blocks are merged to generate a transition frame, so as to effectively reduce the computational pressure of large images. Transition frames generated by the Generative Adversarial Network (GAN) model or by block optical flow estimation must undergo a transition frame quality detection process to determine if their quality meets a preset acceptable threshold. If the threshold is met (i.e., the peak signal-to-noise ratio (PSNR) of the generated transition frame is greater than or equal to the threshold), double-buffered output transition frames are executed. This involves exchanging pointers between the front-end and back-end buffers to pre-store the transition frame and synchronously output it to the display device, effectively preventing screen tearing and flickering. If the threshold is not met (i.e., the PSNR of the generated transition frame is less than the threshold), transition frame optimization is performed. This optimization includes edge enhancement and color correction to improve the detail and color consistency of the transition frame. After optimization, transition frame quality detection is performed again until the quality meets the preset acceptable threshold, thus completing the image switching process and ensuring a smooth transition with display quality that meets requirements.
[0119] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the image switching method of this application. Any simple transformations based on this technical concept are all within the protection scope of this application.
[0120] This application also provides an image switching device, please refer to... Figure 5 The image switching device includes: Data acquisition module 10 is used to respond to image switching requests and acquire the current frame image and the target frame image; Data processing module 20 is used to obtain the image size of the target frame image; Transition frame generation module 30 is used to generate a transition frame to be displayed based on the image size, the current frame image, and the target frame image. The image switching module 40 is used to complete image switching based on the transition frame to be displayed.
[0121] In one embodiment, the transition frame generation module 30 is further configured to input the current frame image and the target frame image into the transition frame generation model to obtain the transition frame to be displayed when the image size is less than or equal to a preset image specification; When the image size is larger than the preset image specification, the target frame image is divided into blocks, and optical flow estimation is performed on the block target frame image based on the current frame image and the target frame image to obtain the transition frame to be displayed.
[0122] In one embodiment, the transition frame generation module 30 is further configured to determine the block size based on the image size when the image size is larger than a preset image specification; The target frame image is divided into blocks based on the block size, and an overlap area of a preset number of pixels is set between adjacent blocks to obtain the block-divided target frame image. Optical flow estimation is performed on the segmented target frame image based on the current frame image and the target frame image to obtain multiple segmented transition frames; The transition frame to be displayed is determined based on multiple segmented transition frames.
[0123] In one embodiment, the transition frame generation module 30 is further configured to synthesize a complete transition frame based on multiple segmented transition frames; Obtain the peak signal-to-noise ratio (PSNR) of the complete transition frame and the target frame image to obtain the second PSNR; When the second peak signal-to-noise ratio is greater than or equal to the preset qualified threshold, the complete transition frame is determined as the transition frame to be displayed; When the second peak signal-to-noise ratio is less than the preset qualified threshold, the quality of the complete transition frame is optimized to obtain the second optimized transition frame, and the peak signal-to-noise ratio of the second optimized transition frame and the target frame image is updated to the second peak signal-to-noise ratio. The quality optimization includes at least one of edge enhancement, color space correction and adjustment of the number of optical flow estimation iterations. When the updated second peak signal-to-noise ratio is greater than or equal to the preset qualified threshold, the second optimized transition frame is determined as the transition frame to be displayed.
[0124] In one embodiment, the transition frame generation module 30 is further configured to input the current frame image and the target frame image into the encoder to obtain visual features and semantic information when the image size is less than or equal to a preset image specification; Visual features and semantic information are input into the generator to obtain the initial transition frame; Obtain the peak signal-to-noise ratio (PSNR) of the initial transition frame and the target frame image to obtain the first PSNR; When the first peak signal-to-noise ratio is less than a preset qualified threshold, the initial transition frame is quality optimized to obtain the first optimized transition frame, and the peak signal-to-noise ratio of the first optimized transition frame and the target frame image is updated to the first peak signal-to-noise ratio. The quality optimization includes at least one of edge enhancement, color space correction and generator model parameter adjustment. When the first peak signal-to-noise ratio is greater than or equal to the preset qualified threshold, the first optimized transition frame is determined as the transition frame to be displayed.
[0125] In one embodiment, the image switching module 40 is further configured to write the transition frame to be displayed into the back buffer; In response to the vertical synchronization signal, the pointers of the front buffer and the back buffer are swapped, and the transition frame to be displayed in the front buffer is output to the display device; Predict the image motion trend based on the optical flow vector information of historical transition frames, and generate updated transition frames to be displayed based on the motion trend; Return to the step of writing the transition frame to be displayed to the back buffer until the image on the display device is switched to the target frame image, thus completing the image switching.
[0126] In one embodiment, the transition frame generation module 30 is further configured to obtain the color depth of the target frame image; The memory allocation format and preset qualification threshold are determined based on color depth; The buffer memory and corresponding transition frame generation strategy are determined based on the image size. The transition frame to be displayed is generated based on the memory allocation format, the preset qualified threshold, and the buffer memory storage transition frame generation strategy.
[0127] In one embodiment, the image switching module 40 is also used to obtain the graphics processor load and device power. When the graphics processor load is greater than the preset load or the device battery is less than the preset battery, an interpolation strategy is used to generate a transition frame to be displayed. Image switching is completed based on the transition frame to be displayed.
[0128] The image switching apparatus provided in this application, employing the image switching method described in the above embodiments, can solve the technical problem of reducing switching latency while ensuring the quality of the switched image. Compared with the prior art, the beneficial effects of the image switching apparatus provided in this application are the same as those of the image switching method described in the above embodiments, and other technical features in the image switching apparatus are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0129] This application provides an image switching device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the image switching method in Embodiment 1 above.
[0130] The following is for reference. Figure 6The diagram illustrates a structural schematic of an image switching device suitable for implementing embodiments of this application. The image switching device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The image switching device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0131] like Figure 6 As shown, the image switching device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in ROM (Read Only Memory) 1002 or a program loaded from storage device 1003 into RAM (Random Access Memory) 1004. RAM 1004 also stores various programs and data required for the operation of the image switching device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touch screens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, LCDs (Liquid Crystal Displays), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the image switching device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows image switching devices with various systems, it should be understood that it is not required to implement or possess all of the systems shown. More or fewer systems may be implemented alternatively.
[0132] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0133] The image switching device provided in this application, employing the image switching method described in the above embodiments, can solve the technical problem of reducing switching latency while ensuring the quality of the switched image. Compared with the prior art, the beneficial effects of the image switching device provided in this application are the same as those of the image switching method described in the above embodiments, and other technical features of this image switching device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0134] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0135] The above are merely specific embodiments 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 scope of the technology 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.
[0136] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the image switching method in the above embodiments.
[0137] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory), or flash memory, optical fiber, CD-ROM (CD-Read Only Memory), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0138] The aforementioned computer-readable storage medium may be included in the image switching device; or it may exist independently and not be assembled into the image switching device.
[0139] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the image switching device, cause the image switching device to: respond to an image switching request, acquire the current frame image and the target frame image; acquire the image size of the target frame image; generate a transition frame to be displayed based on the image size, the current frame image, and the target frame image; and complete the image switching based on the transition frame to be displayed.
[0140] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including LAN (Local Area Network) or WAN (Wide Area Network)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0141] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0142] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0143] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for performing the above-described image switching method, thereby solving the technical problem of reducing switching latency while ensuring the quality of the switched image. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the image switching method provided in the above embodiments, and will not be repeated here.
[0144] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the image switching method described above.
[0145] The computer program product provided in this application can solve the technical problem of reducing switching latency while ensuring the quality of the switched image. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the image switching method provided in the above embodiments, and will not be repeated here.
[0146] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. An image switching method, characterized in that, The image switching method includes: Respond to the image switching request and obtain the current frame image and the target frame image; Obtain the image size of the target frame image; A transition frame to be displayed is generated based on the image size, the current frame image, and the target frame image; Image switching is completed based on the transition frame to be displayed.
2. The method as described in claim 1, characterized in that, The step of generating a transition frame to be displayed based on the image size, the current frame image, and the target frame image includes: When the image size is less than or equal to the preset image specification, the current frame image and the target frame image are input into the transition frame generation model to obtain the transition frame to be displayed; When the image size is larger than the preset image specification, the target frame image is divided into blocks, and optical flow estimation is performed on the block-based target frame image based on the current frame image and the target frame image to obtain the transition frame to be displayed.
3. The method as described in claim 2, characterized in that, The step of dividing the target frame image into blocks when the image size is larger than the preset image specification, and performing optical flow estimation on the divided target frame images based on the current frame image and the target frame image to obtain the transition frame to be displayed includes: When the image size is larger than the preset image specification, the block size is determined based on the image size; The target frame image is divided into blocks based on the block size, and an overlapping area of a preset number of pixels is set between adjacent blocks to obtain the block-divided target frame image. Optical flow estimation is performed on the segmented target frame image based on the current frame image and the target frame image to obtain multiple segmented transition frames; The transition frame to be displayed is determined based on the multiple segmented transition frames.
4. The method as described in claim 3, characterized in that, The step of determining the transition frame to be displayed based on the multiple segmented transition frames includes: A complete transition frame is synthesized based on the multiple segmented transition frames; The peak signal-to-noise ratio (PSNR) of the complete transition frame and the target frame image is obtained to obtain the second PSNR. When the second peak signal-to-noise ratio is greater than or equal to a preset qualified threshold, the complete transition frame is determined to be a transition frame to be displayed; When the second peak signal-to-noise ratio is less than a preset qualified threshold, the quality of the complete transition frame is optimized to obtain a second optimized transition frame, and the peak signal-to-noise ratio of the second optimized transition frame and the target frame image is updated to the second peak signal-to-noise ratio. The quality optimization includes at least one of edge enhancement, color space correction and adjustment of the number of optical flow estimation iterations. When the updated second peak signal-to-noise ratio is greater than or equal to the preset qualified threshold, the second optimized transition frame is determined as the transition frame to be displayed.
5. The method as described in claim 2, characterized in that, The transition frame generation model includes an encoder and a generator; The step of inputting the current frame image and the target frame image into a transition frame generation model to obtain a transition frame to be displayed when the image size is less than or equal to a preset image specification includes: When the image size is less than or equal to a preset image specification, the current frame image and the target frame image are input into the encoder to obtain visual features and semantic information; The visual features and semantic information are input into the generator to obtain the initial transition frame; The peak signal-to-noise ratio (PSNR) of the initial transition frame and the target frame image is obtained to obtain the first PSNR. When the first peak signal-to-noise ratio is less than a preset qualified threshold, the initial transition frame is quality optimized to obtain a first optimized transition frame, and the peak signal-to-noise ratio of the first optimized transition frame and the target frame image is updated to the first peak signal-to-noise ratio. The quality optimization includes at least one of edge enhancement, color space correction and generator model parameter adjustment. When the first peak signal-to-noise ratio is greater than or equal to a preset qualified threshold, the first optimized transition frame is determined to be a transition frame to be displayed.
6. The method as described in claim 1, characterized in that, The step of completing the image switching based on the transition frame to be displayed includes: Write the transition frame to be displayed into the back buffer; In response to the vertical synchronization signal, the pointers of the front buffer and the rear buffer are swapped, and the transition frame to be displayed in the front buffer is output to the display device; The image motion trend is predicted based on the optical flow vector information of historical transition frames, and an updated transition frame to be displayed is generated based on the motion trend. Return to the step of writing the transition frame to be displayed into the buffer until the image of the display device is switched to the target frame image, thus completing the image switching.
7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Obtain the color depth of the target frame image; The memory allocation format and preset qualification threshold are determined based on the color depth. The buffer memory and corresponding transition frame generation strategy are determined based on the image size. The transition frames to be displayed are generated based on the memory allocation format, the preset qualified threshold, and the buffer memory storing the transition frame generation strategy.
8. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Get the graphics processor load and device battery level; When the graphics processor load is greater than a preset load or the device battery power is less than a preset battery power, an interpolation strategy is used to generate a transition frame to be displayed. Image switching is completed based on the transition frame to be displayed.
9. An image switching device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the image switching method as described in any one of claims 1 to 8.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the image switching method as described in any one of claims 1 to 8.