当前位置: 首页 > news >正文

网站开发可以学吗wordpress彩票模板

网站开发可以学吗,wordpress彩票模板,绥中网站建设分类信息网,图形网站建设软件结合这周看的论文,我对这周研究的Histogram of oriented gradients(HOG)谈谈自己的理解#xff1a; HOG descriptors 是应用在计算机视觉和图像处理领域#xff0c;用于目标检測的特征描写叙述器。这项技术是用来计算局部图像梯度的方向信息的统计值。这样的方法跟边缘方向直…   结合这周看的论文,我对这周研究的Histogram of oriented gradients(HOG)谈谈自己的理解 HOG descriptors 是应用在计算机视觉和图像处理领域用于目标检測的特征描写叙述器。这项技术是用来计算局部图像梯度的方向信息的统计值。这样的方法跟边缘方向直方图edge orientation histograms、尺度不变特征变换scale-invariant feature transform descriptors以及形状上下文方法 shape contexts有非常多相似之处但与它们的不同点是HOG描写叙述器是在一个网格密集的大小统一的细胞单元dense grid of uniformly spaced cells上计算并且为了提高性能还採用了重叠的局部对照度归一化overlapping local contrast normalization技术。 这篇文章的作者Navneet Dalal和Bill Triggs是法国国家计算机技术和控制研究所French National Institute for Research in Computer Science and Control (INRIA)的研究员。他们在这篇文章中首次提出了HOG方法。这篇文章被发表在2005年的CVPR上。他们主要是将这样的方法应用在静态图像中的行人检測上但在后来他们也将其应用在电影和视频中的行人检測以及静态图像中的车辆和常见动物的检測。 HOG描写叙述器最重要的思想是在一副图像中局部目标的表象和形状appearance and shape能够被梯度或边缘的方向密度分布非常好地描写叙述。详细的实现方法是首先将图像分成小的连通区域我们把它叫细胞单元。然后採集细胞单元中各像素点的梯度的或边缘的方向直方图。最后把这些直方图组合起来就能够构成特征描写叙述器。为了提高性能我们还能够把这些局部直方图在图像的更大的范围内我们把它叫区间或block进行对照度归一化contrast-normalized所採用的方法是先计算各直方图在这个区间block中的密度然后依据这个密度对区间中的各个细胞单元做归一化。通过这个归一化后能对光照变化和阴影获得更好的效果。 与其它的特征描写叙述方法相比HOG描写叙述器后非常多长处。首先因为HOG方法是在图像的局部细胞单元上操作所以它对图像几何的geometric和光学的photometric形变都能保持非常好的不变性这两种形变仅仅会出如今更大的空间领域上。其次作者通过实验发现在粗的空域抽样coarse spatial sampling、精细的方向抽样fine orientation sampling以及较强的局部光学归一化strong local photometric normalization等条件下仅仅要行人大体上可以保持直立的姿势就容许行人有一些细微的肢体动作这些细微的动作可以被忽略而不影响检測效果。综上所述HOG方法是特别适合于做图像中的行人检測的。   上图是作者做的行人检測试验当中a表示全部训练图像集的平均梯度average gradient across their training imagesb和c分别表示图像中每个区间block上的最大最大正、负SVM权值d表示一副測试图像e计算完R-HOG后的測试图像f和g分别表示被正、负SVM权值加权后的R-HOG图像。 算法的实现 色彩和伽马归一化color and gamma normalization 作者分别在灰度空间、RGB色彩空间和LAB色彩空间上对图像进行色彩和伽马归一化但实验结果显示这个归一化的预处理工作对最后的结果没有影响原因可能是在兴许步骤中也有归一化的过程那些过程能够代替这个预处理的归一化。所以在实际应用中这一步能够省略。 梯度的计算Gradient computation 最经常使用的方法是简单地使用一个一维的离散微分模板1-D centered, point discrete derivative mask在一个方向上或者同一时候在水平和垂直两个方向上对图像进行处理更确切地说这种方法须要使用以下的滤波器核滤除图像中的色彩或变化剧烈的数据color or intensity data   作者也尝试了其它一些更复杂的模板如3×3 Sobel 模板或对角线模板diagonal masks可是在这个行人检測的实验中这些复杂模板的表现都较差所以作者的结论是模板越简单效果反而越好。作者也尝试了在使用微分模板前增加一个高斯平滑滤波可是这个高斯平滑滤波的增加使得检測效果更差原因是很多实用的图像信息是来自变化剧烈的边缘而在计算梯度之前增加高斯滤波会把这些边缘滤除掉。 构建方向的直方图creating the orientation histograms 第三步就是为图像的每个细胞单元构建梯度方向直方图。细胞单元中的每个像素点都为某个基于方向的直方图通道orientation-based histogram channel投票。投票是採取加权投票weighted voting的方式即每一票都是带权值的这个权值是依据该像素点的梯度幅度计算出来。能够採用幅值本身或者它的函数来表示这个权值实际測试表明使用幅值来表示权值能获得最佳的效果当然也能够选择幅值的函数来表示比方幅值的平方根square root、幅值的平方square of the gradient magnitude、幅值的截断形式clipped version of the magnitude等。细胞单元能够是矩形的rectangular也能够是星形的radial。直方图通道是平均分布在0-1800无向或0-3600有向范围内。作者发现採用无向的梯度和9个直方图通道能在行人检測试验中取得最佳的效果。 把细胞单元组合成大的区间grouping the cells together into larger blocks 因为局部光照的变化variations of illumination以及前景-背景对照度foreground-background contrast的变化使得梯度强度gradient strengths的变化范围很大。这就须要对梯度强度做归一化作者採取的办法是把各个细胞单元组合成大的、空间上连通的区间blocks。这样以来HOG描写叙述器就变成了由各区间全部细胞单元的直方图成分所组成的一个向量。这些区间是互有重叠的这就意味着每一个细胞单元的输出都多次作用于终于的描写叙述器。区间有两个基本的几何形状——矩形区间R-HOG和环形区间C-HOG。R-HOG区间大体上是一些方形的格子它能够有三个參数来表征每一个区间中细胞单元的数目、每一个细胞单元中像素点的数目、每一个细胞的直方图通道数目。作者通过实验表明行人检測的最佳參数设置是3×3细胞/区间、6×6像素/细胞、9个直方图通道。作者还发现在对直方图做处理之前给每一个区间block加一个高斯空域窗体Gaussian spatial window是很必要的由于这样能够减少边缘的周围像素点pixels around the edge的权重。 R-HOG跟SIFT描写叙述器看起来非常相似但他们的不同之处是R-HOG是在单一尺度下、密集的网格内、没有对方向排序的情况下被计算出来are computed in dense grids at some single scale without orientation alignment而SIFT描写叙述器是在多尺度下、稀疏的图像关键点上、对方向排序的情况下被计算出来are computed at sparse, scale-invariant key image points and are rotated to align orientation。补充一点R-HOG是各区间被组合起来用于对空域信息进行编码are used in conjunction to encode spatial form information而SIFT的各描写叙述器是单独使用的are used singly。 C-HOG区间blocks有两种不同的形式它们的差别在于一个的中心细胞是完整的一个的中心细胞是被切割的。如右图所看到的 作者发现C-HOG的这两种形式都能取得同样的效果。C-HOG区间blocks能够用四个參数来表征角度盒子的个数number of angular bins、半径盒子个数number of radial bins、中心盒子的半径radius of the center bin、半径的伸展因子expansion factor for the radius。通过实验对于行人检測最佳的參数设置为4个角度盒子、2个半径盒子、中心盒子半径为4个像素、伸展因子为2。前面提到过对于R-HOG中间加一个高斯空域窗体是非常有必要的但对于C-HOG这显得没有必要。C-HOG看起来非常像基于形状上下文Shape Contexts的方法但不同之处是C-HOG的区间中包括的细胞单元有多个方向通道orientation channels而基于形状上下文的方法只只用到了一个单一的边缘存在数edge presence count。 区间归一化Block normalization 作者採用了四中不同的方法对区间进行归一化并对结果进行了比較。引入v表示一个还没有被归一化的向量它包括了给定区间block的全部直方图信息。| | vk | |表示v的k阶范数这里的k去1、2。用e表示一个非常小的常数。这时归一化因子能够表演示样例如以下 L2-norm: L1-norm: L1-sqrt: 还有第四种归一化方式L2-Hys它能够通过先进行L2-norm对结果进行截短clipping然后再又一次归一化得到。作者发现採用L2-Hys, L2-norm, 和 L1-sqrt方式所取得的效果是一样的L1-norm略微表现出一点点不可靠性。可是对于没有被归一化的数据来说这四种方法都表现出来显著的改进。 SVM分类器SVM classifier 最后一步就是把提取的HOG特征输入到SVM分类器中寻找一个最优超平面作为决策函数。作者採用的方法是使用免费的SVMLight软件包加上HOG分类器来寻找測试图像中的行人。 zz from http://hi.baidu.com/ykaitao_handsome/blog/item/d7a2c3156e368a0a4b90a745.html   本文来自CSDN博客转载请标明出处http://blog.csdn.net/forsiny/archive/2010/03/22/5404268.aspx posted 2011-06-01 13:51 我陪你面朝大海 阅读(403) 评论(0) 编辑 转peopledetect学习来自opencv中文论坛 OpenCV2.0提供了行人检測的样例用的是法国人Navneet Dalal最早在CVPR2005会议上提出的方法。 近期正在学习它以下是自己的学习体会希望共同探讨提高。 1、VC 2008 Express下安装OpenCV2.0--能够直接使用2.1不用使用CMake进行编译了避免编译出错       这是一切工作的基础感谢版主提供的參考http://www.opencv.org.cn/index.php/VC_2008_Expressä¸å®è£OpenCV2.02、体会该程序 在DOS界面进入例如以下路径 C:\OpenCV2.0\samples\c  peopledetect.exe filename.jpg 当中filename.jpg为待检測的文件名称 3、编译程序  创建一个控制台程序从C:\OpenCV2.0\samples\c下将peopledetect.cpp增加到project中按步骤1的方法进行设置。编译成功可是在DEBUG模式下生成的EXE文件执行出错非常奇怪 。 改成RELEASE模式后再次编译生成的EXE文件能够执行。 4程序代码简要说明 1) getDefaultPeopleDetector() 获得3780维检測算子105 blocks with 4 histograms each and 9 bins per histogram there are 3,780 values--为什么是105blocks 2).cv::HOGDescriptor hog; 创建类的对象 一系列变量初始化   winSize(64,128), blockSize(16,16), blockStride(8,8), cellSize(8,8), nbins(9), derivAperture(1), winSigma(-1), histogramNormType(L2Hys), L2HysThreshold(0.2), gammaCorrection(true) 3). 调用函数detectMultiScale(img, found, 0, cv::Size(8,8), cv::Size(24,16), 1.05, 2);    參数分别为待检图像、返回结果列表、门槛值hitThreshold、窗体步长winStride、图像padding margin、比例系数、门槛值groupThreshold通过改动參数发现就所用的某图片參数0改为0.01就检測不到改为0.001能够1.05改为1.1就不行1.06能够2改为1能够0.8下面不行24,16改成0,0也能够32,32也行 该函数内容例如以下 (1) 得到层数 levels  某图片530402为例lg(402/128)/lg1.0523.4 则得到层数为24  (2) 循环levels次每次运行内容例如以下 HOGThreadData tdata threadData[getThreadNum()]; Mat smallerImg(sz, img.type(), tdata.smallerImgBuf.data);     调用下面核心函数 detect(smallerImg, tdata.locations, hitThreshold, winStride, padding); 其參数分别为该比例下图像、返回结果列表、门槛值、步长、margin 该函数内容例如以下 (a)得到补齐图像尺寸paddedImgSize (b)创建类的对象 HOGCache cache(this, img, padding, padding, nwindows 0, cacheStride); 在创建过程中首先初始化 HOGCache::init,包含计算梯度 descriptor-computeGradient、得到块的个数105、每块參数个数36      (c)获得窗体个数nwindows以第一层为例其窗体数为53032*2-64/81、40232*2-128/81 67*432881当中32,32为winStride參数也可用24,16 (d)在每一个窗体运行循环内容例如以下 在105个块中运行循环每一个块内容为通过getblock函数计算HOG特征并归一化36个数分别与算子中相应数进行相应运算推断105个块的总和 s hitThreshold 则觉得检測到目标  4主体部分感觉就是以上这些但非常多细节还须要进一步弄清。 5、原文献写的算法流程 文献NavneetDalalThesis.pdf 78页图5.5描写叙述了The complete object detection algorithm. 前2步为初始化上面基本提到了。后面2步例如以下 For each scale Si [Ss, SsSr, . . . , Sn] (a) Rescale the input image using bilinear interpolation (b) Extract features (Fig. 4.12) and densely scan the scaled image with stride Ns for object/non-object detections (c) Push all detections with t(wi) c to a list Non-maximum suppression (a) Represent each detection in 3-D position and scale space yi (b) Using (5.9), compute the uncertainty matrices Hi for each point (c) Compute the mean shift vector (5.7) iteratively for each point in the list until it converges to a mode (d) The list of all of the modes gives the final fused detections (e) For each mode compute the bounding box from the final centre point and scale 下面内容节选自文献NavneetDalalThesis.pdf把重要的部分挑出来了。当中保留了原文章节号便于查找。 4. Histogram of Oriented Gradients Based Encoding of Images Default Detector. As a yardstick for the purpose of comparison, throughout this section we compare results to our default detector which has the following properties: input image in RGB colour space (without any gamma correction); image gradient computed by applying [?1, 0, 1] filter along x- and yaxis with no smoothing; linear gradient voting into 9 orientation bins in 0_–180_; 16×16 pixel blocks containing 2×2 cells of 8×8 pixel; Gaussian block windowing with _ 8 pixel; L2-Hys (Lowe-style clipped L2 norm) block normalisation; blocks spaced with a stride of 8 pixels (hence 4-fold coverage of each cell); 64×128 detection window; and linear SVM classifier. We often quote the performance at 10?4 false positives per window (FPPW) – the maximum false positive rate that we consider to be useful for a real detector given that 103–104 windows are tested for each image. 4.3.2 Gradient Computation The simple [?1, 0, 1] masks give the best performance. 4.3.3 Spatial / Orientation Binning Each pixel contributes a weighted vote for orientation based on the orientation of the gradient element centred on it. The votes are accumulated into orientation bins over local spatial regions that we call cells. To reduce aliasing, votes are interpolated trilinearly between the neighbouring bin centres in both orientation and position. Details of the trilinear interpolation voting procedure are presented in Appendix D. The vote is a function of the gradient magnitude at the pixel, either the magnitude itself, its square, its square root, or a clipped form of the magnitude representing soft presence/absence of an edge at the pixel. In practice, using the magnitude itself gives the best results. 4.3.4 Block Normalisation Schemes and Descriptor Overlap good normalisation is critical and including overlap significantly improves the performance. Figure 4.4(d) shows that L2-Hys, L2-norm and L1-sqrt all perform equally well for the person detector. such as cars and motorbikes, L1-sqrt gives the best results. 4.3.5 Descriptor Blocks R-HOG. For human detection, 3×3 cell blocks of 6×6 pixel cells perform best with 10.4% miss-rate at 10?4 FPPW. Our standard 2×2 cell blocks of 8×8 cells are a close second. We find 2×2 and 3×3 cell blocks work best. 4.3.6 Detector Window and Context Our 64×128 detection window includes about 16 pixels of margin around the person on all four sides. 4.3.7 Classifier By default we use a soft (C0.01) linear SVM trained with SVMLight [Joachims 1999].We modified SVMLight to reduce memory usage for problems with large dense descriptor vectors. --------------------------------- 5. Multi-Scale Object Localisation the detector scans the image with a detection window at all positions and scales, running the classifier in each window and fusing multiple overlapping detections to yield the final object detections. We represent detections using kernel density estimation (KDE) in 3-D position and scale space. KDE is a data-driven process where continuous densities are evaluated by applying a smoothing kernel to observed data points. The bandwidth of the smoothing kernel defines the local neighbourhood. The detection scores are incorporated by weighting the observed detection points by their score values while computing the density estimate. Thus KDE naturally incorporates the first two criteria. The overlap criterion follows from the fact that detections at very different scales or positions are far off in 3-D position and scale space, and are thus not smoothed together. The modes (maxima) of the density estimate correspond to the positions and scales of final detections. Let xi [xi, yi] and s0i denote the detection position and scale, respectively, for the i-th detection. the detections are represented in 3-D space as y [x, y, s], where s log(s’). the variable bandwidth mean shift vector is defined as (5.7) For each of the n point the mean shift based iterative procedure is guaranteed to converge to a mode2. Detection Uncertainty Matrix Hi. One key input to the above mode detection algorithm is the amount of uncertainty Hi to be associated with each point. We assume isosymmetric covariances, i.e. the Hi’s are diagonal matrices. Let diag [H] represent the 3 diagonal elements of H. We use scale dependent covariance matrices such that diag [Hi] [(exp(si)_x)2, (exp(si)_y)2, (_s)2] (5.9) where _x, _y and _s are user supplied smoothing values. The term t(wi) provides the weight for each detection. For linear SVMs we usually use threshold 0. the smoothing parameters _x, _y,and _s used in the non-maximum suppression stage. These parameters can have a significant impact on performance so proper evaluation is necessary. For all of the results here, unless otherwise noted, a scale ratio of 1.05, a stride of 8 pixels, and _x 8, _y 16, _s log(1.3) are used as default values. A scale ratio of 1.01 gives the best performance, but significantly slows the overall process. Scale smoothing of log(1.3)–log(1.6) gives good performance for most object classes. We group these mode candidates using a proximity measure. The final location is the ode corresponding to the highest density. ---------------------------------------------------- 附录 A. INRIA Static Person Data Set The (centred and normalised) positive windows are supplied by the user, and the initial set of negatives is created once and for all by randomly sampling negative images.A preliminary classifier is thus trained using these. Second, the preliminary detector is used to exhaustively scan the negative training images for hard examples (false positives). The classifier is then re-trained using this augmented training set (user supplied positives, initial negatives and hard examples) to produce the final detector. INRIA Static Person Data Set As images of people are highly variable, to learn an effective classifier, the positive training examples need to be properly normalized and centered to minimize the variance among them. For this we manually annotated all upright people in the original images. The image regions belonging to the annotations were cropped and rescaled to 64×128 pixel image windows. On average the subjects height is 96 pixels in these normalised windows to allow for an approximately16 pixel margin on each side. In practise we leave a further 16 pixel margin around each side of the image window to ensure that flow and gradients can be computed without boundary effects. The margins were added by appropriately expanding the annotations on each side before cropping the image regions. //------------------------以上摘自datal的博士毕业论文 关于INRIA Person Dataset的很多其它介绍见下面链接http://pascal.inrialpes.fr/data/human/Original Images             Folders Train and Test correspond, respectively, to original training and test images. Both folders have three sub folders: (a) pos (positive training or test images), (b) neg (negative training or test images), and (c) annotations (annotation files for positive images in Pascal Challenge format). Normalized Images         Folders train_64x128_H96 and test_64x128_H96 correspond to normalized dataset as used in above referenced paper. Both folders have two sub folders: (a) pos (normalized positive training or test images centered on the person with their left-right reflections), (b) neg (containing original negative training or test images). Note images in folder train/pos are of 96x160 pixels (a margin of 16 pixels around each side), and images in folder test/pos are of 70x134 pixels (a margin of 3 pixels around each side). This has been done to avoid boundary conditions (thus to avoid any particular bias in the classifier). In both folders, use the centered 64x128 pixels window for original detection task. Negative windows         To generate negative training windows from normalized images, a fixed set of 12180 windows (10 windows per negative image) are sampled randomly from 1218 negative training photos providing the initial negative training set. For each detector and parameter combination, a preliminary detector is trained and all negative training images are searched exhaustively (over a scale-space pyramid) for false positives (hard examples). All examples with score greater than zero are considered hard examples. The method is then re-trained using this augmented set (initial 12180 hard examples) to produce the final detector. The set of hard examples is subsampled if necessary, so that the descriptors of the final training set fit into 1.7 GB of RAM for SVM training. //------------------------------------------------------______________ 原作者对 OpenCV2.0 peopledetect 进行了2次更新https://code.ros.org/trac/opencv/changeset/2314/trunk近期一次改为例如以下 --------------------- #include cvaux.h #include highgui.h #include stdio.h #include string.h #include ctype.h using namespace cv; using namespace std; int main(int argc, char** argv) { Mat img; FILE* f 0; char _filename[1024]; if( argc 1 ) { printf(Usage: peopledetect (image_filename | image_list.txt)\n); return 0; } img imread(argv[1]); if( img.data ) { strcpy(_filename, argv[1]); } else { f fopen(argv[1], rt); if(!f) { fprintf( stderr, ERROR: the specified file could not be loaded\n); return -1; } } HOGDescriptor hog; hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector()); for(;;) { char* filename _filename; if(f) { if(!fgets(filename, (int)sizeof(_filename)-2, f)) break; //while(*filename isspace(*filename)) // filename; if(filename[0] #) continue; int l strlen(filename); while(l 0 isspace(filename[l-1])) --l; filename[l] \0; img imread(filename); } printf(%s:\n, filename); if(!img.data) continue; fflush(stdout); vectorRect found, found_filtered; double t (double)getTickCount(); // run the detector with default parameters. to get a higher hit-rate // (and more false alarms, respectively), decrease the hitThreshold and // groupThreshold (set groupThreshold to 0 to turn off the grouping completely). int can img.channels(); hog.detectMultiScale(img, found, 0, Size(8,8), Size(32,32), 1.05, 2); t (double)getTickCount() - t; printf(tdetection time %gms\n, t*1000./cv::getTickFrequency()); size_t i, j; for( i 0; i found.size(); i ) { Rect r found[i]; for( j 0; j found.size(); j ) if( j ! i (r found[j]) r) break; if( j found.size() ) found_filtered.push_back(r); } for( i 0; i found_filtered.size(); i ) { Rect r found_filtered[i]; // the HOG detector returns slightly larger rectangles than the real objects. // so we slightly shrink the rectangles to get a nicer output. r.x cvRound(r.width*0.1); r.width cvRound(r.width*0.1; r.y cvRound(r.height*0.07); r.height cvRound(r.height*0.1; rectangle(img, r.tl(), r.br(), cv::Scalar(0,255,0), 3); } imshow(people detector, img); int c waitKey(0) 255; if( c q || c Q || !f) break; } if(f) fclose(f); return 0; } 更新后能够批量检測图片 将须要批量检測的图片构造一个TXT文本文件名称为filename.txt, 其内容例如以下 1.jpg 2.jpg ...... 然后在DOS界面输入 peopledetect filename.txt  就可以自己主动检測每一个图片。 //------------------------------Navneet Dalal的OLT工作流程描写叙述 Navneet Dalal在下面站点提供了INRIA Object Detection and Localization Toolkithttp://pascal.inrialpes.fr/soft/olt/Wilson Suryajaya Leoputra提供了它的windows版本号http://www.computing.edu.au/~12482661/hog.html须要 Copy all the dlls (boost_1.34.1*.dll, blitz_0.9.dll, opencv*.dll) into ROOT_PROJECT_DIR/debug/ Navneet Dalal提供了linux下的可执行程序借别人的linux系统执行一下先把整体流程了解了。 以下结合OLTbinaries\readme和OLTbinaries\HOG\record两个文件把其流程描写叙述一下。 1.下载 INRIA person detection database 解压到OLTbinaries\把当中的train_64x128_H96 重命名为 train test_64x128_H96 重命名为 test. 2在linux下执行 runall.sh script. 等待结果出来后打开matlab 执行 plotdet.m 可绘制 DET曲线 ------这是一步到位法-------------------------------------------------- -------此外它还提供了分步运行法------------------------------------- 1、由pos.lst列表提供的图片计算正样本RHOG特征pos.lst列表格式例如以下 train/pos/crop_000010a.png train/pos/crop_000010b.png train/pos/crop_000011a.png ------下面表示-linux下运行语句下同------ ./bin//dump_rhog -W 64,128 -C 8,8 -N 2,2 -B 9 -G 8,8 -S 0 --wtscale 2 --maxvalue 0.2 -- epsilon 1 --fullcirc 0 -v 3 --proc rgb_sqrt --norm l2hys -s 1 train/pos.lst  HOG/train_pos.RHOG 2.计算负样本RHOG特征 ./bin//dump_rhog -W 64,128 -C 8,8 -N 2,2 -B 9 -G 8,8 -S 0 --wtscale 2 --maxvalue 0.2 -- epsilon 1 --fullcirc 0 -v 3 --proc rgb_sqrt --norm l2hys -s 10 train/neg.lst HOG/train_neg.RHOG 3.训练 ./bin//dump4svmlearn -p HOG/train_pos.RHOG -n HOG/train_neg.RHOG HOG/train_BiSVMLight.blt -v 4.创建 model file: HOG/model_4BiSVMLight.alt ./bin//svm_learn -j 3 -B 1 -z c -v 1 -t 0 HOG/train_BiSVMLight.blt HOG/model_4BiSVMLight.alt 5.创建目录 mkdir -p HOG/hard 6.分类 ./bin//classify_rhog train/neg.lst HOG/hard/list.txt HOG/model_4BiSVMLight.alt -d HOG/hard/hard_neg.txt -c HOG/hard/hist.txt -m 0 -t 0 --no_nonmax 1 --avsize 0 --margin 0 --scaleratio 1.2 -l N -W 64,128 -C 8,8 -N 2,2 -B 9 -G 8,8 -S 0 --wtscale 2 --maxvalue 0.2 -- epsilon 1 --fullcirc 0 -v 3 --proc rgb_sqrt --norm l2hys -------- false /- 分类结果会写入 HOG/hard/hard_neg.txt 7. 将hard增加到neg,再次计算RHOG特征 ./bin//dump_rhog -W 64,128 -C 8,8 -N 2,2 -B 9 -G 8,8 -S 0 --wtscale 2 --maxvalue 0.2 -- epsilon 1 --fullcirc 0 -v 3 --proc rgb_sqrt --norm l2hys -s 0 HOG/hard/hard_neg.txt OG/train_hard_neg.RHOG --poscases 2416 --negcases 12180 --dumphard 1 --hardscore 0 -- memorylimit 1700 8.再次训练 ./bin//dump4svmlearn -p HOG/train_pos.RHOG -n HOG/train_neg.RHOG -n HOG/train_hard_neg.RHOG HOG/train_BiSVMLight.blt -v 4 9.得到终于的模型 ./bin//svm_learn -j 3 -B 1 -z c -v 1 -t 0 HOG/train_BiSVMLight.blt HOG/model_4BiSVMLight.alt Opencv中用到的3780 个值应该就在这个模型里面model_4BiSVMLight.alt只是它的格式未知无法直接读取可是能够研究svm_learn程序是怎样生成它的;此外该模型由程序classify_rhog调用研究它怎样调用预计是一个解析此格式的思路 10.创建目录 mkdir -p HOG/WindowTest_Negative 11.负样本检測结果 ./bin//classify_rhog -W 64,128 -C 8,8 -N 2,2 -B 9 -G 8,8 -S 0 --wtscale 2 --maxvalue 0.2 --epsilon 1 --fullcirc 0 -v 3 --proc rgb_sqrt --norm l2hys -p 1 --no_nonmax 1 --nopyramid 0 - -scaleratio 1.2 -t 0 -m 0 --avsize 0 --margin 0 test/neg.lst HOG/WindowTest_Negative/list.txt HOG/model_4BiSVMLight.alt -c HOG/WindowTest_Negative/histogram.txt 12.创建目录 mkdir -p HOG/WindowTest_Positive 13.正样本检測结果 ./bin//classify_rhog -W 64,128 -C 8,8 -N 2,2 -B 9 -G 8,8 -S 0 --wtscale 2 --maxvalue 0.2 -- epsilon 1 --fullcirc 0 -v 3 --proc rgb_sqrt --norm l2hys -p 1 --no_nonmax 1 --nopyramid 1 -t 0 -m 0 --avsize 0 --margin 0 test/pos.lst HOG/WindowTest_Positive/list.txt  HOG/model_4BiSVMLight.alt -c HOG/WindowTest_Positive/histogram.txt 怎样制作训练样本 分析了原作者的数据集结合网上一些资料以下描写叙述怎样制作训练样本 1、怎样从原始图片生成样本 对照INRIAPerson\INRIAPerson\Train\pos原始图片INRIAPerson\train_64x128_H96\pos生成样本能够发现作者从原始图片裁剪出一些站立的人要求该人不被遮挡然后对剪裁的图片left-right reflect。以第一张图片为例crop001001它剪裁了2个不被遮挡的人再加上原照片共3张再加左右镜像总共6张。 2、裁剪  可利用基于opencv1.0的程序imageclipper进行裁剪并保存,它会自己主动生成文件名称并保存在同一路径下新生成的imageclipper目录下。 3.改变图片大小  能够利用Acdsee软件Tools/open in editor,进去后到Resize选项; tools/rotate还可实现left-right reflect 自己编了一个程序批量改变图片大小代码见下一楼 4. 制作pos.lst列表   进入dos界面定位到须要制作列表的图片目录下输入 dir /b pos.lst就可以生成文件列表 / #include cv.h #include highgui.h #include cvaux.h int main(int argc,char * argv[]) { IplImage* src ; IplImage* dst 0; CvSize dst_size; FILE* f 0; char _filename[1024]; int l; f fopen(argv[1], rt); if(!f) { fprintf( stderr, ERROR: the specified file could not be loaded\n); return -1; } for(;;) { char* filename _filename; if(f) { if(!fgets(filename, (int)sizeof(_filename)-2, f)) break; if(filename[0] #) continue; l strlen(filename); while(l 0 isspace(filename[l-1])) --l; filename[l] \0; srccvLoadImage(filename,1); } dst_size.width 96; dst_size.height 160; dstcvCreateImage(dst_size,src-depth,src-nChannels); cvResize(src,dst,CV_INTER_LINEAR);// char* filename2 _filename;char* filename3 _filename; filename3_96x160.jpg; strncat(filename2, filename,l-4); strcat(filename2, filename3); cvSaveImage(filename2, dst); } if(f) fclose(f); cvWaitKey(-1); cvReleaseImage( src ); cvReleaseImage( dst ); return 0; }
http://www.yutouwan.com/news/168238/

相关文章:

  • 做国际网站花钱吗国内最好的在线网站建设
  • 电商设计网站有哪些在线购物网站 模版
  • 汽车网站建设参考文献开题报告百度地图广告投放
  • seo网站推广目的图片常采用gif或jpeg格式
  • 深圳微商城网站设计多少钱微信公众号网页怎么制作
  • 宁波拾谷网站建设毕业设计 建设网站
  • 律师网站建设品牌wordpress -editor
  • 建设一个下载网站网站怎做
  • 丽江古城区建设局网站注册规划师报考条件2022
  • 济南做设计公司网站佛山企业网站建设公司
  • 网站的通知栏一般用什么控件做深圳公交公司官网
  • 浙江网站建设公司电话网站策划书撰写流程
  • 官方网站建设费用php能做手机网站吗
  • 河北省住房和城乡建设厅新网站做视频资源网站
  • 自助建站系统代理重庆公司章程电子版在哪里下载
  • 浦江网站建设yw126电商设计招聘
  • 苏州定制网站建设宣传类的网站有哪些
  • 佛山网站建设公司哪家好这么做国外网站的国内镜像站
  • 免费的网站登录模板下载如何查看网站模板
  • 主题资源网站制作平台开发者模式关掉好还是开着好
  • 国外做行程的网站wordpress手机不能看视频
  • 如何在公司网站下设置邮箱丹阳网站建设要多少钱
  • 网站竞价什么是网络营销中的免费营销策略
  • 舟山网站设计公司网站顶部展出的大幅广告
  • rails网站开发东莞网站设计哪家强
  • 做食品网站的素材网站备案填写
  • 推荐广东中山网站建设国际网站建设的目的
  • 网站建设合伙合同范本wordpress固定链接发布失败
  • 个人如何申请网站电商怎么做才能赚钱
  • 在putty做网站要拷贝什么中国搜索引擎排行榜