tile_images and tile_images_offset operators for simple mosaic images

tile_images and tile_images_offset operators for simple mosaic images - xh6300 - Blog Park

On paper, I feel shallow at the end, and I absolutely know that this matter has to be done. Fry it again.

1. Introduction

Sometimes a simple puzzle is usually required, which does not involve image fusion or the like, just simple translation to stitch multiple images into one image. tile_images and tile_images_offset are 2 operators for simple puzzles.

When it comes to puzzles, there are definitely the following questions to be clear:

1. How many pictures to put together? Since there are multiple images, this requires a tuple to store a collection of multiple images.

2. Is it a horizontal puzzle or a vertical puzzle? This involves the orientation of the puzzle.

3. Is it seamless splicing one next to the other? Can you do "seam" free stitching? This involves stitching offsets.

 2. tile_images operator puzzle

tile_images (Images: TiledImage: NumColumns, TileOrder:)

Among them: NumColumns refers to the number of columns in the final image , and TileOrder refers to the order in which the sub-images are arranged— vertical or horizontal .

*简单拼接图像的tile_images和tile_images_offset算子
read_image (Image1, 'D:/OpenCVandImages/opencv_images/635.png')
read_image (Image2, 'D:/OpenCVandImages/opencv_images/636.png')
read_image (Image3, 'D:/OpenCVandImages/opencv_images/637.png')
read_image (Image4, 'D:/OpenCVandImages/opencv_images/628.png')
get_image_size (Image2, Width, Height)

gen_empty_obj (Images)
concat_obj (Images, Image1, Images)
concat_obj (Images, Image2, Images)
concat_obj (Images, Image3, Images)
concat_obj (Images, Image4, Images)

tile_images (Images, TiledImage,3, 'vertical')

tile_images (Images, TiledImage2,2, 'vertical')

tile_images (Images, TiledImage3,3, 'horizontal')

tile_images (Images, TiledImage4,2, 'horizontal')

 

 

 三、tile_images_offset

tile_images_offset (imgs, TiledImage, [0, Height], [0,0], [-1,-1], [-1,-1], [-1,-1], [-1,-1], Width, Height *2)

① There are many two-dimensional tuples in the above line of code. In fact, there are several dimensions in several tuples .

②  [0, Height], [0,0] means that the row and column coordinates of the upper left corner of the first picture are (0, 0), and the row and column coordinates of the upper left corner of the second picture are (Height, 0), which means the second picture The graph is vertically next to the first graph.

③ After the four parameters Row1, Col1, Row2, Col2, if you are interested, you can go to the help document yourself, and generally keep the default values.

④   Width, Height *2 means that the width of the final mosaic is Width and the height is Height *2.

 

 

 


read_image (Image11, 'D:/OpenCVandImages/opencv_images/635.png')
read_image (Image22, 'D:/OpenCVandImages/opencv_images/636.png')
read_image (Image33, 'D:/OpenCVandImages/opencv_images/637.png')
get_image_size (Image2, Width, Height)
gen_empty_obj (imgs)
concat_obj (imgs, Image11, imgs)
concat_obj (imgs, Image22, imgs)


*第一、二、三、四……张图的左上角顶点的位置
tile_images_offset (imgs, TiledImage5, [0, Height], [0,0], [-1,-1], [-1,-1], [-1,-1], [-1,-1], Width, Height *2)

tile_images_offset (imgs, TiledImage6, [0, Height], [0,100], [-1,-1], [-1,-1], [-1,-1], [-1,-1], Width, Height *2)
concat_obj (imgs, Image33, imgs)
tile_images_offset (imgs, TiledImage5, [0, Height,2*Height], [0,0,0], [-1,-1,-1], [-1,-1,-1], [-1,-1,-1], [-1,-1,-1], Width, Height *3)

Guess you like

Origin blog.csdn.net/weixin_39354845/article/details/123539054