Image zooming method and device, equipment and medium

By calculating the target direction angle in the image scaling algorithm and determining the interpolation method, combining the closest neighbor and improved interpolation algorithm, the problem of jagging phenomenon and insufficient clarity in the image scaling process in the prior art is solved, and higher image scaling accuracy and clarity are achieved.

CN119887507APending Publication Date: 2025-04-25SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510115404.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

Existing image scaling algorithms are prone to jagging during the scaling process, and lack the relationship between surrounding pixels, resulting in insufficient image clarity and accuracy.

Method used

By analyzing the image signals collected by the image acquisition device, the resolution matching between the image and the display device is calculated, and if it does not match, the scaling process is performed. The specific steps include calculating the scaling ratio, determining the relative position coordinates of the target position, calculating the target direction angle based on the pixel coordinates around the relative position coordinates, and deciding whether to use the closest interpolation algorithm or improve the interpolation algorithm based on the direction angle. Improved interpolation algorithm to consider the data of surrounding pixel points for interpolation calculation to avoid jagging.

Benefits of technology

It effectively improves the accuracy and clarity of the image scaling algorithm, avoids jagged and discontinuous problems, and improves the quality after image scaling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887507A_ABST
    Figure CN119887507A_ABST
Patent Text Reader

Abstract

The invention discloses an image zooming method and device, equipment and a medium, and relates to the technical field of image processing, and the method comprises the steps: obtaining image data; if the image resolution of the image data is not matched with the display resolution of the display equipment, calculating relative position coordinates of each target position coordinate in the to-be-displayed image in the display equipment in the image data by using a scaling calculated based on the image resolution and the display resolution; calculating a direction angle based on the coordinates of the pixel points around the relative position coordinates, and determining a corresponding interpolation method according to a direction angle calculation result; if the interpolation method is the nearest neighbor interpolation algorithm, selecting pixel point data closest to the relative position coordinates in the image data and assigning the pixel point data to the target position coordinates; and if the interpolation method is an improved interpolation algorithm, determining a target area to which the relative position coordinates belong in the image data, and assigning interpolation pixel point data calculated based on the pixel point data corresponding to the target area to the target position coordinates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image scaling method, device, equipment and medium. Background Art

[0002] FPGA (Field-Programmable Gate Array) is currently widely used in industrial design, chip prototype verification, communication, data acquisition, image processing, etc. During image transmission, the resolution of the captured image may be 640×480, 800×60, 1024×768, 1280×1024, 1360×768, 1920×1080. Due to different application scenarios, the devices to be presented by the captured images are also different. Some LCD (Liquid Crystal Display) monitors can support image display with a resolution of 480×272, and some monitors can support image display with a resolution of 1920×1080. When the captured image does not match the existing device resolution, it cannot be displayed normally, and the image needs to be reduced or enlarged to adapt to the resolution of the display.

[0003] The image scaling algorithm is to reduce or enlarge the target image according to the resolution of the source image. Usually, the method used for image reduction or enlargement is the nearest neighbor interpolation algorithm. The nearest neighbor interpolation algorithm selects the nearest pixel point as the pixel value of the target image according to the mapping position of the target image in the source image. However, since the relationship between the surrounding pixels is not taken into account, the final scaled image will have serious jagged edges.

[0004] In summary, how to improve the accuracy and clarity of the image scaling algorithm and effectively avoid the aliasing phenomenon is a problem that needs to be solved. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide an image scaling method, device, equipment and medium, which can improve the accuracy and clarity of the image scaling algorithm and effectively avoid the aliasing phenomenon. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses an image scaling method, comprising:

[0007] Analyze the image signal acquired by the image acquisition device to obtain image data;

[0008] If the image resolution of the image data does not match the display resolution of the display device, then the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data are calculated using a scaling ratio calculated based on the image resolution and the display resolution;

[0009] Calculate the target direction angle based on the pixel coordinates around the relative position coordinates, and determine the corresponding target interpolation method according to the direction angle calculation result;

[0010] If the target interpolation method is the nearest neighbor interpolation algorithm, the pixel point data closest to the relative position coordinates in the image data is selected and assigned to the target position coordinates;

[0011] If the target interpolation method is a preset improved interpolation algorithm, the target area to which the relative position coordinates belong in the image data is determined, and interpolated pixel point data calculated based on each pixel point data corresponding to the target area is assigned to the target position coordinates.

[0012] Optionally, calculating the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data using the scaling ratio calculated based on the image resolution and the display resolution includes:

[0013] Determine a first height value and a first width value corresponding to the image data based on the image resolution, and determine a second height value and a second width value corresponding to the image to be displayed in the display device based on the display resolution;

[0014] Determine a vertical scaling ratio based on a ratio of the first height value to the second height value, and determine a horizontal scaling ratio based on the first width value and the second width value;

[0015] For each target position coordinate in the image to be displayed, the vertical coordinate value of the relative position coordinate in the image data is determined using the vertical scaling ratio and the vertical coordinate value of the target position coordinate, and the horizontal coordinate value of the relative position coordinate in the image data is determined using the horizontal scaling ratio and the horizontal coordinate value of the target position coordinate.

[0016] Optionally, the target direction angle includes a direction angle of 0 degrees, a direction angle of 45 degrees, a direction angle of 90 degrees, and a direction angle of 135 degrees;

[0017] Accordingly, the corresponding target interpolation method is determined according to the direction angle calculation result, including:

[0018] The calculation result of the 0 degree direction angle, the calculation result of the 45 degree direction angle, the calculation result of the 90 degree direction angle and the calculation result of the 135 degree direction angle are summed to obtain a sum result;

[0019] It is determined whether the summation result is less than a preset threshold value. If so, the nearest neighbor interpolation algorithm is determined as the target interpolation method, otherwise the improved interpolation algorithm is determined as the target interpolation method.

[0020] Optionally, the target direction angle is calculated based on the pixel coordinates around the relative position coordinates, including:

[0021] Taking the relative position coordinate as the center, selecting the coordinates of multiple surrounding pixels to form a target coordinate area based on the coordinates of the multiple pixels;

[0022] In the target coordinate area, the 0-degree direction angle is calculated based on the preset number of pixel coordinates in the 0-degree direction, the 45-degree direction angle is calculated based on the preset number of pixel coordinates in the 45-degree direction, the 90-degree direction angle is calculated based on the preset number of pixel coordinates in the 90-degree direction, and the 135-degree direction angle is calculated based on the preset number of pixel coordinates in the 135-degree direction.

[0023] Optionally, analyzing an image signal acquired by an image acquisition device to obtain image data includes:

[0024] Analyze the image signal collected by the image acquisition device according to the preset indication signal to obtain image data, and store the image data in the double rate synchronous dynamic random access memory; wherein the indication signal includes a line synchronization signal, a field synchronization signal and a data enable signal;

[0025] Accordingly, the image scaling method of the present application further includes:

[0026] The scaled image data is displayed using a display device based on the indication signal.

[0027] Optionally, determining the target region to which the relative position coordinates belong in the image data, and assigning interpolated pixel point data calculated based on each pixel point data corresponding to the target region to the target position coordinates includes:

[0028] Determine four pixel coordinates in the image data that can surround the relative position coordinate, and use the area formed by the four pixel coordinates as the target area to which the relative position coordinate belongs in the image data;

[0029] The target area is divided into 4×4 sub-areas; each sub-area has a corresponding area ratio threshold in the horizontal and vertical directions;

[0030] After multiplying the horizontal coordinate value and the vertical coordinate value of the relative position coordinate by 256 respectively, determine the low 8 bits of the horizontal coordinate data and the low 8 bits of the vertical coordinate data;

[0031] Compare the lower 8 bits of the horizontal coordinate data and the lower 8 bits of the vertical coordinate data with the area ratio threshold corresponding to each sub-area in the corresponding direction in turn to determine the target sub-area to which the relative position coordinate belongs in the target area;

[0032] The pixel point data corresponding to the four pixel point coordinates are weightedly calculated according to the target interpolation weight coefficient corresponding to the target sub-region to obtain interpolated pixel point data, and the interpolated pixel point data is assigned to the target position coordinates.

[0033] Optionally, the image scaling method of the present application further includes:

[0034] According to the positional relationship of each sub-region in the target region and the distance between each sub-region and the four pixel points, an interpolation weight coefficient corresponding to the four pixel points is pre-assigned to each sub-region.

[0035] In a second aspect, the present application discloses an image scaling device, comprising:

[0036] An analysis module, used for analyzing the image signal acquired by the image acquisition device to obtain image data;

[0037] A scaling calculation module, used for calculating the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data using a scaling ratio calculated based on the image resolution and the display resolution if the image resolution of the image data does not match the display resolution of the display device;

[0038] An interpolation method determination module is used to calculate the target direction angle based on the pixel point coordinates around the relative position coordinates, and determine the corresponding target interpolation method according to the direction angle calculation result;

[0039] A first interpolation module is used for selecting pixel point data closest to the relative position coordinates in the image data and assigning them to the target position coordinates if the target interpolation method is the nearest neighbor interpolation algorithm;

[0040] The second interpolation module is used to determine the target area to which the relative position coordinates belong in the image data if the target interpolation method is a preset improved interpolation algorithm, and assign the interpolated pixel point data calculated based on the pixel point data corresponding to the target area to the target position coordinates.

[0041] In a third aspect, the present application discloses an electronic device, comprising:

[0042] Memory, used to store computer programs;

[0043] The processor is used to execute a computer program to implement the steps of the aforementioned disclosed image scaling method.

[0044] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed image scaling method are implemented.

[0045] It can be seen that the present application obtains image data by analyzing the image signal captured by the image acquisition device; if the image resolution of the image data does not match the display resolution of the display device, the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data are calculated using the scaling ratio calculated based on the image resolution and the display resolution; the target direction angle is calculated based on the pixel point coordinates around the relative position coordinates, and the corresponding target interpolation method is determined according to the direction angle calculation result; if the target interpolation method is the nearest neighbor interpolation algorithm, the pixel point data in the image data that is closest to the relative position coordinates is selected and assigned to the target position coordinates; if the target interpolation method is a preset improved interpolation algorithm, the target area to which the relative position coordinates belong in the image data is determined, and the interpolated pixel point data calculated based on the pixel point data corresponding to the target area is assigned to the target position coordinates.

[0046] Beneficial effect: After acquiring the image signal collected by the image acquisition device, the present application needs to first analyze the image signal to obtain the corresponding image data. It is further necessary to determine whether the image resolution of the image data matches the display resolution of the display device. If they match, there is no need to scale the image. If they do not match, the scaling ratio is calculated based on the image resolution and the display resolution, so as to calculate the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data using the scaling ratio. After obtaining the relative position coordinates, the target direction angle is calculated based on the pixel point coordinates around the relative position coordinates, and its purpose is to determine the corresponding target interpolation method according to the direction angle calculation result; the target interpolation method can be specifically the nearest neighbor interpolation algorithm and the preset improved interpolation algorithm. If the target interpolation method is the nearest neighbor interpolation algorithm, the pixel point data closest to the relative position coordinate in the image data is selected and assigned to the target position coordinate. If the target interpolation method is the improved interpolation algorithm, the target area to which the relative position coordinate belongs in the image data is determined, and the interpolated pixel point data calculated based on the pixel point data corresponding to the target area is assigned to the target position coordinate. That is, the present application adds the calculation of the direction angle, and the result of the direction angle calculation can indicate whether the pixel changes smoothly, so as to decide whether the current image data is scaled using the nearest neighbor interpolation algorithm or the improved interpolation algorithm according to the result of the direction angle calculation. When using the improved interpolation algorithm, it is necessary to first determine the target area to which the relative position coordinates belong, and then calculate the interpolated pixel point data according to the pixel point data corresponding to the target area, so as to assign the interpolated pixel point data to the target position coordinates, thereby taking into account the relationship between the surrounding pixels and avoiding jagged edges and discontinuity problems. The scheme of the present application can improve the accuracy and clarity of the image scaling algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0048] Figure 1 A flow chart of an image scaling method disclosed in this application;

[0049] Figure 2 This is an architecture diagram applicable to an image scaling method disclosed in this application;

[0050] Figure 3 A schematic diagram of pixel selection for a nearest neighbor interpolation algorithm disclosed in this application;

[0051] Figure 4 A flow chart of a method using an improved interpolation algorithm disclosed in the present application;

[0052] Figure 5 A schematic diagram of region division of an improved interpolation algorithm disclosed in this application;

[0053] Figure 6 A flowchart of a specific image scaling method disclosed in this application;

[0054] Figure 7 A schematic diagram of calculating a direction angle disclosed in the present application;

[0055] Figure 8 A schematic diagram of a state machine in an FPGA disclosed in this application;

[0056] Fig. 9 A schematic diagram of the structure of an image scaling device disclosed in this application;

[0057] Fig.10 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0059] The image scaling algorithm is to reduce or enlarge the resolution of the target image and the source image. Usually, the image is reduced or enlarged by the nearest neighbor interpolation algorithm. The nearest neighbor interpolation algorithm selects the nearest pixel point as the pixel value of the target image according to the mapping position of the target image in the source image. However, since the relationship between the surrounding pixels is not taken into account, the final scaled image will have serious aliasing. To this end, the embodiments of the present application disclose an image scaling method, device, equipment and medium, which can improve the accuracy and clarity of the image scaling algorithm and effectively avoid the aliasing phenomenon.

[0060] See also Figure 1 and Figure 2 As shown, an embodiment of the present application discloses an image scaling method, the method comprising:

[0061] Step S11: Analyze the image signal acquired by the image acquisition device to obtain image data.

[0062] In this embodiment, after the image signal captured by the image capture device is acquired, it is necessary to first analyze the image signal to obtain corresponding image data.

[0063] In a specific embodiment, the above-mentioned analysis of the image signal collected by the image acquisition device to obtain image data includes: analyzing the image signal collected by the image acquisition device according to a preset indication signal to obtain image data, and storing the image data in a double rate synchronous dynamic random access memory; wherein the indication signal includes a line synchronization signal, a field synchronization signal and a data enable signal. Specifically, Figure 2 As shown in , it should be pointed out first that the present application uses FPGA (Field-Programmable Gate Array, field programmable logic device) chip as the core processor to process image data from the image acquisition device, including storage, reduction, enlargement, and image display logic control. Specifically, the image acquisition device and the FPGA chip are connected through the IO (input / output) pins of the FPGA, and the acquired image is sent to the processing logic of the image acquisition device. The processing logic of the image acquisition device analyzes the image through the indication signals coming with the image signal, such as HS (Horizontal Synchronization, line synchronization signal), VS (Vertical Synchronization, field synchronization signal), DE (Data Enable Signal, data enable signal) and other signals to obtain image data and write it to the DDR memory (Double Data Rate, double rate synchronous dynamic random access memory). Among them, the role of the line synchronization signal is to select the effective line signal interval on the liquid crystal panel, and the role of the field synchronization signal is to select the effective field signal interval on the liquid crystal panel.

[0064] Step S12: If the image resolution of the image data does not match the display resolution of the display device, the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data are calculated using a scaling ratio calculated based on the image resolution and the display resolution.

[0065] In this embodiment, it is further necessary to determine whether the image resolution of the image data matches the display resolution of the display device. If they match, there is no need to scale the image. If they do not match, the scaling ratio is calculated based on the image resolution and the display resolution, and the scaling ratio is used to calculate the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data, so as to map the pixel points of the source image to the image to be displayed through an interpolation algorithm.

[0066] That is, when the image resolution of the image data does not match the display resolution of the display device, the image data in the DDR memory will be sent to the scaling logic through FIFIO. It should be pointed out that the image captured by the image acquisition device can be sent to different display devices for display. By comparing the image resolution of the image data with the display resolution of different display devices, the corresponding scaling ratio can be obtained. Figure 2 Just take a display device as an example.

[0067] In a specific embodiment, the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data are calculated using a scaling ratio calculated based on the image resolution and the display resolution, including: determining a first height value and a first width value corresponding to the image data based on the image resolution, and determining a second height value and a second width value corresponding to the image to be displayed in the display device based on the display resolution; determining a vertical scaling ratio based on a ratio of the first height value to the second height value, and determining a horizontal scaling ratio based on the first width value and the second width value; for each target position coordinate in the image to be displayed, determining the vertical coordinate value of the relative position coordinate in the image data using the vertical scaling ratio and the vertical coordinate value of the target position coordinate, and determining the horizontal coordinate value of the relative position coordinate in the image data using the horizontal scaling ratio and the horizontal coordinate value of the target position coordinate.

[0068] That is, firstly, a first height value SRC_HEIGHT and a first width value SRC_WIDTH corresponding to the image data are determined based on the image resolution, and a second height value DIS_HEIGHT and a second width value DIS_WIDTH corresponding to the image to be displayed in the display device are determined based on the display resolution, thereby determining a vertical scaling ratio SRC_HEIGHT / DIS_HEIGHT based on the ratio of the first height value to the second height value, and determining a horizontal scaling ratio SRC_WIDTH / DIS_WIDTH based on the first width value and the second width value, then for each target position coordinate (i, j) in the image to be displayed, the vertical scaling ratio and the vertical coordinate value of the target position coordinate are used to determine the vertical coordinate value y of the relative position coordinate in the image data. j =SRC_HEIGHT / DIS_HEIGHT×j, use the horizontal scaling ratio and the horizontal coordinate value of the target position coordinate to determine the horizontal coordinate value x of the relative position coordinate in the image data i =SRC_WIDTH / DIS_WIDTH×i.

[0069] Step S13: Calculate the target direction angle based on the pixel coordinates around the relative position coordinates, and determine the corresponding target interpolation method according to the direction angle calculation result.

[0070] In this embodiment, after the relative position coordinates are obtained, the target direction angle is calculated based on the pixel coordinates around the relative position coordinates, and the purpose is to determine the corresponding target interpolation method according to the direction angle calculation result; the target interpolation method can specifically be a nearest neighbor interpolation algorithm and a preset improved interpolation algorithm. That is, the present application adds the calculation of the direction angle, and the result of the direction angle calculation can indicate whether the pixel changes smoothly, so as to determine whether the current image data is scaled using the nearest neighbor interpolation algorithm that retains the original image data or the improved interpolation algorithm according to the result of the direction angle calculation.

[0071] It is understandable that although the nearest neighbor interpolation algorithm can realize the function of image scaling, since it does not take the relationship between surrounding pixels into consideration, the final scaled image will have serious aliasing. On this basis, the improved interpolation algorithm considers adding surrounding pixels to the generation of final image pixel information.

[0072] Step S14: If the target interpolation method is the nearest neighbor interpolation algorithm, select the image data corresponding to the relative position coordinate (x i ,y j ) The nearest pixel data is assigned to the target position coordinates (i, j).

[0073] In this embodiment, if the target interpolation method is the nearest neighbor interpolation algorithm, the pixel data in the image data that is closest to the relative position coordinates is selected and assigned to the target position coordinates. That is, the nearest neighbor interpolation algorithm selects the nearest pixel point as the pixel value of the target image according to the mapping position, such as Figure 3 As shown in the figure, point P (x i ,y j ) falls in an area closer to Q11, then according to the nearest neighbor interpolation algorithm, the pixel value of the target position coordinate is Q11.

[0074] Step S15: If the target interpolation method is a preset improved interpolation algorithm, determine the target area to which the relative position coordinates belong in the image data, and assign interpolated pixel point data calculated based on each pixel point data corresponding to the target area to the target position coordinates.

[0075] In this embodiment, if the target interpolation method is an improved interpolation algorithm, it is necessary to first determine the target area to which the relative position coordinates belong, and then calculate the interpolated pixel data according to the pixel data corresponding to the target area, so as to assign the interpolated pixel data to the target position coordinates, thereby taking into account the relationship between the surrounding pixels and avoiding jaggedness and discontinuity problems. The solution of this application can improve the accuracy and clarity of the image scaling algorithm.

[0076] In a specific implementation, the image scaling method of the present application further includes: using a display device to display the scaled image data based on the indication signal. Figure 2 As shown in , the data obtained after the scaling logic processing is written into the FIFO for use by the subsequent display logic. The display logic is matched according to the display device, which includes the line synchronization signal, the starting position of the field synchronization signal and the width of a line of data, so as to display the scaled image data according to these indication signals.

[0077] like Figure 4 As shown, in a specific implementation, the above-mentioned determination of the target area to which the relative position coordinates belong in the image data, and assigning the interpolated pixel point data calculated based on the pixel point data corresponding to the target area to the target position coordinates, includes the following steps:

[0078] Step S151: Determine four pixel coordinates in the image data that can surround the relative position coordinates, and use the area formed by the four pixel coordinates as the target area to which the relative position coordinates belong in the image data.

[0079] In this embodiment, first determine the image data that can enclose the relative position coordinates P (x i ,y j )’s four pixel coordinates, such as Figure 3As shown in Q11 (x, y), Q12 (x, y+1), Q21 (x+1, y) and Q22 (x+1, y+1), the 2×2 area formed by the coordinates of these four pixel points is used as the target area to which the relative position coordinates belong in the image data.

[0080] Step S152: Divide the target area into 4×4 sub-areas; wherein each sub-area has a corresponding area ratio threshold in the horizontal and vertical directions.

[0081] In this embodiment, considering the feasibility of implementation in FPGA and the amount of calculation, the improved interpolation algorithm is improved on the basis of the nearest neighbor interpolation algorithm, which can not only reflect the pixel conditions of the source image, but also reflect the conditions of the surrounding pixels. The region division of the improved interpolation algorithm is as follows: Figure 5 As shown, the target area is further divided into 4×4 sub-areas, that is, divided into 16 small areas; wherein each sub-area has a corresponding area ratio threshold in the horizontal and vertical directions, and the ratio thresholds are 0.25, 0.5, and 0.75 respectively.

[0082] Step S153: multiply the horizontal coordinate value and the vertical coordinate value of the relative position coordinate by 256 respectively, and determine the low 8 bits of the horizontal coordinate data and the low 8 bits of the vertical coordinate data.

[0083] In this embodiment, the specific location of the interpolation point is determined based on the decimal part of the coordinates. However, since decimal calculations cannot be performed directly inside the FPGA, when mapping the interpolation point, the horizontal and vertical coordinate values ​​of the relative position coordinates need to be multiplied by 256, that is, x i =SRC_WIDTH / DIS_WIDTH×i×256, y j =SRC_HEIGHT / DIS_HEIGHT×j×256.

[0084] Step S154: compare the lower 8 bits of the horizontal coordinate data and the lower 8 bits of the vertical coordinate data with the area ratio threshold corresponding to each sub-area in the corresponding direction in turn to determine the target sub-area to which the relative position coordinate belongs in the target area.

[0085] In this embodiment, when judging the decimal part, the lower 8 bits of the horizontal coordinate data and the lower 8 bits of the vertical coordinate data are compared with the area ratio thresholds 0.25, 0.5, and 0.75 corresponding to each sub-area in the corresponding direction. In this way, the target sub-area to which the relative position coordinate belongs in the target area is determined, that is, the sub-area to which the relative position coordinate belongs is determined. Figure 5 The specific sub-areas corresponding to the serial numbers 1 to 16 in .

[0086] Step S155: performing weighted calculation on the pixel point data corresponding to the four pixel point coordinates according to the target interpolation weight coefficient corresponding to the target sub-region to obtain interpolated pixel point data, and assigning the interpolated pixel point data to the target position coordinates.

[0087] In this embodiment, the target interpolation weight coefficient corresponding to the target sub-region is determined, and the pixel point data corresponding to the four pixel point coordinates are weighted calculated using the target interpolation weight coefficient to obtain the interpolated pixel point data. Figure 5 The interpolation formula for each region in is:

[0088] No. 1: ;

[0089] No. 2: ;

[0090] No. 3: ;

[0091] No. 4: ;

[0092] No. 5: ;

[0093] No. 6: ;

[0094] Number 7: ;

[0095] No. 8: ;

[0096] No. 9: ;

[0097] No. 10: ;

[0098] No.11: ;

[0099] No.12: ;

[0100] No. 13: ;

[0101] No.14: ;

[0102] No. 15: ;

[0103] No.16: .

[0104] After the interpolation pixel point data of the target sub-area is calculated according to the above interpolation formula, the interpolation pixel point data is assigned to the target position coordinates.

[0105] Furthermore, the above method also includes: pre-assigning interpolation weight coefficients corresponding to the four pixels to each sub-region according to the positional relationship of each sub-region in the target region and the distance between each sub-region and the four pixels. It can be understood that the interpolation weight coefficient reflects the degree of association between the region and the four basic pixels, which mainly depends on the positional relationship of each sub-region in the target region and the distance between each sub-region and the four pixels. For example, for regions 1, 4, 13, 16, etc., the weight value of the pixel data closer to them is higher, accounting for the main component of the final result.

[0106] It can be seen that after acquiring the image signal collected by the image acquisition device, the present application needs to first analyze the image signal to obtain the corresponding image data. It is further necessary to determine whether the image resolution of the image data matches the display resolution of the display device. If they match, there is no need to scale the image. If they do not match, the scaling ratio is calculated based on the image resolution and the display resolution, so as to calculate the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data using the scaling ratio. After obtaining the relative position coordinates, the target direction angle is calculated based on the pixel coordinates around the relative position coordinates. The purpose is to determine the corresponding target interpolation method according to the direction angle calculation result; the target interpolation method can be specifically the nearest interpolation algorithm and the preset improved interpolation algorithm. If the target interpolation method is the nearest interpolation algorithm, the pixel data in the image data that is closest to the relative position coordinate is selected and assigned to the target position coordinate. If the target interpolation method is the improved interpolation algorithm, the target area to which the relative position coordinate belongs in the image data is determined, and the interpolated pixel data calculated based on the pixel data corresponding to the target area is assigned to the target position coordinate. That is, the present application adds the calculation of the direction angle, and the result of the direction angle calculation can indicate whether the pixel changes smoothly, so as to decide whether the current image data is scaled using the nearest neighbor interpolation algorithm or the improved interpolation algorithm according to the result of the direction angle calculation. When using the improved interpolation algorithm, it is necessary to first determine the target area to which the relative position coordinates belong, and then calculate the interpolated pixel point data according to the pixel point data corresponding to the target area, so as to assign the interpolated pixel point data to the target position coordinates, thereby taking into account the relationship between the surrounding pixels and avoiding jagged edges and discontinuity problems. The scheme of the present application can improve the accuracy and clarity of the image scaling algorithm.

[0107] See also Figure 6 As shown, the embodiment of the present application discloses a specific image scaling method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, it includes:

[0108] Step S21: Analyze the image signal acquired by the image acquisition device to obtain image data.

[0109] Step S22: If the image resolution of the image data does not match the display resolution of the display device, the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data are calculated using a scaling ratio calculated based on the image resolution and the display resolution.

[0110] Step S23: Calculate the target direction angle based on the pixel coordinates around the relative position coordinates; the target direction angle includes a 0 degree direction angle, a 45 degree direction angle, a 90 degree direction angle and a 135 degree direction angle.

[0111] In this embodiment, the target direction angle is calculated based on the pixel coordinates around the relative position coordinates, wherein the target direction angle may specifically include a 0 degree direction angle, a 45 degree direction angle, a 90 degree direction angle, and a 135 degree direction angle.

[0112] Specifically, the target direction angle is calculated based on the pixel coordinates around the relative position coordinates, including: taking the relative position coordinates as the center, selecting multiple pixel coordinates around to form a target coordinate area based on the multiple pixel coordinates; in the target coordinate area, calculating the 0-degree direction angle based on a preset number of pixel coordinates in the 0-degree direction, calculating the 45-degree direction angle based on a preset number of pixel coordinates in the 45-degree direction, calculating the 90-degree direction angle based on a preset number of pixel coordinates in the 90-degree direction, and calculating the 135-degree direction angle based on a preset number of pixel coordinates in the 135-degree direction. That is, Figure 7 As shown, taking the relative position coordinates as the center, multiple pixel coordinates around are selected to form the target coordinate area. The direction angle is calculated as follows:

[0113] In the target coordinate area, the 0 degree direction angle is calculated based on the coordinates of the 6 pixel points in the 0 degree direction:

[0114] ;

[0115] Calculate the 45-degree angle based on the coordinates of the six pixels in the 45-degree direction:

[0116] ;

[0117] Calculate the 90-degree angle based on the coordinates of the six pixels in the 90-degree direction:

[0118] ;

[0119] Calculate the 135-degree direction angle based on the coordinates of the 6 pixel points in the 135-degree direction:

[0120] .

[0121] Step S24: performing a sum operation on the 0 degree azimuth angle calculation result, the 45 degree azimuth angle calculation result, the 90 degree azimuth angle calculation result and the 135 degree azimuth angle calculation result to obtain a sum result, and determining whether the sum result is less than a preset threshold value, if so, determining the nearest neighbor interpolation algorithm as the target interpolation method, otherwise determining the improved interpolation algorithm as the target interpolation method.

[0122] In this embodiment, after obtaining the calculation results of the 0 degree direction angle, the 45 degree direction angle, the 90 degree direction angle and the 135 degree direction angle, a summation operation is performed to obtain a summation result. Then the summation result is compared with a preset threshold value, and if the summation result is less than the preset threshold value, the nearest neighbor interpolation algorithm is determined as the target interpolation method, otherwise the improved interpolation algorithm is determined as the target interpolation method.

[0123] Step S25: If the target interpolation method is the nearest neighbor interpolation algorithm, the pixel point data closest to the relative position coordinates in the image data is selected and assigned to the target position coordinates.

[0124] Step S26: If the target interpolation method is a preset improved interpolation algorithm, determine the target area to which the relative position coordinates belong in the image data, and assign interpolated pixel point data calculated based on each pixel point data corresponding to the target area to the target position coordinates.

[0125] In this embodiment, in addition to using the nearest neighbor interpolation algorithm and the improved interpolation algorithm to scale the image, other interpolation algorithms such as bilinear interpolation and bicubic interpolation can be further introduced, and the most suitable algorithm can be automatically selected or dynamically fused according to the local features of the image, such as texture complexity and edge sharpness. For example, the nearest neighbor interpolation algorithm with less computational effort is used in the flat area of ​​the image, the bilinear interpolation algorithm is used in the area with moderate texture to obtain a better smoothing effect, and the improved interpolation algorithm or the bicubic interpolation algorithm is used in the area with rich details and edges to accurately maintain the image details. In this way, the overall quality and adaptability of image scaling can be further improved.

[0126] In addition, deep learning technology is also used to learn a large amount of image data to train a model that can predict the best parameters and algorithm selection for image scaling. In the actual scaling process, the image features are input into the model, and the model outputs the corresponding scaling strategy. For example, a convolutional neural network (CNN) model can be constructed to input a local block of the image. After multiple layers of convolution and pooling operations, the interpolation algorithm suitable for the area and related parameter adjustment suggestions are output, such as appropriately increasing the weight coefficients of surrounding pixels in certain complex texture areas, thereby improving the intelligence and accuracy of image scaling.

[0127] Combine the following Figure 8The state machine in the FPGA disclosed in the article explains the above scheme in detail:

[0128] Four RAM controllers (RAM stands for Random Access Memory) are generated inside the FPGA, and 4 rows of adjacent data are sent to the RAM. RAM1 and RAM2 are mainly used for calculating interpolation points, RAM3 is used to determine the direction angle, and RAM4 is used to store data.

[0129] First, when a frame of image starts, the state machine enters the data storage state from the start state. The data storage state will store the image data in RAM4. When there are at least 4 data in RAM4, it enters the direction angle judgment state to calculate the direction angle. According to the value of the direction angle, it is decided which algorithm to use, the nearest neighbor interpolation algorithm or the improved interpolation algorithm. If the improved interpolation algorithm is used, it is necessary to further determine which area the mapping point falls in the improved interpolation algorithm. According to the regional rules, different calculation formulas are used to calculate the pixel data of the interpolation point. If the nearest neighbor interpolation algorithm is used, then it is necessary to convert x i and j The lower 8 bits are rounded off to determine which point is closer to the 2×2 area, and the pixel data is assigned to the target position coordinates; after the current data calculation is completed, the direction angle is determined; when all data calculations are completed, the data is stored.

[0130] For more specific processing procedures of the above steps S21, S22 and S25, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be described in detail here.

[0131] It can be seen that the present application discloses a method of determining whether to use the nearest neighbor interpolation algorithm or the preset improved interpolation algorithm by calculating the direction angle; wherein the direction angle may specifically include a 0 degree direction angle, a 45 degree direction angle, a 90 degree direction angle, and a 135 degree direction angle. The direction angle can quantitatively reflect the changing trend and directional characteristics of the pixel values ​​in the local area of ​​the image. Through these calculation results, it can be judged whether the image is relatively smooth or there is a large difference in pixel values ​​in the local area. If the absolute value of the direction angle is small, it means that the pixel value changes relatively slowly in this area. At this time, the nearest neighbor interpolation algorithm is sufficient to meet the image scaling requirements, because it simply selects the nearest pixel point assignment and will not have a significant impact on the image quality; on the contrary, if the absolute value of the direction angle is large, it indicates that the image has complex pixel changes in this area, such as at the edge of the image, in the texture-rich area, etc. The improved interpolation algorithm can better utilize the surrounding pixel information to accurately calculate the interpolation point pixel value, thereby effectively reducing aliasing and discontinuity, and improving the quality of the image after scaling. The present application sets a threshold in advance. When the sum of the four direction angles is greater than the threshold, the improved interpolation algorithm is used, otherwise the nearest neighbor interpolation algorithm is used.

[0132] See also Fig. 9 As shown, an embodiment of the present application discloses an image scaling device, the device comprising:

[0133] An analysis module 11 is used to analyze the image signal acquired by the image acquisition device to obtain image data;

[0134] A scaling calculation module 12 is used to calculate the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data using a scaling ratio calculated based on the image resolution and the display resolution if the image resolution of the image data does not match the display resolution of the display device;

[0135] An interpolation method determination module 13 is used to calculate the target direction angle based on the pixel point coordinates around the relative position coordinates, and determine the corresponding target interpolation method according to the direction angle calculation result;

[0136] A first interpolation module 14 is used for selecting pixel point data closest to the relative position coordinates in the image data and assigning them to the target position coordinates if the target interpolation method is the nearest neighbor interpolation algorithm;

[0137] The second interpolation module 15 is used to determine the target area to which the relative position coordinates belong in the image data if the target interpolation method is a preset improved interpolation algorithm, and assign interpolated pixel point data calculated based on each pixel point data corresponding to the target area to the target position coordinates.

[0138] It can be seen that after acquiring the image signal collected by the image acquisition device, the present application needs to first analyze the image signal to obtain the corresponding image data. It is further necessary to determine whether the image resolution of the image data matches the display resolution of the display device. If they match, there is no need to scale the image. If they do not match, the scaling ratio is calculated based on the image resolution and the display resolution, so as to calculate the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data using the scaling ratio. After obtaining the relative position coordinates, the target direction angle is calculated based on the pixel coordinates around the relative position coordinates. The purpose is to determine the corresponding target interpolation method according to the direction angle calculation result; the target interpolation method can be specifically the nearest interpolation algorithm and the preset improved interpolation algorithm. If the target interpolation method is the nearest interpolation algorithm, the pixel data in the image data that is closest to the relative position coordinate is selected and assigned to the target position coordinate. If the target interpolation method is the improved interpolation algorithm, the target area to which the relative position coordinate belongs in the image data is determined, and the interpolated pixel data calculated based on the pixel data corresponding to the target area is assigned to the target position coordinate. That is, the present application adds the calculation of the direction angle, and the result of the direction angle calculation can indicate whether the pixel changes smoothly, so as to decide whether the current image data is scaled using the nearest neighbor interpolation algorithm or the improved interpolation algorithm according to the result of the direction angle calculation. When using the improved interpolation algorithm, it is necessary to first determine the target area to which the relative position coordinates belong, and then calculate the interpolated pixel point data according to the pixel point data corresponding to the target area, so as to assign the interpolated pixel point data to the target position coordinates, thereby taking into account the relationship between the surrounding pixels and avoiding jagged edges and discontinuity problems. The scheme of the present application can improve the accuracy and clarity of the image scaling algorithm.

[0139] Since the embodiments of the device part correspond to the embodiments of the method part, the embodiments of the device part refer to the description of the embodiments of the method part, which will not be described here. In addition, the invention has the same beneficial effects as the above-mentioned image scaling method.

[0140] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the image scaling method performed by the electronic device disclosed in any of the aforementioned embodiments.

[0141] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0142] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0143] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0144] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the processor 21 on the massive data 223 in the memory 22, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the image scaling method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data transmitted from an external device received by the electronic device, the data 223 can also include data collected by its own input and output interface 25.

[0145] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the image scaling method disclosed in any of the aforementioned embodiments are implemented.

[0146] Furthermore, an embodiment of the present application also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the image scaling method disclosed in any of the aforementioned embodiments.

[0147] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0148] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0149] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art.

[0150] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0151] The above is a detailed introduction to an image scaling method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. An image scaling method, characterized in that: include: Analyze the image signal acquired by the image acquisition device to obtain image data; If the image resolution of the image data does not match the display resolution of the display device, then calculating the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data using a scaling ratio calculated based on the image resolution and the display resolution; Calculating the target direction angle based on the pixel point coordinates around the relative position coordinates, and determining the corresponding target interpolation method according to the direction angle calculation result; If the target interpolation method is the nearest neighbor interpolation algorithm, then the pixel point data closest to the relative position coordinates in the image data is selected and assigned to the target position coordinates; If the target interpolation method is a preset improved interpolation algorithm, the target area to which the relative position coordinates belong in the image data is determined, and the interpolated pixel point data calculated based on the pixel point data corresponding to the target area is assigned to the target position coordinates.

2. The image scaling method according to claim 1, characterized in that: The step of calculating the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data by using the scaling ratio calculated based on the image resolution and the display resolution includes: Determine a first height value and a first width value corresponding to the image data based on the image resolution, and determine a second height value and a second width value corresponding to the image to be displayed in the display device based on the display resolution; Determine a vertical scaling ratio based on a ratio of the first height value to the second height value, and determine a horizontal scaling ratio based on the first width value to the second width value; For each target position coordinate in the image to be displayed, the vertical coordinate value of the relative position coordinate in the image data is determined using the vertical scaling ratio and the vertical coordinate value of the target position coordinate, and the horizontal coordinate value of the relative position coordinate in the image data is determined using the horizontal scaling ratio and the horizontal coordinate value of the target position coordinate.

3. The image scaling method according to claim 1, characterized in that: The target direction angles include a 0 degree direction angle, a 45 degree direction angle, a 90 degree direction angle and a 135 degree direction angle; Correspondingly, the method of determining the corresponding target interpolation method according to the direction angle calculation result includes: The calculation result of the 0 degree direction angle, the calculation result of the 45 degree direction angle, the calculation result of the 90 degree direction angle and the calculation result of the 135 degree direction angle are summed to obtain a sum result; It is determined whether the summation result is less than a preset threshold value. If so, the nearest neighbor interpolation algorithm is determined as the target interpolation method; otherwise, the improved interpolation algorithm is determined as the target interpolation method.

4. The image scaling method according to claim 3, characterized in that: The calculating the target direction angle based on the pixel point coordinates around the relative position coordinates includes: Taking the relative position coordinate as the center, selecting a plurality of surrounding pixel coordinates to form a target coordinate area based on the plurality of pixel coordinates; In the target coordinate area, the 0 degree direction angle is calculated based on the preset number of pixel point coordinates in the 0 degree direction, the 45 degree direction angle is calculated based on the preset number of pixel point coordinates in the 45 degree direction, the 90 degree direction angle is calculated based on the preset number of pixel point coordinates in the 90 degree direction, and the 135 degree direction angle is calculated based on the preset number of pixel point coordinates in the 135 degree direction.

5. The image scaling method according to claim 1, characterized in that: The step of analyzing the image signal acquired by the image acquisition device to obtain image data includes: Analyze the image signal collected by the image acquisition device according to the preset indication signal to obtain image data, and store the image data in a double rate synchronous dynamic random access memory; wherein the indication signal includes a line synchronization signal, a field synchronization signal and a data enable signal; Accordingly, the image scaling method further includes: The scaled image data is displayed using the display device based on the indication signal.

6. The image scaling method according to any one of claims 1 to 5, characterized in that: The determining the target area to which the relative position coordinates belong in the image data, and assigning interpolated pixel point data calculated based on each pixel point data corresponding to the target area to the target position coordinates, includes: Determine four pixel point coordinates in the image data that can surround the relative position coordinates, and use the area formed by the four pixel point coordinates as the target area to which the relative position coordinates in the image data belong; Divide the target area into 4×4 sub-areas; wherein each of the sub-areas corresponds to an area ratio threshold in the horizontal and vertical directions; After multiplying the abscissa value and the ordinate value of the relative position coordinate by 256 respectively, determine the lower 8 bits of the abscissa data and the lower 8 bits of the ordinate data; Compare the lower 8 bits of the horizontal coordinate data and the lower 8 bits of the vertical coordinate data with the area ratio threshold corresponding to each of the sub-areas in the corresponding direction, so as to determine the target sub-area to which the relative position coordinate belongs in the target area; The pixel point data corresponding to the four pixel point coordinates are weightedly calculated according to the target interpolation weight coefficient corresponding to the target sub-region to obtain interpolated pixel point data, and the interpolated pixel point data is assigned to the target position coordinates.

7. The image scaling method according to claim 6, characterized in that: Also includes: According to the positional relationship of each of the sub-regions in the target region and the distance between each of the sub-regions and the four pixel points, an interpolation weight coefficient corresponding to the four pixel points is pre-assigned to each of the sub-regions.

8. An image scaling device, characterized in that: include: An analysis module, used for analyzing the image signal acquired by the image acquisition device to obtain image data; a scaling calculation module, configured to calculate the relative position coordinates of each target position coordinate in the image to be displayed in the display device in the image data by using a scaling ratio calculated based on the image resolution and the display resolution if the image resolution of the image data does not match the display resolution of the display device; An interpolation method determination module, used to calculate the target direction angle based on the pixel point coordinates around the relative position coordinates, and determine the corresponding target interpolation method according to the direction angle calculation result; A first interpolation module, configured to select pixel point data closest to the relative position coordinates in the image data and assign them to the target position coordinates if the target interpolation method is a nearest neighbor interpolation algorithm; The second interpolation module is used to determine the target area to which the relative position coordinates belong in the image data if the target interpolation method is a preset improved interpolation algorithm, and assign the interpolated pixel point data calculated based on the pixel point data corresponding to the target area to the target position coordinates.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the image scaling method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the steps of the image scaling method according to any one of claims 1 to 7 are implemented.