コード例 #1
0
 public void TestInplaceNot()
 {
     if (CudaInvoke.HasCuda)
     {
         Image <Bgr, Byte>     img    = new Image <Bgr, byte>(300, 400);
         CudaImage <Bgr, Byte> gpuMat = new CudaImage <Bgr, byte>(img);
         CudaInvoke.BitwiseNot(gpuMat, gpuMat, null, null);
         Assert.IsTrue(gpuMat.Equals(new CudaImage <Bgr, Byte>(img.Not())));
     }
 }
コード例 #2
0
        public void TestColorConvert()
        {
            if (CudaInvoke.HasCuda)
            {
                Image <Bgr, Byte> img = new Image <Bgr, byte>(300, 400);
                img.SetRandUniform(new MCvScalar(0.0, 0.0, 0.0), new MCvScalar(255.0, 255.0, 255.0));
                Image <Gray, Byte> imgGray = img.Convert <Gray, Byte>();
                Image <Hsv, Byte>  imgHsv  = img.Convert <Hsv, Byte>();

                CudaImage <Bgr, Byte>  gpuImg     = new CudaImage <Bgr, Byte>(img);
                CudaImage <Gray, Byte> gpuImgGray = gpuImg.Convert <Gray, Byte>();
                CudaImage <Hsv, Byte>  gpuImgHsv  = gpuImg.Convert <Hsv, Byte>();

                Assert.IsTrue(gpuImgGray.Equals(new CudaImage <Gray, Byte>(imgGray)));
                Assert.IsTrue(gpuImgHsv.ToImage().Equals(imgHsv));
                Assert.IsTrue(gpuImgHsv.Equals(new CudaImage <Hsv, Byte>(imgHsv)));
            }
        }
コード例 #3
0
ファイル: AutoTestCuda.cs プロジェクト: Warren-GH/emgucv
 public void TestInplaceNot()
 {
    if (CudaInvoke.HasCuda)
    {
       Image<Bgr, Byte> img = new Image<Bgr, byte>(300, 400);
       CudaImage<Bgr, Byte> gpuMat = new CudaImage<Bgr, byte>(img);
       CudaInvoke.BitwiseNot(gpuMat, gpuMat, null, null);
       Assert.IsTrue(gpuMat.Equals(new CudaImage<Bgr, Byte>(img.Not())));
    }
 }