Image slice seamless connection method and system based on feathering technology

By feathering the overlapping areas of the image slices, the problem that image seam lines cannot be completely eliminated in the prior art is solved, and high-quality image seamless connection and consistent visual effects are achieved.

CN119693224AActive Publication Date: 2025-03-25AFIRSTSOFT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411651316.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-25
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

The prior art cannot completely eliminate the seam lines between image slices, and when processing images with obvious color changes or complex textures, the seam lines are still significant and the image quality is poor.

Method used

Using the seamless connection method of image slicing based on feathering technology, the overlapping areas are processed, and the image blocks are gradually calculated and merged until all overlapping areas are feathered, achieving seamless fusion.

Benefits of technology

The seam lines between image chunking are completely eliminated, the image is highly consistent and the visual effect is maintained, and high-quality image seamless connection is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693224A_ABST
    Figure CN119693224A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image processing, and provides an image slice seamless connection method and system based on the feathering technology. The method comprises the following steps: slicing an input image to obtain N blocks, and then calculating the coordinates of the upper left corner of each block; determining an overlapping region range of the two blocks according to the combination direction of the blocks by adopting a pairwise combination mode; on the basis of the sizes of the blocks and the coordinates of the upper left corner, a specific overlapping area is obtained through calculation; performing feathering processing on the overlapped region to obtain two blocks after smooth transition; and the steps of determining the range of the overlapping regions, calculating the overlapping regions and performing feathering processing are repeated and iterated until all the overlapping regions are feathered, and a final seamless fusion image is obtained. According to the method, under the condition that image information is not lost and the overall visual consistency of the images is kept, the image seam lines are thoroughly eliminated, and high-quality image seamless connection is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and system for seamlessly connecting image slices based on feathering technology. Background Art

[0002] When processing images with super-resolution models or other AI enhancement technologies, images usually need to be sliced. When the sliced ​​images are subsequently merged, seams will appear. Currently, pixel-level processing is commonly used to optimize image seams, that is, the overlapping parts of each slice are retained when the image is sliced, and the overlapping parts are proportionally added when merging. Although such methods can reduce the conspicuousness of seams to a certain extent, they still have the following defects:

[0003] First, the current image seam optimization method cannot completely eliminate the seam, and the fusion processing of the overlapping parts depends on a fixed ratio, which cannot adapt to the characteristics of different images. When processing images with obvious color changes and bright colors, the seam will still be obvious.

[0004] Second, when processing images with complex textures or color gradients, the fusion of overlapping parts often results in the loss of image information, making the final synthesized image of poor quality and unable to meet the application scenarios that require high-quality, flawless output;

[0005] Therefore, we need to develop a method and system for seamless connection of image slices based on feathering technology, which can completely eliminate image seams and achieve high-quality seamless connection of images without losing image information and maintaining the overall visual consistency of the image. Summary of the invention

[0006] The purpose of the present invention is to provide a method and system for seamless connection of image slices based on feathering technology, so as to solve the problems mentioned in the above background technology that the existing image seam line optimization method cannot completely eliminate the seam line, the image optimization quality is poor, and the applicability is not high.

[0007] To achieve the above object, the present invention adopts the following technical solutions:

[0008] According to one aspect of the present invention, a method for seamlessly connecting image slices based on feathering technology is provided, the method comprising the following steps:

[0009] Slice the input image to obtain N blocks and calculate the coordinates of the upper left corner of each block;

[0010] Adopting a two-by-two merging method, determining the overlapping area range of two blocks according to the merging direction of the blocks;

[0011] Based on the size of the block and the coordinate of the upper left corner, a specific overlapping area is calculated;

[0012] Performing feathering processing on the overlapping area to obtain two blocks after smooth transition;

[0013] The steps of determining the range of the overlapping area, calculating the overlapping area, and feathering are repeated and iterated until all the overlapping areas are feathered to obtain a final seamlessly fused image.

[0014] According to another aspect of the present invention, a system for seamlessly connecting image slices based on feathering technology is provided, the system comprising: an image slicing module, a range determination module, an area calculation module, a feathering processing module and a repeated iteration module.

[0015] The image slicing module is used to slice the input image to obtain N blocks and then calculate the coordinates of the upper left corner of each block;

[0016] The range determination module is used to determine the overlapping area range of two blocks according to the merging direction of the blocks by merging two blocks in a pairwise manner;

[0017] The area calculation module is used to calculate the specific overlapping area according to the size of the block and the coordinates of the upper left corner;

[0018] The feathering processing module is used to perform feathering processing on the overlapping area to obtain two blocks after smooth transition;

[0019] The above-mentioned iterative module is used to repeatedly iterate the steps of determining the range of the overlapping area, calculating the overlapping area and feathering processing until all the overlapping areas are feathered to obtain a final seamlessly fused image.

[0020] Based on the above scheme, when the input image is sliced, the number of blocks is determined by the number of rows and columns of the slices; wherein the number of rows and columns of the slices is calculated according to the size of the input image and the input size of the super-resolution model, and the specific calculation formula is:

[0021] R = (H-1 + h) / h;

[0022] C = (W-1 + w) / w;

[0023] Among them, R is the number of rows of the slice, C is the number of columns of the slice, H is the height of the input image, W is the width of the input image, h is the input size height of the super-resolution model, and w is the input size width of the super-resolution model.

[0024] Based on the above scheme, when the input image is sliced, the horizontal offset and the vertical offset are calculated according to the number of rows and columns of the slice, the size of the input image and the input size of the super-resolution model, specifically:

[0025] If W≤w, then X=0;

[0026] If W>w, then X=(W-w) / (C-1);

[0027] If H≤h, then Y=0;

[0028] If H>h, then Y=(H-h) / (R-1);

[0029] Among them, X is the offset in the horizontal direction, Y is the offset in the vertical direction, W is the width of the input image, w is the input size width of the super-resolution model, H is the height of the input image, h is the input size height of the super-resolution model, R is the number of rows of the slice, and C is the number of columns of the slice.

[0030] Based on the above scheme, after the input image is sliced ​​and N blocks are obtained, the upper left corner coordinates of each block are calculated according to the row and column indexes, the horizontal offset and the vertical offset. The specific calculation formula is:

[0031] x = i × X;

[0032] y = j × Y;

[0033] Wherein, x and y represent the horizontal coordinate and the vertical coordinate of the upper left corner of the block respectively, i is the column index, j is the row index, X is the offset in the horizontal direction, and Y is the offset in the vertical direction.

[0034] Based on the above scheme, when the N blocks are merged in pairs, they are merged one by one in the same direction and feathered in sequence, specifically including: first taking the rows as the basis, merging in pairs, merging all the blocks in each row one by one; then taking the columns as the basis, merging in pairs, merging all the blocks in each column one by one; or first taking the columns as the basis, merging in pairs, merging all the blocks in each column one by one, and then taking the rows as the basis, merging in pairs, merging all the blocks in each row one by one.

[0035] Based on the above scheme, the overlapping area of ​​two blocks is determined according to the merging direction of the blocks, specifically including:

[0036] If the merging direction is horizontal, the area range formed between the right end of the current block and the left end of the next block in the horizontal direction is the overlapping area range;

[0037] If the merging direction is a vertical direction, the area range formed between the bottom of the current block and the top of the next block in the vertical direction is the overlapping area range.

[0038] Based on the above scheme, after determining the overlapping area range of the two blocks, the specific overlapping area is calculated according to the size and upper left corner coordinates of the current block, and the overlapping area is feathered. The specific steps are as follows:

[0039] The transparency of the corresponding pixel position in the overlapping area is calculated by linear interpolation:

[0040] If the merging direction is horizontal, the transparency of the left and right edges of the overlapping area are:

[0041] Alpha (左) =(W w -P i ) / W w ;

[0042] Alpha (右) =P i / W w ;

[0043] Among them, Alpha (左) 、Alpha (右) are the transparency of the left and right edges of the overlapping area, respectively, w is the width of the overlapping area, P i is the pixel position;

[0044] If the merging direction is vertical, the transparency of the upper and lower edges of the overlapping area are:

[0045] Alpha (上) =(H h -P i ) / H h ;

[0046] Alpha (下) =P i / H h ;

[0047] Among them, Alpha (上) 、Alpha (下) are the transparency of the upper and lower edges of the overlapping area, respectively, h is the height of the overlapping area, P i is the pixel position;

[0048] Based on the transparency, the pixel values ​​of the two blocks are mixed to obtain two blocks after smooth transition.

[0049] The mixing of the pixel values ​​of the two blocks is achieved by calculating the new color value of the current pixel position in the overlapping area. The specific calculation formula is:

[0050] P (new) =Alpha (P) ×P (A) +(1-Alpha (P) )×P (B) ;

[0051] Among them, P (new) is the new color value of the current pixel position in the overlapping area, Alpha (P) is the transparency of the current pixel position, P (A) , P (B) They respectively represent the color values ​​of the pixels corresponding to the two blocks to be merged.

[0052] It can be seen from the above technical solution that compared with the prior art, the present invention has at least the following advantages and positive effects:

[0053] (1) The present invention can completely eliminate the seams between image blocks by feathering the overlapping areas, so that the image blocks can still maintain a highly consistent visual effect after being merged.

[0054] (2) The present invention adopts a two-by-two merging method to gradually calculate the overlapping areas between image blocks and perform feathering processing, which can effectively avoid the problem of unnatural color transition or loss of details and achieve seamless connection of high-quality images.

[0055] (3) The present invention uses feathering technology to achieve seamless connection of image slices, which is easy to operate. It can not only be quickly integrated into the existing image processing system, but also adapt to a variety of image enhancement tasks, and is extremely efficient and easy to use. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0057] Figure 1 A flowchart of a method for seamlessly connecting image slices based on feathering technology provided by an embodiment of the present invention is shown;

[0058] Figure 2 A flow chart of a method for merging image blocks provided by an embodiment of the present invention is shown;

[0059] Figure 3 A flow chart of a method for feathering an overlapping area provided by an embodiment of the present invention is shown;

[0060] Figure 4 A schematic diagram of the structure of a system for seamlessly connecting image slices based on feathering technology provided by an embodiment of the present invention is shown;

[0061] in, Figure 4 The reference numerals in the figures are described as follows:

[0062] 400-a system for seamless connection of image slices based on feathering technology; 401-image slicing module, 4011-image slicing processing unit, 4012-image coordinate calculation unit; 402-range determination module; 403-area calculation module; 404-feathering processing module, 4041-transparency calculation unit, 4042-pixel value calculation unit; 405-repeated iteration module. DETAILED DESCRIPTION

[0063] In order to more clearly explain the purpose, technical solutions and advantages of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. The example implementation methods can be implemented in various forms and should not be understood as being limited to the examples described herein. On the contrary, these implementation methods are provided to make the present invention more comprehensive and complete, and to fully convey the concepts of the example implementation methods to those skilled in the art.

[0064] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.

[0065] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0066] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0067] The present invention is described in detail below in conjunction with specific embodiments:

[0068] Example 1

[0069] like Figure 1 As shown, the embodiment of the present invention provides a method for seamlessly connecting image slices based on feathering technology, and the specific steps of the method are as follows:

[0070] S1: Slice the input image to obtain N blocks and calculate the coordinates of the upper left corner of each block;

[0071] When a super-resolution model processes an image or processes an image through other AI enhancement techniques, the image usually needs to be sliced ​​to adapt to the fixed input format of the model. In this embodiment, before slicing the input image, the image segmentation parameter is first calculated according to the size of the input image and the input size of the super-resolution model, so that the number of image segments can be determined later according to the image segmentation parameter.

[0072] Specifically, in this embodiment, the image block parameters include: the number of rows of slices, the number of columns of slices, the offset in the horizontal direction, and the offset in the vertical direction; wherein the number of rows and columns of the slices are calculated according to the size of the input image and the input size of the super-resolution model, and the specific calculation formula is:

[0073] R = (H-1 + h) / h;

[0074] C = (W-1 + w) / w;

[0075] Among them, R is the number of rows of the slice, C is the number of columns of the slice, H is the height of the input image, W is the width of the input image, h is the input size height of the super-resolution model, and w is the input size width of the super-resolution model.

[0076] Furthermore, the horizontal offset and the vertical offset are calculated according to the number of rows and columns of the slice, the size of the input image and the input size of the super-resolution model, and the specific calculation formula is:

[0077] If W≤w, then X=0;

[0078] If W>w, then X=(W-w) / (C-1);

[0079] If H≤h, then Y=0;

[0080] If H>h, then Y=(H-h) / (R-1);

[0081] Among them, X is the offset in the horizontal direction, Y is the offset in the vertical direction, W is the width of the input image, w is the input size width of the super-resolution model, H is the height of the input image, h is the input size height of the super-resolution model, R is the number of rows of the slice, and C is the number of columns of the slice.

[0082] Furthermore, after slicing the input image, N original image blocks are obtained; the original image blocks are AI processed to obtain N blocks after AI processing; wherein the AI ​​processing includes but is not limited to super-resolution enhancement, black and white image colorization, image face enhancement, and image lossless enlargement.

[0083] In this embodiment, the horizontal offset X and the vertical offset Y are adjusted in proportion to the size of the original image blocks and the AI-processed blocks.

[0084] If the size of the original image block is 288*288, and the size of the block after AI processing is 1152*1152, the size of the block after AI processing is 4 times larger than that of the original image block, so the horizontal offset X and the vertical offset Y also need to be enlarged by 4 times.

[0085] Furthermore, the upper left corner coordinates of each block are calculated according to the row and column indexes, the horizontal offset, and the vertical offset. The specific calculation formula is:

[0086] x = i × X;

[0087] y = j × Y;

[0088] Wherein, x and y represent the horizontal coordinate and the vertical coordinate of the upper left corner of the block respectively, i is the column index, j is the row index, X is the offset in the horizontal direction, and Y is the offset in the vertical direction.

[0089] S2: using a two-by-two merging method to determine the overlapping area of ​​two blocks according to the merging direction of the blocks;

[0090] Further, the N blocks are merged in pairs. Preferably, in this embodiment, when the N blocks are merged in pairs, they are merged one by one in the same direction and feathered in sequence.

[0091] like Figure 2 As shown, first merge two by two based on the behavior basis, including:

[0092] S201: Taking the block in the first row and the first column as the starting block in the first row, merging the starting block in the first row with the first block on its right in a pairwise manner based on the row, to obtain a first merged block;

[0093] S202: Taking the first merged block as a new starting block, merging the new starting block with the first block on its right in a pairwise manner based on rows, to obtain a second merged block;

[0094] S203: repeating the iterative merging step until all blocks in the first row are merged to obtain merged blocks in the first row;

[0095] S204: Taking the block in the first column of the second row as the starting block of the second row, and merging the starting block of the second row with the first block on its right in a pairwise manner based on the row, to obtain a third merged block;

[0096] S205: repeating the iterative merging step until all blocks in the second row are merged to obtain merged blocks in the second row;

[0097] S306: Repeat the steps of taking rows as the basis and performing intra-row merging until intra-row merging of all rows is completed;

[0098] S207: Based on the column, the first row merged block is used as the first column starting block, and the first column starting block is merged with the second row merged block to obtain the first column merged block;

[0099] S208: Repeat the steps of taking the column as the basis and performing merging within the column until all the blocks within the column are merged to obtain a final merged image.

[0100] Specifically, a specific merging situation is used as an example to illustrate the block merging method used in this embodiment. Assume that an image is divided into 3 rows and 3 columns, and 9 blocks are obtained; among which, the blocks in the first row are: A1, A2, A3; the blocks in the second row are: B1, B2, B3; the blocks in the third row are: C1, C2, C3; then, first merge two by two based on the rows:

[0101] For the first row, starting from block A1, block A1 is merged with block A2 to obtain block A12; further, block A12 is merged with block A3 to obtain block A123;

[0102] For the second row, starting from block B1, block B1 is merged with block B2 to obtain block B12; further, block B12 is merged with block B3 to obtain block B123;

[0103] For the third row, starting from block C1, block C1 is merged with block C2 to obtain block C12; further, block C12 is merged with block C3 to obtain block C123;

[0104] Furthermore, after all rows are merged within the same row, they are merged pairwise based on the columns:

[0105] Starting from block A123, block A123 and block B123 are merged to obtain block AB123; further, block AB123 and block C123 are merged to obtain a final merged image.

[0106] Preferably, in this embodiment, the overlapping area range of two blocks is determined according to the merging direction of the blocks, specifically:

[0107] If the merging direction is horizontal, the area range formed between the right end of the current block and the left end of the next block in the horizontal direction is the overlapping area range;

[0108] If the merging direction is a vertical direction, the area range formed between the bottom of the current block and the top of the next block in the vertical direction is the overlapping area range.

[0109] S3: Calculate a specific overlapping area based on the size of the block and the upper left corner coordinates;

[0110] Furthermore, after determining the overlapping area range of the two blocks, the specific overlapping area is calculated according to the size and upper left corner coordinates of the current block; for example:

[0111] A rectangular coordinate system is established with the upper left corner of the original image (i.e., the input image) as the origin. If the original image size H×W is 800*600, and it is divided into 288*288 blocks, then the formula in step S1 shows that the upper left corner coordinate of block 1 in the first row and first column is (0,0), and the upper left corner coordinate of block 2 in the first row and second column is (156,0). Therefore, the upper left corner coordinate of the overlapping area between block 1 and block 2 is (153,0), and the lower right corner coordinate is (288,288).

[0112] S4: performing feathering processing on the overlapping area to obtain two blocks after smooth transition;

[0113] Furthermore, after obtaining the specific overlapping area, feathering is performed on the overlapping area; preferably, in this embodiment, when feathering is performed, a linear interpolation method is used to perform a smooth transition. Figure 3 As shown, feathering is performed on the overlapping area, including:

[0114] S301: Determine the merging direction of two blocks;

[0115] S302: If the merging direction is horizontal, the transparency of the left and right edges of the overlapping area is calculated to obtain the transparency of the pixel positions corresponding to the two blocks; if the merging direction is vertical, the transparency of the upper and lower edges of the overlapping area is calculated to obtain the transparency of the pixel positions corresponding to the two blocks;

[0116] S303: Based on the transparency of the pixel positions corresponding to the two blocks, the pixel values ​​of the two blocks are mixed to obtain two blocks after smooth transition.

[0117] Specifically, in this embodiment, the transparency of the left edge and the right edge of the overlapping area is calculated using the following calculation formulas:

[0118] Alpha (左) =(W w -P i ) / W w ;

[0119] Alpha (右) =P i / W w ;

[0120] Among them, Alpha (左) 、Alpha (右) are the transparency of the left and right edges of the overlapping area, respectively, w is the width of the overlapping area, P i is the pixel position;

[0121] The calculation formulas for calculating the transparency of the upper edge and the lower edge of the overlapping area are:

[0122] Alpha (上) =(H h -P i ) / H h ;

[0123] Alpha (下) =P i / H h ;

[0124] Among them, Alpha (上) 、Alpha (下) are the transparency of the upper and lower edges of the overlapping area, respectively, h is the height of the overlapping area, P i is the pixel position;

[0125] Preferably, in this embodiment, the pixel values ​​of the two blocks are mixed by calculating a new color value of the current pixel position in the overlapping area, and the specific calculation formula is:

[0126] P (new) =Alpha (P) ×P (A) +(1-Alpha (P) )×P (B) ;

[0127] Among them, P (new) is the new color value of the current pixel position in the overlapping area, Alpha (P) is the transparency of the current pixel position, P (A) , P (B) They respectively represent the color values ​​of the pixels corresponding to the two blocks to be merged.

[0128] S5: Repeat the steps of iteratively determining the overlapping area range, calculating the overlapping area, and feathering until all the overlapping areas are feathered to obtain a final seamlessly fused image.

[0129] In this embodiment, as long as two blocks are merged, the steps of determining the overlapping area range, calculating the overlapping area and feathering processing are required. The two merged blocks are smoothly transitioned before the next merge, until the last block is merged and the feathering processing is completed, and the final seamlessly fused image can be obtained.

[0130] The method for seamlessly connecting image slices described in the embodiment of the present invention gradually calculates the overlapping areas between image blocks and performs feathering processing by merging them two by two. This can not only effectively avoid the problems of unnatural color transition or loss of details, but also completely eliminate the seams between image blocks, so that the image blocks can still maintain a highly consistent visual effect after being merged, thereby achieving high-quality seamless connection of images.

[0131] Example 2

[0132] like Figure 4 As shown, the embodiment of the present invention provides an image slice seamless connection system 400 based on feathering technology, the system comprising: an image slicing module 401, a range determination module 402, an area calculation module 403, a feathering processing module 404 and a repeated iteration module 405; wherein:

[0133] The image slicing module 401 is used to slice the input image to obtain N blocks and then calculate the coordinates of the upper left corner of each block;

[0134] In this embodiment, before slicing the input image, it is first necessary to calculate the image blocking parameters according to the size of the input image and the input size of the super-resolution model, so as to subsequently determine the number of image blocks according to the image blocking parameters; wherein the image blocking parameters include: the number of rows of slices, the number of columns of slices, the horizontal offset, and the vertical offset.

[0135] The image slicing module 401 includes: an image slicing processing unit 4011 and an image coordinate calculation unit 4012; wherein:

[0136] The image slicing processing unit 4011 is configured to: perform slicing processing on the input image to obtain N blocks;

[0137] The above-mentioned image coordinate calculation unit 4012 is configured to calculate the coordinates of the upper left corner of each block according to the image block parameters.

[0138] A range determination module 402 is used to determine the overlapping area range of two blocks according to the merging direction of the blocks by adopting a two-by-two merging method;

[0139] Preferably, in this embodiment, when the N blocks are merged in pairs, they are merged one by one in the same direction and feathered in sequence; the overlapping area range of two blocks is determined according to the merging direction of the blocks, specifically:

[0140] If the merging direction is horizontal, the area range formed between the right end of the current block and the left end of the next block in the horizontal direction is the overlapping area range;

[0141] If the merging direction is a vertical direction, the area range formed between the bottom of the current block and the top of the next block in the vertical direction is the overlapping area range.

[0142] The area calculation module 403 is used to calculate the specific overlapping area according to the size of the block and the upper left corner coordinate;

[0143] Furthermore, after determining the overlapping region range of the two blocks, the region calculation module 403 calculates the specific overlapping region according to the size and upper left corner coordinates of the current block, so as to perform feathering processing on the overlapping region in a targeted manner later.

[0144] A feathering processing module 404 is used to perform feathering processing on the overlapping area to obtain two blocks after smooth transition;

[0145] Furthermore, after obtaining the specific overlapping area, the overlapping area is subjected to feathering processing by the feathering processing module 404; preferably, in this embodiment, when performing the feathering processing, a linear interpolation method is used to perform a smooth transition.

[0146] The feathering processing module 404 includes: a transparency calculation unit 4041 and a pixel value mixing unit 4042; wherein:

[0147] The transparency calculation unit 4041 is configured to: calculate the transparency of the corresponding pixel position in the overlapping area by linear interpolation;

[0148] The pixel value mixing unit 4042 is configured to mix the pixel values ​​of the two blocks based on the transparency of the corresponding pixel positions to obtain two blocks after smooth transition.

[0149] The iterative module 405 is used to iteratively iterate the steps of determining the overlapping area range, calculating the overlapping area and feathering until all the overlapping areas are feathered to obtain a final seamlessly fused image.

[0150] In this embodiment, as long as two blocks are merged, the steps of determining the overlapping area range, calculating the overlapping area and feathering processing are required. The two merged blocks are smoothly transitioned before the next merge, until the last block is merged and the feathering processing is completed, and the final seamlessly fused image can be obtained.

[0151] In this embodiment, the overlapping area range is determined by the range determination module 402, the specific overlapping area is calculated by the area calculation module 403, and the overlapping area is feathered by the feathering processing module 404, so that the overlapping area between the blocks can be processed in a targeted manner, and the problems of unnatural color transition or loss of details can be effectively avoided; at the same time, a smooth transition is performed by linear interpolation, which can completely eliminate the seams between the image blocks, so that the image blocks can still maintain a highly consistent visual effect after being merged, and achieve high-quality seamless connection of images. It can also be easily operated and adapt to various image enhancement tasks, and is extremely efficient and easy to use.

[0152] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present invention, which follows the general principles of the present invention and includes common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present invention are indicated by the claims. It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for seamlessly connecting image slices based on feathering technology, characterized in that: The steps include: Slice the input image to obtain N blocks and calculate the coordinates of the upper left corner of each block; Adopting a two-by-two merging method, determining the overlapping area range of two blocks according to the merging direction of the blocks; Based on the size of the block and the coordinate of the upper left corner, a specific overlapping area is calculated; Performing feathering processing on the overlapping area to obtain two blocks after smooth transition; The steps of determining the range of the overlapping area, calculating the overlapping area, and feathering are repeated and iterated until all the overlapping areas are feathered to obtain a final seamlessly fused image.

2. The image slice seamless connection method according to claim 1, characterized in that: The feathering process of the overlapping area specifically includes: Calculating the transparency of corresponding pixel positions in the overlapping area by linear interpolation; Based on the transparency, the pixel values ​​of the two blocks are mixed to obtain two blocks after smooth transition.

3. The image slice seamless connection method according to claim 1, characterized in that: When the input image is sliced, the number of blocks is determined by the number of rows and columns of the slices; the number of rows and columns of the slices is calculated according to the size of the input image and the input size of the super-resolution model, and the specific calculation formula is: R = (H-1 + h) / h; C = (W-1 + w) / w; Among them, R is the number of rows of the slice, C is the number of columns of the slice, H is the height of the input image, W is the width of the input image, h is the input size height of the super-resolution model, and w is the input size width of the super-resolution model.

4. The image slice seamless connection method according to claim 1, characterized in that: When the input image is sliced, the horizontal offset and the vertical offset are calculated according to the number of rows and columns of the slice, the size of the input image and the input size of the super-resolution model, specifically: If W≤w, then X=0; If W>w, then X=(W-w) / (C-1); If H≤h, then Y=0; If H>h, then Y=(H-h) / (R-1); Among them, X is the offset in the horizontal direction, Y is the offset in the vertical direction, W is the width of the input image, w is the input size width of the super-resolution model, H is the height of the input image, h is the input size height of the super-resolution model, R is the number of rows of the slice, and C is the number of columns of the slice.

5. The image slice seamless connection method according to claim 1, characterized in that: The calculation of the upper left corner coordinate of each block is based on the row and column index, the horizontal offset and the vertical offset. The specific formula is: x = i × X; y = j × Y; Wherein, x and y represent the horizontal coordinate and the vertical coordinate of the upper left corner of the block respectively, i is the column index, j is the row index, X is the offset in the horizontal direction, and Y is the offset in the vertical direction.

6. The image slice seamless connection method according to claim 1, characterized in that: When the N blocks are merged in pairs, they are merged one by one in the same direction and feathered in sequence.

7. The image slice seamless connection method according to claim 1, characterized in that: The determining of the overlapping area range of two blocks according to the merging direction of the blocks specifically includes: If the merging direction is horizontal, the area range formed between the right end of the current block and the left end of the next block in the horizontal direction is the overlapping area range; If the merging direction is a vertical direction, the area range formed between the bottom of the current block and the top of the next block in the vertical direction is the overlapping area range.

8. The image slice seamless connection method according to claim 2, characterized in that: The calculating of the transparency of the corresponding pixel position in the overlapping area is calculated by the height or width of the overlapping area, specifically including: If the merging direction is horizontal, the transparency of the left and right edges of the overlapping area are: Alpha (左) =(W w -P i ) / W w ; Alpha (右) =P i / W w ; Among them, Alpha (左) 、Alpha (右) are the transparency of the left and right edges of the overlapping area, respectively, w is the width of the overlapping area, P i is the pixel position; If the merging direction is vertical, the transparency of the upper and lower edges of the overlapping area are: Alpha (上) =(H h -P i ) / H h ; Alpha (下) =P i / H h ; Among them, Alpha (上) 、Alpha (下) are the transparency of the upper and lower edges of the overlapping area, respectively, h is the height of the overlapping area, P i is the pixel position.

9. The image slice seamless connection method according to claim 2, characterized in that: The mixing of the pixel values ​​of the two blocks is achieved by calculating the new color value of the current pixel position in the overlapping area, and the specific calculation formula is: P (new) =Alpha (P) ×P (A) +(1-Alpha (P) )×P (B) ; Among them, P (new) is the new color value of the current pixel position in the overlapping area, Alpha (P) is the transparency of the current pixel position, P (A) , P (B) They respectively represent the color values ​​of the pixels corresponding to the two blocks to be merged.

10. A seamless connection system for image slices based on feathering technology, characterized in that: include: The image slicing module is used to slice the input image, obtain N blocks, and calculate the coordinates of the upper left corner of each block; A range determination module, used to determine the overlapping area range of two blocks according to the merging direction of the blocks by adopting a two-by-two merging method; An area calculation module, used for calculating a specific overlapping area according to the size of the block and the coordinates of the upper left corner; A feathering processing module, used for performing feathering processing on the overlapping area to obtain two blocks after smooth transition; The iterative module is used to iteratively repeat the steps of determining the overlapping area range, calculating the overlapping area and feathering processing until all the overlapping areas are feathered to obtain a final seamlessly fused image.

Citation Information

Patent Citations

  • Outline-based transparency gradient image matting method

    CN105976371A

  • Picture enhancement method and device, equipment and medium

    CN116630191A

  • Mosaic method for multi-time images

    KR1020150033845A