Merge two Mat images into one

前端 未结 3 1145
隐瞒了意图╮
隐瞒了意图╮ 2020-12-31 23:15

I have a problem. I have an image. Then I have to split the image into two equal parts. I made this like that (the code is compiled, everything is good):

Mat         


        
3条回答
  •  独厮守ぢ
    2020-12-31 23:36

    There is several way to do this, but the best way I found is to use cv::hconcat(mat1, mat2, dst) for horizontal merge orcv::vconcat(mat1, mat2, dst) for vertical.

    Don't forget to take care of empty matrix merge case !

提交回复
热议问题