什么是寻找大津阈值emgu品种的功能? [英] what is the function to find otsu threshold in emgu cv?

查看:246
本文介绍了什么是寻找大津阈值emgu品种的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不需要阈值的图像。我想要的门槛。我发现这个在OpenCV中

I don't need the thresholded image. I want the threshold. I found this in OpenCV.

cv::threshold( orig_img, thres_img, 0, 255, CV_THRESH_BINARY+CV_THRESH_OTSU );



是否有EmguCv等效。先谢谢了。

Is there an equivalent in EmguCv. Thanks in advance.

PS。我需要使用此阈值Canny边缘检测

PS. I need to use this threshold for canny edge detector

推荐答案

您可以参考进行自动Canny边缘检测的代码!

You can refer this code for Auto Canny Edge detector!

Image<Gray, byte> Img_Source_Gray = Img_Org_Gray.Copy();
Image<Gray, byte> Img_Egde_Gray = Img_Source_Gray.CopyBlank();
Image<Gray, byte> Img_SourceSmoothed_Gray = Img_Source_Gray.CopyBlank();
Image<Gray, byte> Img_Otsu_Gray = Img_Org_Gray.CopyBlank();

Img_SourceSmoothed_Gray = Img_Source_Gray.SmoothGaussian(3);
double CannyAccThresh = CvInvoke.cvThreshold(Img_EgdeNR_Gray.Ptr, Img_Otsu_Gray.Ptr, 0, 255, Emgu.CV.CvEnum.THRESH.CV_THRESH_OTSU | Emgu.CV.CvEnum.THRESH.CV_THRESH_BINARY);
double CannyThresh = 0.1 * CannyAccThresh;
Img_Otsu_Gray.Dispose();

Img_Egde_Gray = Img_SourceSmoothed_Gray.Canny(CannyThresh, CannyAccThresh);
imageBox2.Image = Img_Egde_Gray;

这篇关于什么是寻找大津阈值emgu品种的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆