Image processing method, device and equipment

By selecting the appropriate image cutting ratio and scanning order based on the aspect ratio of the target image, segmenting and feature extraction of the image, the problem of image scanning methods in the prior art destroying the continuity of visual information is solved, and a better understanding effect of state space model is achieved.

CN119648711AInactive Publication Date: 2025-03-18QINGDAO HISENSE ELECTRONICS TECH CONSULTANCY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411577957.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-03-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The image scanning method in the prior art destroys the continuity of the visual information of the image itself, which is not conducive to the state space model's understanding of the visual information, and causes the visual information of the cut position to be destroyed to a certain extent, thereby affecting the modeling effect of the state space model.

Method used

By receiving the input target image, its aspect ratio is determined, and the image is segmented according to the pre-saved cutting ratio. Each sub-image is feature extracted, and the sub-eigenvectors are spliced ​​according to the preset scanning order to generate the target feature vector. This method preserves the visual information continuity of the image and avoids information destruction.

Benefits of technology

This method effectively preserves the continuity of the visual information of the image by selecting the appropriate image cutting ratio and scanning order, and improves the understanding of visual information by the state space model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648711A_ABST
    Figure CN119648711A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to an image processing method, device and equipment. In the embodiment of the invention, a plurality of image cutting proportions are configured in advance, and a corresponding scanning sequence is configured for each image cutting proportion, so that when the target image is processed, the target image cutting proportion and the corresponding scanning sequence can be selected according to the length-width ratio of the target image; therefore, the target feature vector sequence corresponding to the target image is obtained, the continuity of the visual information of the image is reserved, the visual information of the image is prevented from being damaged, and the understanding effect of the state space model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In recent years, visual modeling based on state-space models has become a research hotspot in the field of computer vision. However, due to the structural limitations of the state-space model itself, the state-space model only supports 1-dimensional sequence input. Therefore, many image scanning methods have emerged that convert 2-dimensional images into 1-dimensional sequences.

[0003] In existing image scanning methods, the image cutting ratio is usually fixed. For example, the image cutting ratio is 3:3. Based on this image cutting ratio, the image is uniformly cut into 3*3 sub-images, that is, 9 sub-images, and then each sub-image is mapped to obtain the feature vector corresponding to each sub-image, and the feature vectors corresponding to the sub-images are combined into a 1-dimensional feature vector sequence. However, in this type of scanning method, the adjacent visual information in the original image is far away in the converted 1-dimensional sequence, which destroys the continuity of the visual information of the image itself and is not conducive to the state space model's understanding of the visual information; in addition, the use of a fixed image cutting position will cause the visual information of the cut position to be destroyed to a certain extent, thereby affecting the modeling effect of the state space model. Summary of the invention

[0004] The present application provides an image processing method, device and equipment to solve the problem that the image scanning method in the prior art destroys the continuity of the visual information of the image itself, is not conducive to the state-space model's understanding of the visual information, and causes the visual information of the cut position to be destroyed to a certain extent, thereby affecting the modeling effect of the state-space model.

[0005] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:

[0006] Receive an input target image and determine the aspect ratio corresponding to the target image; determine a target image cutting ratio corresponding to the pre-saved aspect ratio, and segment the target image according to the target image cutting ratio;

[0007] Perform feature extraction on each sub-image obtained by segmentation, and determine each sub-feature vector corresponding to each sub-image;

[0008] Each sub-feature vector is spliced ​​according to each scanning order of the target image cutting ratio saved in advance to obtain each spliced ​​feature vector corresponding to each scanning order; each spliced ​​feature vector is spliced ​​to obtain a target feature vector corresponding to the target image; wherein the distance between the sub-feature vectors of two adjacent sub-images in at least one spliced ​​feature vector is less than a preset distance threshold.

[0009] The above technical solution has the following advantages or beneficial effects: multiple image cutting ratios are pre-configured, and a corresponding scanning order is configured for each image cutting ratio. When processing the target image, the target image cutting ratio and the corresponding scanning order can be selected according to the aspect ratio of the target image, so as to obtain the target feature vector sequence corresponding to the target image, retaining the continuity of the visual information of the image itself, avoiding the destruction of the visual information of the image, and thus improving the understanding effect of the state space model.

[0010] In some embodiments of the present application, determining the aspect ratio corresponding to the target image includes:

[0011] receiving an input selection operation for an aspect ratio, and determining the selected candidate aspect ratio as the aspect ratio; or,

[0012] An input candidate ratio is received, and the candidate ratio is determined as the aspect ratio.

[0013] The above technical solution has the following advantages or beneficial effects: the aspect ratio can be determined based on multiple methods, and interaction with the user is achieved at the same time.

[0014] In some embodiments of the present application, determining the target image cropping ratio corresponding to the pre-saved aspect ratio includes:

[0015] Determine, among each of the image cropping ratios, two candidate image cropping ratios having the smallest difference from the aspect ratio;

[0016] The cutting ratios of the two candidate images are determined as the target image cutting ratio.

[0017] The above technical solution has the following advantages or beneficial effects: scanning and fusion are performed according to the two target image cutting ratios of each image, and the two target image cutting ratios compensate each other for the damage to the image information caused by cutting, that is, the position cut by one target image cutting ratio will not be cut in the other target image cutting ratio, thereby effectively retaining the image information.

[0018] In some embodiments of the present application, the step of splicing each of the spliced ​​feature vectors to obtain a target feature vector corresponding to the target image includes:

[0019] Splicing the splicing feature vectors belonging to the same target image cutting ratio to determine each candidate feature vector corresponding to each target image cutting ratio;

[0020] Each of the candidate feature vectors is concatenated to obtain the target feature vector.

[0021] The above technical solution has the following advantages or beneficial effects: while flattening the image, the continuity of visual information is maintained, the actual adjacent contents are prevented from being far apart after flattening, and the close connection between the various parts of the image is retained.

[0022] In some embodiments of the present application, each pre-configured image cutting ratio includes: 2:3, 3:4, 4:5, 4:4, 5:4, 4:3 and 3:2, wherein the first digit of the image cutting ratio is the number of columns of the sub-image obtained by cutting, and the second digit is the number of rows of the sub-image obtained by cutting.

[0023] The above technical solution has the following advantages or beneficial effects: a variety of image cutting ratios are designed so that when cutting a target image, a target image cutting ratio suitable for the aspect ratio of the target image can be selected, thereby improving the accuracy of image understanding.

[0024] In some embodiments of the present application, the scanning order corresponding to each image cutting ratio is the same or different.

[0025] In some embodiments of the present application, the scanning order includes:

[0026] If the image cutting ratio is 3:2, the scanning order is to take the first sub-image where the vertex of the image is located as the starting point and perform serpentine scanning by column;

[0027] If the image cutting ratio is 4:3, the scanning order is to use the second sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two columns by row, and use the third sub-image adjacent to the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform a serpentine scan on the last two columns by row;

[0028] If the image cutting ratio is 5:4, the scanning order is to take the fourth sub-image where the vertex is located as the starting point, perform serpentine scanning on the first two rows by column, and take the fifth sub-image adjacent to the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform serpentine scanning on the last two rows by column;

[0029] If the image cutting ratio is 4:4, the scanning order is to take the sixth sub-image where the vertex is located as the starting point, perform serpentine scanning on the first two rows by column, and take the seventh sub-image that is one sub-image apart from the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform serpentine scanning on the last two rows by row; or, take the sixth sub-image as the starting point, perform serpentine scanning on the first two columns by row, and take the eighth sub-image that is one sub-image apart from the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform serpentine scanning on the last two rows by column;

[0030] If the image cutting ratio is 4:5, the scanning order is to take the ninth sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two columns by row, and take the tenth sub-image adjacent to the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform a serpentine scan on the last two columns by row;

[0031] If the image cutting ratio is 3:4, the scanning order is to take the eleventh sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two rows by column, and take the twelfth sub-image adjacent to the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform a serpentine scan on the last two rows by row;

[0032] If the image cutting ratio is 2:3, the scanning order is to take the thirteenth sub-image where the vertex of the image is located as the starting point and perform serpentine scanning row by row.

[0033] The above technical solution has the following advantages or beneficial effects: compared with the previous line-by-line scanning method, this method can maintain adjacent visual information of the input image in the flattened 1-dimensional sequence.

[0034] In some embodiments of the present application, the method further includes:

[0035] The target feature vector is input into a state-space model, and a prediction result output by the state-space model is obtained.

[0036] The above technical solution has the following advantages or beneficial effects: it can realize the understanding and prediction of the target image.

[0037] In a second aspect, an embodiment of the present application further provides an image processing device, the device comprising:

[0038] A segmentation module is used to receive an input target image and determine the aspect ratio corresponding to the target image; determine a target image cutting ratio corresponding to the pre-saved aspect ratio, and segment the target image according to the target image cutting ratio;

[0039] A processing module, used for extracting features from each sub-image obtained by segmentation, and determining each sub-feature vector corresponding to each sub-image;

[0040] A scanning module is used to splice each sub-feature vector according to each scanning order of the target image cutting ratio saved in advance to obtain each spliced ​​feature vector corresponding to each scanning order; splice each spliced ​​feature vector to obtain a target feature vector corresponding to the target image; wherein the distance between the sub-feature vectors of two adjacent sub-images in at least one spliced ​​feature vector is less than a preset distance threshold.

[0041] In a third aspect, an embodiment of the present application further provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of any of the above-mentioned image processing methods when executing a computer program stored in the memory.

[0042] In an embodiment of the present application, an electronic device receives an input target image and determines the aspect ratio corresponding to the target image; determines the target image cutting ratio corresponding to the pre-saved aspect ratio, and segments the target image according to the target image cutting ratio; extracts features from each sub-image obtained by segmentation, and determines each sub-feature vector corresponding to each sub-image; splices each sub-feature vector according to each scanning order of the pre-saved target image cutting ratio to obtain each spliced ​​feature vector corresponding to each scanning order; splices each spliced ​​feature vector to obtain a target feature vector corresponding to the target image; wherein the distance between the sub-feature vectors of two adjacent sub-images in at least one spliced ​​feature vector is less than a preset distance threshold. Since in an embodiment of the present application, multiple image cutting ratios are pre-configured, and a corresponding scanning order is configured for each image cutting ratio, when processing the target image, the target image cutting ratio and the corresponding scanning order can be selected according to the aspect ratio of the target image, so as to obtain a target feature vector sequence corresponding to the target image, thereby retaining the continuity of the visual information of the image itself, avoiding the destruction of the visual information of the image, and improving the understanding effect of the state space model. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0044] Figure 1 A schematic diagram of an image processing process provided in an embodiment of the present application;

[0045] Figure 2A schematic diagram of the interface of a 2D image scanning platform provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of performing image scanning based on two target image cutting ratios according to an embodiment of the present application;

[0047] Figure 4 A schematic diagram of each image cutting ratio provided in the embodiment of the present application;

[0048] Figure 5 A schematic diagram of a continuous image scanning method in a 3:2 mode provided in an embodiment of the present application;

[0049] Figure 6 A schematic diagram of a continuous image scanning method in a 4:3 mode provided in an embodiment of the present application;

[0050] Figure 7 A schematic diagram of a continuous image scanning method in a 5:4 mode provided in an embodiment of the present application;

[0051] Figure 8 A schematic diagram of a continuous image scanning method in a 4:4 mode provided in an embodiment of the present application;

[0052] Fig. 9 A schematic diagram of a continuous image scanning method in a 4:5 mode provided in an embodiment of the present application;

[0053] Fig.10 A schematic diagram of a continuous image scanning method in a 3:4 mode provided in an embodiment of the present application;

[0054] Fig.11 A schematic diagram of a continuous image scanning method in a 2:3 mode provided in an embodiment of the present application;

[0055] Fig.12 The overall architecture diagram of image processing provided by the embodiment of the present application;

[0056] Fig.13 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;

[0057] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0059] In order to avoid the destruction of the visual information of the image and improve the understanding effect of the state-space model, the embodiments of the present application provide an image processing method, device and equipment.

[0060] In an embodiment of the present application, an electronic device receives an input target image and determines an aspect ratio corresponding to the target image; determines a target image cutting ratio corresponding to a pre-saved aspect ratio, and segments the target image according to the target image cutting ratio; performs feature extraction on each sub-image obtained by segmentation, and determines each sub-feature vector corresponding to each sub-image; splices each sub-feature vector according to each scanning order of the pre-saved target image cutting ratio to obtain each spliced ​​feature vector corresponding to each scanning order; splices each spliced ​​feature vector to obtain a target feature vector corresponding to the target image; wherein a distance between sub-feature vectors of two adjacent sub-images in at least one spliced ​​feature vector is less than a preset distance threshold.

[0061] Figure 1 A schematic diagram of an image processing process provided in an embodiment of the present application, the process includes:

[0062] S101: receiving an input target image and determining the aspect ratio corresponding to the target image; determining a target image cutting ratio corresponding to the pre-saved aspect ratio, and segmenting the target image according to the target image cutting ratio; performing feature extraction on each sub-image obtained by segmentation, and determining each sub-feature vector corresponding to each sub-image.

[0063] An image processing method provided in an embodiment of the present application is applied to an electronic device, which may be a PC or a server.

[0064] In order to reduce the impact of image cutting on the state-space model and avoid the cutting effect caused by the image size when using a fixed image cutting ratio for cutting, thereby affecting the subsequent recognition effect, in an embodiment of the present application, multiple image cutting ratios are pre-configured in the electronic device. After receiving the input target image, the electronic device can select the target image cutting ratio that best suits the target image from the multiple image cutting ratios.

[0065] Specifically, in the embodiment of the present application, after the electronic device receives the input target image, the electronic device determines the aspect ratio of the target image according to the size of the target image, and determines the target image cutting ratio that matches the aspect ratio based on the aspect ratio. The electronic device may determine the image cutting ratio that is closest to the aspect ratio as the target image cutting ratio, or may determine the image cutting ratio that is within a preset range of the difference from the aspect ratio as the target image cutting ratio.

[0066] The electronic device segments the target image using the target image cutting ratio, extracts features from each sub-image obtained by the segmentation, and determines each sub-feature vector corresponding to each sub-image.

[0067] It should be noted that in the embodiment of the present application, the size of each sub-image cut by the electronic device is consistent, that is, the electronic device divides the target image equally according to the target image cutting ratio. The target image cutting ratio is the number of cuts, not the size of each sub-image cut.

[0068] For example, if the target image cutting ratio is 3:3, the electronic device divides the target image into three equal parts in length and three equal parts in width, and finally obtains 9 sub-images.

[0069] In the embodiment of the present application, the electronic device may determine the sub-feature vector corresponding to each sub-image based on an existing image feature extraction method, such as determining the sub-feature vector corresponding to each sub-image based on a feature extraction model, etc., which is not limited here.

[0070] S102: splicing each of the sub-feature vectors according to each scanning order of the target image cutting ratio saved in advance to obtain each spliced ​​feature vector corresponding to each scanning order; splicing each of the spliced ​​feature vectors to obtain a target feature vector corresponding to the target image; wherein the distance between the sub-feature vectors of two adjacent sub-images in at least one spliced ​​feature vector is less than a preset distance threshold.

[0071] In order to avoid the adjacent visual information in the original image being far apart in the converted one-dimensional sequence during the image scanning process, in an embodiment of the present application, multiple corresponding scanning sequences are pre-configured for each image cutting ratio, so that when scanning, the adjacent visual information is continuous in at least one scanning sequence, thereby maintaining the continuity of the visual information, avoiding the actual adjacent content being far apart after flattening, and retaining the close connection between the various parts of the image.

[0072] Specifically, the electronic device obtains each scanning order corresponding to the pre-saved target image cutting ratio, and splices the sub-feature vectors of each sub-image of the target image according to each scanning order, to obtain each spliced ​​feature vector corresponding to each scanning order. In the embodiment of the present application, the scanning order is the splicing order of the sub-feature vectors corresponding to each sub-image.

[0073] In the embodiment of the present application, the target image cutting ratio corresponds to multiple scanning orders. After the electronic device determines the splicing feature vector corresponding to each scanning order, the electronic device splices each splicing feature vector to obtain the target feature vector corresponding to the target image. Since each scanning order is different, the distance between the sub-feature vectors of two adjacent sub-images in at least one splicing feature vector is less than the preset distance threshold, that is, the sub-feature vectors of two adjacent sub-images are continuous in at least one splicing feature vector.

[0074] Since in the embodiment of the present application, multiple image cutting ratios are pre-configured, and a corresponding scanning order is configured for each image cutting ratio, when processing the target image, the target image cutting ratio and the corresponding scanning order can be selected according to the aspect ratio of the target image, so as to obtain a target feature vector sequence corresponding to the target image, thereby retaining the continuity of the visual information of the image itself, avoiding the destruction of the visual information of the image, and improving the understanding effect of the state space model.

[0075] In order to avoid the destruction of the visual information of the image and improve the understanding effect of the state space model, based on the above embodiment, in the embodiment of the present application, the aspect ratio corresponding to the target image is determined including:

[0076] receiving an input selection operation for an aspect ratio, and determining the selected candidate aspect ratio as the aspect ratio; or,

[0077] An input candidate ratio is received, and the candidate ratio is determined as the aspect ratio.

[0078] An embodiment of the present application provides an image fusion scanning method for a state-space model, which can also be used as a core scanning method to build a 2D image scanning platform. The 2D image scanning platform allows users to freely select the scanning method, select or input the size of the target image and upload the target image.

[0079] Specifically, Figure 2 The interface diagram of the 2D image scanning platform provided in the embodiment of the present application is shown in FIG. Figure 2 As shown, on the left side of the interface, you can select the image scanning method, configure the existing scanning method and the scanning method provided by the embodiment of the present application in the background, and if you select "continuous scanning", the scanning method provided by the present application is used for scanning; at the same time, select or customize the size of the input target image to select the appropriate target image cutting ratio. The uploaded target image is displayed in the middle of the interface. The scanning results are displayed on the right side of the interface, and the scanning results can be saved for state space modeling.

[0080] Based on this, in an embodiment of the present application, when determining the aspect ratio of a target image, in addition to determining the aspect ratio of the target image based on the size of the target image, the electronic device may also receive an input selection operation for the aspect ratio, and determine the selected candidate aspect ratio as the aspect ratio of the target image; or, the electronic device may receive an input candidate ratio, and determine the candidate ratio as the aspect ratio of the target image.

[0081] In order to avoid the destruction of the visual information of the image and improve the understanding effect of the state space model, based on the above embodiment, in the embodiment of the present application, the determination of the target image cutting ratio corresponding to the pre-saved aspect ratio includes:

[0082] Determine, among each of the image cropping ratios, two candidate image cropping ratios having the smallest difference from the aspect ratio;

[0083] The cutting ratios of the two candidate images are determined as the target image cutting ratio.

[0084] In actual application, the cutting position of the image is usually fixed, which will cause the visual information of the cut position to be destroyed to a certain extent, thereby affecting the modeling effect of the state space model. Based on this, in order to avoid the visual information of the cutting position of the target image from being destroyed, in an embodiment of the present application, the electronic device will select two different target image cutting ratios to segment the target image, so that the cutting position corresponding to one target image cutting ratio is complete in another target image cutting ratio, thereby avoiding the destruction of visual information.

[0085] Specifically, the electronic device determines the difference between the aspect ratio of the target image and each pre-configured image cutting ratio, and determines two candidate image cutting ratios with the smallest difference. The electronic device determines the two candidate image cutting ratios as the target image cutting ratio, and respectively uses each target image cutting ratio to segment the target image.

[0086] In an embodiment of the present application, in order to reduce the impact of image cutting on modeling, in an embodiment of the present application, the target image is segmented according to two target image cutting ratios and scanned and fused. The two target image cutting ratios compensate for each other's damage to the image information caused by cutting, that is, the position cut by one target image cutting ratio will not be cut in another target image cutting ratio, thereby effectively retaining the image information.

[0087] In order to avoid the destruction of the visual information of the image and improve the understanding effect of the state space model, based on the above embodiment, in the embodiment of the present application, the splicing of each spliced ​​feature vector to obtain the target feature vector corresponding to the target image includes:

[0088] Splicing the splicing feature vectors belonging to the same target image cutting ratio to determine each candidate feature vector corresponding to each target image cutting ratio;

[0089] Each of the candidate feature vectors is concatenated to obtain the target feature vector.

[0090] In an embodiment of the present application, after the electronic device segments the target image using two target image cutting ratios, the electronic device performs feature recognition on each sub-image obtained based on each target image cutting ratio to determine a sub-feature vector of each sub-image.

[0091] For each target image cutting ratio, the electronic device splices the sub-feature vectors of the sub-images belonging to the target image cutting ratio according to each scanning order corresponding to the pre-configured target image cutting ratio to obtain the spliced ​​feature vectors corresponding to each scanning order.

[0092] Afterwards, the electronic device stitches the stitching feature vectors belonging to the same target image cutting ratio, determines each candidate feature vector corresponding to each target image cutting ratio, and stitches each candidate feature vector to obtain a target feature vector.

[0093] Figure 3 This is a schematic diagram of performing image scanning based on two target image cutting ratios according to an embodiment of the present application, such as the Figure 3 As shown, the two target image cropping ratios determined by the electronic device are 2:3 and 3:4, and four scanning orders are saved for each image cropping ratio.

[0094] Among them, for the target image cutting ratio of 2:3, the stitching feature vectors corresponding to the four scanning orders determined by the electronic device are [1,4,5,2,3,6], [4,1,2,5,6,3], [3,6,5,2,1,4] and [6,3,2,5,4,1] respectively; for the target image cutting ratio of 3:4, the stitching feature vectors corresponding to the four scanning orders determined by the electronic device are [1,2,6,5,9,10,11,12,8,7,3,4], [9,10,6,5,1,2,3,4,8,7,11,12], [4,3,7,8,12,11,10,9,5,6,2,1] and [12,11,7,8,4,3,2,1,5,6,10,9].

[0095] The electronic device splices the four splicing feature vectors [1,4,5,2,3,6], [4,1,2,5,6,3], [3,6,5,2,1,4] and [6,3,2,5,4,1] corresponding to the target image cutting ratio 2:3 to obtain the candidate feature vector [1,4,5,2,3,6,4,1,2,5,6,3,3,6,5,2,1,4,6,3,2,5,4,1] corresponding to the target image cutting ratio 2:3; the electronic device splices the four splicing feature vectors [1,2,6,5,9,10,11,12,8,7,3,4], [9, The candidate feature vectors corresponding to the target image cutting ratio of 3:4 are obtained by concatenating [1,2,6,5,9,10,11,12,8,7,3,4,9,10,6,5,1,2,3,4,8,7,11,12,4,3,7,8,12,11,10,9,5,6,2,1,12,11,7,8,4,3,2,1,5,6,10,9] and [12,11,7,8,4,3,2,1,5,6,10,9]. The electronic device concatenates the candidate feature vectors corresponding to the two target image cutting ratios to obtain the target feature vector [1,4,5,2,3,6,4,1,2,5,6,3,3,6,5,2,1,4,6,3,2,5,4,1,1,2,6,5,9,10,11,12,8,7,3,4,9,10,6,5,1,2,3,4,8,7,11,12,4,3,7,8,12,11,10,9,5,6,2,1,12,11,7,8,4,3,2,1,5,6,10,9].

[0096] It should be noted that in Figure 3 Each number (such as 1, 2, ..., 12) is only used to identify the sub-feature vector of each sub-image, which can be expanded into a specific vector or matrix, and is not limited here.

[0097] In order to avoid the destruction of the visual information of the image and improve the understanding of the state-space model, on the basis of the above embodiments, in the embodiments of the present application, the pre-configured image cutting ratios of each image include: 2:3, 3:4, 4:5, 4:4, 5:4, 4:3 and 3:2, wherein the first digit of the image cutting ratio is the number of columns of the sub-image obtained by cutting, and the second digit is the number of rows of the sub-image obtained by cutting.

[0098] The embodiments of the present application propose seven image cutting methods: 2:3, 3:4, 4:5, 4:4, 5:4, 4:3, and 3:2, among which 4:4 can also be abbreviated as 1:1.

[0099] In the image cutting ratio, the first number is the number of columns of the sub-image obtained by cutting, and the second number is the number of rows of the sub-image obtained by cutting.

[0100] For example, if the image cutting ratio is 2:3, it means that when cutting, the target image is cut into two columns and three rows of sub-images.

[0101] Figure 4 A schematic diagram of each image cutting ratio provided in the embodiment of the present application, such as the Figure 4 As shown, if the image cutting ratio is 2:3, the target image is cut into two columns and three rows, with a total of 6 sub-images; if the image cutting ratio is 3:4, the target image is cut into three columns and four rows, with a total of 12 sub-images; if the image cutting ratio is 4:5, the target image is cut into four columns and five rows, with a total of 20 sub-images; if the image cutting ratio is 1:1 (4:4), the target image is cut into four columns and four rows, with a total of 16 sub-images; if the image cutting ratio is 3:2, the target image is cut into three columns and two rows, with a total of 6 sub-images; if the image cutting ratio is 4:3, the target image is cut into four columns and three rows, with a total of 12 sub-images; if the image cutting ratio is 5:4, the target image is cut into five columns and four rows, with a total of 20 sub-images.

[0102] In order to avoid the destruction of the visual information of the image and improve the understanding effect of the state-space model, based on the above embodiment, in the embodiment of the present application, the scanning order corresponding to each image cutting ratio is the same or different.

[0103] In the embodiment of the present application, an image continuous scanning mode is designed to expand a 2D image into a 1D sequence while retaining continuous visual information in the image, and for different image cutting ratios, the scanning sequence pre-configured in the electronic device can be the same or different.

[0104] In order to avoid the destruction of the visual information of the image and improve the understanding effect of the state space model, based on the above embodiment, in the embodiment of the present application, the scanning order includes:

[0105] If the image cutting ratio is 3:2, the scanning order is to take the first sub-image where the vertex of the image is located as the starting point and perform serpentine scanning by column;

[0106] If the image cutting ratio is 4:3, the scanning order is to use the second sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two columns by row, and use the third sub-image adjacent to the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform a serpentine scan on the last two columns by row;

[0107] If the image cutting ratio is 5:4, the scanning order is to take the fourth sub-image where the vertex is located as the starting point, perform serpentine scanning on the first two rows by column, and take the fifth sub-image adjacent to the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform serpentine scanning on the last two rows by column;

[0108] If the image cutting ratio is 4:4, the scanning order is to take the sixth sub-image where the vertex is located as the starting point, perform serpentine scanning on the first two rows by column, and take the seventh sub-image that is one sub-image apart from the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform serpentine scanning on the last two rows by row; or, take the sixth sub-image as the starting point, perform serpentine scanning on the first two columns by row, and take the eighth sub-image that is one sub-image apart from the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform serpentine scanning on the last two rows by column;

[0109] If the image cutting ratio is 4:5, the scanning order is to take the ninth sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two columns by row, and take the tenth sub-image adjacent to the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform a serpentine scan on the last two columns by row;

[0110] If the image cutting ratio is 3:4, the scanning order is to take the eleventh sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two rows by column, and take the twelfth sub-image adjacent to the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform a serpentine scan on the last two rows by row;

[0111] If the image cutting ratio is 2:3, the scanning order is to take the thirteenth sub-image where the vertex of the image is located as the starting point and perform serpentine scanning row by row.

[0112] In an embodiment of the present application, a continuous image scanning method is pre-configured in the electronic device, including seven different image cutting ratios, and each image cutting ratio corresponds to four scanning orders. Each scanning method includes four different directions: upper left, lower left, upper right, and lower right. It is mainly responsible for scanning the cut image in a specific order. Compared with the previous line-by-line scanning method, the embodiment of the present application can maintain the adjacent visual information of the input image in the flattened one-dimensional sequence.

[0113] The following is a detailed description of each scanning order corresponding to each image cutting ratio in conjunction with the accompanying drawings:

[0114] If the image cutting ratio is 3:2, the target image is first cut into 3*2 patches, that is, 3 columns and 2 rows of sub-images, and scanned from the upper left, lower left, upper right, and lower right directions respectively, that is, taking the first sub-image where the vertex of the image is located as the starting point, and performing snake scanning by column.

[0115] Figure 5 A schematic diagram of a continuous image scanning method in a 3:2 mode provided in an embodiment of the present application, such as Figure 5 As shown in the figure, when the image cutting ratio is 3:2, the target image is cut into 3 columns and 2 rows of sub-images. The electronic device starts from the corresponding sub-image on the upper left, sorts it in a snake-like manner by row, and identifies the sub-feature vectors corresponding to each sub-image as 1, 2, 3, 4, 5, and 6. Based on this, the four scanning orders corresponding to the image cutting ratio of 3:2 can be represented as [1, 4, 5, 2, 3, 6], [4, 1, 2, 5, 6, 3], [3, 6, 5, 2, 1, 4], and [6, 3, 2, 5, 4, 1] respectively.

[0116] If the image cutting ratio is 4:3, the target image is first cut into 4*3 patches, that is, 4 columns and 3 rows of sub-images, and scanned from the upper left, lower left, upper right, and lower right directions respectively. That is, the second sub-image where the vertex is located is taken as the starting point, and the first two columns are serpentinely scanned by row, and the third sub-image adjacent to the last scanned sub-image in the first two columns and located in the same row is taken as the starting point, and the last two columns are serpentinely scanned by row.

[0117] Figure 6 A schematic diagram of a continuous image scanning method in a 4:3 mode provided in an embodiment of the present application, such as Figure 6 As shown in the figure, when the image cutting ratio is 4:3, the target image is cut into 4 columns and 3 rows of sub-images. The electronic device starts from the corresponding sub-image on the upper left, sorts it in a snake-like manner by row, and identifies the sub-feature vectors corresponding to each sub-image as 1, 2, ..., 11, 12. Based on this, the four scanning orders corresponding to the image cutting ratio of 4:3 can be expressed as [1, 2, 6, 5, 9, 10, 11, 12, 8, 7, 3, 4], [9, 10, 6, 5, 1, 2, 3, 4, 8, 7, 11, 12], [4, 3, 5, 6, 12, 11, 10, 9, 5, 6, 2, 1] and [12, 11, 7, 8, 4, 3, 2, 1, 5, 6, 10, 9].

[0118] If the image cutting ratio is 5:4, the target image is first cut into 5*4 patches, that is, 5 columns and 4 rows of sub-images, and scanned from the upper left, lower left, upper right, and lower right directions respectively. That is, the fourth sub-image where the vertex is located is taken as the starting point, and the first two rows are serpentinely scanned by column, and the fifth sub-image adjacent to the last scanned sub-image in the first two rows and located in the same column is taken as the starting point, and the last two rows are serpentinely scanned by column.

[0119] Figure 7 A schematic diagram of a continuous image scanning method in a 5:4 mode provided in an embodiment of the present application, such as Figure 7 As shown, when the image cutting ratio is 5:4, the target image is divided into 5 columns and 4 rows of sub-images. The electronic device takes the corresponding sub-image on the upper left as the starting point, performs serpentine sorting by row, and identifies the sub-feature vector corresponding to each sub-image as 1, 2, ..., 11, 12 in sequence. Based on this, the four scanning orders corresponding to the image cropping ratio of 5:4 can be expressed as [1,6,7,2,3,8,9,4,5,10,15,20,19,14,13,18,17,12,11,16], [16,11,12,17,18,13,14,19,20,15,10,5,4,9,8,3,2,7,6,1], [5,10,9,4,3,8,7,2,1,6,11,16,17,12,13,18,19,14,15,20] and [20,15,14,19,18,13,12,17,16,11,6,1,2,7,8,3,4,9,10,5].

[0120] If the image cutting ratio is 4:4, the target image is first cut into 4*4 patches, that is, 4 columns and 4 rows of sub-images, and scanned from the upper left, lower left, upper right, and lower right directions respectively, that is, taking the sixth sub-image where the vertex is located as the starting point, the first two rows are serpentinely scanned by column, and taking the seventh sub-image that is one sub-image apart from the last scanned sub-image in the first two rows and located in the same column as the starting point, the last two rows are serpentinely scanned by row; or, taking the sixth sub-image as the starting point, the first two columns are serpentinely scanned by row, and taking the eighth sub-image that is one sub-image apart from the last scanned sub-image in the first two columns and located in the same row as the starting point, the last two rows are serpentinely scanned by column.

[0121] Figure 8 A schematic diagram of a continuous image scanning method in a 4:4 mode provided in an embodiment of the present application, such as Figure 8As shown, when the image cutting ratio is 4:4, the target image is divided into 4 columns and 4 rows of sub-images. The electronic device takes the corresponding sub-image on the upper left as the starting point, performs serpentine sorting by row, and identifies the sub-feature vector corresponding to each sub-image as 1, 2, ..., 15, 16 in sequence. Based on this, the four scanning orders corresponding to the image cropping ratio of 4:4 can be expressed as [1,5,6,2,3,7,8,4,12,16,15,11,10,14,13,9], [4,8,7,3,2,6,5,1,9,13,14,10,11,15,16,12], [13,14,10,9,5,6,2,1,3,4,8,7,11,12,16,15] and [16,15,11,12,8,7,3,4,2,1,5,6,10,9,13,14] respectively.

[0122] Among them, there is a scan jump in each scan sequence with an image cutting ratio of 4:4, such as Figure 8 As shown by the dotted arrow in .

[0123] If the image cutting ratio is 4:5, the target image is first cut into 4*5 patches, that is, 4 columns and 5 rows of sub-images, and scanned from the upper left, lower left, upper right, and lower right directions respectively. That is, the ninth sub-image where the vertex is located is taken as the starting point, and the first two columns are serpentinely scanned by row, and the tenth sub-image adjacent to the last scanned sub-image in the first two columns and located in the same row is taken as the starting point, and the last two columns are serpentinely scanned by row.

[0124] Fig. 9 A schematic diagram of a continuous image scanning method in a 4:5 mode provided in an embodiment of the present application, such as Fig. 9 As shown, when the image cutting ratio is 4:5, the target image is divided into 4 columns and 5 rows of sub-images. The electronic device takes the corresponding sub-image on the upper left as the starting point, performs serpentine sorting by row, and identifies the sub-feature vector corresponding to each sub-image as 1, 2, ..., 19, 20 in sequence. Based on this, the four scanning orders corresponding to the image cropping ratio of 4:5 can be expressed as [1,2,6,5,9,10,14,13,17,18,19,20,16,15,11,12,8,7,3,4], [17,18,14,13,9,10,6,5,1,2,3,4,8,7,11,12,16,15,18,20], [4,3,7,8,12,11,15,16,20,19,18,17,13,14,10,9,6,5,2,1] and [20,19,15,16,12,11,7,8,4,3,2,1,5,6,10,9,13,14,18,17].

[0125] If the image cutting ratio is 3:4, the target image is first cut into 3*4 patches, that is, 3 columns and 4 rows of sub-images, and scanned from the upper left, lower left, upper right, and lower right directions respectively. That is, the eleventh sub-image where the vertex is located is taken as the starting point, and the first two rows are serpentinely scanned by column, and the twelfth sub-image adjacent to the last scanned sub-image in the first two rows and located in the same column is taken as the starting point, and the last two rows are serpentinely scanned by row.

[0126] Fig.10 A schematic diagram of a continuous image scanning method in a 3:4 mode provided in an embodiment of the present application, such as Fig.10 As shown in the figure, when the image cutting ratio is 3:4, the target image is cut into 3 columns and 4 rows of sub-images. The electronic device starts from the corresponding sub-image on the upper left, performs serpentine sorting by row, and identifies the sub-feature vectors corresponding to each sub-image as 1, 2, ..., 11, 12. Based on this, the four scanning orders corresponding to the image cutting ratio of 3:4 can be expressed as [1, 4, 5, 2, 3, 6, 9, 12, 11, 8, 7, 10], [10, 7, 8, 11, 12, 9, 6, 3, 2, 5, 4, 1], [3, 6, 5, 2, 1, 4, 7, 10, 11, 8, 9, 12] and [12, 9, 8, 11, 10, 7, 4, 1, 2, 5, 6, 3].

[0127] If the image cutting ratio is 2:3, the target image is first cut into 2*3 patches, that is, 2 columns and 3 rows of sub-images, and scanned from the upper left, lower left, upper right, and lower right directions respectively, that is, taking the thirteenth sub-image where the vertex of the image is located as the starting point, and performing serpentine scanning by row.

[0128] Fig.11 A schematic diagram of a continuous image scanning method in a 2:3 mode provided in an embodiment of the present application, such as Fig.11 As shown in the figure, when the image cutting ratio is 2:3, the target image is cut into 2 columns and 3 rows of sub-images. The electronic device starts from the corresponding sub-image on the upper left, performs serpentine sorting by row, and identifies the sub-feature vectors corresponding to each sub-image as 1, 2, ..., 5, 6. Based on this, the four scanning orders corresponding to the image cutting ratio of 2:3 can be expressed as [1,2,4,3,5,6], [5,6,4,3,1,2], [2,1,3,4,6,5] and [6,5,3,4,2,1] respectively.

[0129] In order to avoid the destruction of the visual information of the image and improve the understanding effect of the state space model, based on the above embodiment, in the embodiment of the present application, the method further includes:

[0130] The target feature vector is input into a state-space model, and a prediction result output by the state-space model is obtained.

[0131] In an embodiment of the present application, according to the aspect ratio of the input target image, firstly, two of the seven image cutting ratios are selected as the target image cutting ratios, and then the target image is cut according to the target image cutting ratios respectively, and then according to each scanning order corresponding to each target image cutting ratio, the target image is scanned from four directions, and each scanning result is spliced, and finally, the spliced ​​scanning results of the two target image cutting ratios are spliced ​​again, and finally a one-dimensional sequence, namely, the target feature vector, is obtained.

[0132] The electronic device inputs the final target feature vector into the state space model, and the state space model can make predictions based on the target feature vector. The state space model can make predictions based on the target feature vector to reduce information loss caused by image cutting and improve the visual understanding ability of the state space model.

[0133] Fig.12 The overall architecture diagram of image processing provided in the embodiment of the present application is shown in the figure. Fig.12 As shown in the figure, for the input image, first calculate its aspect ratio, and select the two closest to the aspect ratio from the seven image cutting methods (image cutting ratios) of 2:3, 3:4, 4:5, 1:1, 5:4, 4:3, and 3:2. Then, according to the selected image cutting method, select the corresponding image scanning method to scan the image (i.e. flatten it into a 1D sequence), and then fuse the image scanning results. The fusion results can be used as the input of the state space model after passing through the mapping layer. Fig.12 Taking the 720*480 input image as an example, the calculated aspect ratio of the image is 3:2, so the two image cutting methods closest to 3:2 are selected, namely 3:2 and 4:3, and then the image is cut and scanned according to these two methods respectively (each scanning method includes four different directions from the upper left, lower left, upper right, and lower right). The scanning results are spliced ​​and fused and can be sent to the video state space model through the mapping layer.

[0134] The embodiment of the present application proposes an image fusion scanning method for a state space model, which flattens a 2D image into a continuous 1D sequence, and fuses the 1D sequences obtained by different image cutting methods and different scanning directions as the input of the state space model. It has the following advantages:

[0135] 1. Effectively retain the continuous visual information of the image. The image continuous scanning mode of the embodiment of the present application maintains the continuity of the visual information while flattening the image, avoids the actual adjacent content being far apart after flattening, and retains the close connection between the various parts of the image.

[0136] 2. Reduce the impact of image cutting on modeling. The embodiment of the present application designs an image fusion scanning mechanism, which scans and fuses each image according to two cutting methods. The two cutting methods compensate for the damage to image information caused by cutting, that is, the position cut by one cutting method will not be cut by another cutting method, thereby effectively retaining the image information.

[0137] Fig.13 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application, the device comprising:

[0138] The segmentation module 1301 is used to receive an input target image and determine the aspect ratio corresponding to the target image; determine the target image cutting ratio corresponding to the pre-saved aspect ratio, and segment the target image according to the target image cutting ratio;

[0139] The processing module 1302 is used to extract features from each sub-image obtained by segmentation, and determine each sub-feature vector corresponding to each sub-image;

[0140] The scanning module 1303 is used to splice each sub-feature vector according to each scanning order of the target image cutting ratio saved in advance to obtain each spliced ​​feature vector corresponding to each scanning order; splice each spliced ​​feature vector to obtain a target feature vector corresponding to the target image; wherein the distance between the sub-feature vectors of two adjacent sub-images in at least one spliced ​​feature vector is less than a preset distance threshold.

[0141] In a possible implementation, the segmentation module 1301 is specifically configured to receive an input selection operation for an aspect ratio, and determine the selected candidate aspect ratio as the aspect ratio; or receive an input candidate ratio, and determine the candidate ratio as the aspect ratio.

[0142] In a possible implementation, the segmentation module 1301 is specifically configured to determine, among each image cutting ratio, two candidate image cutting ratios having the smallest difference from the aspect ratio; and determine the two candidate image cutting ratios as the target image cutting ratios.

[0143] In a possible implementation, the scanning module 1303 is specifically used to stitch the splicing feature vectors belonging to the same target image cutting ratio to determine each candidate feature vector corresponding to each target image cutting ratio; and stitch each candidate feature vector to obtain the target feature vector.

[0144] In a possible implementation, each preconfigured image cropping ratio includes: 2:3, 3:4, 4:5, 4:4, 5:4, 4:3 and 3:2, wherein the first digit of the image cropping ratio is the number of rows of the sub-image obtained by the cropping, and the second digit is the number of columns of the sub-image obtained by the cropping.

[0145] In a possible implementation manner, the scanning order corresponding to each image cutting ratio is the same or different.

[0146] In a possible implementation, the scanning sequence includes:

[0147] If the image cutting ratio is 3:2, the scanning order is to take the first sub-image where the vertex of the image is located as the starting point and perform serpentine scanning by column;

[0148] If the image cutting ratio is 4:3, the scanning order is to use the second sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two columns by row, and use the third sub-image adjacent to the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform a serpentine scan on the last two columns by row;

[0149] If the image cutting ratio is 5:4, the scanning order is to take the fourth sub-image where the vertex is located as the starting point, perform serpentine scanning on the first two rows by column, and take the fifth sub-image adjacent to the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform serpentine scanning on the last two rows by column;

[0150] If the image cutting ratio is 4:4, the scanning order is to take the sixth sub-image where the vertex is located as the starting point, perform serpentine scanning on the first two rows by column, and take the seventh sub-image that is one sub-image apart from the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform serpentine scanning on the last two rows by row; or, take the sixth sub-image as the starting point, perform serpentine scanning on the first two columns by row, and take the eighth sub-image that is one sub-image apart from the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform serpentine scanning on the last two rows by column;

[0151] If the image cutting ratio is 4:5, the scanning order is to take the ninth sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two columns by row, and take the tenth sub-image adjacent to the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform a serpentine scan on the last two columns by row;

[0152] If the image cutting ratio is 3:4, the scanning order is to take the eleventh sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two rows by column, and take the twelfth sub-image adjacent to the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform a serpentine scan on the last two rows by row;

[0153] If the image cutting ratio is 2:3, the scanning order is to take the thirteenth sub-image where the vertex of the image is located as the starting point and perform serpentine scanning row by row.

[0154] In a possible implementation, the processing module 1302 is further configured to input the target feature vector into a state-space model and obtain a prediction result output by the state-space model.

[0155] Based on the above embodiments, the present application also provides an electronic device, Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.14 As shown, it includes: a processor 1401, a communication interface 1402, a memory 1403 and a communication bus 1404, wherein the processor 1401, the communication interface 1402, and the memory 1403 communicate with each other through the communication bus 1404;

[0156] The memory 1403 stores a computer program. When the program is executed by the processor 1401, the processor 1401 executes the steps of the image processing method provided in the above embodiments.

[0157] Since the principle of solving the problem by the above electronic device is similar to that of the image processing method, the implementation of the above electronic device can refer to the embodiment of the method, and the repeated parts will not be repeated.

[0158] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 1402 is used for communication between the above electronic device and other devices. The memory may include a random access memory (RAM) and may also include a non-volatile memory (NVM), such as at least one disk storage. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0159] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0160] Based on the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program executable by a processor. When the program runs on the processor, the processor implements the image processing method steps provided in the above embodiments.

[0161] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0162] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0163] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0165] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. An image processing method, characterized in that: The method comprises: Receive an input target image and determine the aspect ratio corresponding to the target image; determine a target image cutting ratio corresponding to the pre-saved aspect ratio, and segment the target image according to the target image cutting ratio; Perform feature extraction on each sub-image obtained by segmentation, and determine each sub-feature vector corresponding to each sub-image; Each sub-feature vector is spliced ​​according to each scanning order of the target image cutting ratio saved in advance to obtain each spliced ​​feature vector corresponding to each scanning order; each spliced ​​feature vector is spliced ​​to obtain a target feature vector corresponding to the target image; wherein the distance between the sub-feature vectors of two adjacent sub-images in at least one spliced ​​feature vector is less than a preset distance threshold.

2. The method according to claim 1, characterized in that Determining the aspect ratio corresponding to the target image includes: receiving an input selection operation for an aspect ratio, and determining the selected candidate aspect ratio as the aspect ratio; or, An input candidate ratio is received, and the candidate ratio is determined as the aspect ratio.

3. The method according to claim 1, characterized in that The step of determining the target image cutting ratio corresponding to the pre-saved aspect ratio includes: Determine, among each of the image cropping ratios, two candidate image cropping ratios having the smallest difference from the aspect ratio; The cutting ratios of the two candidate images are determined as the target image cutting ratio.

4. The method according to claim 3, characterized in that The step of splicing each of the spliced ​​feature vectors to obtain a target feature vector corresponding to the target image comprises: Splicing the splicing feature vectors belonging to the same target image cutting ratio to determine each candidate feature vector corresponding to each target image cutting ratio; Each of the candidate feature vectors is concatenated to obtain the target feature vector.

5. The method according to claim 1, characterized in that Each preconfigured image cutting ratio includes: 2:3, 3:4, 4:5, 4:4, 5:4, 4:3 and 3:2, wherein the first digit of the image cutting ratio is the number of columns of the sub-image obtained by cutting, and the second digit is the number of rows of the sub-image obtained by cutting.

6. The method according to claim 5, characterized in that The scanning order corresponding to each image cutting ratio is the same or different.

7. The method according to claim 6, characterized in that The scanning sequence includes: If the image cutting ratio is 3:2, the scanning order is to take the first sub-image where the vertex of the image is located as the starting point and perform serpentine scanning by column; If the image cutting ratio is 4:3, the scanning order is to use the second sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two columns by row, and use the third sub-image adjacent to the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform a serpentine scan on the last two columns by row; If the image cutting ratio is 5:4, the scanning order is to take the fourth sub-image where the vertex is located as the starting point, perform serpentine scanning on the first two rows by column, and take the fifth sub-image adjacent to the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform serpentine scanning on the last two rows by column; If the image cutting ratio is 4:4, the scanning order is to take the sixth sub-image where the vertex is located as the starting point, perform serpentine scanning on the first two rows by column, and take the seventh sub-image that is one sub-image apart from the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform serpentine scanning on the last two rows by row; or, take the sixth sub-image as the starting point, perform serpentine scanning on the first two columns by row, and take the eighth sub-image that is one sub-image apart from the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform serpentine scanning on the last two rows by column; If the image cutting ratio is 4:5, the scanning order is to take the ninth sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two columns by row, and take the tenth sub-image adjacent to the last scanned sub-image in the first two columns and located in the same row as the starting point, and perform a serpentine scan on the last two columns by row; If the image cutting ratio is 3:4, the scanning order is to take the eleventh sub-image where the vertex is located as the starting point, perform a serpentine scan on the first two rows by column, and take the twelfth sub-image adjacent to the last scanned sub-image in the first two rows and located in the same column as the starting point, and perform a serpentine scan on the last two rows by row; If the image cutting ratio is 2:3, the scanning order is to take the thirteenth sub-image where the vertex of the image is located as the starting point and perform serpentine scanning row by row.

8. The method according to claim 1, characterized in that The method further comprises: The target feature vector is input into a state-space model, and a prediction result output by the state-space model is obtained.

9. An image processing device, characterized in that: The device comprises: A segmentation module is used to receive an input target image and determine the aspect ratio corresponding to the target image; determine a target image cutting ratio corresponding to the pre-saved aspect ratio, and segment the target image according to the target image cutting ratio; A processing module, used for extracting features from each sub-image obtained by segmentation, and determining each sub-feature vector corresponding to each sub-image; A scanning module is used to splice each sub-feature vector according to each scanning order of the target image cutting ratio saved in advance to obtain each spliced ​​feature vector corresponding to each scanning order; splice each spliced ​​feature vector to obtain a target feature vector corresponding to the target image; wherein the distance between the sub-feature vectors of two adjacent sub-images in at least one spliced ​​feature vector is less than a preset distance threshold.

10. An electronic device, characterized in that: The electronic device comprises at least a processor and a memory, and the processor is used to implement the steps of the image processing method according to any one of claims 1 to 8 when executing a computer program stored in the memory.