ImageVerifierCode 换一换
格式:DOCX , 页数:6 ,大小:18.93KB ,
资源ID:4418287      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/4418287.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(FQAopencvhaartraining.docx)为本站会员(b****4)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

FQAopencvhaartraining.docx

1、FQAopencvhaartrainingFAQ: OpenCV HaartrainingPosted on : 10-11-2009 | By : rhondasw | In : OpenCV Hi All, before posting your question, please look at this FAQ carefully! Also you can read OpenCV haartraining article. If you are sure, there is no answer to your question, feel free to post comment. A

2、lso please, put comments about improvement of this post. This post will be updated, if needed.Positive imagesWhy positive images are named so?Because a positive image contains the target object which you want machine to detect. Unlike them, a negative image doesnt contain such target objects.Whats v

3、ec file in OpenCV haartraining?During haartraining positive samples should have the same width and height as you define in command “-w -h size”. So original positive images are resized and packed as thumbs to vec file. Vec file has header: number of positive samples, width, height and contain positi

4、ve thumbs in body.Is it possible to merge vec files?Yes, use Google, there are free tools, written by OpenCVs community.I have positive images, how create vec file of positive samples?There is tool in C:Program FilesOpenCVappsHaarTrainingsrc createsamples.cpp. Usage:createsamples -info positive_desc

5、ription.txt -vec samples.vec -w 20 -h 20Whats positive description file?The matter is that, on each positive image, there can be several objects. They have bounding rectangles: x,y, width, height. So you can write such description info of image:positive_image_name num_of_objects x y width height x y

6、 width height Text file, which contains such info about positive images is called description file. So during vec file generation, really objects are packed, but not whole image. Essentially vec file is needed to speed up machine learning.Do I always need description file, even if I have only one ob

7、ject on a image?Yes, with createsamples you need description file. If you have only one object, its bounding rectangle may be bounding rectangle of whole image. If you want, write your own tool for vec file generation =)Should lightning conditions and background be various on positive images?Yes, it

8、s very important. On each positive image, beside object, there is background. Try to fill this background with random noise, avoid constant background.How much background should be on positive image?If you have much background pixels on your positive images in comparison with objects pixels its bad

9、since the haartraining could remember the background as feature of positive image.If you dont have background pixels at all its also bad. There should be small background frame on positive imageShould all original positive images have the same size?No, original images can have any size. But its impo

10、rtant that width, height of this rectangle have the same aspect ratio as -w -h.What s -w and -h should I put in createsamples? Should it be always square? You can put any value to -w and -h depend on aspect ratio of the target object which you want to detect. But objects of smaller size will not be

11、detected! For faces, commonly used values are 2424, 2020. But you may use 2420, 2024, etc.Errors during vec file generation: Incorrect size of input array, 0 kb vec file,-First check you description file: positive_image_name should be absolute path name without spaces like “C:contentimage.jpg” not “

12、C:con tentimage.jpg” or relative path name.-Avoid empty lines in description file-Resolution of original positive image file should be not less, then -w -h parameters you put.-Check that positive images are available in your file systems and not corrupted.-There can be unsupported formats. Jpeg, Bmp

13、, PPM are supported!Example of vec file generation!Lets working directory be C:haartraining. In it there is createsamples.exe. There is folderC:haartrainingpositives. So create description file positive_desc.txt.positivesimage1.jpg 1 10 10 20 20positivesimage2.jpg 2 30 30 50 50 60 60 70 70orC:haartr

14、ainingpositivesimage1.jpg 1 10 10 20 20C:haartrainingpositivesimage2.jpg 2 30 30 50 50 60 60 70 70You should avoid empty lines and empty space in images pathcreatesamples -info positive_desc.txt -vec samples.vec -w 20 -h 20Negative imagesWhat negative images should I take?You can use any image of Op

15、enCV supported formats, which does not contain target objects (which are present on positive images). But they should be various its important! Good enough database is hereShould negative images have the same size?No. But the size should not be less than -w -h, which were put during vec file generat

16、ion.Whats description file for negative image? Its just text file, often called negative.dat, which contains full path to negative images like:image_name1.jpgimage_name2.jpgAvoid empty lines in it.How many negative/positive image should I take?It depends on your task. For real cascades there should

17、be about 1000 positive images and 2000 negative images e.g.Good enough proportion is positive:negative = 1:2, but its not hard rule! I would recommend first to use small number of samples, generate cascade, test it, then enlarge number of samples.Launch haartraining.exe (OpenCVappsHaarTrainingsrc)Ex

18、ample of launchingWorking directory is C:haartraining with haartraining.exe tool and samples.vec file.Lets negative images are in C:haartrainingnegative, in this case negative.dat should be like this:negativeneg1.jpgnegativeneg2.jpgSo in C:haartraining launch this: haartraining -data haarcascade -ve

19、c samples.vec -bg negatives.dat -nstages 20 -minhitrate 0.999 -maxfalsealarm 0.5 -npos 1000 -nneg 2000 -w 20 -h 20 -nonsym -mem 1024 w h is the same, you put during vec file generation npos nneg number of positive samples and negative samples mem RAM memory, that program may use maxfalsealarm maximu

20、m false alarm, that stage may have. If big false alarm it could be bad detection system minhitrate minimal hit rate, that should stage have at least nstage number of stages in cascade What s falsealarm and hitrate of stage?You should read theory of adaboost about strong classifier. Stage is strong c

21、lassifier. In short: For example you have 1000 positive samples. You want your system to detect 900 of them. So desired hitrate = 900/1000 = 0.9. Commonly, put minhitrate = 0.999 For example you have 1000 negative samples. Because its negative, you dont want your system to detect them. But your syst

22、em, because it has error, will detect some of them. Let error be about 490 samples, so false alarm = 490/1000 = 0.49. Commonly,put false alarm = 0.5 Are falsealarm and hitrate depend on each other?Yes, there is dependency. You could not put minhitrate = 1.0 and maxfalsealarm = 0.0. .Firstly, the sys

23、tem builds classifier with desired hitrate, then it will calculate its falsealarm, if the false alarm is higher than maxfalsealarm, the system will reject such classifier and will build the next one. During haartraining you may see such:N |%SMP|F| ST.THR | HR | FA | EXP. ERR|+-+-+-+| 0 |25%|-|-1423.

24、312590| 1.000000| 1.000000| 0.876272|HR hitrateFA falsealarmWhats falsealarm and hitrate of whole cascade?Cascade is linked list (or three) of stages. Thats why: False alarm of cascade = false alarm of stage 1* false alarm of stage 2* Hit rate = hitrate of stage 1 * hitrate of stage 2* How many stag

25、es should be used? If you set big number of stages, then you will achieve better false alarm, but it will take more time for generating cascade. If you set big number of stages, then the detection time could be slower If you set big number of stages, then the worse hitrate will be (0.99*0.99* etc).

26、Commonly 14-25 stages are enough Its useless to set many stage, if you have small number of positive, negative samples Whats weighttrimming, eqw, bt, nonsym options?Really all these parameters are related to Adaboost, read theory. In short: nonsym If you positive samples are not X or Y symmetric, pu

27、t -nonsym, -sym is default! eqw if you have different number of pos and neg images, its better to put no eqw weighttrimming for calculation optimization. It can reduce calculation time a little, but quality may be worse bt what Adaboost algorithm to use: Real AB, Gentle AB, etc. Whats minpos, nsplit

28、s, maxtreesplits options?These parameters are related to clustering. In Adaboost different week classifier may be used: stump-based or tree-based. If you choose nsplits 0, tree-based will be used and you should set up minpos and maxtreesplits. nsplits minimun number of nodes in tree maxtreesplits ma

29、ximum number of nodes in tree. If maxtreesplits nsplits, tree will not be built minpos number of positive images, that can be used by one node during training. All positive images are splitted between nodes. Generally minpos should be not less than npos/nsplits. Errors and stranges during haartraini

30、ng! Error (valid only for Discrete and Real AdaBoost): misclass its warning, but no error. Some options are specific to D and R Adaboost. So your haartraining is ok. Screen is filled with such | 1000 |25%|-|-1423.312590| 1.000000| 1.000000| 0.876272| your training is cycled, restart it. First column

31、 should have value 100 cvAlloc fails. Our of memory you give too much negative images or sample.vec is too big. All these pictures are loaded to RAM. Pay attention you put the same -w and -h, as during vec file generation Pay attention, that number of positive samples and negative samples, you put in -npos -nneg are really available Avoid empty line in negative.dat file Required leaf false alarm rate achieved. Branch training terminated its impossible to build classifier with good false alarm on this negative images. Check your negative images are reall

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1