Image stretching method and device, electronic equipment and computer readable medium

By converting the image into a raster image and a two-dimensional array, extracting and building a stretched area, simple stretching of images in different formats is achieved, solving the problems of single format and cumbersome operation in the prior art, and significantly shortening the image stretching time.

CN119168850APending Publication Date: 2024-12-20BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310720895.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-16
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The prior art is difficult to achieve local stretching of images in different formats, and the stretching operation is cumbersome and takes a long time.

Method used

Convert the image to be stretched into a raster image, then convert it into an image two-dimensional array, extract the two-dimensional array of stretched areas, and build a two-dimensional array of stretched images based on the stretching information, and perform stretching operations through the two-dimensional array. .

Benefits of technology

The stretching of images in different formats is realized, which simplifies the operation steps and shortens the stretching time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119168850A_ABST
    Figure CN119168850A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image stretching method and device, electronic equipment and a computer readable medium. A specific embodiment of the method comprises the following steps: responding to a received to-be-stretched image, and converting the to-be-stretched image into a raster image; converting the raster image into an image two-dimensional array according to pixels corresponding to the raster image; according to a region image to be stretched in the raster image, extracting a corresponding stretched region two-dimensional array from the image two-dimensional array; according to stretching information corresponding to the image to be stretched, a stretched image two-dimensional array corresponding to the image two-dimensional array is constructed, and a stretching area in the stretched image two-dimensional array is an element-free area; and constructing a stretched image according to the stretched area two-dimensional array and the stretched image two-dimensional array. The implementation mode is related to cloud computing, the stretching step is simplified, and the stretching time is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to an image stretching method, device, electronic device, and computer-readable medium. Background Art

[0002] Currently, for partial stretching of images, the commonly used method is to mark the position that needs to be stretched in the PNG format image, make it into a 9patch image, and write the stretching position information into the PNG file header after compilation by AAPT (Android Asset Packaging Tool) to complete the partial stretching of the image.

[0003] However, the above method usually has the following technical problems: the format of the stretched image is relatively single, it is difficult to stretch images of different formats, and the stretching operation is cumbersome and the image stretching time is long.

[0004] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the invention

[0005] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0006] Some embodiments of the present disclosure provide image stretching methods, devices, electronic devices, computer-readable media, and program products to solve one or more of the technical problems mentioned in the above background technology section.

[0007] In a first aspect, some embodiments of the present disclosure provide an image stretching method, the method comprising: in response to receiving an image to be stretched, converting the image to be stretched into a raster image; converting the raster image into a two-dimensional array of images according to pixels corresponding to the raster image; extracting a corresponding two-dimensional array of stretching areas from the two-dimensional array of images according to the image of the area to be stretched in the raster image; constructing a two-dimensional array of stretched images corresponding to the two-dimensional array of images according to stretching information corresponding to the image to be stretched, wherein the stretching area in the two-dimensional array of stretched images is an element-free area; constructing a stretched image according to the two-dimensional array of stretching areas and the two-dimensional array of stretched images.

[0008] Optionally, the stretching information includes a stretching length and a stretching width; and the stretching information corresponding to the image to be stretched is used to construct a stretched image two-dimensional array corresponding to the image two-dimensional array, including: constructing an empty two-dimensional array with the stretching length as the number of rows of the two-dimensional array and the stretching width as the number of columns of the two-dimensional array; determining a width interval and a length interval corresponding to the stretching area two-dimensional array; determining a stretching width two-dimensional array and a stretching length two-dimensional array in the image two-dimensional array according to the width interval and the length interval; and adding the stretching width two-dimensional array and the stretching length two-dimensional array to the empty two-dimensional array to obtain a stretching image two-dimensional array.

[0009] Optionally, the above-mentioned determination of the width interval and the length interval corresponding to the above-mentioned stretching area two-dimensional array includes: establishing a width interval according to the minimum width value and the maximum width value of the above-mentioned stretching area two-dimensional array; establishing a length interval according to the minimum length value and the maximum length value of the above-mentioned stretching area two-dimensional array.

[0010] Optionally, the above-mentioned determination of the stretched width two-dimensional array and the stretched length two-dimensional array in the above-mentioned image two-dimensional array according to the above-mentioned width interval and the above-mentioned length interval includes: determining each two-dimensional array element in the above-mentioned image two-dimensional array that is smaller than the minimum value of the above-mentioned width interval as a first stretched width two-dimensional array; determining each two-dimensional array element in the above-mentioned image two-dimensional array that is larger than the maximum value of the above-mentioned width interval as a second stretched width two-dimensional array; combining the above-mentioned first stretched width two-dimensional array and the above-mentioned second stretched width two-dimensional array into a stretched width two-dimensional array; determining each two-dimensional array element in the above-mentioned image two-dimensional array that is smaller than the minimum value of the above-mentioned length interval as a first stretched length two-dimensional array; determining each two-dimensional array element in the above-mentioned image two-dimensional array that is larger than the maximum value of the above-mentioned length interval as a second stretched length two-dimensional array; and combining the above-mentioned first stretched length two-dimensional array and the above-mentioned second stretched length two-dimensional array into a stretched length two-dimensional array.

[0011] Optionally, the stretched width two-dimensional array includes: a first stretched width two-dimensional array and a second stretched width two-dimensional array, and the stretched length two-dimensional array includes: a first stretched length two-dimensional array and a second stretched length two-dimensional array; and the above-mentioned stretch width two-dimensional array and the above-mentioned stretch length two-dimensional array are added to the above-mentioned empty two-dimensional array to obtain a stretched image two-dimensional array, including: according to the original numbers corresponding to the two-dimensional array elements, each two-dimensional array element in the above-mentioned first stretched width two-dimensional array is added to the above-mentioned empty two-dimensional array in sequence to obtain a first two-dimensional array; each two-dimensional array element in the above-mentioned second stretched width two-dimensional array is added to the above-mentioned first two-dimensional array in reverse order to obtain a second two-dimensional array; according to the original numbers corresponding to the two-dimensional array elements, each two-dimensional array element in the above-mentioned first stretched length two-dimensional array is added to the above-mentioned second two-dimensional array in sequence to obtain a third two-dimensional array; each two-dimensional array element in the above-mentioned second stretched length two-dimensional array is added to the above-mentioned third two-dimensional array in reverse order to obtain a fourth two-dimensional array as the stretched image two-dimensional array.

[0012] Optionally, constructing a stretched image based on the stretched area two-dimensional array and the stretched image two-dimensional array includes: determining the difference between the number of columns of the stretched image two-dimensional array and the number of columns of the image two-dimensional array as the number of stretched columns; determining the difference between the number of rows of the stretched image two-dimensional array and the number of rows of the image two-dimensional array as the number of stretched rows; adding the stretched area two-dimensional array to the stretched image two-dimensional array according to the number of stretched columns and the number of stretched rows to obtain a complete stretched image two-dimensional array; and converting the complete stretched image two-dimensional array into a stretched image.

[0013] Optionally, the above-mentioned stretching area two-dimensional array is added to the above-mentioned stretching image two-dimensional array according to the above-mentioned stretching column number and the above-mentioned stretching row number to obtain a complete stretching image two-dimensional array, including: determining the number of columns and the number of rows of the above-mentioned stretching area two-dimensional array as the number of area columns and the number of area rows respectively; determining the ratio of the above-mentioned stretching column number to the above-mentioned area column number as the number of column element additions; determining the ratio of the above-mentioned stretching row number to the above-mentioned area row number as the number of row element additions; and adding the above-mentioned stretching area two-dimensional array to the above-mentioned stretching image two-dimensional array according to the above-mentioned column element addition times and the above-mentioned row element addition times to obtain a complete stretching image two-dimensional array.

[0014] In a second aspect, some embodiments of the present disclosure provide an image stretching device, the device comprising: a first conversion unit, configured to convert the image to be stretched into a raster image in response to receiving the image to be stretched; a second conversion unit, configured to convert the raster image into a two-dimensional array of images according to pixels corresponding to the raster image; an extraction unit, configured to extract a corresponding two-dimensional array of stretched areas from the two-dimensional array of images according to the image of the area to be stretched in the raster image; a first construction unit, configured to construct a two-dimensional array of stretched images corresponding to the two-dimensional array of images according to the stretching information corresponding to the image to be stretched, wherein the stretching area in the two-dimensional array of stretched images is an element-free area; and a second construction unit, configured to construct a stretched image according to the two-dimensional array of stretched areas and the two-dimensional array of stretched images.

[0015] Optionally, the stretching information includes a stretching length and a stretching width.

[0016] Optionally, the first construction unit is further configured to: construct an empty two-dimensional array with the above-mentioned stretching length as the number of rows of the two-dimensional array and the above-mentioned stretching width as the number of columns of the two-dimensional array; determine the width interval and length interval corresponding to the above-mentioned stretching area two-dimensional array; determine the stretching width two-dimensional array and the stretching length two-dimensional array in the above-mentioned image two-dimensional array according to the above-mentioned width interval and the above-mentioned length interval; add the above-mentioned stretching width two-dimensional array and the above-mentioned stretching length two-dimensional array to the above-mentioned empty two-dimensional array to obtain the stretched image two-dimensional array.

[0017] Optionally, the first construction unit is further configured to: establish a width interval according to the minimum width value and the maximum width value of the above-mentioned two-dimensional array of stretched areas; establish a length interval according to the minimum length value and the maximum length value of the above-mentioned two-dimensional array of stretched areas.

[0018] Optionally, the first construction unit is further configured to: determine each two-dimensional array element in the above-mentioned image two-dimensional array that is smaller than the minimum value of the above-mentioned width interval as a first stretched width two-dimensional array; determine each two-dimensional array element in the above-mentioned image two-dimensional array that is larger than the maximum value of the above-mentioned width interval as a second stretched width two-dimensional array; combine the above-mentioned first stretched width two-dimensional array with the above-mentioned second stretched width two-dimensional array into a stretched width two-dimensional array; determine each two-dimensional array element in the above-mentioned image two-dimensional array that is smaller than the minimum value of the above-mentioned length interval as a first stretched length two-dimensional array; determine each two-dimensional array element in the above-mentioned image two-dimensional array that is larger than the maximum value of the above-mentioned length interval as a second stretched length two-dimensional array; and combine the above-mentioned first stretched length two-dimensional array with the above-mentioned second stretched length two-dimensional array into a stretched length two-dimensional array.

[0019] Optionally, the above-mentioned stretch width two-dimensional array includes: a first stretch width two-dimensional array and a second stretch width two-dimensional array, and the above-mentioned stretch length two-dimensional array includes: a first stretch length two-dimensional array and a second stretch length two-dimensional array.

[0020] Optionally, the first construction unit is further configured to: add each two-dimensional array element in the above-mentioned first stretched width two-dimensional array to the above-mentioned empty two-dimensional array in sequence according to the original numbers corresponding to the two-dimensional array elements, so as to obtain a first two-dimensional array; add each two-dimensional array element in the above-mentioned second stretched width two-dimensional array to the above-mentioned first two-dimensional array in reverse order, so as to obtain a second two-dimensional array; add each two-dimensional array element in the above-mentioned first stretched length two-dimensional array to the above-mentioned second two-dimensional array in sequence according to the original numbers corresponding to the two-dimensional array elements, so as to obtain a third two-dimensional array; add each two-dimensional array element in the above-mentioned second stretched length two-dimensional array to the above-mentioned third two-dimensional array in reverse order, so as to obtain a fourth two-dimensional array as a stretched image two-dimensional array.

[0021] Optionally, the second construction unit is further configured to: determine the difference between the number of columns of the stretched image two-dimensional array and the number of columns of the image two-dimensional array as the stretched column number; determine the difference between the number of rows of the stretched image two-dimensional array and the number of rows of the image two-dimensional array as the stretched row number; add the stretched area two-dimensional array to the stretched image two-dimensional array according to the stretched column number and the stretched row number to obtain a complete stretched image two-dimensional array; and convert the complete stretched image two-dimensional array into a stretched image.

[0022] Optionally, the second construction unit is further configured to: determine the number of columns and the number of rows of the above-mentioned stretched region two-dimensional array as the number of region columns and the number of region rows respectively; determine the ratio of the above-mentioned stretched column number to the above-mentioned region column number as the number of times column elements are added; determine the ratio of the above-mentioned stretched row number to the above-mentioned region row number as the number of times row elements are added; according to the above-mentioned number of times column elements are added and the above-mentioned number of times row elements are added, add the above-mentioned stretched region two-dimensional array to the above-mentioned stretched image two-dimensional array to obtain a complete stretched image two-dimensional array. .

[0023] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.

[0024] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0025] In a fifth aspect, some embodiments of the present disclosure provide a computer program product, including a computer program, which implements the method described in any implementation manner of the above-mentioned first aspect when executed by a processor.

[0026] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the image stretching method of some embodiments of the present disclosure, the stretching of images of different formats can be realized, the operation steps are simplified, and the stretching time is shortened. Specifically, the reason why the image stretching time is long is that the format of the stretched image is relatively single, it is difficult to realize the stretching of images of different formats, and the stretching operation is cumbersome. Based on this, the image stretching method of some embodiments of the present disclosure, first, in response to receiving the image to be stretched, the above-mentioned image to be stretched is converted into a raster image. Thus, images of different formats can be converted into raster images. It is convenient to realize the stretching of images of different formats. Secondly, according to the pixels corresponding to the above-mentioned raster image, the above-mentioned raster image is converted into an image two-dimensional array. Thus, it is convenient to stretch according to the elements in the array, and the stretching steps are simplified. Then, according to the image of the area to be stretched in the above-mentioned raster image, the corresponding two-dimensional array of the stretching area is extracted from the above-mentioned two-dimensional array of the image. Thus, the stretching area can be selected. Then, according to the stretching information corresponding to the above-mentioned image to be stretched, a two-dimensional array of stretched images corresponding to the above-mentioned two-dimensional array of images is constructed. Among them, the stretching area in the above-mentioned two-dimensional array of stretched images is an element-free area. Thus, the image can be stretched by stretching the two-dimensional array. Finally, a stretched image is constructed according to the two-dimensional array of stretched regions and the two-dimensional array of stretched images. Thus, a stretched image can be constructed through a two-dimensional array, thereby simplifying the stretching steps and shortening the stretching time. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0028] Figure 1 is a schematic diagram of an application scenario of the image stretching method of some embodiments of the present disclosure;

[0029] Figure 2 is a flow chart of some embodiments of the image stretching method according to the present disclosure;

[0030] Figure 3 It is a schematic diagram of an application scenario of constructing a two-dimensional array of stretched images in the image stretching method disclosed in the present invention;

[0031] Figure 4 are flow charts of other embodiments of the image stretching method according to the present disclosure;

[0032] Figure 5 is a schematic structural diagram of some embodiments of the image stretching device according to the present disclosure;

[0033] Figure 6 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0034] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0035] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0036] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0037] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0038] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0039] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0040] Figure 1 It is a schematic diagram of an application scenario of the image stretching method according to some embodiments of the present disclosure.

[0041] exist Figure 1In the application scenario, first, the computing device 101 can, in response to receiving the image to be stretched 102, convert the image to be stretched 102 into a raster image 103. Secondly, the computing device 101 can convert the raster image 103 into an image two-dimensional array 104 according to the pixels corresponding to the raster image 103. Next, the computing device 101 can extract the corresponding stretching area two-dimensional array 105 from the image two-dimensional array 104 according to the image of the area to be stretched in the raster image 103. Then, the computing device 101 can construct a stretching image two-dimensional array 106 corresponding to the image two-dimensional array 104 according to the stretching information corresponding to the image to be stretched 102. Among them, the stretching area in the stretching image two-dimensional array 106 is an element-free area. Finally, the computing device 101 can construct a stretching image 107 according to the stretching area two-dimensional array 105 and the stretching image two-dimensional array 106.

[0042] It should be noted that the computing device 101 can be hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, or as a single software or software module. No specific limitation is made here.

[0043] It should be understood that Figure 1 The number of computing devices in the embodiment is only illustrative. Any number of computing devices may be provided according to implementation requirements.

[0044] Continue to refer Figure 2 , shows a process 200 of some embodiments of the image stretching method according to the present disclosure. The image stretching method comprises the following steps:

[0045] Step 201: in response to receiving an image to be stretched, convert the image to be stretched into a raster image.

[0046] In some embodiments, the execution subject of the image stretching method (eg Figure 1 The computing device 101 shown) can convert the image to be stretched into a raster image in response to receiving the image to be stretched. Here, the image to be stretched may refer to an image that needs to be partially stretched. That is, the image to be stretched may be an image that stretches and enlarges a certain area / regions in the image. The image to be stretched may be an image in any format, such as a PNG format image or a JPEG format image. In practice, the image to be stretched may be converted into a raster image. Here, the raster image may refer to a Bitmap. That is, there is no limitation on the conversion method.

[0047] Step 202: convert the raster image into a two-dimensional array of images according to the pixels corresponding to the raster image.

[0048] In some embodiments, the execution subject may convert the raster image into a two-dimensional array of images according to the pixels corresponding to the raster image. First, each pixel in the raster image may be converted into a one-dimensional array in pixel order. That is, each array element is a pixel. Then, the one-dimensional array may be converted into a two-dimensional array according to the width of the raster image as the two-dimensional array of images. That is, the number of row array elements of the two-dimensional array of images is the width of the raster image.

[0049] Step 203: extracting a corresponding two-dimensional array of stretching regions from the two-dimensional array of images according to the image of the region to be stretched in the raster image.

[0050] In some embodiments, the execution subject may extract the corresponding two-dimensional array of stretching areas from the two-dimensional array of images according to the image of the area to be stretched in the raster image. The image of the area to be stretched in the raster image may refer to the raster area map to be stretched in the raster image. First, the pixel coordinates of each pixel of the image of the area to be stretched may be determined. Then, the associated array elements may be located in the two-dimensional array of images according to the corresponding pixel coordinates of the image of the area to be stretched, and the located array elements may be extracted as the two-dimensional array of stretching areas.

[0051] Step 204: construct a two-dimensional array of stretched images corresponding to the two-dimensional array of images according to the stretching information corresponding to the image to be stretched.

[0052] In some embodiments, the execution subject may construct a two-dimensional array of stretched images corresponding to the two-dimensional array of images according to the stretching information corresponding to the image to be stretched. Here, the stretching information may refer to the length and width information of stretching the image. For example, the stretching information may refer to stretching the image width by 5 unit lengths (such as millimeters / centimeters). The stretching area in the two-dimensional array of stretched images is an element-free area. Figure 3 In the example shown, the "L, M, N, I, O" array elements in the image 2D array are the stretch area 2D array. The stretch area in the stretch image 2D array is the blank array element area.

[0053] In practice, the execution subject may construct a stretched image two-dimensional array corresponding to the image two-dimensional array through the following steps:

[0054] In the first step, in response to determining that the stretching information is length stretching information, an empty stretching image two-dimensional array is established. The number of rows of the empty stretching image two-dimensional array is the number of rows of the image two-dimensional array plus the value represented by the stretching information. The number of columns of the empty stretching image two-dimensional array is the same as the number of columns of the image two-dimensional array.

[0055] The second step is to determine the minimum column array element and the maximum column array element corresponding to the above two-dimensional array of the stretching area.

[0056] The third step is to sequentially add the array elements in the above two-dimensional image array whose column number is less than the above minimum column array element to the above empty stretched image two-dimensional array to obtain a first stretched image two-dimensional array.

[0057] The fourth step is to sequentially add the array elements in the above two-dimensional image array whose column number is greater than the above maximum column array element to the above first stretched image two-dimensional array to obtain a stretched image two-dimensional array.

[0058] It should be noted that, when the stretching information is width stretching information, the method of generating the two-dimensional array of stretched images can refer to the description of the first step to the fourth step above.

[0059] Step 205 : constructing a stretched image according to the two-dimensional array of stretched regions and the two-dimensional array of stretched images.

[0060] In some embodiments, the execution subject may construct a stretched image based on the two-dimensional array of stretched regions and the two-dimensional array of stretched images. First, the two-dimensional array of stretched regions may be added to the element-free region in the two-dimensional array of stretched images to obtain a two-dimensional array of target images. For example, the two-dimensional array of stretched regions may be copied N times to fill the element-free region in the two-dimensional array of stretched images. N times may be set based on the number of rows and columns of the element-free region. Then, the two-dimensional array of target images may be converted into a stretched raster image. That is, the two-dimensional array of target images may be converted into a Bitmap bitmap.

[0061] In some optional implementations of some embodiments, the execution subject may construct a stretched image through the following steps:

[0062] In the first step, the difference between the number of columns of the two-dimensional array of the stretched image and the number of columns of the two-dimensional array of the image is determined as the number of stretched columns.

[0063] In the second step, the difference between the number of rows of the two-dimensional array of the stretched image and the number of rows of the two-dimensional array of the image is determined as the number of stretched rows.

[0064] The third step is to add the two-dimensional array of stretched regions to the two-dimensional array of stretched images according to the number of stretched columns and the number of stretched rows, so as to obtain a two-dimensional array of complete stretched images.

[0065] In practice, the third step includes the following sub-steps:

[0066] The first sub-step is to determine the number of columns and the number of rows of the two-dimensional array of the stretching regions as the number of region columns and the number of region rows, respectively.

[0067] The second sub-step is to determine the ratio of the number of stretched columns to the number of regional columns as the number of times column elements are added.

[0068] The third sub-step is to determine the ratio of the number of stretched rows to the number of area rows as the number of times row elements are added.

[0069] The fourth sub-step is to add the two-dimensional array of the stretching region to the two-dimensional array of the stretching image according to the number of times the column elements are added and the number of times the row elements are added, so as to obtain a complete two-dimensional array of the stretching image. That is, for each column array element in the two-dimensional array of the stretching region, the number of times the column elements are added is copied and added horizontally to the two-dimensional array of the stretching image. For each row array element in the two-dimensional array of the stretching region, the number of times the row elements are added is copied and added vertically to the two-dimensional array of the stretching image.

[0070] The fourth step is to convert the above two-dimensional array of complete stretched images into a stretched image. That is, the two-dimensional array of complete stretched images can be converted into a Bitmap bitmap.

[0071] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the image stretching method of some embodiments of the present disclosure, the stretching of images of different formats can be realized, the operation steps are simplified, and the stretching time is shortened. Specifically, the reason why the image stretching time is long is that the format of the stretched image is relatively single, it is difficult to realize the stretching of images of different formats, and the stretching operation is cumbersome. Based on this, the image stretching method of some embodiments of the present disclosure, first, in response to receiving the image to be stretched, the above-mentioned image to be stretched is converted into a raster image. Thus, images of different formats can be converted into raster images. It is convenient to realize the stretching of images of different formats. Secondly, according to the pixels corresponding to the above-mentioned raster image, the above-mentioned raster image is converted into an image two-dimensional array. Thus, it is convenient to stretch according to the elements in the array, and the stretching steps are simplified. Then, according to the image of the area to be stretched in the above-mentioned raster image, the corresponding two-dimensional array of the stretching area is extracted from the above-mentioned two-dimensional array of the image. Thus, the stretching area can be selected. Then, according to the stretching information corresponding to the above-mentioned image to be stretched, a two-dimensional array of stretched images corresponding to the above-mentioned two-dimensional array of images is constructed. Among them, the stretching area in the above-mentioned two-dimensional array of stretched images is an element-free area. Thus, the image can be stretched by stretching the two-dimensional array. Finally, a stretched image is constructed according to the two-dimensional array of stretched regions and the two-dimensional array of stretched images. Thus, a stretched image can be constructed through a two-dimensional array. Thus, the stretching step is simplified, the operation is simple, and the stretching time is shortened.

[0072] Further references Figure 4 , showing some other embodiments of the image stretching method according to the present disclosure. The image stretching method comprises the following steps:

[0073] Step 401: in response to receiving an image to be stretched, convert the image to be stretched into a raster image.

[0074] Step 402: convert the raster image into a two-dimensional array of images according to the pixels corresponding to the raster image.

[0075] Step 403: extracting a corresponding two-dimensional array of stretching regions from the two-dimensional array of images according to the image of the region to be stretched in the raster image.

[0076] In some embodiments, the specific implementation of steps 401-403 and the technical effects brought about can be referred to Figure 2 The corresponding steps 201-203 in the embodiments are not described in detail here.

[0077] Step 404, construct an empty two-dimensional array with the stretching length being the number of rows of the two-dimensional array and the stretching width being the number of columns of the two-dimensional array.

[0078] In some embodiments, the execution subject of the image stretching method (eg Figure 1 The terminal device shown in the figure can construct an empty two-dimensional array with the stretching length as the number of rows of the two-dimensional array and the stretching width as the number of columns of the two-dimensional array. That is, the empty two-dimensional array is constructed with the stretching length as the number of rows of the empty two-dimensional array and the stretching width as the number of columns of the empty two-dimensional array. The above-mentioned stretching information includes the stretching length and the stretching width. The stretching length may refer to the length of the image after stretching. The stretching width may refer to the width of the image after stretching.

[0079] Step 405: Determine the width interval and length interval corresponding to the two-dimensional array of stretching areas.

[0080] In some embodiments, the execution entity may determine a width interval and a length interval corresponding to the two-dimensional array of stretch regions.

[0081] In practice, the width interval and length interval corresponding to the above two-dimensional array of stretching regions can be determined by the following steps:

[0082] In the first step, a width interval is established according to the minimum width and maximum width of the two-dimensional array of the stretching area. The minimum width may refer to the column element value corresponding to the smallest column array element in the two-dimensional array of the stretching area. The maximum width may refer to the column element value corresponding to the largest column array element in the two-dimensional array of the stretching area.

[0083] The second step is to establish a length interval according to the minimum length and maximum length of the two-dimensional array of the stretching area. Here, the minimum length may refer to the row element value corresponding to the smallest column array element in the two-dimensional array of the stretching area. The minimum length may refer to the row element value corresponding to the largest column array element in the two-dimensional array of the stretching area.

[0084] Step 406: Determine a stretching width two-dimensional array and a stretching length two-dimensional array in the image two-dimensional array according to the width interval and the length interval.

[0085] In some embodiments, the execution entity may determine a stretching width two-dimensional array and a stretching length two-dimensional array in the image two-dimensional array according to the width interval and the length interval.

[0086] In practice, the execution subject may determine the stretching width two-dimensional array and the stretching length two-dimensional array in the image two-dimensional array through the following steps:

[0087] In the first step, each two-dimensional array element in the two-dimensional array of the image that is smaller than the minimum value of the width interval is determined as a first stretched width two-dimensional array.

[0088] In the second step, each two-dimensional array element in the above two-dimensional image array that is greater than the maximum value of the above width interval is determined as a second stretched width two-dimensional array.

[0089] The third step is to combine the first stretching width two-dimensional array and the second stretching width two-dimensional array into a stretching width two-dimensional array.

[0090] The fourth step is to determine each two-dimensional array element in the above two-dimensional array of the image that is smaller than the minimum value of the above length interval as a first stretched length two-dimensional array.

[0091] The fifth step is to determine each two-dimensional array element in the above two-dimensional array of the image that is greater than the maximum value of the above length interval as a second stretched length two-dimensional array.

[0092] The sixth step is to combine the first stretching length two-dimensional array and the second stretching length two-dimensional array into a stretching length two-dimensional array.

[0093] Step 407: Add the stretch width two-dimensional array and the stretch length two-dimensional array to the empty two-dimensional array to obtain a stretch image two-dimensional array.

[0094] In some embodiments, the execution entity may add the stretch width two-dimensional array and the stretch length two-dimensional array to the empty two-dimensional array to obtain a stretch image two-dimensional array.

[0095] In practice, the execution subject may add the stretch width two-dimensional array and the stretch length two-dimensional array to the empty two-dimensional array through the following steps to obtain a stretch image two-dimensional array:

[0096] In the first step, the two-dimensional array elements in the first stretched width two-dimensional array are sequentially added to the empty two-dimensional array according to the original numbers corresponding to the two-dimensional array elements to obtain the first two-dimensional array. The original numbers can represent the number of columns and rows of the two-dimensional array elements in the image two-dimensional array.

[0097] The second step is to add each two-dimensional array element in the second stretch width two-dimensional array to the first two-dimensional array in reverse order to obtain a second two-dimensional array.

[0098] The third step is to add each two-dimensional array element in the first stretched length two-dimensional array to the second two-dimensional array in sequence according to the original numbers corresponding to the two-dimensional array elements to obtain a third two-dimensional array.

[0099] The fourth step is to add each two-dimensional array element in the second stretched length two-dimensional array to the third two-dimensional array in reverse order to obtain a fourth two-dimensional array as the stretched image two-dimensional array.

[0100] Step 408: construct a stretched image according to the two-dimensional array of stretched regions and the two-dimensional array of stretched images.

[0101] In some embodiments, the specific implementation of step 408 and the technical effects brought about can be referred to Figure 2 The corresponding step 205 in the embodiments will not be described in detail here.

[0102] from Figure 4 It can be seen that Figure 2 Compared with the description of some corresponding embodiments, Figure 4 In some corresponding embodiments, the process 400 can complete the construction of the stretched image two-dimensional array by the original serial numbers corresponding to the two-dimensional array elements, thereby simplifying the stretching operation steps and shortening the image stretching time.

[0103] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of an image stretching device. These device embodiments are similar to Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0104] like Figure 5 As shown, the image stretching device 500 of some embodiments includes: a first conversion unit 501, a second conversion unit 502, an extraction unit 503, a first construction unit 504 and a second construction unit 505. The first conversion unit 501 is configured to convert the image to be stretched into a raster image in response to receiving the image to be stretched; the second conversion unit 502 is configured to convert the raster image into an image two-dimensional array according to the pixels corresponding to the raster image; the extraction unit 503 is configured to extract the corresponding stretching area two-dimensional array from the image two-dimensional array according to the image of the area to be stretched in the raster image; the first construction unit 504 is configured to construct a stretching image two-dimensional array corresponding to the image two-dimensional array according to the stretching information corresponding to the image to be stretched, wherein the stretching area in the stretching image two-dimensional array is an element-free area; the second construction unit 505 is configured to construct a stretching image according to the stretching area two-dimensional array and the stretching image two-dimensional array.

[0105] Optionally, the stretching information includes a stretching length and a stretching width.

[0106] Optionally, the first construction unit 504 is further configured to: construct an empty two-dimensional array with the above-mentioned stretching length as the number of rows of the two-dimensional array and the above-mentioned stretching width as the number of columns of the two-dimensional array; determine the width interval and length interval corresponding to the above-mentioned stretching area two-dimensional array; determine the stretching width two-dimensional array and the stretching length two-dimensional array in the above-mentioned image two-dimensional array according to the above-mentioned width interval and the above-mentioned length interval; add the above-mentioned stretching width two-dimensional array and the above-mentioned stretching length two-dimensional array to the above-mentioned empty two-dimensional array to obtain the stretched image two-dimensional array.

[0107] Optionally, the first construction unit 504 is further configured to: establish a width interval according to the minimum width value and the maximum width value of the two-dimensional array of the stretching area; establish a length interval according to the minimum length value and the maximum length value of the two-dimensional array of the stretching area.

[0108] Optionally, the first construction unit 504 is further configured to: determine each two-dimensional array element in the above-mentioned image two-dimensional array that is smaller than the minimum value of the above-mentioned width interval as a first stretched width two-dimensional array; determine each two-dimensional array element in the above-mentioned image two-dimensional array that is larger than the maximum value of the above-mentioned width interval as a second stretched width two-dimensional array; combine the above-mentioned first stretched width two-dimensional array with the above-mentioned second stretched width two-dimensional array into a stretched width two-dimensional array; determine each two-dimensional array element in the above-mentioned image two-dimensional array that is smaller than the minimum value of the above-mentioned length interval as a first stretched length two-dimensional array; determine each two-dimensional array element in the above-mentioned image two-dimensional array that is larger than the maximum value of the above-mentioned length interval as a second stretched length two-dimensional array; and combine the above-mentioned first stretched length two-dimensional array with the above-mentioned second stretched length two-dimensional array into a stretched length two-dimensional array.

[0109] Optionally, the above-mentioned stretch width two-dimensional array includes: a first stretch width two-dimensional array and a second stretch width two-dimensional array, and the above-mentioned stretch length two-dimensional array includes: a first stretch length two-dimensional array and a second stretch length two-dimensional array.

[0110] Optionally, the first construction unit 504 is further configured to: add each two-dimensional array element in the above-mentioned first stretched width two-dimensional array to the above-mentioned empty two-dimensional array in sequence according to the original numbers corresponding to the two-dimensional array elements, so as to obtain a first two-dimensional array; add each two-dimensional array element in the above-mentioned second stretched width two-dimensional array to the above-mentioned first two-dimensional array in reverse order to obtain a second two-dimensional array; add each two-dimensional array element in the above-mentioned first stretched length two-dimensional array to the above-mentioned second two-dimensional array in sequence according to the original numbers corresponding to the two-dimensional array elements, so as to obtain a third two-dimensional array; add each two-dimensional array element in the above-mentioned second stretched length two-dimensional array to the above-mentioned third two-dimensional array in reverse order to obtain a fourth two-dimensional array as the stretched image two-dimensional array.

[0111] Optionally, the second construction unit 505 is further configured to: determine the difference between the number of columns of the stretched image two-dimensional array and the number of columns of the image two-dimensional array as the stretched column number; determine the difference between the number of rows of the stretched image two-dimensional array and the number of rows of the image two-dimensional array as the stretched row number; add the stretched area two-dimensional array to the stretched image two-dimensional array according to the stretched column number and the stretched row number to obtain a complete stretched image two-dimensional array; and convert the complete stretched image two-dimensional array into a stretched image.

[0112] Optionally, the second construction unit 505 is further configured to: determine the number of columns and the number of rows of the above-mentioned stretched area two-dimensional array as the number of area columns and the number of area rows, respectively; determine the ratio of the above-mentioned stretched column number to the above-mentioned area column number as the number of times column elements are added; determine the ratio of the above-mentioned stretched row number to the above-mentioned area row number as the number of times row elements are added; and add the above-mentioned stretched area two-dimensional array to the above-mentioned stretched image two-dimensional array according to the above-mentioned number of times column elements are added and the above-mentioned number of times row elements are added to obtain a complete stretched image two-dimensional array.

[0113] It is understood that the units described in the device 500 are similar to those described in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be described in detail here.

[0114] Reference below Figure 6 , which shows an electronic device (eg, Figure 1 The electronic devices in some embodiments of the present disclosure may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, AR / VR / MR devices, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0115] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0116] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0117] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0118] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0119] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0120] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to receiving the image to be stretched, converts the image to be stretched into a raster image; according to the pixels corresponding to the raster image, converts the raster image into a two-dimensional array of images; according to the image of the area to be stretched in the raster image, extracts the corresponding two-dimensional array of stretching areas from the two-dimensional array of images; according to the stretching information corresponding to the image to be stretched, constructs a two-dimensional array of stretched images corresponding to the two-dimensional array of images, wherein the stretching area in the two-dimensional array of stretched images is an element-free area; and constructs a stretched image according to the two-dimensional array of stretching areas and the two-dimensional array of stretched images.

[0121] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0122] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0123] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be set in a processor, for example, may be described as: a processor comprising: a first conversion unit, a second conversion unit, an extraction unit, a first construction unit, and a second construction unit. The names of these units do not constitute limitations on the units themselves in certain cases. For example, the extraction unit may also be described as "a unit that extracts a corresponding two-dimensional array of stretching areas from the above-mentioned two-dimensional array of images according to the image of the area to be stretched in the above-mentioned raster image".

[0124] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0125] Some embodiments of the present disclosure further provide a computer program product, including a computer program, which implements any of the above-mentioned image stretching methods when executed by a processor.

[0126] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. An image stretching method, comprising: In response to receiving the image to be stretched, converting the image to be stretched into a raster image; According to the pixels corresponding to the raster image, converting the raster image into a two-dimensional array of images; According to the image of the area to be stretched in the raster image, extracting a corresponding two-dimensional array of stretching areas from the two-dimensional array of images; According to the stretching information corresponding to the image to be stretched, constructing a two-dimensional array of stretched images corresponding to the two-dimensional array of images, wherein the stretching area in the two-dimensional array of stretched images is an area without elements; A stretched image is constructed according to the stretched area two-dimensional array and the stretched image two-dimensional array.

2. The method according to claim 1, wherein: The stretching information includes a stretching length and a stretching width; as well as The step of constructing a two-dimensional array of stretched images corresponding to the two-dimensional array of images according to the stretching information corresponding to the image to be stretched includes: Construct an empty two-dimensional array with the stretching length as the number of rows of the two-dimensional array and the stretching width as the number of columns of the two-dimensional array; Determine the width interval and the length interval corresponding to the two-dimensional array of the stretching area; Determine a stretching width two-dimensional array and a stretching length two-dimensional array in the image two-dimensional array according to the width interval and the length interval; The stretch width two-dimensional array and the stretch length two-dimensional array are added to the empty two-dimensional array to obtain a stretch image two-dimensional array.

3. The method according to claim 2, wherein: The determining of the width interval and the length interval corresponding to the two-dimensional array of the stretching area includes: Establishing a width interval according to the minimum width and the maximum width of the two-dimensional array of the stretching area; A length interval is established according to the minimum length and the maximum length of the two-dimensional array of the stretching area.

4. The method according to claim 2, wherein: The step of determining a stretching width two-dimensional array and a stretching length two-dimensional array in the image two-dimensional array according to the width interval and the length interval includes: Determine each two-dimensional array element in the image two-dimensional array that is smaller than the minimum value of the width interval as a first stretched width two-dimensional array; Determine each two-dimensional array element in the image two-dimensional array that is greater than the maximum value of the width interval as a second stretched width two-dimensional array; combining the first stretch width two-dimensional array and the second stretch width two-dimensional array into a stretch width two-dimensional array; Determine each two-dimensional array element in the image two-dimensional array that is smaller than the minimum value of the length interval as a first stretched length two-dimensional array; Determine each two-dimensional array element in the image two-dimensional array that is greater than the maximum value of the length interval as a second stretched length two-dimensional array; The first stretched length two-dimensional array and the second stretched length two-dimensional array are combined into a stretched length two-dimensional array.

5. The method according to claim 2, wherein: The stretch width two-dimensional array includes: a first stretch width two-dimensional array and a second stretch width two-dimensional array, and the stretch length two-dimensional array includes: a first stretch length two-dimensional array and a second stretch length two-dimensional array; and The step of adding the stretch width two-dimensional array and the stretch length two-dimensional array to the empty two-dimensional array to obtain a stretch image two-dimensional array includes: According to the original numbers corresponding to the two-dimensional array elements, each two-dimensional array element in the first stretch width two-dimensional array is sequentially added to the empty two-dimensional array to obtain a first two-dimensional array; Adding each two-dimensional array element in the second stretch width two-dimensional array to the first two-dimensional array in reverse order to obtain a second two-dimensional array; According to the original numbers corresponding to the two-dimensional array elements, each two-dimensional array element in the first stretch length two-dimensional array is sequentially added to the second two-dimensional array to obtain a third two-dimensional array; Each two-dimensional array element in the second stretched length two-dimensional array is added to the third two-dimensional array in reverse order to obtain a fourth two-dimensional array as a stretched image two-dimensional array.

6. The method according to claim 1, wherein: The step of constructing a stretched image according to the two-dimensional array of stretched regions and the two-dimensional array of stretched images comprises: Determine the difference between the number of columns of the stretched image two-dimensional array and the number of columns of the image two-dimensional array as the stretched column number; Determine the difference between the number of rows of the stretched image two-dimensional array and the number of rows of the image two-dimensional array as the number of stretched rows; According to the number of stretched columns and the number of stretched rows, the two-dimensional array of stretched regions is added to the two-dimensional array of stretched images to obtain a two-dimensional array of complete stretched images; The complete stretched image two-dimensional array is converted into a stretched image.

7. The method according to claim 6, wherein: The step of adding the two-dimensional array of stretched regions to the two-dimensional array of stretched images according to the number of stretched columns and the number of stretched rows to obtain a two-dimensional array of complete stretched images includes: Determine the number of columns and the number of rows of the two-dimensional array of stretching regions as the number of region columns and the number of region rows respectively; The ratio of the number of stretched columns to the number of regional columns is determined as the number of times column elements are added; The ratio of the number of stretched rows to the number of area rows is determined as the number of times row elements are added; According to the number of times the column elements are added and the number of times the row elements are added, the two-dimensional array of the stretched area is added to the two-dimensional array of the stretched image to obtain a two-dimensional array of the complete stretched image.

8. An image stretching device, comprising: A first conversion unit, configured to convert the to-be-stretched image into a raster image in response to receiving the to-be-stretched image; A second conversion unit is configured to convert the raster image into a two-dimensional array of images according to pixels corresponding to the raster image; An extraction unit is configured to extract a corresponding two-dimensional array of stretching areas from the two-dimensional array of images according to the image of the area to be stretched in the raster image; A first construction unit is configured to construct a stretched image two-dimensional array corresponding to the image two-dimensional array according to the stretching information corresponding to the image to be stretched, wherein the stretching area in the stretched image two-dimensional array is an element-free area; The second constructing unit is configured to construct a stretched image according to the two-dimensional array of stretched regions and the two-dimensional array of stretched images.

9. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.