BAB V PENUTUP
5.2 Saran
BAB V
PENUTUP
5.1. KesimpulanDari hasil pengujian dan analisis tugas akhir ini dapat diambil beberapa kesimpulan yakni :
1. Proses ekstraksi fitur SURF pada suatu citra tidak terpengaruh cahaya.
2. Metode SURF membutuhkan waktu ekstraksi sebesar 2 hingga 3 detik.
3. Kemampuan efektif kamera menangkap citra pada sistem ini berjarak 1 hingga 3 meter.
4. Dari hasil pengujian pada sistem tugas akhir ini memiliki error sebesar 25.20% pada pengujian simbol dengan simbol referensinya sendiri dan error ditempat umum sebesar 22.22% sedangkan untuk pengujian citra referensi gabungan memiliki error yang paling rendah yakni 12.84%. Sehingga sistem ini memiliki error rata-rata 20% dan akurasi sebesar 80%
5.2. Saran
1. Karena metode yang digunakan terpengaruh dari kondisi cahaya disekitar, maka metode pengenalan simbol SURF yang bisa tidak terpengaruh oleh cahaya
2. Pengenalan simbol dengan metode SURF juga terpengaruh dengan hasil tangkapan citra, semakin jauh jarak tangkap kamera semakin kurang bagus citra yang didapatkan, maka disarankan metode pengenalan simbol ini tidak terpengaruh dengan kemampuan tangkap citra kamera.
3. Performa metode SURF yang tidak terjadi delay.
4. Mampu mengenali simbol sekaligus mampu mengetahui lokasi ruang toilet dengan mengenali arah panah yang terdapat pada simbol.
5. Untuk memperbaiki error disarankan menggunakan kamera dengan image sensor dan resolusi yang lebih tinggi.
54
55
DAFTAR PUSTAKA
[1] Nigel H. Lovell, John W. Morley, Spencer C. Chen, Luke E. Hallum, and Gregg J. Suaning, "Biological–MachineSystems Integration: Engineeringthe NeuralInterface", Vol. 98, No. 3, March 2010. [2] H. W. Lee, S. B. Hong, D. W. Seo, W. S. Tae, S. C. Hong, "Mapping
of functional organization in human visual cortex: Electrical cortical stimulation" Neurology, vol. 54, pp. 849–854, 2000.
[3] Kulyukin, V., Kutiyanawala, A., "Accessible Shopping Systems for Blind and Visually Impaired Individuals: Design Requirements and the State of the Art", The Open Rehabilitation Journal 3, 158–168, 2010.
[4] H. Bay, T. Tuytelaars, L. Van Gool, “SURF: Speeded up robust features”, In ECCV,pp. 404-417, 2006.
[5] Vilar F. da Camara Neto, Mario Fernando M. Campos, "An Improved Methodology for Image Feature Matching", XXII Brazilian Symposium on Computer Graphics and Image Processing, 2009.
[6] Yang Jian, Zhang David, Frangi Alejandro F, Yang Jingyu., "Two-Dimensional PCA: A new approach to appearancebased face representation and recognition", IEEE Transactions on Pattern Analysis and Machine Intelligence, pp. 131~137,2004.
[7] Wahyudi, Eko., Wirawan., Hendra Kusuma, "Teknik Pengenalan Wajah Berbasis Local Binary Pattern", Tugas Akhir ITS, Desember 2011.
[8] Guillaume Heusch, Yann Rodriguez, S´ebastien Marcel, “Local Binary Pattern as an Image Preprocessing for Face Authentication”, IDIAP Research Institute, Martigny, 2006.
[9] Johnny Andrean Susanto, Kelvin Giovanni Lukman, "Digital Watermarking Untuk Melindungi Informasi Informasi Multimedia Dengan Metode Fast Fourier Transform (FFT)", <URL:http://epri nts.mdp.ac.id/891/1/JURNAL%202009250032%20JOHNNY_AND REAN_SUSANTO%20DAN%202009250027%20KELVIN_GIOV ANNI_LUKMAN.pdf.>,2003.
56
[10] Achmad Rizal, "Pengolahan Citra" ,<URL: http://achmadrizal. staff.telkomuniversity.ac.id/2014/06/19/pengolahan-citra/>, Juni, 2014.
[11] Hanif Al Fatta, "Konversi Format Citra RGB ke Format Grayscale menggunakanVisual Basic", STIMIK AMIKON Yogyakarta, 2007. [12] Putra, Darma, "Pengolahan Citra Digital", Yogyakarta, Penerbit
ANDI, 2010.
[13] Rachmawati, "Estimasi Parameter Geometris Benda Berbasis Pengolahan Citra Digital", <URL:http://digilib.tes. telkomuniversity .ac.id/index.php?option=com_content&view=article&id=344:citra-digital&catid=15:pemrosesan-sinyal &Itemid=14>, Desember, 2008. [14] Marius Muja, David G. Lowe. "Fast approximate nearest neighbors
with automatic algorithm configuration". In International Conference on Computer Vision Theory and Applications (VISSAPP’09),pages331–340, 2009.
[15] ________., "Logitech Webcam C170", <URL: http://www.logitech. com/id-id/product/webcam-c170>, Juni, 2014.
[16] ________., "A46CB Notebook Tipis 21mm dengan DVD Writer ", <URL:http://www.asus.com/id/Notebooks_Ultrabooks/A46CB/>, Juni, 2014.
[17] ________., "MX 170 powerful earphones for music on the go", <http://en-de.sennheiser.com/stereo-ear-headphones-earphones-mx-170>, Juni, 2014.
BIODATA PENULIS
Penulis dilahirkan di Surabaya pada tanggal 06 Oktober 1992. Sebagai anak ketiga dari tiga bersaudara, penulis mengawali pendidikan formal di SD Negeri Perak Barat 1, yang kemudian dilanjutkan di SMP Negeri 2 Surabaya, SMA Negeri 2 Surabaya dan pada tahun 2010 penulis diterima sebagai mahasiswa di jurusan Teknik Elektro ITS Surabaya. Selama kuliah penulis aktif membantu penyelenggaraan kegiatan dan aktif sebagai asisten laboratorium Elektronika Dasar pada semester 5 hingga semester 8.
57 LAMPIRAN #i ncl ude " cv. h" #i ncl ude " hi ghgui . h" #i ncl ude " ct ype. h" #i ncl ude " st di o. h" #i ncl ude " st dl i b. h"
#i ncl ude " i ost r eam"
#i ncl ude " vect or " i nt wakt u=0; i nt t oi =0; i nt wan=0; i nt pr i =0; i nt wc=0, men=0, women=0; i nt j =0, k=0, l =0; usi ng namespace st d; st at i c doubl e di s=0; CvFont f ont ;
I pl I mage * i mage = 0, * f r ame = 0;
/ / ==== compar eSURF
/ / ====================================================== ========================
doubl e compar eSURFDescr i pt or s( const f l oat* d1, const f l oat* d2, doubl e best , i nt l engt h )
{ doubl e t ot al _cost = 0; asser t ( l engt h % 4 == 0 ) ; f or( i nt i = 0; i < l engt h; i += 4 ) { doubl e t 0 = d1[ i ] - d2[ i ] ; doubl e t 1 = d1[ i +1] - d2[ i +1] ; doubl e t 2 = d1[ i +2] - d2[ i +2] ; doubl e t 3 = d1[ i +3] - d2[ i +3] ; t ot al _cost += t 0* t 0 + t 1* t 1 + t 2* t 2 + t 3* t 3; / / i f ( t ot al _cost > best ) / / br eak; } r et ur n t ot al _cost ; }
58
/ / ==== Near est Nei ghbor
/ / ====================================================== ========================
i nt nai veNear est Nei ghbor ( const f l oat* vec, i nt
l apl aci an,const CvSeq* model _keypoi nt s,const CvSeq* model _descr i pt or s )
{
i nt l engt h = (i nt) ( model _descr i pt or s->el em_si ze/si zeof(f l oat) ) ;
i nt i , nei ghbor = - 1;
doubl e d, di st 1 = 1e6, di st 2 = 1e6; CvSeqReader r eader , kr eader ;
cvSt ar t ReadSeq( model _keypoi nt s, &kr eader , 0 ) ; cvSt ar t ReadSeq( model _descr i pt or s, &r eader , 0 ) ;
f or( i = 0; i < model _descr i pt or s- >t ot al ; i ++ ) {
const CvSURFPoi nt * kp = (const
CvSURFPoi nt * ) kr eader . pt r ;
const f l oat* mvec = (const f l oat* ) r eader . pt r ; CV_NEXT_SEQ_ELEM( kr eader . seq- >el em_si ze, kr eader ) ;
CV_NEXT_SEQ_ELEM( r eader . seq- >el em_si ze, r eader ) ;
i f( l apl aci an ! = kp- >l apl aci an ) cont i nue;
d = compar eSURFDescr i pt or s( vec, mvec, di st 2, l engt h ) ; i f( d < di st 1 ) { di st 2 = di st 1; di st 1 = d; nei ghbor = i ; } el se i f ( d < di st 2 ) di st 2 = d; } di s=di s+di st 1;
59 i f ( di st 1 < 0. 5* di st 2 ) r et ur n nei ghbor ; r et ur n - 1; } / / ==== f i nd pai r s / / ====================================================== ========================
voi d f i ndPai r s( const CvSeq* obj ect Keypoi nt s, const
CvSeq* obj ect Descr i pt or s,
const CvSeq* i mageKeypoi nt s, const CvSeq* i mageDescr i pt or s, vect or <i nt>& pt pai r s )
{
i nt i ;
CvSeqReader r eader , kr eader ;
cvSt ar t ReadSeq( obj ect Keypoi nt s, &kr eader ) ; cvSt ar t ReadSeq( obj ect Descr i pt or s, &r eader ) ; pt pai r s. cl ear ( ) ;
f or( i = 0; i < obj ect Descr i pt or s- >t ot al ; i ++ ) {
const CvSURFPoi nt * kp = (const
CvSURFPoi nt * ) kr eader . pt r ;
const f l oat* descr i pt or = (const f l oat* ) r eader . pt r ;
CV_NEXT_SEQ_ELEM( kr eader . seq- >el em_si ze, kr eader ) ;
CV_NEXT_SEQ_ELEM( r eader . seq- >el em_si ze, r eader ) ;
i nt near est _nei ghbor = nai veNear est Nei ghbor ( descr i pt or , kp- >l apl aci an, i mageKeypoi nt s,
i mageDescr i pt or s) ;
i f( near est _nei ghbor >= 0 ) {
pt pai r s. push_back( i ) ;
pt pai r s. push_back( near est _nei ghbor ) ; }
} }
60
i nt mai n( ) {
/ / cvNamedWi ndow( " vi deo" , CV_WI NDOW_AUTOSI ZE ) ;
CvCapt ur e* capt ur e;
capt ur e = cvCr eat eCamer aCapt ur e( 1) ;
CvSeq * obj ect Keypoi nt s = 0, * obj ect Descr i pt or s = 0;
CvSeq * i mageKeypoi nt s = 0, * i mageDescr i pt or s = 0; CvMemSt or age* st or age = cvCr eat eMemSt or age( 0) ; i nt a, b, c, p, w, t ;
whi l e( 1) {
f r ame = cvRet r i eveFr ame( capt ur e ) ;
i f( ! f r ame ) {
I pl I mage* t emp = cvLoadI mage( " t emp1. j pg", 1 ) ; cvSaveI mage(" t emp. j pg", t emp) ;
cvRel easeI mage( &t emp) ; }
i f( cvWai t Key( 1 ) == ' q' ) {
I pl I mage* t emp = cvLoadI mage( " t emp1. j pg", 1 ) ; cvSaveI mage(" t emp. j pg", t emp) ;
cvRel easeI mage( &t emp) ;
/ / br eak;
}
wakt u++;
i f( wakt u>5 && wakt u < 15) {
wakt u=0;
I pl I mage* i mg1 = cvCl oneI mage( f r ame) ; cvSaveI mage(" t emp. j pg", i mg1) ;
cvRel easeI mage( &i mg1) ; }
I pl I mage* obj ect = cvLoadI mage( " al l . j pg", CV_LOAD_I MAGE_GRAYSCALE ) ;
I pl I mage* obj ect 1 = cvLoadI mage( " men. j pg", CV_LOAD_I MAGE_GRAYSCALE ) ;
61
I pl I mage* obj ect 2 = cvLoadI mage( " women. j pg", CV_LOAD_I MAGE_GRAYSCALE ) ;
I pl I mage* t onny = cvLoadI mage( " t onny. j pg", CV_LOAD_I MAGE_GRAYSCALE ) ;
I pl I mage* i mage = cvLoadI mage( " t emp. j pg", CV_LOAD_I MAGE_GRAYSCALE ) ;
I pl I mage* obj ect _col or =
cvCr eat eI mage( cvGet Si ze( obj ect ) , 8, 3) ; I pl I mage* obj ect _col or 1 =
cvCr eat eI mage( cvGet Si ze( obj ect 1) , 8, 3) ; I pl I mage* obj ect _col or 2 =
cvCr eat eI mage( cvGet Si ze( obj ect 2) , 8, 3) ; I pl I mage* i mage_col or =
cvCr eat eI mage( cvGet Si ze( i mage) , 8, 3) ;
cvCvt Col or ( obj ect , obj ect _col or , CV_GRAY2BGR ) ; cvCvt Col or ( obj ect 1, obj ect _col or 1, CV_GRAY2BGR ) ; cvCvt Col or ( obj ect 2, obj ect _col or 2, CV_GRAY2BGR ) ; cvCvt Col or ( i mage, i mage_col or , CV_GRAY2BGR ) ;
CvSURFPar ams par ams = cvSURFPar ams( 500, 1) ; cvExt r act SURF( obj ect , 0, &obj ect Keypoi nt s, &obj ect Descr i pt or s, st or age, par ams ) ;
cvExt r act SURF( i mage, 0, &i mageKeypoi nt s, &i mageDescr i pt or s, st or age, par ams ) ;
/ / ================================================ =====================
/ / gambar per t ama ( mer ah) t oi l et
/ / ================================================ =====================
vect or <i nt> pt pai r s;
f i ndPai r s( obj ect Keypoi nt s, obj ect Descr i pt or s, i mageKeypoi nt s, i mageDescr i pt or s, pt pai r s ) ;
f or( t = 0; t < (i nt) pt pai r s. si ze( ) ; t += 2 ) {
CvSURFPoi nt * r 1 = ( CvSURFPoi nt * ) cvGet SeqEl em( obj ect Keypoi nt s, pt pai r s[ t ] ) ;
CvSURFPoi nt * r 2 = ( CvSURFPoi nt * ) cvGet SeqEl em( i mageKeypoi nt s, pt pai r s[ t +1] ) ;
CvPoi nt cent er ;
62
cent er . x = cvRound( r 2- >pt . x) ; cent er . y = cvRound( r 2- >pt . y) ;
r adi us = cvRound( r 1- >si ze* 1. 2/ 9. * 2) ; cvCi r cl e( i mage_col or , cent er , r adi us, cvScal ar ( 0, 0, 255, 0) , 1, 8, 0 ) ;
t oi =cent er . x; }
f or( a = 0; a < obj ect Keypoi nt s- >t ot al ; a++ ) {
CvSURFPoi nt * r = ( CvSURFPoi nt * ) cvGet SeqEl em( obj ect Keypoi nt s, a ) ;
CvPoi nt cent er ; i nt r adi us;
cent er . x = cvRound( r - >pt . x) ; cent er . y = cvRound( r - >pt . y) ;
r adi us = cvRound( r - >si ze* 1. 2/ 9. * 2) ; cvCi r cl e( obj ect _col or , cent er , r adi us, cvScal ar ( 0, 0, 255, 0) , 1, 8, 0 ) ;
}
/ / ================================================ =====================
/ / gambar kedua ( hi j au) pr i a
/ / ================================================ =====================
cvExt r act SURF( obj ect 1, 0, &obj ect Keypoi nt s, &obj ect Descr i pt or s, st or age, par ams ) ;
f i ndPai r s( obj ect Keypoi nt s, obj ect Descr i pt or s, i mageKeypoi nt s, i mageDescr i pt or s, pt pai r s ) ;
f or( p = 0; p < (i nt) pt pai r s. si ze( ) ; p += 2 ) {
CvSURFPoi nt * r 11 = ( CvSURFPoi nt * ) cvGet SeqEl em( obj ect Keypoi nt s, pt pai r s[ p] ) ;
CvSURFPoi nt * r 21 = ( CvSURFPoi nt * ) cvGet SeqEl em( i mageKeypoi nt s, pt pai r s[ p+1] ) ;
CvPoi nt cent er 1;
63
cent er 1. x = cvRound( r 21- >pt . x) ; cent er 1. y = cvRound( r 21- >pt . y) ;
r adi us1 = cvRound( r 11- >si ze* 1. 2/ 9. * 2) ; cvCi r cl e( i mage_col or , cent er 1, r adi us1, cvScal ar ( 0, 255, 0, 0) , 1, 8, 0 ) ;
pr i =cent er 1. x; }
f or( b = 0; b < obj ect Keypoi nt s- >t ot al ; b++ ) {
CvSURFPoi nt * r 1 = ( CvSURFPoi nt * ) cvGet SeqEl em( obj ect Keypoi nt s, b ) ;
CvPoi nt cent er ; i nt r adi us;
cent er . x = cvRound( r 1- >pt . x) ; cent er . y = cvRound( r 1- >pt . y) ;
r adi us = cvRound( r 1- >si ze* 1. 2/ 9. * 2) ; cvCi r cl e( obj ect _col or 1, cent er , r adi us, cvScal ar ( 0, 255, 0, 0) , 1, 8, 0 ) ;
}
/ / ================================================ =====================
/ / gambar ket i ga ( bi r u) wani t a
/ / ================================================ =====================
cvExt r act SURF( obj ect 2, 0, &obj ect Keypoi nt s, &obj ect Descr i pt or s, st or age, par ams ) ;
f i ndPai r s( obj ect Keypoi nt s, obj ect Descr i pt or s, i mageKeypoi nt s, i mageDescr i pt or s, pt pai r s ) ;
f or( w = 0; w < (i nt) pt pai r s. si ze( ) ; w += 2 ) {
CvSURFPoi nt * r 11 = ( CvSURFPoi nt * ) cvGet SeqEl em( obj ect Keypoi nt s, pt pai r s[ w] ) ;
CvSURFPoi nt * r 21 = ( CvSURFPoi nt * ) cvGet SeqEl em( i mageKeypoi nt s, pt pai r s[ w+1] ) ;
CvPoi nt cent er 1;
64
cent er 1. x = cvRound( r 21- >pt . x) ; cent er 1. y = cvRound( r 21- >pt . y) ;
r adi us1 = cvRound( r 11- >si ze* 1. 2/ 9. * 2) ; cvCi r cl e( i mage_col or , cent er 1, r adi us1, cvScal ar ( 255, 0, 0, 0) , 1, 8, 0 ) ;
wan=cent er 1. x; }
f or( c = 0; c < obj ect Keypoi nt s- >t ot al ; c++ ) {
CvSURFPoi nt * r 1 = ( CvSURFPoi nt * ) cvGet SeqEl em( obj ect Keypoi nt s, c ) ;
CvPoi nt cent er ; i nt r adi us;
cent er . x = cvRound( r 1- >pt . x) ; cent er . y = cvRound( r 1- >pt . y) ;
r adi us = cvRound( r 1- >si ze* 1. 2/ 9. * 2) ; cvCi r cl e( obj ect _col or 2, cent er , r adi us, cvScal ar ( 255, 0, 0, 0) , 1, 8, 0 ) ;
}
i f( a>64) a=64;
i f( p>b) p=b;
i f( w>c) w=c;
i nt der aj at t oi =( t oi - f r ame- >wi dt h/ 2) / ( 3. 5555* 2) ;
i nt der aj at pr i =( pr i - f r ame- >wi dt h/ 2) / ( 3. 5555* 2) ;
i nt der aj at wan=( wan- f r ame- >wi dt h/ 2) / ( 3. 5555* 2) ;
char
t ext 1[ 80] , t ext 2[ 80] , t ext 3[ 80] , t ext 4[ 80] , t ext 5[ 80] , t ext 6[ 80] ;
cvI ni t Font ( &f ont , CV_FONT_HERSHEY_SI MPLEX, 0. 6, 0. 6, 0, 2) ;
spr i nt f ( t ext 1," r ef er ensi t oi l et : %d, t oi l et : %d ", a, t ) ;
spr i nt f ( t ext 2," r ef er ensi pr i a : %d, pr i a : %d ", b, p) ;
spr i nt f ( t ext 3," r ef er ensi wani t a : %d, wani t a : %d ", c, w) ;
spr i nt f ( t ext 4," l okasi t oi l et : %d ", der aj at t oi ) ; spr i nt f ( t ext 5," l okasi pr i a : %d ", der aj at pr i ) ; spr i nt f ( t ext 6," l okasi wani t a: %d ", der aj at wan) ;
65
cvPut Text ( i mage_col or , t ext 1, cvPoi nt ( 10, 20) , &f ont , cvScal ar ( 0, 0, 0) ) ;
cvPut Text ( i mage_col or , t ext 2, cvPoi nt ( 10, 40) , &f ont , cvScal ar ( 0, 0, 0) ) ;
cvPut Text ( i mage_col or , t ext 3, cvPoi nt ( 10, 60) , &f ont , cvScal ar ( 0, 0, 0) ) ;
cvPut Text ( i mage_col or , t ext 4, cvPoi nt ( 10, 80) , &f ont , cvScal ar ( 0, 0, 0) ) ;
cvPut Text ( i mage_col or , t ext 5, cvPoi nt ( 10, 100) , &f ont , cvScal ar ( 0, 0, 0) ) ;
cvPut Text ( i mage_col or , t ext 6, cvPoi nt ( 10, 120) , &f ont , cvScal ar ( 0, 0, 0) ) ;
I pl I mage* gabung = cvCr eat eI mage(
cvSi ze( i mage_col or >wi dt h+t onny >wi dt h, i mage_col or ->hei ght ) , 8, 3 ) ;
f or(i nt x=0; x<i mage_col or - >wi dt h; x++) {
f or(i nt y=0; y<i mage_col or ->hei ght ; y++)
{
>i mageDat a[ >wi dt hSt ep* y+x*
gabung>nChannel s+1] =i mage_col or >i mageDat a[ i mage_col or ->wi dt hSt ep* y+x* i mage_col or - >nChannel s+1] ;
>i mageDat a[ >wi dt hSt ep* y+x*
gabung>nChannel s+2] =i mage_col or >i mageDat a[ i mage_col or ->wi dt hSt ep* y+x* i mage_col or - >nChannel s+2] ;
>i mageDat a[ >wi dt hSt ep* y+x*
gabung>nChannel s+3] =i mage_col or >i mageDat a[ i mage_col or ->wi dt hSt ep* y+x* i mage_col or - >nChannel s+3] ;
} }
f or(i nt x=0; x<t onny- >wi dt h; x++) {
f or(i nt y=0; y<t onny->hei ght ; y++)
{
gabung-66
>nChannel s+1] =t >i mageDat a[ t onny->wi dt hSt ep* y+x* t onny- >nChannel s+1] ;
>i mageDat a[ >wi dt hSt ep* y+( x+f r ame- >wi dt h) * gabung->nChannel s+2] =t >i mageDat a[ t
onny->wi dt hSt ep* y+x* t onny- >nChannel s+2] ;
>i mageDat a[ >wi dt hSt ep* y+( x+f r ame- >wi dt h) * gabung->nChannel s+3] =t >i mageDat a[ t
onny->wi dt hSt ep* y+x* t onny- >nChannel s+3] ; } }
f or(i nt x=0; x<obj ect _col or - >wi dt h; x++) {
f or(i nt y=0; y<obj ect _col or ->hei ght ; y++)
{
gabung->i mageDat a[ gabung- >wi dt hSt ep* ( y+t onny- >hei ght ) +( x+f r ame>wi dt h) * gabung >nChannel s+1] =obj ect _col or
>i mageDat a[ obj ect _col or >wi dt hSt ep* y+x* obj ect _col or ->nChannel s+1] ;
gabung->i mageDat a[ gabung- >wi dt hSt ep* ( y+t onny- >hei ght ) +( x+f r ame>wi dt h) * gabung >nChannel s+2] =obj ect _col or
>i mageDat a[ obj ect _col or >wi dt hSt ep* y+x* obj ect _col or ->nChannel s+2] ;
gabung->i mageDat a[ gabung- >wi dt hSt ep* ( y+t onny- >hei ght ) +( x+f r ame>wi dt h) * gabung >nChannel s+3] =obj ect _col or
>i mageDat a[ obj ect _col or >wi dt hSt ep* y+x* obj ect _col or ->nChannel s+3] ;
} }
f or(i nt x=0; x<obj ect _col or 1- >wi dt h; x++) {
f or(i nt y=0; y<obj ect _col or 1->hei ght ; y++)
{
gabung->i mageDat a[ gabung- >wi dt hSt ep* ( y+t
gabung-67
>nChannel s+1] =obj ect _col or >i mageDat a[ obj ect _col or 1->wi dt hSt ep* y+x* obj ect _col or 1- >nChannel s+1] ;
gabung->i mageDat a[ gabung- >wi dt hSt ep* ( y+t
onny->hei ght +obj ect _col or - onny->hei ght ) +( x+f r ame- >wi dt h) * gabung->nChannel s+2] =obj ect _col or >i mageDat a[ obj ect _col or 1->wi dt hSt ep* y+x* obj ect _col or 1- >nChannel s+2] ;
gabung->i mageDat a[ gabung- >wi dt hSt ep* ( y+t
onny->hei ght +obj ect _col or - onny->hei ght ) +( x+f r ame- >wi dt h) * gabung->nChannel s+3] =obj ect _col or >i mageDat a[ obj ect _col or 1->wi dt hSt ep* y+x* obj ect _col or 1- >nChannel s+3] ;
} }
f or(i nt x=0; x<obj ect _col or 2- >wi dt h; x++) {
f or(i nt y=0; y<obj ect _col or 2->hei ght ; y++)
{
gabung->i mageDat a[ gabung- >wi dt hSt ep* ( y+t onny->hei ght +obj ect _col or - onny->hei ght ) +( x+f r ame->wi dt h+obj ect _col or 1- ame->wi dt h) *
gabung->nChannel s+1] =obj ect _col or >i mageDat a[ obj ect _col or 2->wi dt hSt ep* y+x* obj ect _col or 2- >nChannel s+1] ;
gabung->i mageDat a[ gabung- >wi dt hSt ep* ( y+t onny->hei ght +obj ect _col or - onny->hei ght ) +( x+f r ame->wi dt h+obj ect _col or 1- ame->wi dt h) *
gabung->nChannel s+2] =obj ect _col or >i mageDat a[ obj ect _col or 2->wi dt hSt ep* y+x* obj ect _col or 2- >nChannel s+2] ;
gabung->i mageDat a[ gabung- >wi dt hSt ep* ( y+t onny->hei ght +obj ect _col or - onny->hei ght ) +( x+f r ame->wi dt h+obj ect _col or 1- ame->wi dt h) *
gabung->nChannel s+3] =obj ect _col or >i mageDat a[ obj ect _col or 2->wi dt hSt ep* y+x* obj ect _col or 2- >nChannel s+3] ;
} }
68
/ / ========================================t oi l et == ==============================================
i f( der aj at t oi >- 15 && der aj at t oi <15 && t >14 && t <35 && wc==0) { Pl aySound( TEXT(" t . wav") ,
NULL, SND_SYNC) ; wc=1; j =der aj at t oi ; men=1; women=1; }
i f( der aj at t oi >15 && der aj at t oi <45 && t >14 && t <35 && wc==0) { Pl aySound( TEXT(" t k1. wav") ,
NULL, SND_SYNC) ; wc=1; j =der aj at t oi ; men=1; women=1; }
i f( der aj at t oi >- 45 && der aj at t oi <- 15 && t >14 && t <35 && wc==0) { Pl aySound( TEXT(" t k- 1. wav") ,
NULL, SND_SYNC) ; wc=1; j =der aj at t oi ; men=1; women=1; }
i f( t <12 | | abs( j - der aj at t oi ) >5) { wc=0; }
/ / ========================================pr i a==== ============================================
i f( der aj at pr i >- 15 && der aj at pr i <15 && p>9 && men==0) { Pl aySound( TEXT(" p. wav") ,
NULL, SND_SYNC) ; men=1; k=der aj at pr i ; wc=1; }
i f( der aj at pr i >15 && der aj at pr i <45 && p>9 && men==0) { Pl aySound( TEXT(" pk1. wav") ,
NULL, SND_SYNC) ; men=1; k=der aj at pr i ; wc=1; }
i f( der aj at pr i >- 45 && der aj at pr i <- 15 && p>9 && men==0) { Pl aySound( TEXT(" pk- 1. wav") ,
NULL, SND_SYNC) ; men=1; k=der aj at pr i ; wc=1; }
i f( p<9 | | abs( k- der aj at pr i ) >5) { men=0; }
/ / ========================================wani t a== ==============================================
i f( der aj at wan>- 15 && der aj at wan<15 && w>6 && women==0) { Pl aySound( TEXT(" w. wav") ,
NULL, SND_SYNC) ; women=1; l =der aj at wan; wc=1; }
i f( der aj at wan>15 && der aj at wan<45 && w>6 && women==0) { Pl aySound( TEXT(" wk1. wav") ,
NULL, SND_SYNC) ; women=1; l =der aj at wan; wc=1; }
i f( der aj at wan>- 45 && der aj at wan<- 15 && w>6 && women==0) { Pl aySound( TEXT(" wk- 1. wav") ,
NULL, SND_SYNC) ; women=1; l =der aj at wan; wc=1; }
i f( w<6 | | abs( l - der aj at wan) >5) { women=0; }
/ / =========================================
syst em(" cl s") ;
pr i nt f (" t oi l et : %d \ n", wc) ; pr i nt f (" pr i a : %d \ n", men) ;
69
pr i nt f (" wani t a : %d \ n", women) ; cvShowI mage( " gabung", gabung) ;
/ / cvShowI mage( " gabunga" , f r ame) ;
cvRel easeI mage( &t onny ) ; cvRel easeI mage( &obj ect ) ; cvRel easeI mage( &obj ect 1 ) ; cvRel easeI mage( &obj ect 2 ) ; cvRel easeI mage( &gabung) ; cvRel easeI mage( &i mage ) ; cvRel easeI mage( &i mage_col or ) ; cvRel easeI mage( &obj ect _col or ) ; cvRel easeI mage( &obj ect _col or 1 ) ; cvRel easeI mage( &obj ect _col or 2 ) ; }
cvRel easeCapt ur e( &capt ur e ) ; cvDest r oyWi ndow( " vi deo" ) ; }
70