资源简介
通过C#+emgucv建立的工程,可用做图像目标框的标注,把标注文件存成txt文件,可以用于VOC2007数据集的制作

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Emgu.CV;
using Emgu.Util;
using Emgu.CV.Structure;
using System.IO;
namespace Annotation
{
public partial class Form1 : Form
{
private int ImageCount;
private List ImagePaths = new List();
private int nowCount = 0;
private int FirstX;
private int FirstY;
private int EndX;
private int EndY;
private Rectangle rect;
public Form1()
{
InitializeComponent();
//Image SrcImage=new Image(@“D:\src.jpg“);//从文件加载图片
//Image SrcImage = new Image(@“001.jpg“);//从文件加载图片
//this.imgbox.Image = SrcImage;
//if (this.imgbox.Height < SrcImage.Height)
//{
// this.imgbox.VerticalScrollBar.Visible = true;
// this.imgbox.VerticalScrollBar.Maximum = SrcImage.Height - imgbox.Height + imgbox.HorizontalScrollBar.Height;
//}
//if (this.imgbox.Width < SrcImage.Width)
//{
// this.imgbox.HorizontalScrollBar.Visible = true;
// this.imgbox.HorizontalScrollBar.Maximum = SrcImage.Width - imgbox.Width + imgbox.VerticalScrollBar.Width;
//}
}
private void button1_Click(object sender EventArgs e)
{
if (nowCount < ImageCount)
{
StreamWriter sw = new StreamWriter(“File.txt“ true);
string s = ImagePaths[nowCount];
Image SrcImage = new Image(@s);//从文件加载图片
this.imgbox.Image = SrcImage;
int resultleftX = Math.Min(FirstX EndX);
int resultleftY = Math.Min(FirstYEndY);
int resultrightX = Math.Max(FirstXEndX);
int resultrightY = Math.Max(FirstYEndY);
if (nowCount != 0)
{
string ss = ImagePaths[nowCount-1];
string filename = System.IO.Path.GetFileName(ss);
string cate = this.textBox1.Text;
sw.WriteLine(filename + “ “ + cate + “ “ + resultleftX.ToString() + “ “ + resultleftY.ToString() + “ “ + resultrightX.ToString() + “ “ + resultrightY.ToString());
File.Delete(ss);
}
sw.Close();
nowCount++;
}
}
private void Form1_Load(object sender EventArgs e)
{
foreach (string Path in Directory.GetFiles(@“G:\fasterrcnn\data“))
{
ImagePaths.Add(Path);
}
if (ImagePaths.Count
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4482 2017-05-18 20:52 Annotation\Annotation\Annotation.csproj
文件 11776 2017-05-20 11:30 Annotation\Annotation\bin\Debug\Annotation.exe
文件 26112 2017-05-20 11:30 Annotation\Annotation\bin\Debug\Annotation.pdb
文件 11600 2017-05-20 11:37 Annotation\Annotation\bin\Debug\Annotation.vshost.exe
文件 490 2010-03-17 22:39 Annotation\Annotation\bin\Debug\Annotation.vshost.exe.manifest
文件 307200 2013-09-23 20:41 Annotation\Annotation\bin\Debug\Emgu.CV.dll
文件 36864 2013-09-23 20:41 Annotation\Annotation\bin\Debug\Emgu.CV.ML.dll
文件 146004 2013-09-23 20:41 Annotation\Annotation\bin\Debug\Emgu.CV.ML.xm
文件 126976 2013-09-23 20:41 Annotation\Annotation\bin\Debug\Emgu.CV.UI.dll
文件 35149 2013-09-23 20:41 Annotation\Annotation\bin\Debug\Emgu.CV.UI.xm
文件 1227435 2013-09-23 20:41 Annotation\Annotation\bin\Debug\Emgu.CV.xm
文件 32768 2013-09-23 20:41 Annotation\Annotation\bin\Debug\Emgu.Util.dll
文件 22455 2013-09-23 20:41 Annotation\Annotation\bin\Debug\Emgu.Util.xm
文件 33835 2017-05-20 11:35 Annotation\Annotation\bin\Debug\File.txt
文件 307200 2013-02-09 07:33 Annotation\Annotation\bin\Debug\ZedGraph.dll
文件 4295 2017-05-20 11:39 Annotation\Annotation\Form1.cs
文件 5049 2017-05-20 11:38 Annotation\Annotation\Form1.Designer.cs
文件 5817 2017-05-20 11:38 Annotation\Annotation\Form1.resx
文件 1149 2017-05-20 11:37 Annotation\Annotation\obj\x86\Debug\Annotation.csproj.FileListAbsolute.txt
文件 975 2017-05-20 11:30 Annotation\Annotation\obj\x86\Debug\Annotation.csproj.GenerateResource.Cache
文件 33168 2017-05-18 20:52 Annotation\Annotation\obj\x86\Debug\Annotation.csprojResolveAssemblyReference.cache
文件 11776 2017-05-20 11:30 Annotation\Annotation\obj\x86\Debug\Annotation.exe
文件 180 2017-05-20 11:30 Annotation\Annotation\obj\x86\Debug\Annotation.Form1.resources
文件 26112 2017-05-20 11:30 Annotation\Annotation\obj\x86\Debug\Annotation.pdb
文件 180 2017-05-18 20:52 Annotation\Annotation\obj\x86\Debug\Annotation.Properties.Resources.resources
文件 27494 2017-05-19 17:32 Annotation\Annotation\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6707 2017-05-20 11:30 Annotation\Annotation\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 543 2017-05-18 21:10 Annotation\Annotation\Program.cs
文件 1370 2017-05-18 20:28 Annotation\Annotation\Properties\AssemblyInfo.cs
文件 2872 2017-05-18 20:28 Annotation\Annotation\Properties\Resources.Designer.cs
............此处省略17个文件信息
相关资源
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
评论
共有 条评论