Image interpolation methods, apparatus, equipment, media and program products
By dividing the image into blocks during the image interpolation process and selecting the appropriate and transitional interpolation kernels based on texture complexity, the problems of noise amplification and visual abrupt changes in image interpolation in the prior art are solved, and the global balance and visual continuity of the image are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SPREADTRUM COMM (TIANJIN) INC
- Filing Date
- 2026-05-08
- Publication Date
- 2026-07-31
AI Technical Summary
Existing image interpolation techniques struggle to balance noise suppression, detail preservation, and visual continuity across different local regions. Fixed interpolation kernels amplify noise in flat areas and blur details in textured areas, while edge-detection-based interpolation kernels are prone to abrupt changes at region boundaries, affecting the continuity and stability of the image.
The input image is obtained through a preset interactive interface, divided into multiple image blocks, the texture complexity is determined based on pixel information, an appropriate interpolation kernel is selected and a transition interpolation kernel is constructed, and interpolation processing is performed in combination with local texture features to improve the image interpolation quality and fidelity.
It achieves global balance and visual continuity in the image interpolation process, avoids image defects caused by hard switching of interpolation kernels, and improves image clarity and visual experience.
Smart Images

Figure CN122492437A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of digital image processing, and more particularly to an image interpolation method, apparatus, device, medium, and program product. Background Technology
[0002] In image scaling, rotation, and deformation processing, a fixed interpolation kernel or an edge detection-based interpolation kernel switching method is typically used to reconstruct the target pixel.
[0003] However, fixed interpolation kernels are difficult to take into account the image features of different local areas, and tend to amplify noise in flat areas and cause blurring of details in textured areas. The switching method based on edge detection mainly relies on edge criteria, which is not adaptable to complex non-edge textures, and the results are prone to sudden changes when switching directly at the boundary of the region, affecting the continuity and stability of the image.
[0004] Therefore, how to maintain global quality balance and visual continuity during image interpolation has become a technical problem that needs to be solved. Summary of the Invention
[0005] The image interpolation method, apparatus, device, medium, and program products provided in this application are intended to solve the aforementioned technical problems. This solution addresses interpolation scenarios involving scaling, rotation, and deformation of images. Instead of relying solely on a single fixed interpolation strategy or simple edge criteria, it combines the textural feature differences of local image regions, employing interpolation processing that matches the features of different regions, while also ensuring smooth transitions between regions. This enhances the adaptability of the image interpolation process to complex content.
[0006] In a first aspect, this application provides an image interpolation method, including:
[0007] The input image to be processed is obtained through a preset interactive interface;
[0008] Based on the input image, determine the corresponding multiple image blocks;
[0009] For each image block, determine the corresponding multiple pixel information;
[0010] The texture complexity of each image block is determined based on the information of each pixel.
[0011] Based on the texture complexity and preset threshold of each image block, determine multiple corresponding comparison results, and based on each comparison result, determine the adaptation interpolation kernel of each image block;
[0012] Based on each texture complexity and each adaptation interpolation kernel, determine the corresponding transition interpolation kernel;
[0013] Based on each of the adaptive interpolation kernels and each of the transition interpolation kernels, a radiometric transformation is performed on the input image to obtain the interpolated image;
[0014] The interpolated image is output through the preset interactive interface.
[0015] Secondly, this application provides an image interpolation apparatus, comprising:
[0016] The acquisition module is used to acquire the input image to be processed through a preset interactive interface;
[0017] The segmentation module is used to determine multiple corresponding image blocks based on the input image;
[0018] The first determining module is used to determine the corresponding multiple pixel information based on each image block;
[0019] The second determining module is used to determine the texture complexity of each image block based on the information of each pixel;
[0020] The first processing module is used to determine multiple corresponding comparison results based on the texture complexity and preset threshold of each image block, and to determine the appropriate interpolation kernel for each image block based on each comparison result.
[0021] The second processing module is used to determine the corresponding transition interpolation kernel based on each texture complexity and each adaptation interpolation kernel;
[0022] The third processing module is used to perform radiative transformation processing on the input image according to each adaptive interpolation kernel and each transition interpolation kernel to obtain the interpolated image;
[0023] The output module is used to output the interpolated image through a preset interactive interface.
[0024] Thirdly, this application provides an image interpolation device, including: a memory and a processor;
[0025] The memory stores instructions that the computer executes;
[0026] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0027] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible embodiments of the first aspect.
[0028] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0029] This application provides an image interpolation method, apparatus, device, medium, and program product. It acquires an input image through a preset interactive interface, quickly identifying the object to be processed and laying the foundation for subsequent processing. Dividing the input image into multiple image blocks enables localized fine-grained processing. Determining texture complexity based on the pixel information of the image blocks accurately quantifies local image features. Selecting an appropriate interpolation kernel by combining texture complexity and a preset threshold allows the interpolation method to match the characteristics of the image region. Determining a transition interpolation kernel based on texture complexity and the appropriate interpolation kernel avoids image defects caused by hard switching of interpolation kernels. Performing affine transformation using the appropriate and transition interpolation kernels improves the image interpolation quality and fidelity. Outputting the interpolated image through the preset interactive interface facilitates intuitive acquisition of processing results. Overall, it achieves the technical effect of ensuring global balance and visual continuity of the interpolated image. Attached Figure Description
[0030] 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.
[0031] Figure 1 This application provides a schematic diagram of an application data processing system architecture.
[0032] Figure 2 A flowchart illustrating the image interpolation method provided in this application embodiment. Figure 1 ;
[0033] Figure 3 A flowchart illustrating the image interpolation method provided in this application embodiment. Figure 2 ;
[0034] Figure 4 A flowchart illustrating the image interpolation method provided in this application embodiment. Figure 3 ;
[0035] Figure 5 A flowchart illustrating the image interpolation method provided in this application embodiment. Figure 4 ;
[0036] Figure 6 This is a schematic diagram of the structure of the image interpolation device provided in the embodiments of this application;
[0037] Figure 7 This is a schematic diagram of the structure of the image interpolation device provided in an embodiment of this application.
[0038] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0039] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0040] Image interpolation technology belongs to the fields of digital image processing and computer vision, and is widely used in scenarios such as image scaling, rotation, affine transformation, deformation correction, and video reconstruction. In mobile terminals, smart display devices, video processing terminals, and image signal processing chips, image interpolation is usually an important basic module for image resampling and image quality enhancement. Its processing results directly affect the clarity, edge stability, and overall visual experience of the magnified image.
[0041] Existing image interpolation schemes typically use a fixed interpolation kernel or a switching mechanism based on edge detection to reconstruct target pixels.
[0042] Fixed interpolation kernels, such as bilinear, bicubic, or similar methods, typically estimate the new pixel value directly based on a predefined weight relationship between surrounding neighboring pixels. Another type of method switches between different interpolation kernels for different regions through edge detection, gradient judgment, or local feature thresholding, attempting to preserve more details at the edges.
[0043] However, existing solutions often rely on local single-point or small-scale gradients as the basis for judgment, lacking the ability to comprehensively analyze the overall statistical characteristics of image patches. They also lack mechanisms for continuous transitions based on changes in texture complexity. Therefore, in low-light, high-noise, low-resolution, or complex texture mixed scenes, the processing results often fail to simultaneously achieve noise suppression, detail preservation, and visual coherence. Furthermore, fixed threshold settings are not adaptable to different image content and shooting conditions, easily leading to overly conservative or aggressive interpolation kernel selection, further amplifying image quality fluctuations and affecting the stability and readability of the final output image.
[0044] Therefore, how to maintain global quality balance and visual continuity during image interpolation has become an urgent technical problem to be solved.
[0045] To address the problems in existing technologies, this application provides an image interpolation method. It acquires the input image through a pre-defined interactive interface, quickly identifying the object to be processed and laying the foundation for subsequent processing. Dividing the input image into multiple image blocks enables localized fine-grained processing. Determining texture complexity based on the pixel information of the image blocks accurately quantifies local image features. Combining texture complexity with a pre-defined threshold to select a suitable interpolation kernel allows the interpolation method to match the characteristics of the image region. Determining a transition interpolation kernel based on texture complexity and the suitable interpolation kernel avoids image artifacts caused by hard switching of interpolation kernels. Performing an affine transformation using the suitable and transition interpolation kernels improves the image interpolation quality and fidelity. Outputting the interpolated image through the pre-defined interactive interface facilitates intuitive acquisition of processing results. Overall, this method ensures global balance and visual continuity of the interpolated image.
[0046] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0047] Figure 1 This is a schematic diagram of an application data processing system architecture provided in an embodiment of this application. The application data processing system is a computer device. Figure 1 As shown, the above architecture includes at least one of a data acquisition device 101, a processing device 102, and a display device 103.
[0048] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the architecture of the application data processing system. In other feasible embodiments of this application, the above architecture may include more or fewer components than illustrated, or combine some components, or split some components, or arrange different components, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown can be implemented in hardware, software, or a combination of both.
[0049] In the specific implementation process, the data acquisition device 101 may include an input / output interface or a communication interface, and the data acquisition device 101 can be connected to the processing device through the input / output interface or the communication interface.
[0050] The processing device 102 can first acquire the input image through a preset interactive interface, then split the image into multiple image blocks, calculate the texture complexity based on the pixel information of each image block, then match and adapt the interpolation kernel according to the texture complexity and a preset threshold, and at the same time generate a transition interpolation kernel based on the texture complexity. Then, the image is subjected to an affine transformation using the two types of interpolation kernels to obtain the interpolated image, and finally output the result through the interactive interface. Throughout the process, the interpolation kernel is dynamically selected and smoothly switched based on the local texture features of the image, so that the appropriate interpolation processing can be achieved in different image regions.
[0051] The display device 103 can also be a touch screen or the screen of a terminal device, used to receive user commands while displaying the above-mentioned content, so as to realize interaction with the user.
[0052] It should be understood that the aforementioned processing device can be implemented by a processor reading instructions from memory and executing those instructions, or it can be implemented by a chip circuit.
[0053] Furthermore, the network architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0054] Figure 2 A flowchart illustrating the image interpolation method provided in this application embodiment. Figure 1 ,like Figure 2 As shown, this embodiment provides an image interpolation method, including:
[0055] S201. Obtain the input image to be processed through the preset interactive interface.
[0056] In this embodiment, the preset interactive interface can be an image access interface set in a terminal device, image processing software, embedded display system, image signal processing platform, or server management page, used to receive raw image data, image stream data, or decoded frame image data to be interpolated. The input image refers to a digital image that needs to be enlarged, scaled, rotated, mapped, or otherwise resampled. Its data format can be a grayscale image, a red-green-blue (RGB) color image, a YUV color space image, or a multi-channel image including a transparency channel.
[0057] In specific implementation, the executing entity can be a processing device consisting of a general-purpose processor, a digital signal processor, an image processing chip, a graphics processor, or a combination thereof.
[0058] For example, in mobile terminal scenarios, users can import images to be processed into the system through file selection windows, album interfaces, camera capture interfaces, or video stream access interfaces; in industrial vision or medical imaging scenarios, input images can also be automatically transmitted to the interactive interface via acquisition cards, sensor interfaces, network communication modules, or local cache modules.
[0059] In one possible embodiment, after receiving the input image, the interactive interface first checks the image's resolution, color format, bit depth, storage order, and image integrity. If the input image is in a compressed encoding format, it is first restored to a pixel matrix through a preset decoding module and then written to the image buffer for subsequent processing modules to use. If the input image is a single frame image from a video sequence, the system can establish a processing task index based on the frame number so that the interpolation result maintains a correspondence with the original data.
[0060] Furthermore, to ensure the accuracy of subsequent texture analysis based on image patches, basic preprocessing can be performed after acquiring the input image. This preprocessing can include operations such as color space conversion, brightness normalization, bad pixel correction, boundary compensation, and preliminary noise estimation.
[0061] For example, for color images, RGB images can be converted into a representation with separate luminance and chrominance components, so that texture complexity is mainly calculated based on luminance information, thereby reducing the interference of color fluctuations on complexity judgment;
[0062] For grayscale images, the single-channel pixel matrix can be directly used as the object of subsequent analysis. In one possible implementation, the interactive interface also receives target radiometric transformation parameters, including scaling factor, rotation angle, translation vector, shearing coefficient, or transformation matrix, thereby matching the image interpolation process with the target space mapping relationship. Radiometric transformation refers to a linear mapping and translation combination process of image coordinates from the original coordinate system to the target coordinate system, commonly used in scenarios such as image scaling, rotation, affine registration, and deformation correction.
[0063] By establishing the correlation between image data and transformation parameters simultaneously during the image access phase, the subsequent interpolation kernel selection can not only adaptively process local image content but also coordinate with the target resampling location, thereby improving the executability and consistency of the entire processing chain.
[0064] Based on the above analysis, this step completes the construction of the entry point for the image processing task, the standardization of basic data, and the initialization of subsequent processing conditions, providing a unified and stable data foundation for subsequent image block division, pixel feature extraction, and adaptive interpolation kernel configuration.
[0065] S202. Based on the input image, determine the corresponding multiple image blocks.
[0066] In this embodiment, an image block refers to several local regions obtained by decomposing the input image according to a preset spatial division rule. Each image block contains a set of adjacent pixels, which are used to statistically analyze the image structure features and perform interpolation strategy matching within a local area.
[0067] The purpose of image patch segmentation is to transform the global processing problem of the entire image into a local analysis problem, so that different regions can use different interpolation kernels according to their own texture, flatness and edge changes, thereby avoiding the loss of detail and noise diffusion caused by a single fixed interpolation method in the integrated processing of the entire image.
[0068] In practical implementation, the input image can be divided according to a fixed-size window, such as dividing the image into rectangular blocks with side lengths of 4 pixels, 8 pixels, 16 pixels, or other sizes. Alternatively, the image block size can be dynamically determined based on the image resolution, scaling factor, and hardware processing capabilities. When the image scaling factor is large, smaller image blocks can be used to improve local adaptability; when the system emphasizes real-time processing, larger image blocks can be used to reduce statistical and decision-making overhead.
[0069] In one possible implementation, determining multiple corresponding image blocks based on the input image includes: determining the overall pixel size based on the input image; and dividing the input image into multiple non-overlapping image blocks based on a preset pixel specification and the overall pixel size.
[0070] In this embodiment, the overall pixel size is used to characterize the pixel distribution range of the input image in the horizontal and vertical directions, and can typically be represented as width and height, or as the corresponding pixel matrix size. In actual processing, the overall pixel size can be obtained by reading the image file header information, parsing image metadata, or directly obtaining the number of rows and columns of the image cache array, in order to provide a boundary basis for subsequent block segmentation. Preset pixel specifications are used to limit the size parameters of a single image block. Size parameters can include the width and height of the block, the number of pixels within the block, or the block arrangement, enabling each image block to be segmented according to a uniform rule.
[0071] Specifically, after determining the overall pixel size, the input image is divided into regions according to a preset pixel specification, spatially segmenting the image into multiple independent block regions. By segmenting the input image into non-overlapping image blocks, each pixel belongs to only one image block, thus avoiding redundant calculations or boundary aliasing during texture statistics. In scenarios requiring improved texture analysis continuity, overlapping windows (such as 2-pixel or 4-pixel overlap) can be further employed, allowing adjacent image blocks to share some pixel regions, thereby enhancing the smoothness of local feature statistics. If the overall pixel size of the input image cannot be divided evenly by the preset pixel specification, segmentation can be achieved by setting padding regions at image edges, correcting the size of end blocks, or adaptively adjusting block boundaries based on remaining pixels, ensuring that all pixels are covered.
[0072] Using the above method, the input image can be stably divided into multiple non-overlapping image blocks. Each image block has a clear spatial range and pixel affiliation, providing a foundation for subsequent extraction of multiple pixel information and calculation of texture complexity based on image blocks. Because the block boundaries are clear, the local texture features within each image block can be independently statistically analyzed, thereby improving the accuracy of interpolation kernel selection and transition interpolation kernel determination, reducing redundant analysis and visual abrupt changes at region boundaries, and resulting in better overall performance in detail preservation, noise suppression, and image continuity in the final interpolation result.
[0073] In one possible embodiment, to reduce the boundary discontinuity caused by independent analysis between adjacent image blocks, the image block division can adopt an overlapping window method, that is, adjacent image blocks share some pixel areas in space.
[0074] For example, when using 8×8 pixels as the basic block, an overlap band of 2 or 4 pixels can be set to make the statistics of texture complexity smoother and provide continuous local feature support for the construction of subsequent transition interpolation kernels.
[0075] In another implementation, the system can also perform adaptive block segmentation based on image content. For example, it can first determine candidate regions based on brightness gradient, local variance, or edge distribution, and then use larger image blocks in flat areas and smaller image blocks in texture-dense areas to balance computational efficiency and texture responsiveness.
[0076] It should be noted that the image patch here is not limited to a strictly regular rectangular region. In the exemplary implementation, it can also be a local neighborhood window constructed with the target sampling point as the center, or an approximately textured consistent region formed by superpixel clustering, as long as it can be used to extract local pixel information and support subsequent texture complexity calculation.
[0077] Optionally, in order to ensure that subsequent processing can correctly locate the mapping relationship between each image block and the original image coordinates, after determining the corresponding multiple image blocks, the following is also included: establishing block index information, start coordinates, end coordinates, center coordinates and adjacency relationship information for each image block.
[0078] In this embodiment, the block index can be used for subsequent fast access to the pixel data of the corresponding image block, and the adjacency information can be used to determine the inter-block transition strategy within the threshold neighborhood.
[0079] For example, when the texture complexity of an image patch is close to a threshold, and its neighboring image patches have been identified as another type of interpolation kernel, the system can combine inter-block adjacency information to calculate a smoother transition interpolation kernel, thereby avoiding overly abrupt region switching.
[0080] Based on the above analysis, it can be seen that this step, by structuring the input image into multiple local image patches that can be analyzed independently but are interconnected, establishes local processing units for subsequent pixel-level statistics, complexity analysis, and adaptive interpolation kernel configuration. This effectively enhances the interpolation method's ability to distinguish between flat regions, edge regions, and complex texture regions, and is an important foundation for solving the problem of insufficient adaptability of traditional unified interpolation kernels.
[0081] S203. Determine the corresponding multiple pixel information for each image block.
[0082] In this embodiment, pixel information refers to numerical information that can characterize the pixel distribution state, grayscale variation state, color variation state, spatial structure relationship, and local statistical characteristics within an image block. Pixel information can be the original pixel value itself, or derived feature parameters calculated from the original value, such as grayscale mean, variance, local gradient magnitude, orientation distribution, Laplacian response, local contrast, neighborhood correlation, energy characteristics, entropy value, or high-frequency component intensity, etc.
[0083] By extracting information from multiple pixels, the system can more completely characterize whether the area inside an image patch is a flat background, regular edges, complex texture, or noise-dominated region. This allows subsequent texture complexity calculations to be more than limited to a single gradient criterion, improving the accuracy of judgment in complex scenes.
[0084] In practice, for each image block, the brightness value matrix of all pixels in the block can be read first, and basic statistics can be calculated based on this. For example, the pixel average value is used to reflect the overall brightness level of the block, the variance is used to characterize the gray-level dispersion within the block, and the difference between the maximum and minimum values is used to reflect the local contrast range.
[0085] In further implementation, to enable pixel information to better distinguish between real texture and noise, this step can employ a multi-level extraction strategy:
[0086] On the one hand, the horizontal, vertical and diagonal gradients within the image patch are calculated in the spatial domain, and the gradient magnitude and direction histogram are obtained to identify whether there are obvious structural changes within the patch. On the other hand, discrete cosine transform, wavelet decomposition or other local frequency analysis are performed on the image patch in the frequency domain or transform domain to statistically determine the energy proportion of mid-to-high frequency components, thereby judging the density of details within the patch.
[0087] If an image patch has high high-frequency energy and a relatively dispersed gradient direction distribution, it usually indicates that the region contains complex texture; if the high-frequency energy is low and the overall variance is small, it can usually be regarded as a flat region; if the local gradient is concentrated in a single direction and the intensity is obvious, it may correspond to an edge region.
[0088] To further suppress the adverse effects of noise on subsequent complexity calculations, the noise estimation results can be combined to restrict isolated spikes, abnormal bright spots, or random high-frequency components.
[0089] For example, median filtering can be used to help estimate the noise level, and then noise compensation can be applied to the gradient statistics to avoid misidentifying noise as texture in low-light, high-noise images.
[0090] In one possible embodiment, the pixel information also includes the boundary pixel differences between an image block and its neighboring blocks, used to characterize the trend of continuous change between regions.
[0091] By introducing inter-block boundary statistics, neighborhood context information can be used when constructing the transition interpolation kernel, rather than relying solely on features within a single block, thus making the switching of interpolation strategies smoother.
[0092] For color images, pixel information can be extracted in the luminance channel while the intensity of color changes is recorded in the chrominance channel to prevent color diffusion at high-saturation color boundaries during interpolation.
[0093] Based on the above analysis, this step extracts pixel information from multiple levels within and between image blocks, enabling subsequent texture complexity calculations to be based on richer local statistics. This provides sufficient data support for accurately selecting the appropriate interpolation kernel and constructing a continuous transition mechanism.
[0094] S204. Determine the texture complexity of each image block based on the information of each pixel.
[0095] In this embodiment, texture complexity is used to quantitatively characterize the gray-level fluctuations, structural changes, texture detail density, and local irregularities within an image patch. It can be understood as a comprehensive indicator reflecting the complexity of the image patch content. Texture complexity is not a single pixel value, but a statistical quantity obtained by fusing information from multiple pixels. The larger the value, the richer the details, the more frequent the pixel changes, or the more complex the texture structure of the image patch; the smaller the value, the flatter the image patch, the slower the changes, or the presence of only low-intensity noise.
[0096] Optionally, in order to make the texture complexity better distinguish between different types of image content, multiple pixel information can be normalized and then combined according to preset weights.
[0097] For example, local variance, average gradient magnitude, high-frequency energy proportion, and directional entropy can be mapped to a unified numerical range, and then weighted and summed according to the contribution of each feature to texture recognition to obtain the texture complexity value of the image patch.
[0098] For example, texture complexity can be expressed as “complexity = α × normalized variance + β × normalized gradient energy + γ × normalized high frequency weight + δ × directional entropy”.
[0099] Among them, α, β, γ, and δ are non-negative weighting coefficients used to balance the impact of different pixel information on the final complexity.
[0100] In the above formula, normalized variance is used to characterize the degree of brightness dispersion within the block, normalized gradient energy is used to reflect the strength of pixel changes, normalized high-frequency weight is used to depict the frequency components of details and textures, and directional entropy is used to describe the complexity of texture direction distribution.
[0101] When the image patch is mainly composed of regular edges, the gradient energy is high while the orientation entropy is low; when the image patch contains complex details such as grass, fabric, and building textures, the high frequency ratio and orientation entropy are usually both high; when the image patch is in a flat background area, all of the above indicators are at a low level.
[0102] By using multiple metrics in combination, misjudgments of a single feature in specific scenarios can be reduced. For example, noise may also increase variance, but its directional entropy and neighborhood correlation often differ from those of real textures. Therefore, a comprehensive set of metrics is more conducive to improving the robustness of complexity calculations.
[0103] In one possible implementation, the complexity value can also be corrected by incorporating a noise compensation term, for example, by subtracting the estimated noise baseline from the variance or high-frequency energy, to suppress the artificially high impact of random noise on the complexity.
[0104] To ensure the comparability of complexity values under different images, exposure conditions, and resolutions, this step can also perform full-image range normalization or local adaptive normalization on the complexity results of image patches.
[0105] For example, the complexity can be compressed to between 0 and 1 based on the maximum, minimum, or quantile distribution of the complexity of all image blocks in the entire image, or mapped to a preset integer range, so that it can be compared with a preset threshold later.
[0106] In another implementation, a sliding statistics approach can be used to dynamically adjust the complexity level of the current image block based on the complexity distribution within a local area of the image, thereby adapting to image scenarios with large brightness variations and significant differences in local content.
[0107] Optionally, to improve the accuracy of texture complexity assessment, multi-scale texture features can be further combined for fusion analysis. For example, high-frequency detail features (such as edges and textures) and low-frequency smoothing features (such as gradient regions) of image patches can be extracted through wavelet transform or multi-directional gradient histograms. Then, the high-frequency and low-frequency features are weighted and fused using preset weights to generate a more comprehensive texture complexity index. This multi-scale fusion strategy can avoid misjudging complex textures by single-scale features. For example, in gradient edge regions, high-frequency features can capture subtle changes, while low-frequency features can suppress noise interference, thus more accurately judging the texture complexity of image patches.
[0108] Optionally, to adapt to image characteristics in different scenarios, a dynamic threshold adjustment mechanism can be further introduced. For example, the texture complexity threshold can be dynamically adjusted based on the overall statistical characteristics of the input image (such as global mean squared error distribution and brightness range). In low-resolution images, the threshold can be appropriately lowered to retain more details; in high-noise images, the threshold can be increased to suppress noise propagation. This dynamic adjustment logic optimizes the benchmark for local texture judgment by analyzing the overall characteristics of the image, thereby improving the adaptability and robustness of the interpolation kernel selection strategy in diverse scenarios.
[0109] Based on the above analysis, this step, by fusing and modeling multi-source pixel information, forms a quantitative index that can reflect the local texture state of image blocks. This transforms the interpolation kernel selection from relying on empirical single edge judgment to relying on comprehensive discrimination based on local statistical features. This not only improves the differentiation accuracy of flat areas, edge areas and complex texture areas, but also provides continuous numerical basis for subsequent threshold comparison and transition interpolation kernel generation.
[0110] S205. Based on the texture complexity of each image block and the preset threshold, determine the corresponding multiple comparison results, and based on each comparison result, determine the adaptation interpolation kernel for each image block.
[0111] In this embodiment, a preset threshold is used to establish a mapping relationship between the texture complexity of an image patch and the interpolation strategy. This threshold can be a single threshold or multiple hierarchical thresholds. The comparison result refers to the classification information obtained by comparing the texture complexity of an image patch with the preset threshold, such as complexity below the threshold, close to the threshold, above the threshold, or falling within a certain complexity range. The adapted interpolation kernel refers to the set of interpolation functions, weighting models, or sampling kernel parameters selected based on the texture complexity category of the image patch for reconstructing the target pixels of that image patch. The interpolation kernel can be understood as a mathematical tool used to weight the original pixels in the neighborhood when calculating the pixel value to be generated. Different interpolation kernels correspond to different smoothing capabilities, edge preservation capabilities, and texture response capabilities.
[0112] In practice, when the texture complexity of an image patch is below a preset threshold, the region can be determined to be either a flat region or a region with weak texture. In flat regions with texture complexity below the preset threshold (low mean square error), a low-sharpening interpolation kernel (such as bilinear interpolation) is selected to suppress noise propagation through its high smoothness characteristics. For example, in flat regions, pixel values are concentrated and the mean square error is low. The low-sharpening interpolation kernel can reduce the amplification effect of random noise through linear weighting of local pixels, thereby avoiding artifacts introduced into flat regions due to interpolation operations.
[0113] When the texture complexity of an image patch is significantly higher than a preset threshold, the region can be identified as a region with rich details or a complex texture region. It is suitable to use an interpolation kernel that has a strong ability to preserve local high-frequency details, such as a bicubic kernel, an edge-enhancing kernel, or a kernel function with directional response characteristics.
[0114] In one possible embodiment, the preset threshold is not a fixed constant, but is set in combination with the global complexity distribution of the input image, noise level, target scaling factor, and application scenario.
[0115] For example, in high-noise environments, the threshold can be appropriately increased to reduce the misjudgment of noise-dominant areas as complex texture areas, thus preventing the incorrect use of sharpening interpolation kernels; in high-definition magnification scenarios, the threshold can be adjusted in conjunction with high-frequency fidelity requirements to improve the ability to reconstruct detailed areas.
[0116] In the multi-threshold implementation, low-complexity thresholds and high-complexity thresholds can be set. Image blocks below the low threshold use a smooth interpolation kernel, while image blocks above the high threshold use a detail-preserving interpolation kernel. Image blocks located between the two thresholds enter the transition decision region, providing conditions for the construction of subsequent transition interpolation kernels.
[0117] The adaptation interpolation kernel can be implemented as a discrete kernel template pre-stored in an interpolation kernel library, or as kernel weights generated in real time through parameterized functions. For example, different kernel widths, center weights, or negative lobe intensities can be configured for different complexity levels, thereby achieving a balance between fuzziness suppression and ringing control.
[0118] Optionally, to enable the adaptation interpolation kernel to work collaboratively with subsequent affine transformation processing, this step can also combine the adaptation interpolation kernel of the image block with the sub-pixel offset of the target sampling position, pre-generating a kernel parameter table for the image block under different sampling phases. In this way, when performing affine mapping, the system only needs to inversely calculate the source image coordinates based on the target coordinates and look up the corresponding kernel weights in the table, thus improving processing efficiency.
[0119] Based on the above analysis, by comparing texture complexity with a preset threshold and outputting a clear comparison result, image patches can obtain an appropriate interpolation kernel that matches their local content features. This avoids the problems of traditional fixed interpolation kernels amplifying noise in flat areas and over-smoothing in complex texture areas. Furthermore, since the comparison result establishes a regular mapping between complexity values and kernel selection, a smooth transition mechanism can be further constructed around the threshold neighborhood to reduce the risk of visual layering and false contours caused by directly switching between different interpolation kernels.
[0120] S206. Determine the corresponding transition interpolation kernel based on each texture complexity and each adaptation interpolation kernel.
[0121] In this embodiment, a transitional interpolation kernel is used to construct a continuous kernel function between different adapted interpolation kernels when the texture complexity of an image patch is close to a threshold or when there are differences in the adapted interpolation kernels of adjacent image patches. This avoids abrupt changes in the interpolation strategy at region boundaries. The essence of the transitional interpolation kernel is to establish a continuous relationship between two or more types of interpolation kernels, allowing the kernel weights to be smoothly adjusted as texture complexity changes, rather than discretely switching at the threshold. Thus, when the complexity of an image patch is near the threshold, even if it is assigned to a certain category, the introduction of a transitional kernel can still absorb some characteristics of neighboring category interpolation kernels, thereby improving the visual continuity at the boundaries of image regions.
[0122] In practice, the mixing coefficient can be determined based on the distance between the texture complexity of the image patch and the threshold. Then, based on the mixing coefficient, the two types of adaptation interpolation kernels can be linearly combined, nonlinearly combined, or parametrically interpolated to generate the transition interpolation kernel corresponding to the image patch.
[0123] For example, when the complexity value is denoted as C, the threshold as T, and the transition bandwidth as Δ, if the following conditions are met:
[0124]
[0125] This indicates that the image patch is located in the threshold neighborhood, at which point a mixing factor can be constructed:
[0126]
[0127] Alternatively, an equivalent normalized weight expression can be used to obtain the transition interpolation kernel in the manner of "transition kernel = λ × high complexity kernel + (1 - λ) × low complexity kernel".
[0128] In the above formula, the mixing factor λ is used to indicate which complexity state the current image patch is closer to.
[0129] When λ approaches 0, the transition kernel is closer to the smooth interpolation kernel;
[0130] When λ approaches 1, the transition kernel is closer to the detail-preserving interpolation kernel;
[0131] When λ is in the middle value, it means that the image patch has both certain texture and certain smoothness attributes. At this time, kernel mixing can obtain a more natural interpolation result.
[0132] Alternatively, to avoid weight imbalance caused by simple linear mixing in certain scenarios, sigmoid functions, exponential functions, or piecewise continuous functions can be used to generate mixing factors, making the transition process smoother in the threshold center region and more quickly approaching the corresponding fitting kernel when far from the threshold.
[0133] In addition, the transition interpolation kernel can also be determined by combining the complexity differences between adjacent image blocks and the appropriate interpolation kernel category.
[0134] For example, if the complexity of the current image block is not within the threshold neighborhood, but there is a significant difference in kernel category between it and its neighboring blocks, a boundary transition kernel can be locally enabled in the block boundary band to reduce abrupt changes at block edges. In this way, the transition interpolation kernel not only considers the complexity value of a single block, but also takes into account the spatial neighborhood context, thereby further enhancing the continuity of the image.
[0135] In one possible embodiment, the transition bandwidth It can be set as an adaptive parameter related to the overall complexity distribution of the image.
[0136] When the image content changes gradually, a smaller transition bandwidth can be set to maintain a high kernel classification discrimination. When the image contains a large number of mixed textures, noise superimposed textures, or complex scene boundaries, the transition bandwidth can be appropriately increased to enable more critical regions to adopt a continuous transition strategy.
[0137] Based on the above analysis, this step, by establishing a continuous mapping relationship between texture complexity and the interpolation kernel, essentially solves the problem of traditional threshold-switching-based interpolation methods easily producing a sense of layering, false contours, and visual discontinuities at region boundaries. Because the transitional interpolation kernel integrates the noise suppression characteristics of flat regions with the detail preservation characteristics of textured regions as needed, it can provide more stable reconstruction results in regions where local content changes are unclear or complexity fluctuates critically, thus improving the overall naturalness and robustness of the interpolated image.
[0138] S207. Perform radiative transformation on the input image according to each adaptive interpolation kernel and each transition interpolation kernel to obtain the interpolated image.
[0139] In this embodiment, radial transformation processing refers to the process of mapping the original pixel coordinates in the input image to the target image coordinate system according to a preset geometric transformation relationship, and calculating the target pixel value at non-integer coordinate positions using an adaptive interpolation kernel or a transition interpolation kernel. The radial transformation here can include scaling, rotation, translation, shearing, and combinations of the above transformations, and can generally be represented by a two-dimensional transformation matrix and a displacement vector.
[0140] In practical calculations, the reverse mapping method is usually adopted. That is, for each target pixel position in the target image, the corresponding real coordinates in the source image are obtained by reverse transformation matrix. Then, neighboring pixels are selected around the real coordinates, and weighted summation is performed according to the adaptation interpolation kernel and the transition interpolation kernel corresponding to the image block to reconstruct the target pixel value, thereby obtaining the interpolated image.
[0141] Specifically, when the source coordinates of the target sampling point are mapped to the inside of an image patch and the image patch is far from the threshold neighborhood, the adaptation interpolation kernel of the image patch can be used directly for interpolation; when the target sampling point is located in the region corresponding to the complexity threshold neighborhood, or is located near the kernel switching boundary of adjacent image patches, the pre-generated transition interpolation kernel is called to achieve smooth reconstruction.
[0142] In one possible embodiment, to improve computational efficiency, a lookup table from the target pixel to the source coordinate can be established first based on the radiometric transformation parameters, and then the corresponding kernel parameters can be quickly called based on the image block index to which the source coordinate belongs.
[0143] If a parametric kernel model is used, the system can calculate weights in real time based on sub-pixel offsets and kernel type during the interpolation stage; if a discrete kernel template is used, the weight coefficients can be directly read from the kernel cache. For each target pixel, the interpolation calculation can be expressed as a weighted sum of its neighboring pixel values and kernel weights, where the kernel weights are given by the adaptive interpolation kernel or the transition interpolation kernel.
[0144] Optionally, to ensure the numerical stability of the output brightness and color, the weighted results can be normalized, truncated, and converted in data format. For example, the floating-point calculation results can be limited to a preset pixel range before being written to the target image buffer. For color images, the adaptive interpolation processing described in this embodiment can be used for the brightness component, while the chrominance component can use an interpolation strategy that is consistent with or smoother than the brightness, in order to balance visual clarity and computational complexity.
[0145] At the hardware implementation level, this step can be executed serially by the Central Processing Unit (CPU), or multiple target pixels can be processed in parallel by the Graphics Processing Unit (GPU). Block-level core selection units and interpolation units can also be designed in the image processing chip to meet the needs of high-resolution real-time applications.
[0146] Based on the above analysis, it can be seen that a uniform and unchanging fixed interpolation kernel is no longer used during the geometric mapping process. Instead, an appropriate interpolation kernel is selected based on the texture complexity of the local image patch, and a transitional interpolation kernel is introduced in the critical region to participate in pixel reconstruction. In this way, in flat background areas, the interpolation process can reduce meaningless high-frequency diffusion and weaken the phenomenon of noise and graininess being amplified; in edge and complex texture areas, the interpolation process can maintain higher local structural clarity and reduce edge blurring and detail loss; at the boundary of regions, due to the presence of the transitional interpolation kernel, the target pixel value will be continuously adjusted with changes in spatial position and complexity, thereby reducing false contours, layer breaks, and visual abrupt changes.
[0147] S208. Output the interpolated image through the preset interactive interface.
[0148] In practice, the system can provide a before-and-after image comparison display window in a preset interactive interface, allowing users or upper-level business modules to view the clarity, edge continuity, and texture performance of the interpolation results. Alternatively, the interpolated image can be encoded into a specified format and written to a storage medium, or transmitted via a network interface to a display terminal, video processing link, industrial inspection system, or medical imaging workstation. For video streaming scenarios, this step can also send the interpolated image as the current output frame to the display buffer queue to ensure continuous real-time playback.
[0149] This application provides an image interpolation method that acquires an input image through a preset interactive interface, quickly identifying the object to be processed and laying the foundation for subsequent processing. Dividing the input image into multiple image blocks enables localized fine-grained processing. Determining texture complexity based on the pixel information of the image blocks allows for precise quantification of local image features. Selecting an appropriate interpolation kernel by combining texture complexity and a preset threshold ensures the interpolation method matches the characteristics of the image region. Determining a transition interpolation kernel based on texture complexity and the appropriate interpolation kernel avoids image artifacts caused by hard switching of interpolation kernels. Performing an affine transformation using the appropriate and transition interpolation kernels improves the image interpolation quality and fidelity. Outputting the interpolated image through the preset interactive interface facilitates intuitive acquisition of processing results. Overall, this method achieves the technical effect of ensuring global balance and visual continuity of the interpolated image.
[0150] Figure 3 A flowchart illustrating the image interpolation method provided in this application embodiment. Figure 2 ,like Figure 3 As shown, this embodiment, based on the above embodiments, provides a detailed explanation of two processes for determining the texture complexity of image patches, including:
[0151] S301. Determine multiple corresponding pixel values based on the pixel information of each image block.
[0152] In this embodiment, each image block corresponds to a pixel value. The pixel value is used to characterize the statistical characteristics of the pixel set within the image block, and it can be the grayscale mean, brightness mean, color channel mean, or a scalar value mapped from the pixel set.
[0153] In the specific implementation, after the input image is divided into multiple image blocks, the pixel information of each image block is extracted, and a pixel value is calculated based on all pixels within that image block. This pixel value can be obtained by summing the gray levels of the pixels within the image block and then taking the average, or by averaging the values of each color channel in a color image and then fusing them, or by converting to a luminance space and extracting luminance statistics. To facilitate a uniform representation of the characteristics of each region during interpolation processing, the pixel value is usually output in scalar form.
[0154] S302. Based on each pixel value, determine the corresponding multiple mean squared error values, and use each mean squared error value as the texture complexity of each image block.
[0155] In this embodiment, the mean squared error is used to reflect the degree of dispersion of pixel values around the statistical center, and can quantify the texture undulation, detail density and local fluctuation amplitude within the image patch.
[0156] By directly using the mean squared error (MSE) value as the texture complexity, the complexity value maintains a correspondence with the richness of the texture in the region; a larger value indicates a more complex texture, while a smaller value indicates a flatter region. By calculating the MSE of the pixel values for each image patch as a texture complexity indicator and normalizing it in conjunction with the pixel range of the image patch, it is possible to effectively distinguish between flat regions (low MSE) and textured regions (high MSE). For example, in low-resolution images, MSE normalization can avoid misjudgments of texture complexity due to the small pixel range.
[0157] For example, based on the pixel values obtained above, the discreteness of the pixel distribution within the image block is calculated. The square of the difference between each pixel and its value is statistically analyzed, and the mean or equivalent variance of the statistical results is calculated to obtain the corresponding mean squared error value. This mean squared error value, output as the texture complexity of the image block, can be directly used for subsequent threshold comparisons and interpolation kernel selection.
[0158] It should be noted that if input images with different resolutions or color spaces are used, the statistical method of pixel values can also be adjusted to adapt to different image content. This application does not limit this.
[0159] S303. Based on the pixel information of each image block, determine the amount of pixel value change between adjacent pixels.
[0160] In this embodiment, the change in pixel value between adjacent pixels is used to characterize the magnitude of change in grayscale or color between adjacent sampling points within an image block.
[0161] For example, the input image is divided into multiple image blocks according to a preset pixel specification, and the pixel array of each image block is extracted; the difference between adjacent pixels in the horizontal, vertical or diagonal direction is calculated to obtain the pixel value change.
[0162] S304. Based on the change in pixel value, obtain the local gradient features of each image block, and then perform weighted fusion of the local gradient features with the gradient squared sum energy features to obtain the texture complexity of each image block.
[0163] In this embodiment, local gradient features are used to reflect local edge undulations and detail density. Gradient sum of squares energy features are used to characterize the overall energy intensity of the gradient response within the image patch, and weighted fusion is used to integrate local abrupt change information with overall texture energy to obtain a more stable texture complexity representation.
[0164] For example, local gradient features are formed based on the changes in pixel values. Then, the gradient components in each direction are squared and summed to obtain the gradient sum of squares energy feature. Finally, the local gradient features and the gradient sum of squares energy feature are linearly weighted according to preset weighting coefficients to output the texture complexity corresponding to the image patch.
[0165] It should be noted that the weighting coefficient can be preset according to the interpolation scenario, image resolution or noise level. In practical applications, other values can also be selected for the weighting coefficient, which is not limited in this embodiment.
[0166] The image interpolation method provided in this application enhances the perception of texture undulations and improves the adaptability of texture complexity calculation results to different image content by introducing a joint representation of adjacent pixel differences, local gradients, and gradient squared sum energy. Furthermore, the texture complexity obtained based on weighted fusion has better continuity and robustness, which is beneficial for maintaining a smooth transition between different regions in subsequent interpolation processing, thereby improving the clarity, edge preservation ability, and overall visual consistency of the interpolated image.
[0167] Figure 4 A flowchart illustrating the image interpolation method provided in this application embodiment. Figure 3 ,like Figure 4 As shown, this embodiment elaborates on the process of determining the interpolation kernel based on the above embodiments, including:
[0168] S401. Obtain the preset interpolation kernel library.
[0169] The preset interpolation kernel library is used to store the set of kernel parameters used to reconstruct new pixels. It can be configured in memory or written to registers, software configuration files or hardware lookup tables for quick retrieval during interpolation processing.
[0170] S402. Retrieve predefined low-sharp interpolation kernels and high-sharp interpolation kernels from the preset interpolation kernel library.
[0171] In this embodiment, the low-sharpening interpolation kernel is a bilinear interpolation kernel with high smoothness and low sharpness characteristics. Its weight distribution is relatively flat, which can stably reconstruct flat areas and suppress noise diffusion. The high-sharpening interpolation kernel is a bicubic interpolation kernel with high sharpness and low smoothness characteristics. It has a stronger response to neighborhood changes and is suitable for areas with obvious texture undulations in order to maintain edge contours and detail levels.
[0172] S403. Compare the texture complexity of each image block with a preset threshold.
[0173] After calculating the texture complexity of the image patch, the texture complexity is directly compared with a preset threshold.
[0174] S404. If the texture complexity is less than or equal to the preset threshold, then a low-sharpening interpolation kernel is matched for the current image patch as the appropriate interpolation kernel.
[0175] If the texture complexity is less than or equal to the preset threshold, for image patches with low texture complexity, the low-sharpening interpolation kernel is called to estimate the new pixels corresponding to the image patch, in order to reduce the risk of flat areas being over-enhanced.
[0176] S405. If the texture complexity is greater than the preset threshold, then a high-sharpening interpolation kernel is matched for the current image patch as the appropriate interpolation kernel.
[0177] If the texture complexity exceeds a preset threshold, for image blocks with high texture complexity, a high-sharpening interpolation kernel is called to estimate the new pixels corresponding to the image block in order to improve the fidelity of complex textures and edge details.
[0178] The image interpolation method provided in this application achieves directional matching of the interpolation kernel by comparing the texture complexity with the threshold. This allows flat areas and complex texture areas to be reconstructed using kernels with different smoothing characteristics, thereby forming an interpolation processing method adapted to the content features in the same image. This provides high-quality feature input for subsequent anomaly index prediction, thereby enhancing texture preservation while reducing noise diffusion and reducing the image quality imbalance caused by fixed interpolation kernels in different areas. As a result, the output image is improved in terms of sharpness, edge stability, and visual coherence.
[0179] Figure 5 A flowchart illustrating the image interpolation method provided in this application embodiment. Figure 4 ,like Figure 5 As shown, this embodiment, based on the above embodiments, provides a detailed explanation of the process for determining the transition interpolation kernel, including:
[0180] S501. Determine the absolute difference between the texture complexity and the preset threshold for each image block.
[0181] After the image blocks are divided, the texture complexity of each image block is calculated and compared with a preset threshold to obtain the absolute difference.
[0182] S502. For each image block, the absolute difference is compared with a preset interval threshold to determine whether the absolute difference is less than the preset interval threshold, so as to determine whether the texture complexity corresponding to the current image block falls into a preset proximity interval centered on the preset threshold.
[0183] For each image block, after obtaining the absolute difference, it is compared with a preset interval threshold. If the absolute difference is less than the preset interval threshold, it is determined that the texture complexity of the current image block falls into the preset proximity interval centered on the preset threshold. Otherwise, it is determined that the texture complexity of the current image block is outside the preset proximity interval centered on the preset threshold.
[0184] S503. If the judgment result is yes, then according to the preset nonlinear weighting method, assign corresponding weights to the high-sharpening interpolation and low-sharpening interpolation in the preset interpolation kernel library.
[0185] In this embodiment, the nonlinear weighting method includes fuzzy logic rules or exponential weighting. Fuzzy logic rules can establish a membership function based on the degree of deviation between texture complexity and threshold, while exponential weighting can generate weights in an exponential decay or exponential enhancement manner according to the degree of deviation.
[0186] When the absolute difference falls into the near range, the system reads the parameter matrices of high-sharp interpolation and low-sharp interpolation from the preset interpolation kernel library, and generates the corresponding weights for the two according to the non-linear weighting method.
[0187] Specifically, taking the use of fuzzy logic rules to control weight allocation as an example, texture complexity values are mapped to fuzzy sets (such as "very flat", "medium texture", "very texture"), and the weights of the transition kernels are dynamically calculated based on the membership function. Through fuzzy logic rules, the weights of the transition kernels are smoothly adjusted as texture complexity changes, rather than abruptly.
[0188] For example, in regions where texture complexity is close to the threshold, the weight of the transition kernel can be gradually changed according to the asymptotic characteristics of the membership function, thereby achieving a smooth transition of the interpolation results and avoiding visual discontinuities caused by hard switching.
[0189] S504. Based on the weights, perform a weighted average calculation on the high-sharpening interpolation and the low-sharpening interpolation to obtain the corresponding calculation results, and use the calculation results as the transition interpolation kernel.
[0190] Based on the weights, a weighted average is performed on each coefficient of the parameter matrix (i.e., high-sharp interpolation and low-sharp interpolation) to form a new transition interpolation kernel.
[0191] The image interpolation method provided in this application transforms the potentially hard switching of the interpolation kernel into smooth fusion by setting a continuous transition interval near a threshold. This allows image patches with texture complexity close to the boundary to undergo gradual interpolation, thereby reducing abrupt changes at region boundaries and improving the naturalness of edge transitions. Simultaneously, non-linear weighting ensures that weight changes remain consistent with the degree of deviation in texture complexity, helping to balance detail preservation and smooth noise reduction, thus improving the clarity and visual continuity of the interpolated image.
[0192] Figure 6 This is a schematic diagram of the image interpolation device provided in an embodiment of this application. The device in this embodiment can be in the form of software and / or hardware. Figure 6As shown, the image interpolation device 600 provided in this application embodiment includes: an acquisition module 601, a block segmentation module 602, a first determination module 603, a second determination module 604, a first processing module 605, a second processing module 606, a third processing module 607, and an output module 608.
[0193] The acquisition module 601 is used to acquire the input image to be processed through a preset interactive interface;
[0194] The segmentation module 602 is used to determine multiple corresponding image blocks based on the input image;
[0195] The first determining module 603 is used to determine the corresponding multiple pixel information based on each image block;
[0196] The second determining module 604 is used to determine the texture complexity of each image block based on the information of each pixel;
[0197] The first processing module 605 is used to determine multiple corresponding comparison results based on the texture complexity of each image block and a preset threshold, and to determine the appropriate interpolation kernel for each image block based on each comparison result.
[0198] The second processing module 606 is used to determine the corresponding transition interpolation kernel based on each texture complexity and each adaptation interpolation kernel;
[0199] The third processing module 607 is used to perform radiative transformation processing on the input image according to each adaptive interpolation kernel and each transition interpolation kernel to obtain the interpolated image;
[0200] The output module 608 is used to output the interpolated image through a preset interactive interface.
[0201] In one possible implementation, the segmentation module 602 is further configured to:
[0202] Determine the overall pixel size based on the input image;
[0203] Based on preset pixel specifications and overall pixel size, the input image is divided into multiple non-overlapping image blocks.
[0204] In one possible implementation, the second determining module 604 is further configured to:
[0205] Based on the pixel information of each image block, determine the corresponding multiple pixel values, where each image block corresponds to one pixel value;
[0206] For each pixel value, determine the corresponding multiple mean squared error values;
[0207] Each mean squared error value is used as the texture complexity for each image patch.
[0208] In one possible implementation, the first processing module 605 is further configured to:
[0209] Obtain the preset interpolation kernel library;
[0210] Retrieve predefined low-sharp interpolation kernels and high-sharp interpolation kernels from the preset interpolation kernel library. The low-sharp interpolation kernel is a bilinear interpolation kernel with high smoothness and low sharpness characteristics, and the high-sharp interpolation kernel is a bicubic interpolation kernel with high sharpness and low smoothness characteristics.
[0211] The texture complexity of each image patch is numerically compared with a preset threshold;
[0212] If the texture complexity is less than or equal to the preset threshold, then a low-sharpening interpolation kernel is matched as the appropriate interpolation kernel for the current image patch.
[0213] If the texture complexity is greater than the preset threshold, a high-sharpening interpolation kernel is matched for the current image patch as the appropriate interpolation kernel.
[0214] In one possible implementation, the second processing module 606 is further configured to:
[0215] Based on the texture complexity of each image patch and a preset threshold, determine the absolute difference between each texture complexity and the preset threshold;
[0216] For each image patch, the absolute difference is compared with a preset interval threshold;
[0217] Determine whether the absolute difference is less than a preset interval threshold to determine whether the texture complexity of the current image patch falls into a preset proximity interval centered on the preset threshold.
[0218] If the judgment result is yes, then according to the preset nonlinear weighting method, the high-sharp interpolation and low-sharp interpolation in the preset interpolation kernel library are assigned corresponding weights. The nonlinear weighting method includes fuzzy logic rules or exponential weighting method.
[0219] Based on the weights, a weighted average is calculated for the high-sharp interpolation and the low-sharp interpolation to obtain the corresponding calculation results, and the calculation results are used as the transition interpolation kernel.
[0220] In one possible implementation, the second determining module 604 is further configured to:
[0221] Based on the pixel information of each image block, determine the amount of pixel value change between adjacent pixels;
[0222] Based on the change in pixel values, the local gradient features of each image patch are obtained;
[0223] The gradient sum of squares and energy features of each image patch are obtained by summing the squares of the local gradient features.
[0224] The texture complexity of each image patch is obtained by weighted fusion of local gradient features and gradient squared sum energy features.
[0225] The image interpolation device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0226] Figure 7 This is a schematic diagram of the structure of an image interpolation device provided in an embodiment of this application. Figure 7 As shown, the image interpolation device 700 provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the device 700 further includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus.
[0227] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.
[0228] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0229] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0230] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0231] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0232] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0233] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0234] This application also provides a chip, including at least one chip processor, which is used to execute program instructions to perform the above-described method.
[0235] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0236] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0237] The division of units is merely a logical functional division; 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 indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0238] 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.
[0239] In addition, the functional units in the various embodiments of the present invention 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.
[0240] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part 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 of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0241] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0242] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. An image interpolation method characterized by, include: The input image to be processed is obtained through a preset interactive interface; Based on the input image, determine the corresponding multiple image blocks; For each image block, determine the corresponding multiple pixel information; The texture complexity of each image block is determined based on the information of each pixel. Based on the texture complexity and preset threshold of each image block, determine multiple corresponding comparison results, and based on each comparison result, determine the adaptation interpolation kernel of each image block; Based on each texture complexity and each adaptation interpolation kernel, determine the corresponding transition interpolation kernel; Based on each of the adaptive interpolation kernels and each of the transition interpolation kernels, a radiometric transformation is performed on the input image to obtain the interpolated image; The interpolated image is output through the preset interactive interface.
2. The method of claim 1, wherein, The step of determining the corresponding multiple image blocks based on the input image includes: Based on the input image, determine the corresponding overall pixel size; Based on the preset pixel specifications and the overall pixel size, the input image is divided into multiple non-overlapping image blocks.
3. The method of claim 2, wherein, Determining the texture complexity of each image block based on each pixel information includes: Based on the pixel information of each image block, a plurality of corresponding pixel values are determined, wherein each image block corresponds to one pixel value; Based on each pixel value, determine a plurality of corresponding mean squared error values; Each of the mean squared errors is used as the texture complexity of each of the image blocks.
4. The method of claim 3, wherein, The step of determining the corresponding comparison result based on the texture complexity and a preset threshold, and determining the appropriate interpolation kernel based on the comparison result, includes: Obtain the preset interpolation kernel library; Retrieve predefined low-sharp interpolation kernels and high-sharp interpolation kernels from the preset interpolation kernel library, wherein the low-sharp interpolation kernel is a bilinear interpolation kernel with high smoothness and low sharpness characteristics, and the high-sharp interpolation kernel is a bicubic interpolation kernel with high sharpness and low smoothness characteristics. The texture complexity of each image block is numerically compared with the preset threshold; If the texture complexity is less than or equal to the preset threshold, then the low-sharpening interpolation kernel is matched as the adapted interpolation kernel for the current image patch; If the texture complexity is greater than the preset threshold, then the high-sharpening interpolation kernel is matched as the adapted interpolation kernel for the current image patch.
5. The method of claim 4, wherein, The step of determining the corresponding transition interpolation kernel based on each texture complexity and each adaptation interpolation kernel includes: Based on the texture complexity of each image patch and the preset threshold, determine the absolute difference between each texture complexity and the preset threshold; For each of the image blocks, the absolute difference is compared with a preset interval threshold; Determine whether the absolute difference is less than the preset interval threshold to determine whether the texture complexity corresponding to the current image patch falls into a preset proximity interval centered on the preset threshold. If the judgment result is yes, then according to the preset nonlinear weighting method, the high-sharp interpolation and the low-sharp interpolation in the preset interpolation kernel library are assigned corresponding weights, wherein the nonlinear weighting method includes fuzzy logic rules or exponential weighting method. Based on the weights, a weighted average is calculated for the high-sharpening interpolation and the low-sharpening interpolation to obtain the corresponding calculation result, and the calculation result is used as the transition interpolation kernel.
6. The method according to any one of claims 1 to 5, characterized in that, The step of determining the texture complexity of each image block based on each pixel information further includes: Based on the pixel information of each image block, determine the amount of pixel value change between adjacent pixels; Based on the pixel value change, the local gradient features of each image block are obtained; The local gradient features are squared and summed to obtain the gradient squared sum energy features of each image block; The local gradient features and the gradient squared sum energy features are weighted and fused to obtain the texture complexity of each image patch.
7. An image interpolation apparatus characterized by comprising: include: The acquisition module is used to acquire the input image to be processed through a preset interactive interface; The segmentation module is used to determine multiple corresponding image blocks based on the input image; The first determining module is used to determine multiple pixel information corresponding to each image block; The second determining module is used to determine the texture complexity of each image block based on the pixel information. The first processing module is used to determine multiple corresponding comparison results based on the texture complexity and preset threshold of each image block, and to determine the adaptation interpolation kernel of each image block based on each comparison result; The second processing module is used to determine the corresponding transition interpolation kernel based on each texture complexity and each adaptation interpolation kernel; The third processing module is used to perform radiative transformation processing on the input image according to each of the adaptive interpolation kernels and each of the transition interpolation kernels to obtain the interpolated image; The output module is used to output the interpolated image through the preset interactive interface.
8. An image interpolation device characterized by comprising: include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
10. A computer program product, characterised in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.