1 / 20

Slayt 1

rockwell
Download Presentation

Slayt 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


    2. OPENCV ILE OTOMATIK ARABA PLAKA TANINMASI irmakci@hotmail.com

    3. OPEN CV NEDIR? 1.OpenCv nin anlami Açik Kaynak Bilgisayarli Görme Kütüphanesidir. (Intel® Open Source Computer Vision Library) 2.Çogu popüler resim isleme ve bilgisayarli görü algoritmalarini isleyen C ve biraz da C++ fonksiyonlarinin toplamidir

    4. ANAHTAR ÖZELLIKLERI Karsi platformlar için orta seviyeden yüksek seviyeye 300 den fazla C ve C++ ile yazilmis API vardir. OpenCv hem ticari hem ticari olmayan kullanimlar için ücretsizdir. (Tabii ki kimden aldiginizi söylerseniz!)

    5. OPEN CV DE TEMEL YAPILAR CvPoint 2D point with integer coordinates typedef struct CvPoint { int x; int y; } CvPoint; /*Yapici fonksiyon*/ inline CvPoint cvPoint( int x, int y ); Örnek: CvPoint point = cvPoint(3,4);

    6. CvSize pixel-accurate size of a rectangle typedef struct CvSize { int width; /* dikdörtgen genisligi */ int height; /* dikdörtgen boyu */ } CvSize; /* Yapici fonksiyon */ inline CvSize cvSize( int width, int height ); Örnek: CvSize size = cvSize(3,4);

    7. CvRect offset and size of a rectangle typedef struct CvRect { int x; /* sol üst köse koordinati int y; /* sol üst köse koordinati int width; /* dikdörtgen genisligi */ int height; /* dikdörtgen boyu */ } CvRect; /* Yapici fonksiyon */ inline CvRect cvRect( int x, int y, int width, int height ); Örnek: CvRect rect = cvRect(3,4,5,6); printf("x : %d y: %d\n",rect.x,rect.y); printf("w :%d h:%d\n",rect.width,rect.height);

    8. (En çok kullanilan temel yapilardan biri!!!) IplImage typedef struct _IplImage { int nSize; /* sizeof(IplImage) */ int ID; /* version (=0)*/ int nChannels; int alphaChannel; /* ignored by OpenCV */ int depth; char colorModel[4]; char channelSeq[4]; int dataOrder; int origin; int align; int width; int height; struct _IplImage *maskROI; void *imageId; struct _IplTileInfo *tileInfo; int imageSize; char *imageData; /* pointer to aligned image data int widthStep; /* size of aligned image row in bytes */ int BorderMode[4]; int BorderConst[4]; char *imageDataOrigin; } IplImage; Örnek: IplImage* image = cvLoadImage("resim.bmp",0);

    9. OPENCV ÖRNEKLERI

    10. #include "stdafx.h" #include "cv.h" #include "highgui.h" int main( int argc, char** argv ) { IplImage* img = 0; int height,width,step,channels; uchar *data; int i,j,k; char* rice = "rice.tif"; // load an image img=cvLoadImage(rice,-1); if(!img){ printf("Could not load image file: %s\n",argv[1]); exit(0); } // get the image data height = img->height; width = img->width;

    11. step = img->widthStep; channels = img->nChannels; data = (uchar *)img->imageData; printf("Processing a %dx%d image with %d channels\n",height,width,channels); // create a window cvNamedWindow("mainWin",CV_WINDOW_AUTOSIZE); cvMoveWindow("mainWin", 100, 100); // invert the image for(i=0;i<height;i++) for(j=0;j<width;j++) for(k=0;k<channels;k++) data[i*step+j*channels+k]=255-data[i*step+j*channels+k]; // show the image cvShowImage("mainWin", img ); // wait for a key cvWaitKey(0); // release the image cvReleaseImage(&img ); return 0; }

    12. SIMDI DE PIRINÇ SAYALIM…

    13. #include "stdafx.h" #include "cv.h" #include "highgui.h" int main( int argc, char** argv ) { IplImage* src; //binary resim olmak zorunda ve //siyah zemin üzerinde beyazlar üzerinde islem yapar!! src=cvLoadImage("rice.tif",-1); IplImage* dst = cvCreateImage( cvGetSize(src), 8, 1 ); CvMemStorage* storage = cvCreateMemStorage(0); CvSeq* contour = 0; cvThreshold( src, src, 110, 255, CV_THRESH_BINARY );

    14. cvNamedWindow( "Source", 0 ); cvShowImage( "Source", src ); int no =cvFindContours( src, storage, &contour, sizeof(CvContour), CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE ); cvZero( dst ); for( ; contour != 0; contour = contour->h_next ) { CvScalar colorI = CV_RGB( 0, 255, 0 ); CvScalar colorE = CV_RGB( 0, 0, 255 ); cvDrawContours( dst, contour, colorE, colorI, 0, 1, 8 ); } printf("number of contours : %d\n",no); cvNamedWindow( "Components", 0 ); cvShowImage( "Components", dst ); cvWaitKey(0); return 0; }

    15. 80 tane çikti (oldukça iyi!!!)

    16. PLAKA TANINMASI Plaka tanima sistemi park ücretlendirme, yol görüntüleme, güvenlik sistemleri gibi birçok uygulamada önemli rol oynar. Bu projede genel olarak ilk asamada Türk Plakalari incelenmistir Kullanilan yöntem asagida verilmistir.

    20. Kurban bayraminizi simdiden kutlar nice bayramlara vesile olmasini dilerim…

More Related