private void WhiteBalanceBarButtonItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Details.whitebalance = new Mat(); CvInvoke.BalanceWhite(Details.sourceimagehand, Details.whitebalance, WhiteBalanceMethod.Simple, 0f, 255f, 0f, 255f); Step2PictureEdit.Image = Details.whitebalance.Bitmap; ImageProcessingProgressBarControl.PerformStep(); ImageProcessingProgressBarControl.Update(); }
private void ProcessImageBarButtonItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Details.sourceimagehand = new Mat(Details.imagefilepath, LoadImageType.Grayscale); Details.whitebalance = new Mat(); CvInvoke.BalanceWhite(Details.sourceimagehand, Details.whitebalance, WhiteBalanceMethod.Simple, 0f, 255f, 0f, 255f); Directory.CreateDirectory(@"D:\Eighth Semester\HandVeinPattern\\RuntimeDirectory"); Details.adaptivethreshold = new Mat(); CvInvoke.AdaptiveThreshold(Details.whitebalance, Details.adaptivethreshold, 255, AdaptiveThresholdType.GaussianC, ThresholdType.Binary, 11, -3); CvInvoke.Imwrite(@"D:\Eighth Semester\HandVeinPattern\RuntimeDirectory\AdaptiveThreshold.jpg", Details.adaptivethreshold); opencvwrapper.process(); Details.maskedimage = new Mat(); Details.maskedimage = new Mat(@"D:\Eighth Semester\HandVeinPattern\RuntimeDirectory\ResultImage.jpg", LoadImageType.Grayscale); Details.erode_step1 = new Mat(); Details.erode_step2 = new Mat(); CvInvoke.MorphologyEx(Details.maskedimage, Details.erode_step1, MorphOp.Erode, CvInvoke.GetStructuringElement(ElementShape.Ellipse, new Size(3, 3), new Point(-1, -1)), new Point(-1, -1), 9, BorderType.Constant, new MCvScalar(0)); CvInvoke.MorphologyEx(Details.erode_step1, Details.erode_step2, MorphOp.Erode, CvInvoke.GetStructuringElement(ElementShape.Ellipse, new Size(3, 3), new Point(-1, -1)), new Point(-1, -1), 7, BorderType.Constant, new MCvScalar(0)); Details.laplacian = new Mat(); CvInvoke.Laplacian(Details.sourceimagehand, Details.laplacian, DepthType.Cv8U, 11, 1.0, 0.0, BorderType.Constant); Details.multipliedimage = new Mat(); Mat _newFilteredImage = new Mat(); CvInvoke.Multiply(Details.laplacian, Details.maskedimage, _newFilteredImage, 1.0, DepthType.Cv8U); CvInvoke.Multiply(Details.laplacian, Details.erode_step2, Details.multipliedimage, 1.0, DepthType.Cv8U); Mat newsource = new Mat(); newsource = Details.multipliedimage.Clone(); Details.thinnedimage = new Mat(); CvInvoke.Threshold(newsource, Details.thinnedimage, 10, 255, ThresholdType.Binary); CvInvoke.Imwrite(@"D:\Eighth Semester\HandVeinPattern\RuntimeDirectory\MultipliedImage.jpg", Details.thinnedimage); thinningopencvwrapper.process(); Details.thinnedimage = new Mat(); Details.thinnedimage = new Mat(@"D:\Eighth Semester\HandVeinPattern\RuntimeDirectory\ThinnedImage.jpg", LoadImageType.Grayscale); Details.keypointsimage = new Mat(); Details.keypointsimage = PutFeaturesOnImage(); ProcessedImagePictureEdit.Image = Details.keypointsimage.Bitmap; ImageMatchingProgressBarControl.PerformStep(); ImageMatchingProgressBarControl.Update(); }