public void ApplyTest2()
{
var img1 = Accord.Imaging.Image.Clone(Properties.Resources.image2);
var img2 = Accord.Imaging.Image.Clone(Properties.Resources.image2);
var img3 = Accord.Imaging.Image.Clone(Properties.Resources.image2);
var img4 = Accord.Imaging.Image.Clone(Properties.Resources.image2);
MatrixH homography;
Blend blend;
homography = new MatrixH(1, 0, 32,
0, 1, 0,
0, 0);
blend = new Blend(homography, img1);
var img12 = blend.Apply(img2);
//ImageBox.Show("Blend of 1 and 2", img12, PictureBoxSizeMode.Zoom);
Assert.AreEqual(img12.PixelFormat, PixelFormat.Format32bppArgb);
blend = new Blend(homography, img3);
var img34 = blend.Apply(img4);
//ImageBox.Show("Blend of 3 and 4", img34, PictureBoxSizeMode.Zoom);
Assert.AreEqual(img34.PixelFormat, PixelFormat.Format32bppArgb);
homography = new MatrixH(1, 0, 64,
0, 1, 0,
0, 0);
blend = new Blend(homography, img12);
var img1234 = blend.Apply(img34);
//ImageBox.Show("Blend of 1, 2, 3, 4", img1234, PictureBoxSizeMode.Zoom);
Assert.AreEqual(img1234.PixelFormat, PixelFormat.Format32bppArgb);
// Blend of 1 and 5 (8bpp and 32bpp)
homography = new MatrixH(1, 0, 0,
0, 1, 32,
0, 0);
//ImageBox.Show("Image 1", img1, PictureBoxSizeMode.Zoom);
blend = new Blend(homography, img1234);
var img15 = blend.Apply(img1);
//ImageBox.Show("Blend of 1 and 5", img15, PictureBoxSizeMode.Zoom);
Assert.AreEqual(img1234.PixelFormat, PixelFormat.Format32bppArgb);
Assert.AreEqual(img1.PixelFormat, PixelFormat.Format8bppIndexed);
Assert.AreEqual(img15.PixelFormat, PixelFormat.Format32bppArgb);
Assert.AreEqual(128, img15.Width);
Assert.AreEqual(64, img15.Height);
}