private void btn_gray_Click(object sender, EventArgs e)
{
Image img = pborigin.Image;
Image img_grey = (Image)img.Clone();
imgOriginal = Image2Num((Bitmap )img_grey);
if (!Directory.Exists("experiment\\"))
{
Directory.CreateDirectory("experiment\\");
}
//imgurl = pborigin.ImageLocation;
WriteToFile(imgOriginal, "experiment\\" + Path.GetFileNameWithoutExtension(imgurl) + "_original.txt");
//WriteToFile(imgGraying, "e:\\yanzhengma\\gray"+pborigin.ImageLocation);
//灰度化处理
//img_gray = ccccccmd.ImageHelper.Gray(img_gray, ccccccmd.ImageHelper.AlgorithmsType.AverageValue);//平均
//img_gray = ccccccmd.ImageHelper.Gray(img_gray, ccccccmd.ImageHelper.AlgorithmsType.MaxValue );//最大值
// img_gray = ccccccmd.ImageHelper.Gray(img_gray, ccccccmd.ImageHelper.AlgorithmsType.WeightAverage);//加权
graytype = 2;
if (rb_max.Checked)
{
graytype = 1;
}
if (rb_quanzhong .Checked )
{
graytype = 3;
}
img_grey = ImageProcess.Gray((Bitmap)img_grey, graytype);
imgGreied = Image2Num((Bitmap)img_grey);
WriteToFile(imgGreied, "experiment\\" + Path.GetFileNameWithoutExtension(imgurl)+"_greied.txt");
pb_grey.Image = img_grey;
}
/// <summary>