private void btn_bg_Click(object sender, EventArgs e)
{
Image img_noise = (Image)pb_grey.Image.Clone();
//得到灰度图像前景色临界值
// img_noise = ccccccmd.ImageHelper.RemoveBlock(img_noise,2);//报错
//int v = ImageProcess.GetDgGrayValue(img_noise);
int v = ImageProcess.ComputeThresholdValue((Bitmap)img_noise);
//Image test = ImageProcess.RemoveBg((Bitmap)img_noise ,v );
// int v2 = Test.ImageProcess.GetDgGrayValue(img_noise);
Image img_bg= ImageProcess.RemoveBg((Bitmap)img_noise ,v);//-----------去背景,内存法
imgBged = Image2Num((Bitmap)img_bg);
WriteToFile(imgBged, "experiment\\" + Path.GetFileNameWithoutExtension(imgurl) + "_bged.txt");
pb_bg.Image = img_bg;
}
/// <summary>