private void MakeSegmentasionImage() { // if (plantImageBGR == null || plantImageBGR.Empty ()) { // Debug.Log ("Grayscale image not generated, error with the color image"); // return; // } Mat plantImageLAB = plantImageBGR.CvtColor(ColorConversionCodes.BGR2Lab); Mat[] plantLabChannels = Cv2.Split(plantImageLAB); plantSegmentasionImage = Cv2.Abs(plantLabChannels [1] - plantLabChannels [2]); plantSegmentasionCenter = new Point(plantCenter.x, plantCenter.y); }
public void cuda_abs() { Mat mat1 = Image("lenna.png", ImreadModes.Grayscale); Size size = mat1.Size(); using (GpuMat g_mat1 = new GpuMat(size, mat1.Type())) using (GpuMat dst = new GpuMat()) { g_mat1.Upload(mat1); Cuda.cuda.abs(g_mat1, dst); Mat dst_gold = Cv2.Abs(mat1); ImageEquals(dst_gold, dst); ShowImagesWhenDebugMode(g_mat1, dst); } }
/// <summary> /// Computes absolute value of each matrix element /// </summary> /// <returns></returns> public MatExpr Abs() { return(Cv2.Abs(this)); }