自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

meether

积累正能量,坚持前进

  • 博客(54)
  • 资源 (2)
  • 收藏
  • 关注

原创 数字转字符串

template <typename T> static std::string num2str(T v) { std::ostringstream oss; oss << v; return oss.str(); } 

2018-07-18 22:37:19 809

原创 awk 提取两个字符串之间的内容

#/bin/bashsrc=$1dst=$2cat ${src} | grep -E ".*" | awk '{t=$0;gsub(/.*|.*/,"",t);print t}' > ${dst}

2015-10-23 23:56:30 20046

原创 days

/*储存12个月的天数*/const int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};/*判断是否为闰年*/int isLeapYear(int year){ if(((year%4==0)&&(year%100!=0)) ||(year%400==0)) { return 1; } return 0;}i

2015-08-16 20:56:15 590

原创 vote

#include #include#includeusing namespace std;map candidaes;typedef map::iterator VstrItor;int invild =0;unsigned int Addcandidate(char* pCandidateName){ if(NULL == pCandidateName ) {

2015-07-17 22:51:00 739

原创 自守数判断

#include #includeint getNum(long num){ int count = 0; while(num) { num/=10; count++; } return count;}int mypow(int n){ int p=1; int i; for(i= 0;

2015-07-17 22:03:25 1568

原创 时间函数

#include #include #include #includeusing namespace std;time_t GetTimeStampByStr( const char* pDate ){ const char* pStart = pDate; char szYear[5], szMonth[3], szDay[3], szHour[3],

2015-07-16 23:30:21 565

原创 文件操作——日期排序

#include #include #include #include using namespace std;#define MAXLINELENGTH 20#define YEAR 1970typedef struct DATE{ int year; int month; int day; int hour; int min; int sec;} DATE;

2015-07-14 23:16:17 533

原创 文件读写

#include #include #include #define MAXLINELENGTH 10void fileCopy(FILE *pfin,FILE *fout){ //复制第一行内容 char buffer[MAXLINELENGTH]={'\0'}; fgets(buffer,MAXLINELENGTH,pfin); printf("fil

2015-07-12 23:40:28 464

原创 zookeeper C API

#include #include #include #include "include/zookeeper/zookeeper.h"#include "include/zookeeper/zookeeper_log.h"//void zktest_watcher_g(zhandle_t* zh, int type, int state,// const char*

2015-05-03 22:49:05 558

原创 oj 题(二)

句子翻转,单词翻转// HuaweiOJ.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #includeusing namespace std;int converse(char* str,char* end){ if(NULL == str||NULL == end ) { return -1; }

2015-05-03 19:21:17 448

原创 test

dafsdfasd

2015-04-30 19:43:14 446

原创 OJ练习题

1十六进制转成十进制显示 char a[10]; gets_s(a); int len = strlen(a); int sum = 0, int weight = 1; for(int i=len-1;i>1;i--) { if(a[i]>='0' &&a[i]<='9') { sum=sum+(a[i]-48)*weight; weight=weight

2015-04-29 21:57:13 1125

原创 C++读取文件txt中double型内容

ifstream ifstr_man("GMM-data//man.txt");//读取文本数据 一列;// ifstream ifstr_woman("GMM-data//woman.txt"); //读取文本数据 一列;// double d; while (ifstr_man >> d) sample.push_back(d);//将数据压入堆栈。// while (ifst

2015-01-29 16:27:06 8921

原创 halcon 培训

今天去大恒图像进行了halcon11的培训

2015-01-29 16:18:54 2695

原创 opencv2中MSER区域提取

opencv 更新速度一直在加快,最新版本都出到了3.0beta了。MSER一直在用C接口的,最近想试一下3.0的MSER,发现还用不起来,因为封装方法还没搞清楚,也没有太多参考,就用了Qt5.3+opencv2.4.7中的C++接口MSER,当然没有界面,还是控制台程序。总的来说还是比较方便的。#include #include "opencv2/core/core.hpp"#inclu

2015-01-26 09:08:58 3144

原创 opencv2学习_1从C风格转向C++

opencv2 之后的版本都是基于C++的,对于习惯使用C风格的朋友们来说很不适应。比如图片的数据结构都发生了巨大的变化。我们熟悉的IPlimage 结构将觅不的踪影。

2015-01-24 17:07:58 683

原创 自己写的Kmeans

#include #include #include#include#include "fstream"using namespace std;typedef struct Point{ double x; double y; int label;}Point;class Sample{ public: Sample(const string& file_

2015-01-24 16:55:13 530

原创 给RGB加上BMP文件头

需要将摄像头采集到的图像数据(纯净的RGB,或BGR数据)加上文件头后暂存在内存中如若写入文件仅需将memcpy换成fwrite即可。#ifndef RGB2BMP_H#define RGB2BMP_H///为拍摄的RGB数据加上BMP文件头///作者:/// 2014.6.25///typedef unsigned char BYTE;typedef unsigned s

2015-01-24 16:53:22 1516

原创 结构体用法总结

一,定义简单结构体时可以对一些简单的函数定义、运算符进行重载,其实这是C++类的特性,但比类更加轻量级,且为后续处理提供了非常大的方便。如下例对>号进行重载方便了时间的比较。活学活用C/C++;struct Time{ int h,m,s; bool operator>(const Time a)const { if(a.h==h&&a.m==m) retur

2015-01-24 16:47:46 605

原创 常用C++函数模板整理

1:数值交换      template static inline void swap(T& x, T& y) { T t=x; x=y; y=t; }

2015-01-17 15:51:48 546

原创 360笔试2014-10-11

第一部分,四十道选择题基础知识,前五道是

2014-10-11 21:30:35 1451

原创 MFC 下调用Qt编写的含界面的dll

接到任务要做一个既可以在纠结了好几天了,

2014-07-27 23:23:57 18308 14

原创 给图像数据加上BMP文件头

需要将摄像头采集到的图像数据

2014-07-01 14:51:34 4832

原创 MSER_sample

// mser.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "opencv2/highgui/highgui.hpp"#include "opencv2/features2d/features2d.hpp"#include "opencv2/imgproc/imgproc_c.h"#include void help()

2014-07-01 14:45:45 991

转载 vector类的resize和reserve方法

vector 的reserve增加了vector的capacity,但是它的size没有改变!而resize改变了vector的capacity同时也增加了它的size!原因如下: reserve是容器预留空间,但在空间内不真正创建元素对象,所以在没有添加新的对象之前,不能引用容器内的元素。加入新的元素时,要调用push_back()/insert()函数。 resiz

2014-05-21 17:19:19 766

原创 交通标志红孔检测法

哈工大博士王刚毅论文中提到红孔检测法,lun

2014-05-19 10:53:49 1191 1

转载 字符串转整形

int StrToDecInt1(const char* str){ static const int MAX = (int)((unsigned)~0 >> 1);//32位能表示的最大的正整数// static const int MIN = -(int)((unsigned)~0 >> 1) - 1;//最小负整数// static const int MAX_DIV = (int)

2014-05-13 11:12:50 739

原创 MFC中使用多个timer定时器

1,在MFC中添加WM_TIMER消息处理函数会生成     void CFaceDetectDlg::OnTimer(UINT_PTR nIDEvent)

2014-05-10 16:55:39 8827

原创 matlab meanshift

用MATLAB 编写的meanshift 寻找聚类中心的程序%% mean shift%% 产生随机点x1 = 30 + sqrt(9) * randn(1,100);y1 = 30 +sqrt(9) * randn(1,100);x2 =20+sqrt(7) * randn(1,100);y2 =20+sqrt(7) * randn(1,100);x3 =10+sqrt(6)

2014-04-14 16:25:17 2091

原创 opencv 视频处理框架,面向对象,简单实用,可扩展

头文件/*------------------------------------------------------------------------------------------*\ This file contains material supporting chapter 10 of the cookbook: Computer Vision Progr

2014-03-21 18:02:13 812

原创 opencv 中图像处理的一般流程——面向对象

图像处理算法opencv实现的通用框架,很实用,总结如下。将要处理的图片当做参数传递给算法类,每个算法都做一个类算法类的定义            1.必要的参数,参数的set,get函数;            2.必要的辅助函数,尽量拆分开来,功能独立,短小;    3. 输出图像作为成员变量,处理结果通过其返回    class GetColor{priv

2014-03-09 20:20:05 2883 1

原创 C#输入类型检查异常

public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void calculateClick(object sender, RoutedEventArgs e

2014-03-05 20:26:35 1508

原创 vs2010下编译DLL库和使用

一、创建DLL 文件1 vs2010下选择win32应用程序,创建DLL 工程2 创建头文件testdll.h#ifndef TestDll_H_#define TestDll_H_#ifdef MYLIBDLL#define MYLIBDLL extern "C" _declspec(dllimport) #else#define MYLIBDLL extern "C" _

2014-03-03 11:27:13 1236

原创 matlab版hog+svm图像二分类

开始接触svm分类器是opencv中的使用起来很方便,后来根据实际需要需要使用matlab版的,以前没怎么接触过,开始有点头大,不知从何下手,查阅相关例子后,就开始训练了自己所需分类器了,也很方便.其中hog源程序参考http://blog.csdn.net/huangli19870217/article/details/7695458准备工作1:创建正阳本文件夹“pos”将正阳本放入

2014-02-26 11:00:40 14756 43

原创 C++实现弗洛伊德算法

还没有正儿八经的独立实现过一个什么算法呢,以前写的时候总是把别人的程序放在旁边,自己写的时候时不时瞄两眼,最终觉得是自己写出来的,但是时间一久就又忘记怎么实现的了,其实这是没有真正的理解算法,要是理解了,再加上语言功底可以就很容易去实现它。归根到底写不出来还是没有真正的搞懂,主函数:// Frod.cpp : Defines the entry point for the console

2014-01-10 10:41:11 3844

原创 纯属练手

// L2norm.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include using namespace std;typedef struct { int rows; int cols; float* data;}Matri

2014-01-09 15:15:31 614

原创 dijkstra算法详细分析

// dijkstra.cpp : Defines the entry point for the console application.//#include "stdafx.h"//狄杰斯特拉算法寻找图中的最短距离//#include #include "stdio.h"#include "stdlib.h"#include #inclu

2014-01-08 21:57:45 1092

原创 DPM样本生成——字符转换

// DPMSample.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include #include #include #include #include "cv.h"#include "cxcore.h"#incl

2014-01-08 14:42:00 834

原创 图像缩放

高深的搞不动了搞些简单的// Gauss.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "cv.h"#include "highgui.h"#include ;#include using namespace std;void resizeIma

2014-01-07 20:17:12 800

原创 matlab与C混合编程调试-vs2010+matlab2012a

matlab 对于科学计算来说非常方便易用,但是效率不太高,尤其是一些自己写的未经优化的程序。可以将计算比较耗时的算法用C语言实现然后在matlab下调用,但关键是如何编写和调试。编写还好说,查看一下mex借口函数的用法应该跟编写普通函数差不多,只不过参数需要经过转换,转换时细心点,再加上有点C指针的基本功就能胜任。       但是调试比较麻烦,之前一直以为是一件十分困难的事情,但是尝试之后

2014-01-02 21:32:46 2513

MFC调用QT页面

MFC 调用QT制作的界面,非常好用,值得学习。

2015-11-16

数字图像处理 计算机视觉

Use the binary to compute color descriptors within an image, such as color histograms and color SIFT. The input image can be in PNG or JPG formats. The detector and descriptor options are documented below

2013-02-28

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除