
目标检测是计算机视觉中最基本和最具挑战性的问题之一,它试图从自然图像中的大量预定义类别中定位目标实例。深度学习技术已成为直接从数据中学习特征表示的强大策略,并在通用目标检测领域取得了显著突破。鉴于这一快速发展时期,本文的目标是全面综述深度学习技术在这一领域的最新成就。这项调查包括300多项研究贡献,涵盖了通用对象检测的许多方面:检测框架、对象特征表示、对象提议生成、上下文建模、训练策略和评估指标。我们通过确定未来研究的前景来完成调查。
作为计算机视觉中的一个长期、基本和具有挑战性的问题,目标检测(如图1所示)几十年来一直是一个活跃的研究领域(Fischler和Elschlager 1973)。目标检测的目标是确定图像中是否存在来自给定类别(如人类、汽车、自行车、狗或猫)的任何对象实例,如果存在,则返回每个对象实例的空间位置和范围(例如,通过边界框Everingham等人2010;Russakovsky等人2015)。作为图像理解和计算机视觉的基石,目标检测是解决复杂或高级视觉任务的基础,例如分割、场景理解、目标跟踪、图像字幕、事件检测和活动识别。目标检测支持广泛的应用,包括机器人视觉、消费电子、安全、自动驾驶、人机交互、基于内容的图像检索、智能视频监控和增强现实。
最近,深度学习技术(Hinton和Salakhutdinov 2006;LeCun等人,2015)已成为从数据中自动学习特征表示的强大方法。特别是,如图3所示,这些技术在对象检测方面提供了重大改进。
如图2所示,物体检测可以分为两种类型之一(Grauman和Leibe 2011;Zhang等人,2013):特定实例的检测与广泛类别的检测。第一种类型旨在检测特定对象的实例(例如唐纳德·特朗普的脸、埃菲尔铁塔或邻居的狗),本质上是一个匹配问题。第二种类型的目标是检测某些预定义对象类别(例如人、汽车、自行车和狗)的实例(通常以前未看到)。历史上,目标检测领域的大部分工作都集中在单个类别(通常是人脸和行人)或几个特定类别的检测上。相比之下,在过去几年中,研究界已开始朝着更具挑战性的目标迈进,即建立通用目标检测系统,在该系统中,目标检测能力的广度与人类相当。
Krizhevsky等人(2012a)提出了一种称为AlexNet的深度卷积神经网络(DCNN),该网络在大规模视觉识别挑战(ILSVRC)中实现了破纪录的图像分类精度(Russakovsky等人,2015)。自那时以来,计算机视觉的大多数方面的研究重点都是深度学习方法,实际上包括通用对象检测领域(Girshick等人2014;He等人2014;Girshick 2015;Sermanet al.2014;Ren等人2017)。虽然已经取得了巨大的进步,如图3所示,但我们不知道在过去5年中对这一主题进行了全面的调查。鉴于进展速度异常迅速,本文试图跟踪最新进展并总结其成果,以便更清楚地了解通用目标检测中的当前全景。
如表1所示,已经发布了许多著名的物体检测调查。其中包括许多关于特定物体检测问题的优秀调查,例如行人检测(Enzweiler和Gavrila 2009;Geronimo等人2010;Dollar等人2012)、人脸检测(Yang等人2002;Zafeiriou等人2015)、车辆检测(Sun等人2006)和文本检测(Ye和Doermann 2015)。除了张等人(2013)就对象类检测主题进行的调查外,最近直接关注一般对象检测问题的调查相对较少。然而,在Grauman和Leibe(2011)、Andreopoulos和Tsotsos(2013)以及Zhang等人(2013)中回顾的研究大多是在2012年之前,因此在深度学习和相关方法最近取得显著成功并占据主导地位之前。
深度学习允许计算模型学习极其复杂、微妙和抽象的表示,推动了广泛问题的重大进展,如视觉识别、物体检测、语音识别、自然语言处理、医学图像分析、药物发现和基因组学。在不同类型的深度神经网络中,DCNN(LeCun等人,1998、2015;Krizhevsky等人,2012a)在处理图像、视频、语音和音频方面取得了突破。可以肯定的是,已经发表了许多关于深度学习的调查,包括Bengio等人(2013)、LeCun等人(2015)、Litjens等人(2017)、Gu等人(2018),以及最近在ICCV和CVPR的教程中发表的调查。
相比之下,虽然已经提出了许多基于深度学习的目标检测方法,但我们不知道最近有任何全面的调查。全面回顾和总结现有工作对于目标检测的进一步进展至关重要,特别是对于希望进入该领域的研究人员而言。由于我们的重点是一般物体检测,因此将不考虑针对特定物体检测的DCNN的广泛工作,例如人脸检测(李等人2015a;张等人2016a;胡等人2017)、行人检测(张等人2016b;何桑等人2015)、车辆检测(周等人2016b)和交通标志检测(朱等人2016b)。
基于深度学习的通用目标检测的论文数量惊人。事实上,有如此之多的内容,以至于对最新技术的任何全面综述都超出了任何合理篇幅的论文的范围。因此,有必要制定选择标准,将我们的重点限制在顶级期刊和会议论文上。由于这些局限性,我们真诚地向那些作品未包含在本文中的作者道歉。有关相关主题工作的调查,读者请参阅表1中的文章。本综述主要关注过去5年的主要进展,我们将注意力限制在静态图片上,将视频对象检测这一重要课题作为未来单独考虑的主题。

OpenCV级联分类器数据(比如:cascade.xml)用于实现目标识别的核心数据。
CascadeClassifier则是opencv下objdetect模块中用来做目标检测的级联分类器的一个类;简而言之是滑动窗口机制+级联分类器的方式;早期opencv版本仅支持haar特征的目标检测,分别在opencv2.2和2.4之后开始支持LBP和HOG特征的目标检测。
使用现成的级联分类器数据局限性太多了,工业软件都是自己制作。

(1)图片最好用现场拍摄的照片,尽量不要过多的处理,原本最好!
(2)文件夹、文件名等,最好不要有汉字等,数字与字母最好;文件夹最好不要有空格!
(3)本文的《层级分类器集成生成环境》可以帮助你一键生成同样大小、黑白以及按数字命名的正样本图片及负样本图片。
正样本图片,是告诉程序,这些 或 接近的就是目标!
(1)正样本 一般要求 20x20,24x24,64x64;
(2)现在有了本文的《层级分类器集成生成环境》,你随便,正样本只要截取的是正方形(其实也不一定)的即可。
(3)彩色?黑白?无所谓。
(4)正样本文件 pos.txt 是为了生成 正样本矢量化数据 pos.vec 准备的;
- posdata/001.jpg 1 0 0 20 20
- posdata/002.jpg 1 0 0 20 20
- posdata/003.jpg 1 0 0 20 20
- posdata/004.jpg 1 0 0 20 20
- posdata/005.jpg 1 0 0 20 20
- posdata/006.jpg 1 0 0 20 20
- posdata/007.jpg 1 0 0 20 20
- posdata/008.jpg 1 0 0 20 20
- posdata/009.jpg 1 0 0 20 20
- posdata/010.jpg 1 0 0 20 20
- posdata/011.jpg 1 0 0 20 20
- posdata/012.jpg 1 0 0 20 20
正样本文件 pos.txt 每行的格式是:
文件名 样本目标数 起点x 起点 y 宽度 高度
文件名可以用相对路径。样本数建议为1。起点建议为(0,0)。
本文的《层级分类器集成生成环境》可以帮助你一键生成 pos.txt 文件。图片尺寸自动提取。
正样本矢量化数据 pos.vec 是训练必须的基础数据,是归一化、标准化、矢量化的 正样本数据,可以不再使用正样本图片及其数据,因而大大提高训练效率。
正样本矢量化数据 pos.vec 用 opencv_createsamples.exe 生成。
Windows cmd:
opencv_createsamples.exe -vec pos.vec -info pos.txt -num 12 -w 20 -h 20
Windows PowerShell:
.\opencv_createsamples.exe -vec pos.vec -info pos.txt -num 12 -w 20 -h 20
参数简要说明:
- -vec pos.vec 生成的矢量文件
- -info pos.txt 正样本文件
- -num 12 正样本数量
- -w 20 正样本尺寸(宽)
- -h 20 正样本尺寸(高)
本文的《层级分类器集成生成环境》可以帮助你一键生成 pos.vec 文件。不需要进入 cmd 或 PowerShell 去敲键盘!
(1)负样本 是告诉识别程序,哪些元素是目标中没有的!
(2)负样本,大小无所谓;唯一的要求是不能含有正样本的物体;建议尺寸为 320x240 -- 640x480 ;
(3)负样本文件 neg.txt
- C:/Downloads/Baidu/opencv_bin/negdata/001.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/002.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/003.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/004.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/005.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/006.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/007.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/008.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/009.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/010.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/011.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/012.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/013.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/014.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/015.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/016.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/017.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/018.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/019.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/020.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/021.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/022.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/023.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/024.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/025.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/026.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/027.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/028.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/029.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/030.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/031.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/032.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/033.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/034.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/035.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/036.jpeg
- C:/Downloads/Baidu/opencv_bin/negdata/037.jpeg
负样本文件,只需要指定用于训练的 负样本图片即可。绝对地址!绝对地址!绝对地址!
本文的《层级分类器集成生成环境》可以帮助你一键生成 neg.txt 文件。
正样本数 :负样本数 至少是 1:3
有了 pos.vec 与 neg.txt 文件,就可以进行训练了。这个过程 坑 比较多。
Windows cmd:
opencv_traincascaded.exe -data xml -vec pos.vec -bg neg.txt -numPos 12 -numNeg 37 -numStages 20 -w 20 -h 20 -maxFalseAlarmRate 0.5 -mode ALL
Windows PowerShell:
.\opencv_traincascaded.exe -data xml -vec pos.vec -bg neg.txt -numPos 12 -numNeg 37 -numStages 20 -w 20 -h 20 -maxFalseAlarmRate 0.5 -mode ALL
注意几点:
(1)先检查 pos.vec ,neg.txt 文件是否存在?是否符合要求?
(2)建议创建子目录 posdata 放置 正样本 图片;子目录 negdata 放置 负样本图片;
(3)必须创建 xml 子目录;生成结果就在这个子目录下;
(4)无需生成 neg.vec
这个过程很吃资源,很慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢慢,要花很长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长的时间。
敲击这些参数,很麻烦的。经过漫长的等待,最终生成 xml/cascade.xml 文件,大功告成!
本文的《层级分类器集成生成环境》可以帮助你一键做好上述工作,自动完成训练,生成 cascade.xml 文件!!!!!

自己制作 级联分类器数据 不是一件轻松、简单的事情,但没有级联分类器数据几乎无法开展后续的工作。因而不得不硬着头皮做下去。
看到大多数朋友都喜欢进入 cmd 去 key key key,效率实在是太低了。
我们这些从 DOS 过来的骨灰级程序员,有了 Windows 或 iOS 的 GUI ,终于摆脱了 KEY KEY KEY ,看到没有 GUI 的程序简直是受罪。关键是效率太低了。3天的活,本来1小时可以搞掂。
很多 Short-finger Boy 热衷于敲键盘,自以为很 Cool !
为了提高效率,很多年前就写了 《层级分类器集成生成环境》,现在按 Visual Studio 2022 做些改动与改进,放出来分享。
永远别指望深度混淆的代码与文章、下载会收费或改作 VIP!
因为深度混淆主要用C#编程,赚钱很容易,不求名不求利,更不在乎这点毛毛雨。
首先需要有 openCV 训练器相关程序:
(1)使用 openCV 开源,自己或使用别人编译好的 build ;
(2)去 OpenCV 官网下载:
OpenCV 官网下载
https://opencv.org/releases/
(3)(多动症儿童〄的博客_CSDN博客-百度AI,笔记领域博主)提供的下载:
反正,你需要准备下面这些文件,并且复制到 Visual Studio 项目文件的 bin/debug/opencv_bin 目录下。
- opencv_annotation.exe
- opencv_annotationd.exe
- opencv_aruco341.dll
- opencv_aruco341d.dll
- opencv_bgsegm341.dll
- opencv_bgsegm341d.dll
- opencv_bioinspired341.dll
- opencv_bioinspired341d.dll
- opencv_calib3d341.dll
- opencv_calib3d341d.dll
- opencv_ccalib341.dll
- opencv_ccalib341d.dll
- opencv_core341.dll
- opencv_core341d.dll
- opencv_createsamples.exe
- opencv_createsamplesd.exe
- opencv_datasets341.dll
- opencv_datasets341d.dll
- opencv_dnn341.dll
- opencv_dnn341d.dll
- opencv_dnn_objdetect341.dll
- opencv_dnn_objdetect341d.dll
- opencv_dpm341.dll
- opencv_dpm341d.dll
- opencv_face341.dll
- opencv_face341d.dll
- opencv_features2d341.dll
- opencv_features2d341d.dll
- opencv_ffmpeg341_64.dll
- opencv_flann341.dll
- opencv_flann341d.dll
- opencv_fuzzy341.dll
- opencv_fuzzy341d.dll
- opencv_hfs341.dll
- opencv_hfs341d.dll
- opencv_highgui341.dll
- opencv_highgui341d.dll
- opencv_img_hash341.dll
- opencv_img_hash341d.dll
- opencv_imgcodecs341.dll
- opencv_imgcodecs341d.dll
- opencv_imgproc341.dll
- opencv_imgproc341d.dll
- opencv_interactive-calibration.exe
- opencv_interactive-calibrationd.exe
- opencv_line_descriptor341.dll
- opencv_line_descriptor341d.dll
- opencv_ml341.dll
- opencv_ml341d.dll
- opencv_objdetect341.dll
- opencv_objdetect341d.dll
- opencv_optflow341.dll
- opencv_optflow341d.dll
- opencv_phase_unwrapping341.dll
- opencv_phase_unwrapping341d.dll
- opencv_photo341.dll
- opencv_photo341d.dll
- opencv_plot341.dll
- opencv_plot341d.dll
- opencv_reg341.dll
- opencv_reg341d.dll
- opencv_rgbd341.dll
- opencv_rgbd341d.dll
- opencv_saliency341.dll
- opencv_saliency341d.dll
- opencv_shape341.dll
- opencv_shape341d.dll
- opencv_stereo341.dll
- opencv_stereo341d.dll
- opencv_stitching341.dll
- opencv_stitching341d.dll
- opencv_structured_light341.dll
- opencv_structured_light341d.dll
- opencv_superres341.dll
- opencv_superres341d.dll
- opencv_surface_matching341.dll
- opencv_surface_matching341d.dll
- opencv_text341.dll
- opencv_text341d.dll
- opencv_tracking341.dll
- opencv_tracking341d.dll
- opencv_traincascade.exe
- opencv_version.exe
- opencv_versiond.exe
- opencv_video341.dll
- opencv_video341d.dll
- opencv_videoio341.dll
- opencv_videoio341d.dll
- opencv_videostab341.dll
- opencv_videostab341d.dll
- opencv_visualisation.exe
- opencv_visualisationd.exe
- opencv_waldboost_detector.exe
- opencv_waldboost_detectord.exe
- opencv_xfeatures2d341.dll
- opencv_xfeatures2d341d.dll
- opencv_ximgproc341.dll
- opencv_ximgproc341d.dll
- opencv_xobjdetect341.dll
- opencv_xobjdetect341d.dll
- opencv_xphoto341.dll
- opencv_xphoto341d.dll
特别注意,有些下载得到的文件
opencv_traincascaded.exe
而不是:
opencv_traincascade.exe
请修改为:opencv_traincascade.exe
CVTrainer项目的目录结构是:

功能包括:批量处理;统一尺寸;统一名称;统一后缀;
- #region 图片批量转换
-
- /// <summary>
- /// 原始文件夹
- /// </summary>
- private string FromFolder { get; set; } = "";
- /// <summary>
- /// 目标文件夹
- /// </summary>
- private string SaveFolder { get; set; } = "";
- /// <summary>
- /// 图片尺寸信息
- /// </summary>
- private int[] SaveSizes { get; set; }
- /// <summary>
- /// 数字型文件名的序列号
- /// </summary>
- private int SaveIndex { get; set; } = 1;
-
- private void tpNormalize_SizeChanged(object sender, EventArgs e)
- {
- txtFrom.Width = tpNormalize.Width - txtFrom.Left - btnFrom.Width - 60;
- btnFrom.Left = txtFrom.Left + txtFrom.Width + 5;
- btnFrom.Top = txtFrom.Top;
- btnFrom.Height = txtFrom.Height;
- }
-
- /// <summary>
- /// 浏览原始文件夹
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnFrom_Click(object sender, EventArgs e)
- {
- if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
- {
- FromFolder = folderBrowserDialog1.SelectedPath;
- txtFrom.Text = FromFolder;
- SaveSizes = ImageSizes(FromFolder);
- if (SaveSizes[0] != SaveSizes[1]) txtFromWidth.Text = SaveSizes[0] + "..." + SaveSizes[1];
- else txtFromWidth.Text = SaveSizes[0] + "";
- if (SaveSizes[2] != SaveSizes[3]) txtFromHeight.Text = SaveSizes[2] + "..." + SaveSizes[3];
- else txtFromHeight.Text = SaveSizes[2] + "";
-
- txtSaveWidth.Text = SaveSizes[0] + "";
- txtSaveHeight.Text = SaveSizes[2] + "";
- }
- }
-
- /// <summary>
- /// 浏览并指定目标文件夹
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSave_Click(object sender, EventArgs e)
- {
- if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
- {
- SaveFolder = folderBrowserDialog1.SelectedPath;
- txtSave.Text = SaveFolder;
- }
- }
-
- /// <summary>
- /// 图片的批量处理
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnNormalize_Click(object sender, EventArgs e)
- {
- if (FromFolder.Length < 1)
- {
- MessageBox.Show("browse the source folder.");
- return;
- }
- if (SaveFolder.Length < 1)
- {
- MessageBox.Show("browse the destination folder.");
- return;
- }
- int w = int.Parse("0" + txtSaveWidth.Text);
- int h = int.Parse("0" + txtSaveHeight.Text);
- try
- {
- int idx = 0;
- SaveIndex = 1;
- DirectoryInfo fd = new DirectoryInfo(FromFolder);
- FileInfo[] xfiles = fd.GetFiles();
- progressBar1.Maximum = xfiles.Count();
- progressBar1.Visible = true;
- foreach (FileInfo fx in xfiles)
- {
- progressBar1.Value = idx;
- progressBar1.Refresh();
- if (IsImageFile(fx.Extension))
- {
- string filename = Path.Combine(SaveFolder, fx.Name);
- if (cbNumericName.Checked)
- {
- filename = Path.Combine(SaveFolder, GetNumericalName());
- }
-
- // 如果只是复制
- if (w == SaveSizes[0] && h == SaveSizes[2] && txtSaveExt.Text.Length == 0)
- {
- File.Copy(fx.FullName, filename);
- continue;
- }
- else
- {
- Image img = Image.FromFile(fx.FullName);
- if (txtSaveExt.Text.Length > 0)
- {
- filename = Path.Combine(SaveFolder, fx.Name.Replace(fx.Extension, "") + txtSaveExt.Text);
- }
- if (w > 0 && h > 0)
- {
- Bitmap bmp = new Bitmap(w, h);
- Graphics g = Graphics.FromImage(bmp);
- g.DrawImage(img, 0, 0, w, h);
- if(cbGray.Checked)
- {
- ToGrayImage(ref bmp);
- }
- bmp.Save(filename);
- }
- else if (w > 0 && h == 0)
- {
- h = (int)(w * (double)img.Height / (double)img.Width);
- Bitmap bmp = new Bitmap(w, h);
- Graphics g = Graphics.FromImage(bmp);
- g.DrawImage(img, 0, 0, w, h);
- if (cbGray.Checked)
- {
- ToGrayImage(ref bmp);
- }
- bmp.Save(filename);
- }
- else
- {
- w = (int)(h * (double)img.Width / (double)img.Height);
- Bitmap bmp = new Bitmap(w, h);
- Graphics g = Graphics.FromImage(bmp);
- g.DrawImage(img, 0, 0, w, h);
- if (cbGray.Checked)
- {
- ToGrayImage(ref bmp);
- }
- bmp.Save(filename);
- }
- }
- }
- }
- progressBar1.Visible = false;
- MessageBox.Show("OK!");
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
-
- /// <summary>
- /// 计算下一个可使用的数字型图片文件名
- /// </summary>
- /// <returns></returns>
- private string GetNumericalName()
- {
- while (true)
- {
- string sname = String.Format("{0:D5}", SaveIndex);
- if (!File.Exists(Path.Combine(SaveFolder, sname)))
- {
- return sname;
- }
- SaveIndex++;
- }
- }
- #endregion
一键生成 pos.txt 文件;一键生成 pos.vec 文件。
- #region 正样本
-
- private void tabPage1_SizeChanged(object sender, EventArgs e)
- {
- txtPosFolder.Width = tabPage1.Width - txtPosFolder.Left - btnPosFolder.Width - 60;
- btnPosFolder.Left = txtPosFolder.Left + txtPosFolder.Width + 5;
- btnPosFolder.Top = txtPosFolder.Top;
- }
-
- /// <summary>
- /// 浏览并指定 正样本 文件夹
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnPosFolder_Click(object sender, EventArgs e)
- {
- if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
- {
- txtPosFolder.Text = folderBrowserDialog1.SelectedPath;
- txtPosCount.Text = CountImageFile(txtPosFolder.Text) + "";
- }
- }
-
- /// <summary>
- /// 生成 pos.txt 文件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnPosTxt_Click(object sender, EventArgs e)
- {
- if (txtPosFolder.Text.Length < 1)
- {
- MessageBox.Show("Please browse the folder contains positive images!");
- return;
- }
-
- try
- {
- // 为复制图片做准备
- string imgPosFolder = Path.Combine(WorkFolder, @"posdata");
- if (cbPosCopy.Checked)
- {
- if (!Directory.Exists(imgPosFolder))
- {
- Directory.CreateDirectory(imgPosFolder);
- }
- }
-
- StringBuilder sb = new StringBuilder();
- DirectoryInfo fd = new DirectoryInfo(txtPosFolder.Text);
- FileInfo[] xfiles = fd.GetFiles();
- foreach (FileInfo fx in xfiles)
- {
- if (IsImageFile(fx.Extension))
- {
- // 将样本图片文件复制到工作文件夹/posdata
- if (cbPosCopy.Checked)
- {
- string df = Path.Combine(imgPosFolder, fx.Name);
- File.Copy(fx.FullName, df);
- }
-
- sb.Append("posdata/");
- sb.Append(fx.Name + " ");
- sb.Append(txtSampleCount.Text + " ");
- sb.Append(txtOriginX.Text + " ");
- sb.Append(txtOriginY.Text + " ");
-
- // 自动获取图片尺寸
- Image img = Image.FromFile(fx.FullName);
- sb.Append(img.Width + " ");
- sb.AppendLine(img.Height + "");
-
- // 按最小的图片设置 vector 参数
- if (txtSampleWidth.Text.Length == 0)
- txtSampleWidth.Text = img.Width + "";
- else if (Int32.Parse(txtSampleWidth.Text) > img.Width)
- txtSampleWidth.Text = img.Width + "";
- if (txtSampleHeight.Text.Length == 0)
- txtSampleHeight.Text = img.Height + "";
- else if (Int32.Parse(txtSampleHeight.Text) > img.Height)
- txtSampleHeight.Text = img.Height + "";
- }
- }
-
- if (!Directory.Exists(WorkFolder))
- {
- Directory.CreateDirectory(WorkFolder);
- }
-
- File.WriteAllText(Path.Combine(WorkFolder, @"pos.txt"), sb.ToString(), Encoding.Default);
- webBrowser1.DocumentText = sb.ToString().Replace("\r\n", "<br>\r\n");
-
- MessageBox.Show(Path.Combine(WorkFolder, @"pos.txt") + " OK!");
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
-
- /// <summary>
- /// 生成 pos.vec 矢量文件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnPosVec_Click(object sender, EventArgs e)
- {
- string filename = Path.Combine(WorkFolder, @"pos.txt");
- if (!File.Exists(filename))
- {
- MessageBox.Show("Should first create pos.txt !");
- return;
- }
-
- Directory.SetCurrentDirectory(WorkFolder);
-
- StringBuilder sb = new StringBuilder();
- //sb.Append(WorkFolder + "\\");
- //sb.Append("opencv_createsamples.exe ");
- sb.Append("-vec pos.vec ");
- sb.Append("-info pos.txt ");
- sb.Append("-num " + txtPosCount.Text + " ");
- sb.Append("-w " + txtSampleWidth.Text + " ");
- sb.Append("-h " + txtSampleHeight.Text);
-
- Process p = new Process();
- p.StartInfo.FileName = Path.Combine(WorkFolder, @"opencv_createsamples.exe");
- p.StartInfo.Arguments = sb.ToString();
- //是否使用操作系统shell启动
- p.StartInfo.UseShellExecute = false;
- //接受来自调用程序的输入信息
- p.StartInfo.RedirectStandardInput = false;
- //由调用程序获取输出信息
- p.StartInfo.RedirectStandardOutput = true;
- //重定向标准错误输出
- p.StartInfo.RedirectStandardError = true;
- //不显示程序窗口
- p.StartInfo.CreateNoWindow = true;
- //启动程序
- p.Start();
- //p.StandardInput.AutoFlush = false;
- string output = p.StandardOutput.ReadToEnd();
- //等待程序执行完退出进程
- p.WaitForExit();
- p.Close();
-
- webBrowser1.DocumentText = output.Replace("\n", "<br>\n");
-
- string filenname = Path.Combine(WorkFolder, @"pos.vec");
- if (File.Exists(filename))
- {
- MessageBox.Show(filename + " OK!");
- }
- }
-
- #endregion
一键生成 neg.txt 文件;
- #region 负样本
-
- private void tabPage2_SizeChanged(object sender, EventArgs e)
- {
- txtNegFolder.Width = tabPage2.Width - txtNegFolder.Left - btnNegFolder.Width - 60;
- btnNegFolder.Left = txtNegFolder.Left + txtNegFolder.Width + 5;
- btnNegFolder.Top = txtNegFolder.Top;
- }
-
- /// <summary>
- /// 浏览并指定 负样本 文件夹
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnNegFolder_Click(object sender, EventArgs e)
- {
- if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
- {
- txtNegFolder.Text = folderBrowserDialog1.SelectedPath;
- txtNegCount.Text = CountImageFile(txtNegFolder.Text) + "";
- }
- }
-
- /// <summary>
- /// 生成负样本 neg.txt 文件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnNegTxt_Click(object sender, EventArgs e)
- {
- string imgNegFolder = Path.Combine(WorkFolder, @"negdata");
-
- StringBuilder sb = new StringBuilder();
- DirectoryInfo fd = new DirectoryInfo(txtNegFolder.Text);
- FileInfo[] xfiles = fd.GetFiles();
- foreach (FileInfo fx in xfiles)
- {
- if (IsImageFile(fx.Extension))
- {
- // 将样本图片文件复制到工作文件夹/negdata
- if (cbNegCopy.Checked)
- {
- string df = Path.Combine(imgNegFolder, fx.Name);
- File.Copy(fx.FullName, df);
- sb.AppendLine(Path.Combine(imgNegFolder, fx.Name).Replace("\\", "/"));
- }
- else
- {
- sb.AppendLine(fx.FullName.Replace("\\", "/"));
- }
- }
- }
-
- if (!Directory.Exists(WorkFolder))
- {
- Directory.CreateDirectory(WorkFolder);
- }
-
- File.WriteAllText(Path.Combine(WorkFolder, @"neg.txt"), sb.ToString(), Encoding.Default);
- webBrowser1.DocumentText = sb.ToString().Replace("\r\n", "<br>\r\n");
-
- MessageBox.Show(Path.Combine(WorkFolder, @"neg.txt") + " OK!");
- }
-
- #endregion
一键生成 xml/cascade.xml 文件;
- #region 训练
- private void btnTrainning_Click(object sender, EventArgs e)
- {
- string filename = Path.Combine(WorkFolder, @"pos.vec");
- if (!File.Exists(filename))
- {
- MessageBox.Show("Should first create pos.vec !");
- return;
- }
- filename = Path.Combine(WorkFolder, @"neg.txt");
- if (!File.Exists(filename))
- {
- MessageBox.Show("Should first create neg.txt !");
- return;
- }
-
- Directory.SetCurrentDirectory(WorkFolder);
-
- StringBuilder sb = new StringBuilder();
- sb.Append("-data xml ");
- sb.Append("-vec " + txtVecFile.Text + " ");
- sb.Append("-bg " + txtNegFile.Text + " ");
- sb.Append("-numPos " + txtNumPos.Text + " ");
- sb.Append("-numNeg " + txtNumNeg.Text + " ");
- sb.Append("-numStages 20 ");
- sb.Append("-w " + txtPosWidth.Text + " ");
- sb.Append("-h " + txtPosHeight.Text + " ");
- sb.Append("-minHitRate " + txtHitRate.Text + " ");
- sb.Append("-weightTrimRate " + txtTrimRate.Text + " ");
- sb.Append("-maxFalseAlarmRate " + txtFalseAlarm.Text + " ");
- sb.Append("-stagetype " + txtStage.Text + " ");
- sb.Append("-boosttype " + cxBoost.SelectedItem.ToString() + " ");
- sb.Append("-featuretype " + cxFeature.SelectedItem.ToString() + " ");
- sb.Append("-mode " + cxMode.SelectedItem.ToString() + " ");
-
- Process p = new Process();
- p.StartInfo.FileName = Path.Combine(WorkFolder, @"opencv_traincascade.exe");
- p.StartInfo.Arguments = sb.ToString();
- //是否使用操作系统shell启动
- p.StartInfo.UseShellExecute = false;
- //接受来自调用程序的输入信息
- p.StartInfo.RedirectStandardInput = false;
- //由调用程序获取输出信息
- p.StartInfo.RedirectStandardOutput = true;
- //重定向标准错误输出
- p.StartInfo.RedirectStandardError = true;
- //不显示程序窗口
- p.StartInfo.CreateNoWindow = true;
- //启动程序
- this.Cursor = Cursors.WaitCursor;
- p.Start();
- //p.StandardInput.AutoFlush = false;
- string output = p.StandardOutput.ReadToEnd();
- //等待程序执行完退出进程
- p.WaitForExit();
- p.Close();
- this.Cursor = Cursors.Default;
-
- webBrowser1.DocumentText = output.Replace("\n", "<br>\n");
-
- string xmlname = Path.Combine(WorkFolder, @"xml", @"cascade.xml");
- if (File.Exists(xmlname))
- {
- MessageBox.Show(xmlname + " OK!");
- }
- }
-
- #endregion
7、基础函数
Form1.cs
- using System;
- using System.IO;
- using System.Text;
- using System.Linq;
- using System.Drawing;
- using System.Diagnostics;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Runtime.InteropServices;
-
- namespace Legalsoft.CVTrainer
- {
- /// <summary>
- /// OpenCV 训练集继承生成环境
- /// 北京联高软件开发有限公司
- /// Beijing Legal Software Ltd.
- /// </summary>
- public partial class Form1 : Form
- {
- /// <summary>
- /// 工作目录
- /// 一般是 CVTrainer.exe 下的 opencv_bin
- /// </summary>
- private string WorkFolder { get; set; } = "";
-
- public Form1()
- {
- InitializeComponent();
-
- #region 正样本相关
- btnPosFolder.Height = txtPosFolder.Height;
- WorkFolder = Path.Combine(Application.StartupPath, "opencv_bin");
- lbWorkFolderValue.Text = WorkFolder;
- cbPosCopy.Checked = true;
- cbPosCopy.Cursor = Cursors.Hand;
- btnPosTxt.Cursor = Cursors.Hand;
- btnPosVec.Cursor = Cursors.Hand;
- #endregion
-
- #region 负样本相关
- label14.Text = WorkFolder;
- cbNegCopy.Cursor = Cursors.Hand;
- btnNegTxt.Cursor = Cursors.Hand;
- #endregion
-
- #region 训练相关
- label17.Text = WorkFolder;
- btnTrainning.Cursor = Cursors.Hand;
- cxBoost.SelectedIndex = 0;
- cxFeature.SelectedIndex = 0;
- cxMode.SelectedIndex = 2;
- #endregion
-
- #region 图片预处理相关
- cbGray.Cursor = Cursors.Hand;
- txtSaveExt.Text = "";
- cbNumericName.Cursor = Cursors.Hand;
- btnNormalize.Cursor = Cursors.Hand;
- txtFrom.ReadOnly = true;
- txtFromWidth.ReadOnly = true;
- txtFromHeight.ReadOnly = true;
- btnFrom.Cursor = Cursors.Hand;
- txtSave.ReadOnly = true;
- btnSave.Cursor = Cursors.Hand;
- progressBar1.Visible = false;
- #endregion
-
- tabPage1.Text = " Positive Images ";
- tabPage2.Text = " Negative Images ";
- tabPage3.Text = " Cascade Train ";
- tpNormalize.Text = " Image Normalization ";
- panel1.Dock = DockStyle.Top;
- tabControl1.Dock = DockStyle.Fill;
- panel2.Dock = DockStyle.Fill;
- webBrowser1.Dock = DockStyle.Fill;
- this.Text = "C#,OpenCV Object Detect Images Trainer ——BEIJING LEGAL SOFTWARE LTD.";
- this.StartPosition = FormStartPosition.CenterScreen;
- }
-
- private void Form1_Load(object sender, EventArgs e)
- {
- Summary();
- }
-
- private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (tabControl1.SelectedIndex != 0)
- {
- Summary();
- }
- }
-
- /// <summary>
- /// 计算一些概要信息
- /// </summary>
- private void Summary()
- {
- StringBuilder sb = new StringBuilder();
- sb.AppendLine("<style>b { font-weight:bold;color:#AA0000; } </style>");
-
- sb.AppendLine("Work folder: " + WorkFolder + "<br>");
- string folder = WorkFolder;
- if (!Directory.Exists(folder))
- {
- sb.AppendLine("!Create Work folder " + WorkFolder + "<br>");
- MessageBox.Show("Work folder not exist!\nYou can do nothing!");
- return;
- }
-
- folder = Path.Combine(WorkFolder, "xml");
- sb.AppendLine("Parameters folder: " + folder + "<br>");
- if (!Directory.Exists(folder))
- {
- sb.AppendLine("!Create parameter(xml) folder " + folder + "<br>");
- Directory.CreateDirectory(folder);
- }
-
- folder = Path.Combine(WorkFolder, "posdata");
- sb.AppendLine("Positive folder: " + folder + "<br>");
- if (!Directory.Exists(folder))
- {
- sb.AppendLine("!Create Positive folder " + folder + "<br>");
- Directory.CreateDirectory(folder);
- }
- else
- {
- int count = CountImageFile(folder);
- if (count > 0)
- {
- sb.AppendLine("There have " + count + " images<br>");
- txtPosCount.Text = count + "";
- txtNumPos.Text = count + "";
- txtPosFolder.Text = folder;
- }
-
- if (File.Exists(Path.Combine(WorkFolder, @"pos.txt")))
- {
- sb.AppendLine("There have <b>pos.txt</b><br>");
-
- int[] sz = ImageSizes(Path.Combine(WorkFolder, @"posdata"));
- txtSampleWidth.Text = sz[0] + "";
- txtSampleHeight.Text = sz[2] + "";
-
- txtPosWidth.Text = sz[0] + "";
- txtPosHeight.Text = sz[2] + "";
- sb.AppendLine("Image size: " + sz[0] + "," + sz[2] + "<br>");
- }
- else
- {
- sb.AppendLine("There have't <b>pos.txt</b><br>");
- }
-
- if (File.Exists(Path.Combine(WorkFolder, @"pos.vec")))
- {
- sb.AppendLine("There have <b>pos.vec</b><br>");
- }
- else
- {
- sb.AppendLine("There have <b>not pos.vec</b><br>");
- }
-
- cbPosCopy.Checked = (count == 0);
- }
-
- folder = Path.Combine(WorkFolder, "negdata");
- sb.AppendLine("Negative folder: " + folder + "<br>");
- if (!Directory.Exists(folder))
- {
- sb.AppendLine("!Create Negative folder " + folder + "<br>");
- Directory.CreateDirectory(folder);
- }
- else
- {
- int count = CountImageFile(folder);
- if (count > 0)
- {
- sb.AppendLine("There have " + count + " images<br>");
- txtNegCount.Text = count + "";
- txtNumNeg.Text = count + "";
- txtNegFolder.Text = folder;
- }
-
- if (File.Exists(Path.Combine(WorkFolder, @"neg.txt")))
- {
- sb.AppendLine("There have <b>neg.txt</b><br>");
- }
- else
- {
- sb.AppendLine("There have <b>not neg.txt</b><br>");
- }
-
- cbNegCopy.Checked = (count == 0);
- }
-
- webBrowser1.DocumentText = sb.ToString();
- }
-
- //...
- // 这里添加上面的其他代码
- }
- }
基础函数:
- #region 基础函数
-
- /// <summary>
- /// 文件是图片吗?
- /// 按文件后缀判别;可自行添加;
- /// </summary>
- /// <param name="ext"></param>
- /// <returns></returns>
- private bool IsImageFile(string ext)
- {
- ext = ext.ToLower();
- if (ext == ".bmp") return true;
- if (ext == ".gif") return true;
- if (ext == ".png") return true;
- if (ext == ".jpg" || ext == ".jpeg") return true;
- return false;
- }
-
- /// <summary>
- /// 统计指定目录下的图片文件数量
- /// </summary>
- /// <param name="folder"></param>
- /// <returns></returns>
- private int CountImageFile(string folder)
- {
- DirectoryInfo fd = new DirectoryInfo(folder);
- int count = 0;
- FileInfo[] xfiles = fd.GetFiles();
- foreach (FileInfo fx in xfiles)
- {
- if (IsImageFile(fx.Extension))
- {
- count++;
- }
- }
- return count;
- }
-
- /// <summary>
- /// 提取指定文件夹下图片的尺寸(最小、最大的高度、宽度)
- /// </summary>
- /// <param name="folder"></param>
- /// <returns></returns>
- private int[] ImageSizes(string folder)
- {
- int min_width = Int16.MaxValue;
- int max_width = 0;
- int min_height = Int16.MaxValue;
- int max_height = 0;
-
- DirectoryInfo fd = new DirectoryInfo(folder);
- FileInfo[] xfiles = fd.GetFiles();
- foreach (FileInfo fx in xfiles)
- {
- if (IsImageFile(fx.Extension))
- {
- Image img = Image.FromFile(fx.FullName);
- if (img.Width > max_width) max_width = img.Width;
- if (img.Width < min_width) min_width = img.Width;
- if (img.Height > max_height) max_height = img.Height;
- if (img.Height < min_height) min_height = img.Height;
- }
- }
- return new int[] { min_width, max_width, min_height, max_height };
- }
-
- /// <summary>
- /// 图片转为黑白的
- /// 简单的代码,看得懂一些;效率低下;
- /// 不过,图片不多的够用了。
- /// </summary>
- /// <param name="bmp"></param>
- private void ToGrayImage(ref Bitmap bmp)
- {
- for (int y = 0; y < bmp.Height; y++)
- {
- for (int x = 0; x < bmp.Width; x++)
- {
- Color cc = bmp.GetPixel(x, y);
- int cx = Math.Min(255, (int)(cc.R * 0.299 + cc.G * 0.587 + cc.B * 0.114));
- bmp.SetPixel(x, y, Color.FromArgb(cx, cx, cx));
- }
- }
- }
-
- #endregion
8、界面相关代码
- namespace Legalsoft.CVTrainer
- {
- partial class Form1
- {
- /// <summary>
- /// 必需的设计器变量。
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// 清理所有正在使用的资源。
- /// </summary>
- /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows 窗体设计器生成的代码
-
- /// <summary>
- /// 设计器支持所需的方法 - 不要修改
- /// 使用代码编辑器修改此方法的内容。
- /// </summary>
- private void InitializeComponent()
- {
- this.panel1 = new System.Windows.Forms.Panel();
- this.tabControl1 = new System.Windows.Forms.TabControl();
- this.tpNormalize = new System.Windows.Forms.TabPage();
- this.progressBar1 = new System.Windows.Forms.ProgressBar();
- this.cbNumericName = new System.Windows.Forms.CheckBox();
- this.txtSaveExt = new System.Windows.Forms.TextBox();
- this.cbGray = new System.Windows.Forms.CheckBox();
- this.btnNormalize = new System.Windows.Forms.Button();
- this.label35 = new System.Windows.Forms.Label();
- this.txtSaveHeight = new System.Windows.Forms.TextBox();
- this.txtSaveWidth = new System.Windows.Forms.TextBox();
- this.label33 = new System.Windows.Forms.Label();
- this.txtFromHeight = new System.Windows.Forms.TextBox();
- this.txtFromWidth = new System.Windows.Forms.TextBox();
- this.btnSave = new System.Windows.Forms.Button();
- this.txtSave = new System.Windows.Forms.TextBox();
- this.lbSave = new System.Windows.Forms.Label();
- this.btnFrom = new System.Windows.Forms.Button();
- this.txtFrom = new System.Windows.Forms.TextBox();
- this.lbFrom = new System.Windows.Forms.Label();
- this.tabPage1 = new System.Windows.Forms.TabPage();
- this.txtBgColor = new System.Windows.Forms.TextBox();
- this.lbBgColor = new System.Windows.Forms.Label();
- this.label11 = new System.Windows.Forms.Label();
- this.txtPosCount = new System.Windows.Forms.TextBox();
- this.lbPosCount = new System.Windows.Forms.Label();
- this.lbWorkFolderValue = new System.Windows.Forms.Label();
- this.lbWorkFolder = new System.Windows.Forms.Label();
- this.cbPosCopy = new System.Windows.Forms.CheckBox();
- this.label7 = new System.Windows.Forms.Label();
- this.btnPosVec = new System.Windows.Forms.Button();
- this.btnPosTxt = new System.Windows.Forms.Button();
- this.label5 = new System.Windows.Forms.Label();
- this.txtSampleHeight = new System.Windows.Forms.TextBox();
- this.txtSampleWidth = new System.Windows.Forms.TextBox();
- this.lbSample = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.txtOriginY = new System.Windows.Forms.TextBox();
- this.txtOriginX = new System.Windows.Forms.TextBox();
- this.lbOriginal = new System.Windows.Forms.Label();
- this.txtSampleCount = new System.Windows.Forms.TextBox();
- this.lbSampleCount = new System.Windows.Forms.Label();
- this.btnPosFolder = new System.Windows.Forms.Button();
- this.txtPosFolder = new System.Windows.Forms.TextBox();
- this.lbPosFolder = new System.Windows.Forms.Label();
- this.tabPage2 = new System.Windows.Forms.TabPage();
- this.label12 = new System.Windows.Forms.Label();
- this.txtNegCount = new System.Windows.Forms.TextBox();
- this.lbNegCount = new System.Windows.Forms.Label();
- this.label14 = new System.Windows.Forms.Label();
- this.lbNegWorkFolder = new System.Windows.Forms.Label();
- this.cbNegCopy = new System.Windows.Forms.CheckBox();
- this.btnNegTxt = new System.Windows.Forms.Button();
- this.btnNegFolder = new System.Windows.Forms.Button();
- this.txtNegFolder = new System.Windows.Forms.TextBox();
- this.lbNegFolder = new System.Windows.Forms.Label();
- this.tabPage3 = new System.Windows.Forms.TabPage();
- this.label1 = new System.Windows.Forms.Label();
- this.txtPosHeight = new System.Windows.Forms.TextBox();
- this.txtPosWidth = new System.Windows.Forms.TextBox();
- this.lbMode = new System.Windows.Forms.Label();
- this.lbNumNeg = new System.Windows.Forms.Label();
- this.lbNumPos = new System.Windows.Forms.Label();
- this.txtTrimRate = new System.Windows.Forms.TextBox();
- this.lbWeightTrimRate = new System.Windows.Forms.Label();
- this.txtFalseAlarm = new System.Windows.Forms.TextBox();
- this.lbMasFalseAlarmRate = new System.Windows.Forms.Label();
- this.txtHitRate = new System.Windows.Forms.TextBox();
- this.lbMinHitRate = new System.Windows.Forms.Label();
- this.lbBoostType = new System.Windows.Forms.Label();
- this.txtNumNeg = new System.Windows.Forms.TextBox();
- this.txtNumPos = new System.Windows.Forms.TextBox();
- this.lbFeatureType = new System.Windows.Forms.Label();
- this.txtStage = new System.Windows.Forms.TextBox();
- this.lbStageType = new System.Windows.Forms.Label();
- this.txtNegFile = new System.Windows.Forms.TextBox();
- this.lbBgFileName = new System.Windows.Forms.Label();
- this.txtVecFile = new System.Windows.Forms.TextBox();
- this.lbVecFileName = new System.Windows.Forms.Label();
- this.txtXml = new System.Windows.Forms.TextBox();
- this.lbCascadeDirName = new System.Windows.Forms.Label();
- this.label17 = new System.Windows.Forms.Label();
- this.lbTrWorkFolder = new System.Windows.Forms.Label();
- this.btnTrainning = new System.Windows.Forms.Button();
- this.panel2 = new System.Windows.Forms.Panel();
- this.webBrowser1 = new System.Windows.Forms.WebBrowser();
- this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
- this.label2 = new System.Windows.Forms.Label();
- this.txtStageNumber = new System.Windows.Forms.TextBox();
- this.label3 = new System.Windows.Forms.Label();
- this.cxMode = new System.Windows.Forms.ComboBox();
- this.cxFeature = new System.Windows.Forms.ComboBox();
- this.cxBoost = new System.Windows.Forms.ComboBox();
- this.panel1.SuspendLayout();
- this.tabControl1.SuspendLayout();
- this.tpNormalize.SuspendLayout();
- this.tabPage1.SuspendLayout();
- this.tabPage2.SuspendLayout();
- this.tabPage3.SuspendLayout();
- this.panel2.SuspendLayout();
- this.SuspendLayout();
- //
- // panel1
- //
- this.panel1.Controls.Add(this.tabControl1);
- this.panel1.Location = new System.Drawing.Point(12, 12);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(1530, 666);
- this.panel1.TabIndex = 0;
- //
- // tabControl1
- //
- this.tabControl1.Controls.Add(this.tpNormalize);
- this.tabControl1.Controls.Add(this.tabPage1);
- this.tabControl1.Controls.Add(this.tabPage2);
- this.tabControl1.Controls.Add(this.tabPage3);
- this.tabControl1.Cursor = System.Windows.Forms.Cursors.Arrow;
- this.tabControl1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.tabControl1.ItemSize = new System.Drawing.Size(108, 41);
- this.tabControl1.Location = new System.Drawing.Point(12, 13);
- this.tabControl1.Name = "tabControl1";
- this.tabControl1.SelectedIndex = 0;
- this.tabControl1.Size = new System.Drawing.Size(1457, 639);
- this.tabControl1.TabIndex = 0;
- this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
- //
- // tpNormalize
- //
- this.tpNormalize.Controls.Add(this.label2);
- this.tpNormalize.Controls.Add(this.progressBar1);
- this.tpNormalize.Controls.Add(this.cbNumericName);
- this.tpNormalize.Controls.Add(this.txtSaveExt);
- this.tpNormalize.Controls.Add(this.cbGray);
- this.tpNormalize.Controls.Add(this.btnNormalize);
- this.tpNormalize.Controls.Add(this.label35);
- this.tpNormalize.Controls.Add(this.txtSaveHeight);
- this.tpNormalize.Controls.Add(this.txtSaveWidth);
- this.tpNormalize.Controls.Add(this.label33);
- this.tpNormalize.Controls.Add(this.txtFromHeight);
- this.tpNormalize.Controls.Add(this.txtFromWidth);
- this.tpNormalize.Controls.Add(this.btnSave);
- this.tpNormalize.Controls.Add(this.txtSave);
- this.tpNormalize.Controls.Add(this.lbSave);
- this.tpNormalize.Controls.Add(this.btnFrom);
- this.tpNormalize.Controls.Add(this.txtFrom);
- this.tpNormalize.Controls.Add(this.lbFrom);
- this.tpNormalize.Location = new System.Drawing.Point(8, 49);
- this.tpNormalize.Name = "tpNormalize";
- this.tpNormalize.Padding = new System.Windows.Forms.Padding(3);
- this.tpNormalize.Size = new System.Drawing.Size(1441, 582);
- this.tpNormalize.TabIndex = 3;
- this.tpNormalize.Text = "tabPage4";
- this.tpNormalize.UseVisualStyleBackColor = true;
- this.tpNormalize.SizeChanged += new System.EventHandler(this.tpNormalize_SizeChanged);
- //
- // progressBar1
- //
- this.progressBar1.Location = new System.Drawing.Point(527, 439);
- this.progressBar1.Name = "progressBar1";
- this.progressBar1.Size = new System.Drawing.Size(375, 74);
- this.progressBar1.TabIndex = 45;
- //
- // cbNumericName
- //
- this.cbNumericName.AutoSize = true;
- this.cbNumericName.Location = new System.Drawing.Point(564, 376);
- this.cbNumericName.Name = "cbNumericName";
- this.cbNumericName.Size = new System.Drawing.Size(646, 32);
- this.cbNumericName.TabIndex = 44;
- this.cbNumericName.Text = "Rename filename to Numerical serial names ?";
- this.cbNumericName.UseVisualStyleBackColor = true;
- //
- // txtSaveExt
- //
- this.txtSaveExt.Location = new System.Drawing.Point(298, 306);
- this.txtSaveExt.Name = "txtSaveExt";
- this.txtSaveExt.Size = new System.Drawing.Size(215, 39);
- this.txtSaveExt.TabIndex = 43;
- //
- // cbGray
- //
- this.cbGray.AutoSize = true;
- this.cbGray.Location = new System.Drawing.Point(298, 376);
- this.cbGray.Name = "cbGray";
- this.cbGray.Size = new System.Drawing.Size(240, 32);
- this.cbGray.TabIndex = 41;
- this.cbGray.Text = "To Gray Image?";
- this.cbGray.UseVisualStyleBackColor = true;
- //
- // btnNormalize
- //
- this.btnNormalize.Location = new System.Drawing.Point(298, 439);
- this.btnNormalize.Name = "btnNormalize";
- this.btnNormalize.Size = new System.Drawing.Size(215, 74);
- this.btnNormalize.TabIndex = 40;
- this.btnNormalize.Text = "Normalize";
- this.btnNormalize.UseVisualStyleBackColor = true;
- this.btnNormalize.Click += new System.EventHandler(this.btnNormalize_Click);
- //
- // label35
- //
- this.label35.AutoSize = true;
- this.label35.Location = new System.Drawing.Point(522, 252);
- this.label35.Name = "label35";
- this.label35.Size = new System.Drawing.Size(26, 28);
- this.label35.TabIndex = 39;
- this.label35.Text = "x";
- //
- // txtSaveHeight
- //
- this.txtSaveHeight.Location = new System.Drawing.Point(554, 241);
- this.txtSaveHeight.Name = "txtSaveHeight";
- this.txtSaveHeight.Size = new System.Drawing.Size(215, 39);
- this.txtSaveHeight.TabIndex = 38;
- //
- // txtSaveWidth
- //
- this.txtSaveWidth.Location = new System.Drawing.Point(298, 241);
- this.txtSaveWidth.Name = "txtSaveWidth";
- this.txtSaveWidth.Size = new System.Drawing.Size(215, 39);
- this.txtSaveWidth.TabIndex = 37;
- //
- // label33
- //
- this.label33.AutoSize = true;
- this.label33.Location = new System.Drawing.Point(522, 114);
- this.label33.Name = "label33";
- this.label33.Size = new System.Drawing.Size(26, 28);
- this.label33.TabIndex = 35;
- this.label33.Text = "x";
- //
- // txtFromHeight
- //
- this.txtFromHeight.Location = new System.Drawing.Point(554, 103);
- this.txtFromHeight.Name = "txtFromHeight";
- this.txtFromHeight.Size = new System.Drawing.Size(215, 39);
- this.txtFromHeight.TabIndex = 34;
- //
- // txtFromWidth
- //
- this.txtFromWidth.Location = new System.Drawing.Point(298, 103);
- this.txtFromWidth.Name = "txtFromWidth";
- this.txtFromWidth.Size = new System.Drawing.Size(215, 39);
- this.txtFromWidth.TabIndex = 33;
- //
- // btnSave
- //
- this.btnSave.Location = new System.Drawing.Point(689, 179);
- this.btnSave.Name = "btnSave";
- this.btnSave.Size = new System.Drawing.Size(223, 44);
- this.btnSave.TabIndex = 30;
- this.btnSave.Text = "browse...";
- this.btnSave.UseVisualStyleBackColor = true;
- this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
- //
- // txtSave
- //
- this.txtSave.Location = new System.Drawing.Point(298, 179);
- this.txtSave.Name = "txtSave";
- this.txtSave.Size = new System.Drawing.Size(375, 39);
- this.txtSave.TabIndex = 29;
- //
- // lbSave
- //
- this.lbSave.AutoSize = true;
- this.lbSave.Location = new System.Drawing.Point(112, 182);
- this.lbSave.Name = "lbSave";
- this.lbSave.Size = new System.Drawing.Size(180, 28);
- this.lbSave.TabIndex = 28;
- this.lbSave.Text = "Save folder:";
- //
- // btnFrom
- //
- this.btnFrom.Location = new System.Drawing.Point(689, 44);
- this.btnFrom.Name = "btnFrom";
- this.btnFrom.Size = new System.Drawing.Size(223, 44);
- this.btnFrom.TabIndex = 27;
- this.btnFrom.Text = "browse...";
- this.btnFrom.UseVisualStyleBackColor = true;
- this.btnFrom.Click += new System.EventHandler(this.btnFrom_Click);
- //
- // txtFrom
- //
- this.txtFrom.Location = new System.Drawing.Point(298, 44);
- this.txtFrom.Name = "txtFrom";
- this.txtFrom.Size = new System.Drawing.Size(375, 39);
- this.txtFrom.TabIndex = 26;
- //
- // lbFrom
- //
- this.lbFrom.AutoSize = true;
- this.lbFrom.Location = new System.Drawing.Point(84, 47);
- this.lbFrom.Name = "lbFrom";
- this.lbFrom.Size = new System.Drawing.Size(208, 28);
- this.lbFrom.TabIndex = 25;
- this.lbFrom.Text = "Source folder:";
- //
- // tabPage1
- //
- this.tabPage1.Controls.Add(this.txtBgColor);
- this.tabPage1.Controls.Add(this.lbBgColor);
- this.tabPage1.Controls.Add(this.label11);
- this.tabPage1.Controls.Add(this.txtPosCount);
- this.tabPage1.Controls.Add(this.lbPosCount);
- this.tabPage1.Controls.Add(this.lbWorkFolderValue);
- this.tabPage1.Controls.Add(this.lbWorkFolder);
- this.tabPage1.Controls.Add(this.cbPosCopy);
- this.tabPage1.Controls.Add(this.label7);
- this.tabPage1.Controls.Add(this.btnPosVec);
- this.tabPage1.Controls.Add(this.btnPosTxt);
- this.tabPage1.Controls.Add(this.label5);
- this.tabPage1.Controls.Add(this.txtSampleHeight);
- this.tabPage1.Controls.Add(this.txtSampleWidth);
- this.tabPage1.Controls.Add(this.lbSample);
- this.tabPage1.Controls.Add(this.label4);
- this.tabPage1.Controls.Add(this.txtOriginY);
- this.tabPage1.Controls.Add(this.txtOriginX);
- this.tabPage1.Controls.Add(this.lbOriginal);
- this.tabPage1.Controls.Add(this.txtSampleCount);
- this.tabPage1.Controls.Add(this.lbSampleCount);
- this.tabPage1.Controls.Add(this.btnPosFolder);
- this.tabPage1.Controls.Add(this.txtPosFolder);
- this.tabPage1.Controls.Add(this.lbPosFolder);
- this.tabPage1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.tabPage1.Location = new System.Drawing.Point(8, 49);
- this.tabPage1.Name = "tabPage1";
- this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage1.Size = new System.Drawing.Size(1441, 582);
- this.tabPage1.TabIndex = 0;
- this.tabPage1.Text = "tabPage1";
- this.tabPage1.UseVisualStyleBackColor = true;
- this.tabPage1.SizeChanged += new System.EventHandler(this.tabPage1_SizeChanged);
- //
- // txtBgColor
- //
- this.txtBgColor.Location = new System.Drawing.Point(905, 157);
- this.txtBgColor.Name = "txtBgColor";
- this.txtBgColor.Size = new System.Drawing.Size(118, 39);
- this.txtBgColor.TabIndex = 23;
- this.txtBgColor.Text = "0";
- //
- // lbBgColor
- //
- this.lbBgColor.AutoSize = true;
- this.lbBgColor.Location = new System.Drawing.Point(551, 164);
- this.lbBgColor.Name = "lbBgColor";
- this.lbBgColor.Size = new System.Drawing.Size(348, 28);
- this.lbBgColor.TabIndex = 22;
- this.lbBgColor.Text = "Background Color(0-255):";
- //
- // label11
- //
- this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(528, 103);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(96, 28);
- this.label11.TabIndex = 21;
- this.label11.Text = "images";
- //
- // txtPosCount
- //
- this.txtPosCount.Location = new System.Drawing.Point(298, 100);
- this.txtPosCount.Name = "txtPosCount";
- this.txtPosCount.Size = new System.Drawing.Size(215, 39);
- this.txtPosCount.TabIndex = 20;
- //
- // lbPosCount
- //
- this.lbPosCount.AutoSize = true;
- this.lbPosCount.Location = new System.Drawing.Point(112, 103);
- this.lbPosCount.Name = "lbPosCount";
- this.lbPosCount.Size = new System.Drawing.Size(180, 28);
- this.lbPosCount.TabIndex = 19;
- this.lbPosCount.Text = "Image Count:";
- //
- // lbWorkFolderValue
- //
- this.lbWorkFolderValue.AutoSize = true;
- this.lbWorkFolderValue.ForeColor = System.Drawing.Color.BlueViolet;
- this.lbWorkFolderValue.Location = new System.Drawing.Point(292, 347);
- this.lbWorkFolderValue.Name = "lbWorkFolderValue";
- this.lbWorkFolderValue.Size = new System.Drawing.Size(96, 28);
- this.lbWorkFolderValue.TabIndex = 18;
- this.lbWorkFolderValue.Text = "label9";
- //
- // lbWorkFolder
- //
- this.lbWorkFolder.AutoSize = true;
- this.lbWorkFolder.Location = new System.Drawing.Point(112, 347);
- this.lbWorkFolder.Name = "lbWorkFolder";
- this.lbWorkFolder.Size = new System.Drawing.Size(180, 28);
- this.lbWorkFolder.TabIndex = 17;
- this.lbWorkFolder.Text = "Work Folder:";
- //
- // cbPosCopy
- //
- this.cbPosCopy.AutoSize = true;
- this.cbPosCopy.Location = new System.Drawing.Point(298, 398);
- this.cbPosCopy.Name = "cbPosCopy";
- this.cbPosCopy.Size = new System.Drawing.Size(674, 32);
- this.cbPosCopy.TabIndex = 16;
- this.cbPosCopy.Text = "Copy positive images to {Work Folder}/posdata";
- this.cbPosCopy.UseVisualStyleBackColor = true;
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(421, 164);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(96, 28);
- this.label7.TabIndex = 15;
- this.label7.Text = "/image";
- //
- // btnPosVec
- //
- this.btnPosVec.Location = new System.Drawing.Point(524, 453);
- this.btnPosVec.Name = "btnPosVec";
- this.btnPosVec.Size = new System.Drawing.Size(215, 74);
- this.btnPosVec.TabIndex = 14;
- this.btnPosVec.Text = "=> pos.vec";
- this.btnPosVec.UseVisualStyleBackColor = true;
- this.btnPosVec.Click += new System.EventHandler(this.btnPosVec_Click);
- //
- // btnPosTxt
- //
- this.btnPosTxt.Location = new System.Drawing.Point(298, 453);
- this.btnPosTxt.Name = "btnPosTxt";
- this.btnPosTxt.Size = new System.Drawing.Size(215, 74);
- this.btnPosTxt.TabIndex = 13;
- this.btnPosTxt.Text = "=> pos.txt";
- this.btnPosTxt.UseVisualStyleBackColor = true;
- this.btnPosTxt.Click += new System.EventHandler(this.btnPosTxt_Click);
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(519, 287);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(26, 28);
- this.label5.TabIndex = 12;
- this.label5.Text = "x";
- //
- // txtSampleHeight
- //
- this.txtSampleHeight.Location = new System.Drawing.Point(556, 276);
- this.txtSampleHeight.Name = "txtSampleHeight";
- this.txtSampleHeight.Size = new System.Drawing.Size(215, 39);
- this.txtSampleHeight.TabIndex = 11;
- //
- // txtSampleWidth
- //
- this.txtSampleWidth.Location = new System.Drawing.Point(297, 276);
- this.txtSampleWidth.Name = "txtSampleWidth";
- this.txtSampleWidth.Size = new System.Drawing.Size(215, 39);
- this.txtSampleWidth.TabIndex = 10;
- //
- // lbSample
- //
- this.lbSample.AutoSize = true;
- this.lbSample.Location = new System.Drawing.Point(41, 279);
- this.lbSample.Name = "lbSample";
- this.lbSample.Size = new System.Drawing.Size(250, 28);
- this.lbSample.TabIndex = 9;
- this.lbSample.Text = "Sample Size(WxH):";
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(519, 227);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(26, 28);
- this.label4.TabIndex = 8;
- this.label4.Text = ",";
- //
- // txtOriginY
- //
- this.txtOriginY.Location = new System.Drawing.Point(556, 216);
- this.txtOriginY.Name = "txtOriginY";
- this.txtOriginY.Size = new System.Drawing.Size(215, 39);
- this.txtOriginY.TabIndex = 7;
- this.txtOriginY.Text = "0";
- //
- // txtOriginX
- //
- this.txtOriginX.Location = new System.Drawing.Point(298, 216);
- this.txtOriginX.Name = "txtOriginX";
- this.txtOriginX.Size = new System.Drawing.Size(215, 39);
- this.txtOriginX.TabIndex = 6;
- this.txtOriginX.Text = "0";
- //
- // lbOriginal
- //
- this.lbOriginal.AutoSize = true;
- this.lbOriginal.Location = new System.Drawing.Point(84, 219);
- this.lbOriginal.Name = "lbOriginal";
- this.lbOriginal.Size = new System.Drawing.Size(208, 28);
- this.lbOriginal.TabIndex = 5;
- this.lbOriginal.Text = "Original(X,Y):";
- //
- // txtSampleCount
- //
- this.txtSampleCount.Location = new System.Drawing.Point(297, 157);
- this.txtSampleCount.Name = "txtSampleCount";
- this.txtSampleCount.Size = new System.Drawing.Size(118, 39);
- this.txtSampleCount.TabIndex = 4;
- this.txtSampleCount.Text = "1";
- //
- // lbSampleCount
- //
- this.lbSampleCount.AutoSize = true;
- this.lbSampleCount.Location = new System.Drawing.Point(83, 160);
- this.lbSampleCount.Name = "lbSampleCount";
- this.lbSampleCount.Size = new System.Drawing.Size(208, 28);
- this.lbSampleCount.TabIndex = 3;
- this.lbSampleCount.Text = "Sample Number:";
- //
- // btnPosFolder
- //
- this.btnPosFolder.Location = new System.Drawing.Point(689, 44);
- this.btnPosFolder.Name = "btnPosFolder";
- this.btnPosFolder.Size = new System.Drawing.Size(223, 44);
- this.btnPosFolder.TabIndex = 2;
- this.btnPosFolder.Text = "browse...";
- this.btnPosFolder.UseVisualStyleBackColor = true;
- this.btnPosFolder.Click += new System.EventHandler(this.btnPosFolder_Click);
- //
- // txtPosFolder
- //
- this.txtPosFolder.Location = new System.Drawing.Point(298, 44);
- this.txtPosFolder.Name = "txtPosFolder";
- this.txtPosFolder.Size = new System.Drawing.Size(375, 39);
- this.txtPosFolder.TabIndex = 1;
- //
- // lbPosFolder
- //
- this.lbPosFolder.AutoSize = true;
- this.lbPosFolder.Location = new System.Drawing.Point(56, 47);
- this.lbPosFolder.Name = "lbPosFolder";
- this.lbPosFolder.Size = new System.Drawing.Size(236, 28);
- this.lbPosFolder.TabIndex = 0;
- this.lbPosFolder.Text = "Positive Folder:";
- //
- // tabPage2
- //
- this.tabPage2.Controls.Add(this.label12);
- this.tabPage2.Controls.Add(this.txtNegCount);
- this.tabPage2.Controls.Add(this.lbNegCount);
- this.tabPage2.Controls.Add(this.label14);
- this.tabPage2.Controls.Add(this.lbNegWorkFolder);
- this.tabPage2.Controls.Add(this.cbNegCopy);
- this.tabPage2.Controls.Add(this.btnNegTxt);
- this.tabPage2.Controls.Add(this.btnNegFolder);
- this.tabPage2.Controls.Add(this.txtNegFolder);
- this.tabPage2.Controls.Add(this.lbNegFolder);
- this.tabPage2.Location = new System.Drawing.Point(8, 49);
- this.tabPage2.Name = "tabPage2";
- this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage2.Size = new System.Drawing.Size(1441, 582);
- this.tabPage2.TabIndex = 1;
- this.tabPage2.Text = "tabPage2";
- this.tabPage2.UseVisualStyleBackColor = true;
- this.tabPage2.SizeChanged += new System.EventHandler(this.tabPage2_SizeChanged);
- //
- // label12
- //
- this.label12.AutoSize = true;
- this.label12.Location = new System.Drawing.Point(528, 103);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(96, 28);
- this.label12.TabIndex = 31;
- this.label12.Text = "images";
- //
- // txtNegCount
- //
- this.txtNegCount.Location = new System.Drawing.Point(298, 100);
- this.txtNegCount.Name = "txtNegCount";
- this.txtNegCount.Size = new System.Drawing.Size(215, 39);
- this.txtNegCount.TabIndex = 30;
- //
- // lbNegCount
- //
- this.lbNegCount.AutoSize = true;
- this.lbNegCount.Location = new System.Drawing.Point(48, 103);
- this.lbNegCount.Name = "lbNegCount";
- this.lbNegCount.Size = new System.Drawing.Size(236, 28);
- this.lbNegCount.TabIndex = 29;
- this.lbNegCount.Text = "Negative Images:";
- //
- // label14
- //
- this.label14.AutoSize = true;
- this.label14.ForeColor = System.Drawing.Color.BlueViolet;
- this.label14.Location = new System.Drawing.Point(292, 166);
- this.label14.Name = "label14";
- this.label14.Size = new System.Drawing.Size(110, 28);
- this.label14.TabIndex = 28;
- this.label14.Text = "label14";
- //
- // lbNegWorkFolder
- //
- this.lbNegWorkFolder.AutoSize = true;
- this.lbNegWorkFolder.Location = new System.Drawing.Point(104, 166);
- this.lbNegWorkFolder.Name = "lbNegWorkFolder";
- this.lbNegWorkFolder.Size = new System.Drawing.Size(180, 28);
- this.lbNegWorkFolder.TabIndex = 27;
- this.lbNegWorkFolder.Text = "Work Folder:";
- //
- // cbNegCopy
- //
- this.cbNegCopy.AutoSize = true;
- this.cbNegCopy.Location = new System.Drawing.Point(298, 217);
- this.cbNegCopy.Name = "cbNegCopy";
- this.cbNegCopy.Size = new System.Drawing.Size(674, 32);
- this.cbNegCopy.TabIndex = 26;
- this.cbNegCopy.Text = "Copy negative images to {Work Folder}/negdata";
- this.cbNegCopy.UseVisualStyleBackColor = true;
- //
- // btnNegTxt
- //
- this.btnNegTxt.Location = new System.Drawing.Point(297, 279);
- this.btnNegTxt.Name = "btnNegTxt";
- this.btnNegTxt.Size = new System.Drawing.Size(215, 74);
- this.btnNegTxt.TabIndex = 25;
- this.btnNegTxt.Text = "=> neg.txt";
- this.btnNegTxt.UseVisualStyleBackColor = true;
- this.btnNegTxt.Click += new System.EventHandler(this.btnNegTxt_Click);
- //
- // btnNegFolder
- //
- this.btnNegFolder.Location = new System.Drawing.Point(689, 44);
- this.btnNegFolder.Name = "btnNegFolder";
- this.btnNegFolder.Size = new System.Drawing.Size(223, 44);
- this.btnNegFolder.TabIndex = 24;
- this.btnNegFolder.Text = "browse...";
- this.btnNegFolder.UseVisualStyleBackColor = true;
- this.btnNegFolder.Click += new System.EventHandler(this.btnNegFolder_Click);
- //
- // txtNegFolder
- //
- this.txtNegFolder.Location = new System.Drawing.Point(298, 44);
- this.txtNegFolder.Name = "txtNegFolder";
- this.txtNegFolder.Size = new System.Drawing.Size(375, 39);
- this.txtNegFolder.TabIndex = 23;
- //
- // lbNegFolder
- //
- this.lbNegFolder.AutoSize = true;
- this.lbNegFolder.Location = new System.Drawing.Point(76, 47);
- this.lbNegFolder.Name = "lbNegFolder";
- this.lbNegFolder.Size = new System.Drawing.Size(208, 28);
- this.lbNegFolder.TabIndex = 22;
- this.lbNegFolder.Text = "Source Folder:";
- //
- // tabPage3
- //
- this.tabPage3.Controls.Add(this.cxBoost);
- this.tabPage3.Controls.Add(this.cxFeature);
- this.tabPage3.Controls.Add(this.cxMode);
- this.tabPage3.Controls.Add(this.txtStageNumber);
- this.tabPage3.Controls.Add(this.label3);
- this.tabPage3.Controls.Add(this.label1);
- this.tabPage3.Controls.Add(this.txtPosHeight);
- this.tabPage3.Controls.Add(this.txtPosWidth);
- this.tabPage3.Controls.Add(this.lbMode);
- this.tabPage3.Controls.Add(this.lbNumNeg);
- this.tabPage3.Controls.Add(this.lbNumPos);
- this.tabPage3.Controls.Add(this.txtTrimRate);
- this.tabPage3.Controls.Add(this.lbWeightTrimRate);
- this.tabPage3.Controls.Add(this.txtFalseAlarm);
- this.tabPage3.Controls.Add(this.lbMasFalseAlarmRate);
- this.tabPage3.Controls.Add(this.txtHitRate);
- this.tabPage3.Controls.Add(this.lbMinHitRate);
- this.tabPage3.Controls.Add(this.lbBoostType);
- this.tabPage3.Controls.Add(this.txtNumNeg);
- this.tabPage3.Controls.Add(this.txtNumPos);
- this.tabPage3.Controls.Add(this.lbFeatureType);
- this.tabPage3.Controls.Add(this.txtStage);
- this.tabPage3.Controls.Add(this.lbStageType);
- this.tabPage3.Controls.Add(this.txtNegFile);
- this.tabPage3.Controls.Add(this.lbBgFileName);
- this.tabPage3.Controls.Add(this.txtVecFile);
- this.tabPage3.Controls.Add(this.lbVecFileName);
- this.tabPage3.Controls.Add(this.txtXml);
- this.tabPage3.Controls.Add(this.lbCascadeDirName);
- this.tabPage3.Controls.Add(this.label17);
- this.tabPage3.Controls.Add(this.lbTrWorkFolder);
- this.tabPage3.Controls.Add(this.btnTrainning);
- this.tabPage3.Location = new System.Drawing.Point(8, 49);
- this.tabPage3.Name = "tabPage3";
- this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage3.Size = new System.Drawing.Size(1441, 582);
- this.tabPage3.TabIndex = 2;
- this.tabPage3.Text = "tabPage3";
- this.tabPage3.UseVisualStyleBackColor = true;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(1028, 167);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(180, 28);
- this.label1.TabIndex = 60;
- this.label1.Text = "Sample Size:";
- //
- // txtPosHeight
- //
- this.txtPosHeight.Location = new System.Drawing.Point(1309, 164);
- this.txtPosHeight.Name = "txtPosHeight";
- this.txtPosHeight.Size = new System.Drawing.Size(88, 39);
- this.txtPosHeight.TabIndex = 59;
- //
- // txtPosWidth
- //
- this.txtPosWidth.Location = new System.Drawing.Point(1214, 164);
- this.txtPosWidth.Name = "txtPosWidth";
- this.txtPosWidth.Size = new System.Drawing.Size(89, 39);
- this.txtPosWidth.TabIndex = 58;
- //
- // lbMode
- //
- this.lbMode.AutoSize = true;
- this.lbMode.Location = new System.Drawing.Point(648, 404);
- this.lbMode.Name = "lbMode";
- this.lbMode.Size = new System.Drawing.Size(166, 28);
- this.lbMode.TabIndex = 56;
- this.lbMode.Text = "Train Mode:";
- //
- // lbNumNeg
- //
- this.lbNumNeg.AutoSize = true;
- this.lbNumNeg.Location = new System.Drawing.Point(578, 228);
- this.lbNumNeg.Name = "lbNumNeg";
- this.lbNumNeg.Size = new System.Drawing.Size(236, 28);
- this.lbNumNeg.TabIndex = 55;
- this.lbNumNeg.Text = "Negative Number:";
- //
- // lbNumPos
- //
- this.lbNumPos.AutoSize = true;
- this.lbNumPos.Location = new System.Drawing.Point(578, 167);
- this.lbNumPos.Name = "lbNumPos";
- this.lbNumPos.Size = new System.Drawing.Size(236, 28);
- this.lbNumPos.TabIndex = 54;
- this.lbNumPos.Text = "Positive Number:";
- //
- // txtTrimRate
- //
- this.txtTrimRate.Location = new System.Drawing.Point(298, 404);
- this.txtTrimRate.Name = "txtTrimRate";
- this.txtTrimRate.Size = new System.Drawing.Size(196, 39);
- this.txtTrimRate.TabIndex = 53;
- this.txtTrimRate.Text = "0.95";
- //
- // lbWeightTrimRate
- //
- this.lbWeightTrimRate.AutoSize = true;
- this.lbWeightTrimRate.Location = new System.Drawing.Point(37, 407);
- this.lbWeightTrimRate.Name = "lbWeightTrimRate";
- this.lbWeightTrimRate.Size = new System.Drawing.Size(250, 28);
- this.lbWeightTrimRate.TabIndex = 52;
- this.lbWeightTrimRate.Text = "Weight Trim Rate:";
- //
- // txtFalseAlarm
- //
- this.txtFalseAlarm.Location = new System.Drawing.Point(820, 346);
- this.txtFalseAlarm.Name = "txtFalseAlarm";
- this.txtFalseAlarm.Size = new System.Drawing.Size(158, 39);
- this.txtFalseAlarm.TabIndex = 51;
- this.txtFalseAlarm.Text = "0.5";
- //
- // lbMasFalseAlarmRate
- //
- this.lbMasFalseAlarmRate.AutoSize = true;
- this.lbMasFalseAlarmRate.Location = new System.Drawing.Point(513, 349);
- this.lbMasFalseAlarmRate.Name = "lbMasFalseAlarmRate";
- this.lbMasFalseAlarmRate.Size = new System.Drawing.Size(306, 28);
- this.lbMasFalseAlarmRate.TabIndex = 50;
- this.lbMasFalseAlarmRate.Text = "Max False Alarm Rate:";
- //
- // txtHitRate
- //
- this.txtHitRate.Location = new System.Drawing.Point(298, 346);
- this.txtHitRate.Name = "txtHitRate";
- this.txtHitRate.Size = new System.Drawing.Size(196, 39);
- this.txtHitRate.TabIndex = 49;
- this.txtHitRate.Text = "0.995";
- //
- // lbMinHitRate
- //
- this.lbMinHitRate.AutoSize = true;
- this.lbMinHitRate.Location = new System.Drawing.Point(51, 349);
- this.lbMinHitRate.Name = "lbMinHitRate";
- this.lbMinHitRate.Size = new System.Drawing.Size(236, 28);
- this.lbMinHitRate.TabIndex = 48;
- this.lbMinHitRate.Text = "Minium Hit Rate:";
- //
- // lbBoostType
- //
- this.lbBoostType.AutoSize = true;
- this.lbBoostType.Location = new System.Drawing.Point(648, 289);
- this.lbBoostType.Name = "lbBoostType";
- this.lbBoostType.Size = new System.Drawing.Size(166, 28);
- this.lbBoostType.TabIndex = 46;
- this.lbBoostType.Text = "Boost Type:";
- //
- // txtNumNeg
- //
- this.txtNumNeg.Location = new System.Drawing.Point(820, 225);
- this.txtNumNeg.Name = "txtNumNeg";
- this.txtNumNeg.Size = new System.Drawing.Size(158, 39);
- this.txtNumNeg.TabIndex = 43;
- //
- // txtNumPos
- //
- this.txtNumPos.Location = new System.Drawing.Point(820, 161);
- this.txtNumPos.Name = "txtNumPos";
- this.txtNumPos.Size = new System.Drawing.Size(158, 39);
- this.txtNumPos.TabIndex = 42;
- //
- // lbFeatureType
- //
- this.lbFeatureType.AutoSize = true;
- this.lbFeatureType.Location = new System.Drawing.Point(1017, 289);
- this.lbFeatureType.Name = "lbFeatureType";
- this.lbFeatureType.Size = new System.Drawing.Size(194, 28);
- this.lbFeatureType.TabIndex = 40;
- this.lbFeatureType.Text = "Feature Type:";
- //
- // txtStage
- //
- this.txtStage.Location = new System.Drawing.Point(298, 286);
- this.txtStage.Name = "txtStage";
- this.txtStage.ReadOnly = true;
- this.txtStage.Size = new System.Drawing.Size(196, 39);
- this.txtStage.TabIndex = 39;
- this.txtStage.Text = "BOOST";
- //
- // lbStageType
- //
- this.lbStageType.AutoSize = true;
- this.lbStageType.Location = new System.Drawing.Point(121, 289);
- this.lbStageType.Name = "lbStageType";
- this.lbStageType.Size = new System.Drawing.Size(166, 28);
- this.lbStageType.TabIndex = 38;
- this.lbStageType.Text = "Stage Type:";
- //
- // txtNegFile
- //
- this.txtNegFile.Location = new System.Drawing.Point(298, 225);
- this.txtNegFile.Name = "txtNegFile";
- this.txtNegFile.Size = new System.Drawing.Size(196, 39);
- this.txtNegFile.TabIndex = 37;
- this.txtNegFile.Text = "neg.txt";
- //
- // lbBgFileName
- //
- this.lbBgFileName.AutoSize = true;
- this.lbBgFileName.Location = new System.Drawing.Point(23, 228);
- this.lbBgFileName.Name = "lbBgFileName";
- this.lbBgFileName.Size = new System.Drawing.Size(264, 28);
- this.lbBgFileName.TabIndex = 36;
- this.lbBgFileName.Text = "Negative Filename:";
- //
- // txtVecFile
- //
- this.txtVecFile.Location = new System.Drawing.Point(298, 161);
- this.txtVecFile.Name = "txtVecFile";
- this.txtVecFile.Size = new System.Drawing.Size(196, 39);
- this.txtVecFile.TabIndex = 35;
- this.txtVecFile.Text = "pos.vec";
- //
- // lbVecFileName
- //
- this.lbVecFileName.AutoSize = true;
- this.lbVecFileName.Location = new System.Drawing.Point(51, 164);
- this.lbVecFileName.Name = "lbVecFileName";
- this.lbVecFileName.Size = new System.Drawing.Size(236, 28);
- this.lbVecFileName.TabIndex = 34;
- this.lbVecFileName.Text = "Vector Filename:";
- //
- // txtXml
- //
- this.txtXml.Location = new System.Drawing.Point(298, 100);
- this.txtXml.Name = "txtXml";
- this.txtXml.Size = new System.Drawing.Size(196, 39);
- this.txtXml.TabIndex = 33;
- this.txtXml.Text = "xml";
- //
- // lbCascadeDirName
- //
- this.lbCascadeDirName.AutoSize = true;
- this.lbCascadeDirName.Location = new System.Drawing.Point(28, 103);
- this.lbCascadeDirName.Name = "lbCascadeDirName";
- this.lbCascadeDirName.Size = new System.Drawing.Size(264, 28);
- this.lbCascadeDirName.TabIndex = 32;
- this.lbCascadeDirName.Text = "Parameters Folder:";
- //
- // label17
- //
- this.label17.AutoSize = true;
- this.label17.ForeColor = System.Drawing.Color.BlueViolet;
- this.label17.Location = new System.Drawing.Point(293, 44);
- this.label17.Name = "label17";
- this.label17.Size = new System.Drawing.Size(110, 28);
- this.label17.TabIndex = 31;
- this.label17.Text = "label17";
- //
- // lbTrWorkFolder
- //
- this.lbTrWorkFolder.AutoSize = true;
- this.lbTrWorkFolder.Location = new System.Drawing.Point(107, 44);
- this.lbTrWorkFolder.Name = "lbTrWorkFolder";
- this.lbTrWorkFolder.Size = new System.Drawing.Size(180, 28);
- this.lbTrWorkFolder.TabIndex = 30;
- this.lbTrWorkFolder.Text = "Work Folder:";
- //
- // btnTrainning
- //
- this.btnTrainning.Location = new System.Drawing.Point(298, 467);
- this.btnTrainning.Name = "btnTrainning";
- this.btnTrainning.Size = new System.Drawing.Size(274, 74);
- this.btnTrainning.TabIndex = 29;
- this.btnTrainning.Text = "=> Cascade.xml";
- this.btnTrainning.UseVisualStyleBackColor = true;
- this.btnTrainning.Click += new System.EventHandler(this.btnTrainning_Click);
- //
- // panel2
- //
- this.panel2.Controls.Add(this.webBrowser1);
- this.panel2.Location = new System.Drawing.Point(13, 707);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(1173, 256);
- this.panel2.TabIndex = 1;
- //
- // webBrowser1
- //
- this.webBrowser1.Location = new System.Drawing.Point(15, 33);
- this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
- this.webBrowser1.Name = "webBrowser1";
- this.webBrowser1.Size = new System.Drawing.Size(880, 240);
- this.webBrowser1.TabIndex = 0;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(59, 309);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(236, 28);
- this.label2.TabIndex = 46;
- this.label2.Text = "Unity Extension:";
- //
- // txtStageNumber
- //
- this.txtStageNumber.Location = new System.Drawing.Point(1214, 401);
- this.txtStageNumber.Name = "txtStageNumber";
- this.txtStageNumber.Size = new System.Drawing.Size(89, 39);
- this.txtStageNumber.TabIndex = 62;
- this.txtStageNumber.Text = "20";
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(1014, 404);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(194, 28);
- this.label3.TabIndex = 61;
- this.label3.Text = "Stage Number:";
- //
- // cxMode
- //
- this.cxMode.FormattingEnabled = true;
- this.cxMode.Items.AddRange(new object[] {
- "BASIC",
- "CORE",
- "ALL"});
- this.cxMode.Location = new System.Drawing.Point(820, 401);
- this.cxMode.Name = "cxMode";
- this.cxMode.Size = new System.Drawing.Size(158, 36);
- this.cxMode.TabIndex = 63;
- //
- // cxFeature
- //
- this.cxFeature.FormattingEnabled = true;
- this.cxFeature.Items.AddRange(new object[] {
- "HAAR",
- "LBP",
- "HOG"});
- this.cxFeature.Location = new System.Drawing.Point(1214, 286);
- this.cxFeature.Name = "cxFeature";
- this.cxFeature.Size = new System.Drawing.Size(183, 36);
- this.cxFeature.TabIndex = 64;
- //
- // cxBoost
- //
- this.cxBoost.FormattingEnabled = true;
- this.cxBoost.Items.AddRange(new object[] {
- "GAB",
- "RAB",
- "DAB",
- "LB"});
- this.cxBoost.Location = new System.Drawing.Point(820, 284);
- this.cxBoost.Name = "cxBoost";
- this.cxBoost.Size = new System.Drawing.Size(158, 36);
- this.cxBoost.TabIndex = 65;
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(1771, 975);
- this.Controls.Add(this.panel2);
- this.Controls.Add(this.panel1);
- this.Name = "Form1";
- this.Text = "Form1";
- this.Load += new System.EventHandler(this.Form1_Load);
- this.panel1.ResumeLayout(false);
- this.tabControl1.ResumeLayout(false);
- this.tpNormalize.ResumeLayout(false);
- this.tpNormalize.PerformLayout();
- this.tabPage1.ResumeLayout(false);
- this.tabPage1.PerformLayout();
- this.tabPage2.ResumeLayout(false);
- this.tabPage2.PerformLayout();
- this.tabPage3.ResumeLayout(false);
- this.tabPage3.PerformLayout();
- this.panel2.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.Panel panel1;
- private System.Windows.Forms.TabControl tabControl1;
- private System.Windows.Forms.TabPage tabPage1;
- private System.Windows.Forms.TabPage tabPage2;
- private System.Windows.Forms.TabPage tabPage3;
- private System.Windows.Forms.TabPage tpNormalize;
- private System.Windows.Forms.Panel panel2;
- private System.Windows.Forms.WebBrowser webBrowser1;
- private System.Windows.Forms.Button btnPosTxt;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.TextBox txtSampleHeight;
- private System.Windows.Forms.TextBox txtSampleWidth;
- private System.Windows.Forms.Label lbSample;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.TextBox txtOriginY;
- private System.Windows.Forms.TextBox txtOriginX;
- private System.Windows.Forms.Label lbOriginal;
- private System.Windows.Forms.TextBox txtSampleCount;
- private System.Windows.Forms.Label lbSampleCount;
- private System.Windows.Forms.Button btnPosFolder;
- private System.Windows.Forms.TextBox txtPosFolder;
- private System.Windows.Forms.Label lbPosFolder;
- private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
- private System.Windows.Forms.Button btnPosVec;
- private System.Windows.Forms.CheckBox cbPosCopy;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.Label lbWorkFolderValue;
- private System.Windows.Forms.Label lbWorkFolder;
- private System.Windows.Forms.Label label11;
- private System.Windows.Forms.TextBox txtPosCount;
- private System.Windows.Forms.Label lbPosCount;
- private System.Windows.Forms.Label label12;
- private System.Windows.Forms.TextBox txtNegCount;
- private System.Windows.Forms.Label lbNegCount;
- private System.Windows.Forms.Label label14;
- private System.Windows.Forms.Label lbNegWorkFolder;
- private System.Windows.Forms.CheckBox cbNegCopy;
- private System.Windows.Forms.Button btnNegTxt;
- private System.Windows.Forms.Button btnNegFolder;
- private System.Windows.Forms.TextBox txtNegFolder;
- private System.Windows.Forms.Label lbNegFolder;
- private System.Windows.Forms.Label lbMode;
- private System.Windows.Forms.Label lbNumNeg;
- private System.Windows.Forms.Label lbNumPos;
- private System.Windows.Forms.TextBox txtTrimRate;
- private System.Windows.Forms.Label lbWeightTrimRate;
- private System.Windows.Forms.TextBox txtFalseAlarm;
- private System.Windows.Forms.Label lbMasFalseAlarmRate;
- private System.Windows.Forms.TextBox txtHitRate;
- private System.Windows.Forms.Label lbMinHitRate;
- private System.Windows.Forms.Label lbBoostType;
- private System.Windows.Forms.TextBox txtNumNeg;
- private System.Windows.Forms.TextBox txtNumPos;
- private System.Windows.Forms.Label lbFeatureType;
- private System.Windows.Forms.TextBox txtStage;
- private System.Windows.Forms.Label lbStageType;
- private System.Windows.Forms.TextBox txtNegFile;
- private System.Windows.Forms.Label lbBgFileName;
- private System.Windows.Forms.TextBox txtVecFile;
- private System.Windows.Forms.Label lbVecFileName;
- private System.Windows.Forms.TextBox txtXml;
- private System.Windows.Forms.Label lbCascadeDirName;
- private System.Windows.Forms.Label label17;
- private System.Windows.Forms.Label lbTrWorkFolder;
- private System.Windows.Forms.Button btnTrainning;
- private System.Windows.Forms.CheckBox cbNumericName;
- private System.Windows.Forms.TextBox txtSaveExt;
- private System.Windows.Forms.CheckBox cbGray;
- private System.Windows.Forms.Button btnNormalize;
- private System.Windows.Forms.Label label35;
- private System.Windows.Forms.TextBox txtSaveHeight;
- private System.Windows.Forms.TextBox txtSaveWidth;
- private System.Windows.Forms.Label label33;
- private System.Windows.Forms.TextBox txtFromHeight;
- private System.Windows.Forms.TextBox txtFromWidth;
- private System.Windows.Forms.Button btnSave;
- private System.Windows.Forms.TextBox txtSave;
- private System.Windows.Forms.Label lbSave;
- private System.Windows.Forms.Button btnFrom;
- private System.Windows.Forms.TextBox txtFrom;
- private System.Windows.Forms.Label lbFrom;
- private System.Windows.Forms.ProgressBar progressBar1;
- private System.Windows.Forms.TextBox txtBgColor;
- private System.Windows.Forms.Label lbBgColor;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.TextBox txtPosHeight;
- private System.Windows.Forms.TextBox txtPosWidth;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.TextBox txtStageNumber;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.ComboBox cxFeature;
- private System.Windows.Forms.ComboBox cxMode;
- private System.Windows.Forms.ComboBox cxBoost;
- }
- }
-
以上代码经验证可用,继续享受编程的乐趣吧。