I am using a C6 series sensor (Model: C6-4090MCS30-300-420-405) using CVB and I receive images 4096 x .1060.
The final goal is to scan an object and show its image, the size is proximately 4096 x 4096.
The object can’t fit in a single image, therefore we need to scan multiple images of the object while the object moves under the sensor.
So the question is, is there a good way to combine the received images into a single one? Or maybe there is a parameter that defines how many scans needed to create a single image?
the best way is to create a new image with the width dimension of the original images and the hight dimension equal to the number of images to stitch times the lines of the original image.
Here is quick example of stitching the same image 4 times to a new image:
Original image:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Stemmer.Cvb;
namespace CVB_StitchImages
{
internal class Program
{
static void Main(string[] args)
{
int imgCount = 4;
Image[] imgs = new Image[imgCount];
for(int i = 0 ; i < imgs.Length; i++)
{
imgs[i] = Image.FromFile("img.tif");
}
var height = imgs[0].Height;
var heightStitch = height * imgCount;
Image stitchedImage = new Image(imgs[0].Width, heightStitch, imgs[0].Planes.Count, imgs[0].Planes[0].DataType);
LinearAccessData<UInt16> stitchedImage_LinAcc = stitchedImage.Planes[0].GetLinearAccess<UInt16>();
for (int i = 0 ;i < imgs.Length; i++)
{
LinearAccessData<UInt16> linacc = imgs[i].Planes[0].GetLinearAccess<UInt16>();
for(int j = 0 ; j < imgs[i].Width ; j++)
{
for(int k = 0; k < imgs[i].Height ; k++)
{
stitchedImage_LinAcc[j, k + (imgs[i].Height * i)] = linacc[j, k];
}
}
}
stitchedImage.Save("StitchedImage.tif");
}
}
}