Hi, I want to concatenate multiple images from line scan camera. Which is the best way to do that?

Hi, I want to concatenate multiple images from line scan camera. Which is the best way to do that?

Hi @Win64,

One solution would be to define the final concatenated image and write the acquired images in a defined position inside of it by using the following functions in c++:


Kind regards

Hi @Win64

I have never done this to be honest but thinking about it the python way I might just make the images an array:

npArray = cvb.as_array(image)

and then just += the two arrays.
Have never tried that but maybe you want to give it a go and let us know if this actually works.

Hi @Win64,

the best way depends on what you want to achieve. Note, that the following is valid for area and line scan cameras. I will only refer to a way to put pixel next to each other. I will not cover any sophisticated stitching.

The simplest way is to use:

concat_v_image = cvb.PanoramicMappedImage.create_vertical(image_a, image_b)
concat_h_image = cvb.PanoramicMappedImage.create_horizontal(image_a, image_b)

If you have more then two images to concatenate you can stack the calls. Please be aware that no data is copied so these method is very fast. If the memory layout of the final image must be contiguous I suggest to call Image.clone() to copy all the data into a contiguous layout.