Mat属性step,size,step1,elemSize,elemSize1总结...
分类:
其他好文 时间:
2015-04-28 09:48:43
阅读次数:
181
为了让数据集能够有旋转不变形,希望在caffe训练处好结果,我对采集的数据集进行了一个仿射变换。
利用opencv可以比较方便的实现这个事情。
我的数据集还有一些点标注。标注需要在图片旋转的同时把关键点也旋转到合适的位置。
Mat affineTransform(Mat src, std::vector& v)
{
Mat rot_mat(2, 3, CV_32FC1);
...
分类:
Web程序 时间:
2015-04-27 09:57:24
阅读次数:
324
一、读取图像1、利用Mat数据结构读取和显示图片#include"cv.h"#include "highgui.h"#includeusing namespace std;using namespace cv;int _tmain(int argc, _TCHAR* argv[]){ Mat i.....
分类:
其他好文 时间:
2015-04-26 15:06:59
阅读次数:
207
XML文件(使用FileStorage类)使用OpenCV时不仅要保存影像结果,往往也需要保存中间的矩阵结果,而OpenCV的imwrite函数只支持CV8U类型的数据(使用OpenCV保存其他类型Mat的时候,程序不会报错,但是无法生成结果文件),因此会给工作带来很多不便。OpenCV在2.0以后的版本中提供了FileStorage类,供用户直接使用,保存为XML/YAML文件。保存XML保存示例...
分类:
其他好文 时间:
2015-04-25 22:52:43
阅读次数:
275
分析:
dis(k,v1,v2)函数求到当前位置概率为v1,到当前位置之前一步的概率为v2,前进k步到达位置的概率,然后矩阵加速。
代码:
//poj 3744
//sep9
#include
#include
using namespace std;
int pos[12];
double p,mat[4][4];
double ans[4][4];
void mul1()
{
d...
分类:
其他好文 时间:
2015-04-25 00:16:32
阅读次数:
140
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat...
分类:
其他好文 时间:
2015-04-22 13:22:15
阅读次数:
95
两矩阵 A * B ,当 A 的行数等于 B 的列数时,A * B 合法,结果如下: 1 #include 2 #include 3 4 struct mat{ 5 int r,c; //r即row,矩阵行数;c即column,矩阵列数 6 int m[10][1...
分类:
其他好文 时间:
2015-04-21 07:04:15
阅读次数:
166
如果使用vector<vector > contours;作为findContours的参数,在运行时会得到Assertion failed (mtype == type0 || (CV_MAT_CN(mtype) == CV_MAT_CN(type0) && ((1 << type0) & f...原因是标准库里有std::vector 和 Point
和findContours里...
分类:
其他好文 时间:
2015-04-18 17:48:11
阅读次数:
380
组分析(1) spm----specify 2nd-level---- Directory:输出文件所要保存的文件夹----SCANS:输入con文件(2) Estimate----select spm.mat----点击绿色按钮进行转换;(3) Results----点spm.mat----点t-...
分类:
其他好文 时间:
2015-04-16 23:16:58
阅读次数:
390
思路很好像,卡了我很久的就是当最大房间一样的时候判断输出哪个的条件, = = 简直无情
/*
ID: 18906421
LANG: C++
PROG: castle
*/
#include
#include
#include
using namespace std;
const int maxn = 55;
int mat[maxn][maxn][2] = {0}; // 0 1 下 右
i...
分类:
其他好文 时间:
2015-04-15 19:40:26
阅读次数:
150