You are on page 1of 11

What Is OpenCV?

OpenCV [OpenCV] l open source (xem http://opensource.org) computer vision library c sn http://SourceForge.net/projects/opencvlibrary. Th vin ny c vit trong C v C++ v chy di Linux, Windows v Mac OS X. C pht trin tch cc trn cc giao din cho Python, Ruby, Matlab, v cc ngn ng khc. OpenCV c thit k cho hiu qu tnh ton v vi tp trung mnh cho cc ng dng thi gian thc. OpenCV c vit trong optimized C v c th c cc thun li ca cc multicore processor. Nu bn quan tm ti u t ng xa hn trn kin trc Intel [Intel], bn c th mua cc th vin Integrated Performance Primitives (IPP) [IPP] ca Intel, m gm cc hm ti u mc thp trong nhiu lnh vc thut ton khc nhau. OpenCV t ng dng IPP library thch hp lc chy nu th vin c ci. Mt trong cc mc ch ca OpenCV l cung cp mt h tng n gin dng v computer vision m gip mi ngi dng cc ng dng vision phc tp mt cch nhanh chng. OpenCV library cha trn 500 hm m tri ra nhiu lnh vc trong vision, gm factory product inspection, medical imaging, security, user interface, camera calibration, stereo vision, v robotics. V computer vision v machine learning thng i chung, OpenCV cng cha Machine Learning Library (MLL) a mc ch chung. Th vin ph ny dc gii hn v nhn din mu thng k v clustering. MLL l cc k hu ch cho cc nhim v vision m li ca nhim v ca OpenCV, nhng nhn chung n c dng cho bt k vn machine learning.

Ai dng OpenCV?

Hu ht nh khoa hc v lp trnh vin thc nghim computer bit v vi kha cnh ca vai tr m computer vision ng. Nhng vi mi ngi bit tt c cc cch m computer vision c dng. V d, hu ht mi ngi bit g v vic dng ca n trong surveillance, v nhiu cng bit rng n ang c dng rng ri cho nh v video trn Web. Mt vi thy dng mt t ca computer vision trong cc giao din game. Nhng t ngi ngi nhn ra hu ht nh aerial v street-map (chng hn trong Googles Street View) s dng nhiu k thut hiu chnh camera v image stitching. Vi nhn bit cc ng dng niche trong gim st an ton, cc phng tin bay unmanned, hay hay phn tch biomedical. Nhng t ngi bit cch pervasive machine vision trong sn xut: hu nh mi th m sn xut hng lot t ng kim tra mm im dng computer vision. Bn quyn open source cho OpenCV c cu trc m bn c th dng mt sn phm thng mi dng tt c hay mt phn OpenCV. Bn khng c ngha v phi opensource sn phm ca bn hay return cc ci tin vo public domain, m ta hy vng bn s. In part v of nhng ci ny liberal licensing terms, c cng ng ln ngi dng m bao gm mi ngi t cc cng ty ln (IBM, Microsoft , Intel, SONY, Siemens, v Google, nu tn ch mt vi) v cc trung tm nghin cu (chng hn Stanford, MIT, CMU, Cambridge, v INRIA). C mt Yahoo groups forum ni ngi dng c th gi cc cu hi v tho lun http://groups.yahoo.com/group/OpenCV; n c khong 20,000 thnh vin. OpenCV l ph bin trn ton th gii, vi cc cng ng ngi dng ln China, Japan, Russia, Europe, v Israel. Khi alpha release ca n January 1999, OpenCV c dng nhiu trong cc ng dng, sn phm, v n lc nghin cu. Cc ng dng ny gm ni nh vi nhau trong bn v tinh v web, sp xp nh qut, gim nhiu nh y hc, phn tch i tng, an ninh v cc h d xm nhp, cc h gim st t ng v an ton, cc h thm tra sn xut, hin chnh camera, cc ng dng qun s, v cc phng tin trn khng, di t, v di nc khng ngi. N c dng trong nhn din m thnh v m nhc, ni k thut nhn bit vision c p dng vi cc nh spectrogram m thanh. OpenCV l phn quan trng ca h vision trong robot t Stanford, Stanley, m thng $2M DARPA Grand Challenge desert robot race [Thrun06].

What Is Computer Vision?

Computer vision* l bin i data t mt still hay video camera thnh mt trong mt quyt nh hay mt biu din mi. Tt c cc bin i ny c lm c c vi kt qu c th. Input data c th gm vi thng tin hon cnh chng hn camera c lp trong xe hay laser range finder nhn bit mt object trong 1 meter. Quyt nh c th l c mt ngi trong hnh hay c t bo ung th 14 trn slide ny. Biu din mi c th chnh ngha mt nh mu thnh nh xm hay b chuyn ng t mt chui nh. V ta l cc to vt thy c, tht ngc khi ngh rng cng vic computer vision l d. Qu kh c th n c thy, khi ni, mt chic xe khi bn bt u n trong nh? Trc gic ban u ca bn c th rt sai lm. No ngi chia tn hiu thy c thnh nhiu knh m cc kiu khc nhau stream ca thng tin vo no bn. No c mt h tp trung m nhn din, chng mt cch ph thuc nhim v, cc phn quan trng ca mt nh kim tra trong khi kim tra kh nhiu cc vng khc. C hi tip massive trong visual stream m, as yet, t c hiu. C cc input kt hp ph bin t cc sensor iu khin c v tt c cc nhn bit khc m cho php no v cc kt hp cho c lm t nhng nm sng trn th gii. Cc vng hi tip trong no quay li tt c cc bc x l gm chnh cc hardware sensor (mt), m iu khin sng qua mng mt v chnh s nhn trn b mt ca vng mc. Trong h vision my, tuy nhin, computer nhn mt grid cc s t camera hay t disk, v th . Cho hu ht phn, khng c nhn bit mu to sn, khng iu khin t ng tiu c v m, khng kt hp cho vi nhng nm kinh nghim. Cho hu ht cc phn, cc vision system vn hon ton ngy ng. Hnh 1-1 cho thy nh ca mt xe. Trong nh ta thy mt gng chiu hu trn cnh xe ca ngi lai. iu computer thy ch l mt grid cc s. Bt k s c cho bn trong grid c mt thnh phn nhiu ln v do t n cho ta mt t thng tin, nhng grid cc s ny l tt c computer thy. Nhim v ca ta sau tr thnh chnh grid s nhiu ny thnh s nhn thc: gng chiu hu. Hnh 1-2 cho vi hiu bit hn v l do computer vision qu kh.

Hnh 1-1. Vi mt computer, gng chiu hu ch l mt grid cc s

Tht ra, vn , nh ta a n do xa, l xu hn kh; khng c kh nng gii quyt. Cho mt ci nhn hai chiu (2D) v th gii 3D, khng c cch duy nht ti to tn hiu 3D. V hnh thc, mt vn sai nh th khng c gii php duy nht hay r rng. Cng nh 2D c th biu din bt k s kt hp bt k ca cnh 3D, ngay c nu data l hon ho. Tuy nhin, nh c cp, data b

Hnh 1-2. The ill-posed nature of vision: the 2D appearance of objects c th thay i radically with Viewpoint

sai bi noise v distortions. Vic sai xut pht t cc thay i trong th gii (thi tit, nh sng, phn x, chuyn ng), khng hon ho trong lens v thit lp c, thi im tch hp tt trn sensor (motion blur), nhiu in trong sensor hay cc in khc, v vic nn nhn to sau khi chp nh. Nhng th thch nn lng c cho ny, cch c th ta lm bt k x l? Trong thit k h thng thc, kin thc hon cnh thm thng c th c dng gii quyt cc gii hn t ln ta bi cc visual sensor. Quan st v d v mt mobile robot m phi tm v nhc cc stapler trong ta nh. Robot c th dng cc s tht rng bn l mt object c thy trong bn trong vn phng v cc stapler hu ht c thy trn bn. iu ny cho mt reference kch thc ngm nh; cc stapler phi c th va trn bn. N cng gip ngn nhn nhm cc stapler ni khng th t (chng hn, trn trn hay ca s). Robot c th an ton b qua blimp qung co 200-foot ging mt stapler v blimp thiu the prerequisite wood-grained background of

a desk. Ngc li, vi cc nhim v chng hn nhn nh, tt c cc nh stapler trong database c th l cc stapler thc v do kch thc qu ln v cc cu hnh bt thng khc c th c ngn bi cc trch nhim ca nhng ngi m ly photograph. Ngha l, photographer c th ly nh ch ca cc stapler thc, kch thc bnh thng. Ngi ta hng n tm i tng khi ly nh v hng n t chng theo ckj tnh hng. Do , thng c rt t thng tin ngm nh khng ch trong cc photo c ly bi ngi. Thng tin ng cnh c th cng c m hnh r rng bng cc k thut my hc. Cc bin n chng hn kch thc, hng vi trng lc, v do c th sau c lin thng vi cc gi tr trong tp hun luyn gn nhn. Thay vo , mt ci c th c o cc bin bias n bi dng cc sensor ph. Vic dng ca mt laser range finder o su cho php ta o chnh xc kch thc mt object. Vn tip theo computer vision i din l noise. Ta in hnh gii quyt noise bi dng cc phng php thng k. V d, n c th l khng th d mt cnh trong nh hon ton bi so mt con tr vi cc lng ging tc thi ca n. Nhng nu ta quan st thng k trn vng cc b, edge detection tr thnh d hn. Mt cnh thc nn xut hin nh mt string ca nhng p ng lng ging tc thi trn mt vng cc b, mi ci m hng thch hp vi cc lng ging ca n. Cng c kh nng b noise bi ly thng k thao thi gian. Lng k thut khc v noise hay distortion bi dng cc m hnh ring hc trc tip t data sn c. V d, v cc lens distortion c hiu r, ci cn ch hc cc tham s m hnh a thc n gin m tv do lm ng hu ht hon toncc distortion nh th. Nhng hnh ng hay quyt nh m computer vision c lm da vo camera data thc hin trong hon cnh ca mc ch hay nhim v c th. Ta c th mun b noise hay lm hng mt nh sao cho h an ninh ca ta s pht cnh bo nu c ngi tro ro hay v ta cn mt h thng gim st m n bao nhiu ngi i qua mt khu trong amusement park. Phn mm vision cho cc robot m lang thang qua cc vn phng s thc hin cc chin lc khc nhau m phn mm vision cho cc camera an ninh tnh v hai h c cc hon cnh v mc ch khc nhau. Nh mt lut chung: hon cnh computer vision nhiu rng buc hn, th nhiu hn ta c th da vo cc rng buc ny n gin vn v tin cp hn cho gii php ca ta. OpenCV nhm n cung cp cc cng c c bn cn gii quyt cc vn computer vision. Trong vi trng hp, cc chc nng cao cp trong th vin ny s gii cc vn phc tp hn trong computer vision. Ngay c khi y khng l vn , cc thnh phn c bn trong th vin l hon ton cho phpto cc gii php hon chnh ca ring bn vi hu ht bt k vn computer vision. Trong trng hp sau, c vi phng php th v ng ca dng th vin; tt c trong chng bt u vi gii vn dng cng nhiu cc thnh phn th vin sn c nh c th. in hnh, sau khi bn pht trin gii php nhp u tin, bn c th thy ni gii php yu v cha nhng im yu ny bi dng code ring v s thng minh ca bn (iu tt bit rng gii quyt vn bn thc s c, hn ci bn hnh dung). Bn c th sau dng gii php nhp nh mt benchmark tip cn cc ci tip bn lm. T im , bt c im yu cn li c th c x tr bi khm ph hon cnh ca h ln hn m trong vn ca bn c nhng vo.

The Origin of OpenCV

OpenCV pht trin t mt nghin cu Intel khi xng cho cc ng dng tn dng CPU cao cp. Hng n kt thc ny, Intel khai trng nhiu projects gm real-time ray tracing v 3D display walls. Mt trong cc tc gi lm vic cho Intel thi im ang thm cc trng i hc v thng bo rng vi nhm i hc nh, chng hn MIT Media Lab, c cc h tng computer vision pht trin v m ni bm m c chuyn t sinh vin n sinh vin v m cho mi sinh vin mi mt bt u v gi trong pht trin ng dng vision ring. Thay v khm ph li cc hm c s t u, sinh vin mi c th bt u dng nh ci n trc.

Do , OpenCV c hiu nh mt cch lm h tng computer vision sn c. Vi h tr ca Intels Performance Library Team,* OpenCV bt u vi li ca cc tin chun m v thut ton c thc hin c gi n cc thnh vin ca Intels Russian library team. y l ni ca OpenCV: n bt u trong phng th nghim ca Intel vi cng tc t Soft ware Performance Libraries group cng nhau thc hin v kinh nghim ti u Russia. Ch cht trong Russian team members l Vadim Pisarevsky, ngi qun l, m, v ti u nhiu trong OpenCV v ngi vn trung tm ca nhiu trong n lc OpenCV. Cng vi anh, Victor Eruhimov h tr pht trin cu trc ban u, v Valery Kuriakin iu hnh Russian lab v h tr ln cho n lc ny. C vi mc ch cho OpenCV lc bt u: Nghin cu vision cao cp bi cung cp khng ch m m cn m ti u cho kin trc vision c bn. Khng pht minh li bnh xe. Ph bin kin thc vision bi cung cp h tng chung m cc developer c th dng, sao cho code s d c v kh chuyn nhiu hn. Cc ng dng thng mi da trn vision cao cp bi m kh chuyn, thc hin ti u sn c min phvi mt bn quyn m khng i hi cc ng dng thng mi l m hay min ph. Nhng mc tiu ny to thnh l do ca OpenCV. Cho php cc ng dng computer vision gia tng nhu cu cho cc processor nhanh. Dn n nng cp cc processor nhanh hn m to ra nhu cu cho Intel m bn cc extra software. l l do m m v min ph ny ln t mt hardware vendor hn l mt cng ty software. Trong vi hon cnh, c nhiu khng gian i mi software bn trong mt hardware company. Trong bt k n lc open source, iu quan trng nghin cu mt lng nghim tc m project tr thnh t chp nhn. By gi c xp x hai triu download ca OpenCV, v s ny tng trung bnh 26,000 downloads mt thng. User group by gi gn n 20,000 members. OpenCV nhn nhiu hp tc user, v trung tm pht trin ln bn ngoi Intel.* ng thi gian ca OpenCV c thy trong Hnh 1-3. Theo cch ny, OpenCV b nh hng bi bng n v ph sn dot-com v cng bi lng ln thay i ca iu hnh v hng. Trong cc dao ng ny, c nhng lc khi OpenCV khng c ci Intel lm vic trn n ton b. Tuy nhin, vi thun li ca multicore processor v nhiu ng dng mi ca computer vision, gi tr ca OpenCV bt u tng. Ngy nay, OpenCV l mt lnh vc tch cc vi t chc, do mong mun thy nhiu cp nhthtrong hiu chnh nhiu camera, nhn bit su, cc phng php trn vision vi cc laser range finder, v nhn bit mu tt hn cng nh nhiu h tr cho cc nhu cu robotic vision. Cho nhiu thng tin hn v tng lai ca OpenCV, xem chng 14.

Hnh 1-3. ng thi gian OpenCV

Speeding Up OpenCV withIPP

V OpenCV c tr bn trong the Intel Performance Primitives team v vi developer chnh vn cn cc thut ng quen dng vi team , OpenCV khai thc m c chnh tay, ti u cao trong IPP t tng tc. Ci tin tc t dng IPP c th l quan trng. Hnh 1-4 so hai th vin vision khc nhau, LTI [LTI] v VXL [VXL], vi OpenCV v OpenCV dng IPP. Lu hiu qu l mc ch chnh ca OpenCV; th vin cn kh nng chy vision code thi gian thc. OpenCV c vit trong C v C++ code ti u hiu qu. N khng ph thuc vo bt k cch trn IPP. Nu IPP c mt, tuy nhin, OpenCV s t ng ly thun li ca IPP bi ti cc th vin ng ca IPP ci thin xa hn tc ca n.

Hnh 1-4. Hai th vin vision khc (LTI v VXL) so vi OpenCV (khng c v c IPP) trn bn performance benchmark khc nhau: bn thanh cho mi benchmark nhn bit im t l thi gian chy cho mi th vin c cho; trong tt c trng hp, OpenCV thc hin tt so vi cc th vin khc v OpenCV c IPP thc hin tt so vi OpenCV khng c IPP

Who Owns OpenCV?

Mc d Intel khi ng OpenCV, th vin ny l v lun lun c tp trung nng cp dng thng mi v nghin cu. N do l m v min ph, v t code ca n c th c dng hay nhng (ton b hay mt phn) trong cc ng dng khc, c hay khng thng mi hay nghin cu. N khng p ng dng ca bn code l m hay min ph. N khng i hi bn return cc ci tin v li th vinnhng ta hy vng bn s.

Downloading v ci t OpenCV

OpenCV site chnh trn SourceForge http://SourceForge.net/projects/opencvlibrary v OpenCV Wiki [OpenCV Wiki] page http://opencvlibrary.SourceForge.net. Cho Linux, source distribution l file opencv-1.0.0.tar.gz; cho Windows, bn mun

OpenCV_1.0.exe. Tuy nhin, hu ht bn cp nht lun lun trn CVS server SourceForge.

Install

Mt khi bn download cc th vin, bn phi ci chng. Cho cc hng dn ci t chi tit trn Linux hay Mac OS, thy text file c tn INSTALL trc tip di .../opencv/ directory; file ny cng m t cch build v chy cc hm kim tra OpenCV. INSTALL k cc chng trnh ph bn s cn tr thnh mt OpenCV developer, chng hn autoconf, automake, libtool, v swig.

Windows

Ly ci t kh thi t SourceForge v chy n. It s install OpenCV, register DirectShow filters, v perform various post-installation procedures. Bn hin ang bt u dng OpenCV. Bn c th lun i n .../opencv/_make directory v m opencv.sln bng MSVC++ hay MSVC.NET 2005, hay bn c th m opencv.dsw bng cc bn thp hn ca MSVC++ v cc build debug version hay rebuild cc release version ca library.* thm cc ti u hiu qu thng mi IPP vo Windows, ly v install IPP t Intel site (http://www.intel.com/software/products/ipp/index.htm); dng version 5.1 hay sau. m bo binary folder thch hn (chng hn, c:/program files intel/ipp/5.1/ia32/bin) trong system path. IPP s by gi c t ng d bi OpenCV v ti lc thc thi (nhiu hn trong chng 3).

Linux

Prebuilt binaries for Linux are not included withthe Linux version of OpenCV owing to the large variety of versions of GCC v GLIBC in diff erent distributions (SuSE, Debian, Ubuntu, etc.). Nu your distribution khng off er OpenCV, bn s phi build it from sources as detailed in the .../opencv/INSTALL file. To build the libraries v demos, bn s need GTK+ 2.x hay higher, including headers. Bn s also need pkgconfig, libpng, zlib, libjpeg, libtiff , v libjasper withdevelopment files. Bn s need Python 2.3, 2.4, hay 2.5 withheaders installed (developer package). You s also need libavcodec v the other libav* libraries (including headers) from ff mpeg 0.4.9-pre1 hay later (svn checkout svn://svn.mplayerhq.hu/ff mpeg/trunk ff mpeg). Download ff mpeg from http://ffmpeg.mplayerhq.hu/download.html. The ff mpeg program has a lesser general public license (LGPL). To dng it withnon-GPL software (such as OpenCV), build v dng a shared ff mpg library:
$> ./configure --enable-shared $> make $> sudo make install

You s end up with: /usr/local/lib/libavcodec.so.*, /usr/local/lib/libavformat.so.*, /usr/local/lib/libavutil.so.*, v include files under various /usr/local/include/libav*. To build OpenCV mt khi it is downloaded:
$> $> $> $> ./configure make sudo make install sudo ldconfig

Aft er installation is complete, the default installation pathis /usr/local/lib/ v /usr/local/include/opencv/. Hence bn cn to add /usr/local/lib/ to /etc/ld.so.conf (and run ldconfig aft erwards) hay add it to the LD_LIBRARY_PATH mi trng variable; then you are done. To add the commercial IPP performance optimizations to Linux, install IPP as described trc y. Lets assume it was installed in /opt/intel/ipp/5.1/ia32/. Add <your install_path>/bin/ v <your install_path>/bin/linux32 LD_LIBRARY_PATH in your initialization script (.bashrc hay similar):
LD_LIBRARY_PATH=/opt/intel/ipp/5.1/ia32/bin:/opt/intel/ipp/5.1 /ia32/bin/linux32:$LD_LIBRARY_PATH export LD_LIBRARY_PATH

Alternatively, bn c th add <your install_path>/bin v <your install_path>/bin/linux32, one per line, to /etc/ld.so.conf v then chy ldconfig as root

(or dng sudo). Thats it. by gi OpenCV should c th locate IPP shared libraries v make dng of them on Linux. thy .../opencv/INSTALL for more details.

MacOS X

As of this writing, full chc nng on MacOS X is a priority but c still some limitations (e.g., writing AVIs); nhng ci ny limitations are described in .../opencv/INSTALL. The requirements v building instructions are similar to the Linux case, withthe following exceptions: Bi mc nh, Carbon c dng thay v GTK+. Bi mc nh, QuickTime c dng thay v ff mpeg. pkg-config is optional (it c dng explicitly only in cc sample/c/build_all.sh script). RPM v ldconfig are not supported bi mc nh. dng configure+make+sudo make install to build v install OpenCV, update LD_LIBRARY_PATH (unless ./configure --prefix=/usr c dng). For full functionality, bn should install libpng, libtiff , libjpeg v libjasper from darwinports and/or fink v make them available to ./configure (see ./configure --help). For the hu ht current thng tin, thy the OpenCV Wiki at http://opencvlibrary .SourceForge.net/ v the Mac-specific page http://opencvlibrary.SourceForge.net/ Mac_OS_X_OpenCV_Port.

Getting the Latest OpenCV via CVS

OpenCV is under active development, v bugs are oft en fixed rapidly khi bug reports contain accurate m ts v code that demonstrates the bug. Tuy nhin, official OpenCV releases occur only mt khi hay twice a year. Nu bn are seriously developing a project hay product, bn s c l want code fixes v updates ngay khi they become available. To do this, bn s need to access OpenCVs Concurrent Versions System (CVS) on SourceForge. This isnt the place for a tutorial in CVS usage. Nu youve worked withother open source projects then youre c l familiar withit already. Nu bn havent, check out Essential CVS by Jennifer Vesperman (OReilly). A command-line CVS client ships withLinux, OS X, v hu ht UNIX-like systems. Cho Windows users, ta recommend TortoiseCVS (http://www.tortoisecvs.org/), m integrates nicely withWindows Explorer. On Windows, nu bn mun the latest OpenCV from the CVS repository then bn s need to access the CVSROOT directory:
:pserver:anonymous@opencvlibrary.cvs.sourceforge.net:2401/cvsroot/opencvlibrary

On Linux, bn c th just dng the following hai commands: When asked for password, hit return. Then use:

cvs -d:pserver:anonymous@opencvlibrary.cvs.sourceforge.net:/cvsroot/opencvlibrary login cvs -z3 -d:pserver:anonymous@opencvlibrary.cvs.sourceforge.net:/cvsroot/opencvlibrary co -P opencv

More OpenCV Documentation

The primary documentation for OpenCV is the HTML documentation that ships with the source code. Thm vo to this, the OpenCV Wiki v the older HTML documentation are available on the Web.

Documentation Available in HTML

OpenCV ships withhtml-based user documentation in the .../opencv/docs subdirectory. Load the index.htm file, m cha the following links. CXCORE Contains data structures, matrix algebra, data transforms, object persistence, memory

management, error handling, v dynamic loading of code cng nh drawing, text v basic math. CV Contains image processing, image structure analysis, motion v tracking, pattern recognition, v camera calibration. Machine Learning (ML) Contains nhiu clustering, classification v data analysis functions. HighGUI Contains user interface GUI v image/video storage v recall. CVCAM Camera interface. Haartraining How to train the boosted cascade object detector. This is in the .../opencv/apps/ HaarTraining/doc/haartraining.htm file. The .../opencv/docs directory also cha IPLMAN.pdf, m was the original manual for OpenCV. It is by gi defunct v should c dng withcaution, but it does include detailed m ts of algorithms v of what image types c th c dng witha particular algorithm. D nhin, the first stop for such image v algorithm details is the book you are reading now.

Documentation via the Wiki

OpenCVs documentation Wiki is more up-to-date than the html pages that ship with OpenCV v it also features additional content as well. The Wiki is located at http:// opencvlibrary.SourceForge.net. It bao gm thng tin on: Instructions on bin dch O penCV dng Eclipse IDE Face recognition withOpenCV Video surveillance library Tutorials Camera compatibility Links to the Chinese v the Korean user groups Another Wiki, located at http://opencvlibrary.SourceForge.net/CvAux, is the only documentation of the auxiliary functions discussed in OpenCV Structure v Content (next section). CvAux bao gm the following functional areas: Stereo correspondence View point morphing of cameras 3D tracking in stereo Eigen object (PCA) functions for object recognition Embedded hidden Markov models (HMMs) This Wiki has been translated into Chinese at http://www.opencv.org.cn/index.php/ %E9%A6%96%E9%A1%B5. Bt chp of your documentation source, it is oft en hard to know: Which image type (fl oating, integer, byte; 13 channels) works withwhich function Which functions work in place Details of cch call the more complex functions (e.g., contours) Details about running nhiu of the examples in the /opencv/samples/c/ directory What to do, not just how cch set parameters of certain functions One aim of sch ny is to address nhng ci ny cc vn .

OpenCV Structure v Content

OpenCV c cu trc rng ri thnh nm thnh phn chnh, bn m c thy trong Hnh 1-5. thnh phn CV cha x l nh c bn v cc thut ton computer vision cao cp; ML l th vin my hc, m bao gm nhiu classifier thng k v cc clustering

tool. HighGUI cha cc I/O routines v functions lu v ti video v images, v CXCore cha cc cu trc data structures v content c s.

Hnh 1-5. Cu trc c bn ca OpenCV

Hnh 1-5 khng k CvAux, m cha c cc lnh vc qu c (nhn mt HMM nhng) v cc thut ton th nghim (phn lp background/foreground). CvAux khng c bit c m t tt trong Wiki v khng c m t trong tt c trong .../opencv/docs subdirectory. CvAux bao gm: Cc eigen object, mt k thut nhn din hiu qu m, v bn cht, mt th tc tha mn mu Cc m hnh Markov 1D v 2D c n, k thut nhn din thng k c gii bi lp trnh ng Cc Embedded HMM (cc quan st ca mt parent HMM l chnh cc HMM) Gesture recognition t stereo vision support Cc m rng cho Delaunay triangulation, cc chui, v hn na Stereo vision Shape matching with region contours Texture descriptors Eye v mouthtracking 3D tracking Finding skeletons (central lines) of objects in a scene Warping intermediate views gia hai camera views Background-foreground segmentation Video surveillance (see Wiki FAQ for more documentation) Camera calibration C++ classes (the C functions v engine are in CV) Some of nhng ci ny features c th migrate to CV in the future; others c l never will.

Portability

OpenCV was designed to be portable. It was originally written to compile across Borland C++, MSVC++, v the Intel compilers. This meant that the C v C++ code had to be fairly standard in order to make cross-platform support easier. Hnh 1-6 shows the platforms on which OpenCV is known to run. Support for 32-bit Intel architecture (IA32) on Windows is the hu ht mature, followed by Linux on the same architecture.

Mac OS X portability became a priority only aft er Apple started dng Intel processors. (The OS X port isnt as mature as the Windows hay Linux versions, but this is changing rapidly.) These are followed by 64-bit support on extended memory (EM64T) v the 64-bit Intel architecture (IA64). The least mature portability is on Sun hardware and other operating systems. If an architecture hay OS khng appear in Hnh 1-6, this khng mean c no OpenCV ports to it. OpenCV has been ported to hu ht every commercial system, from PowerPC Macs to robotic dogs. OpenCV runs well on AMDs line of processors, and even the further optimizations available in IPP s take advantage of multimedia extensions (MMX) in AMD processors that incorporate this k thut.

Hnh 1-6. OpenCV portability guide for release 1.0: operating systems are shown on the left ; computer architecture types across top

Exercises

Download v install the latest release of OpenCV. C 1. ompile it in debug v release mode. 2. Download v build the latest CVS update of OpenCV. 3. m t ti thiu three ambiguous aspects of converting 3D inputs into a 2D representation. How would bn overcome nhng ci ny ambiguities?

You might also like