1 / 60

OpenCV Training course

OpenCV Training course. By Theerayod Wiangtong. Goals. Develop a universal toolbox for research and development in the field of Computer Vision. Why use OpenCV?. Fast development time, more than 500 algorithms in OpenCV libraries C/C++ based programming Both Windows and Linux supported

jacqui
Télécharger la présentation

OpenCV Training course

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


  1. OpenCVTraining course By Theerayod Wiangtong

  2. Goals • Develop a universal toolbox for research and development in the field of Computer Vision

  3. Why use OpenCV? • Fast development time, more than 500 algorithms in OpenCV libraries • C/C++ based programming • Both Windows and Linux supported • Open and free, BSD license • Loads of developers using OpenCV • Loads of information and documents • Etc

  4. History of OpenCV • Originally developed by Intel, currently maintained by Willow Garage

  5. OpenCV - Features Table Courtesy Learning OpenCV: Computer Vision with the OpenCV Library Cross-platform and extremely portable Free! for both research and commercial use Targeted for real-time applications

  6. OpenCV – Architecture & Modules • CvAux • Area for experimental algorithms: e.g. HMM, Stereo vision, 3D tracking, Bg/fg segmentation, camera calibration, Shape matching, Gesture recognition, ..

  7. OpenCV Comparisons

  8. Examples of Using OpenCV functions • Click here

  9. OpenCV: Algorithmic Content

  10. OpenCV Functionality • Basic structures and operations • Image Analysis • Structural Analysis • Object Recognition • Motion Analysis and Object Tracking • 3D Reconstruction (more than 500 algorithms!!)

  11. Image Thresholding • Fixed threshold; • Adaptive threshold;

  12. Statistics • min, max, mean value, standard deviation over the image • Multidimensional histograms • Norms C, L1, L2

  13. Multidimensional Histograms • Histogram operations : calculation, normalization, comparison, back project

  14. Histogram Equalization

  15. Histograms comparison

  16. Image Pyramids

  17. Convolution in image • The source pixel and its surrounding pixels are all mathematically merged to produce a single destination pixel. The matrix slides across the surface of the source image, producing pixels for the destination image http://beej.us/blog/data/convolution-image-processing/

  18. Image Pyramids • Gaussian and Laplacian

  19. Morphological Operations • Two basic morphology operations using structuring element: • erosion • dilation

  20. Distance Transform • Calculate the distance for all non-feature points to the closest feature point • Two-pass algorithm, 3x3 and 5x5 masks, various metrics predefined

  21. Flood Filling • grayscale image, floating range • grayscale image, fixed range

  22. Feature Detection • Fixed filters (Sobel operator, Canny operator, Laplacian, Scharr filter) • Hough transform (find lines and circles) http://www.stevens-tech.edu/wireless/klin/EdgeDetection/EdgeDetectionInfo.htm

  23. Edge detection operators This means: pixel(i,j) = 2*pixel(i,j) - pixel(i,j+1) - pixel(i+1,j). • Simple • Cross Template 1: Template 2: pixel(i,j) = maximum(template 1, template 2)

  24. Edge detection operators • Prewitt • Sobel X-axis Template: Y-axis Template: pixel(i,j) = sqrt((x-axis template)^2 + (y-axis template)^2)

  25. Canny Edge Detector http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.html

  26. Hough Transform

  27. Contour Retrieving • The contour representation: • Chain code (Freeman code) • Polygonal representation Initial Point Chain code for the curve: 34445670007654443 Contour representation

  28. Hierarchical representation of contours Image Boundary (W1) (W2) (W3) (B2) (B3) (B4) (W5) (W6)

  29. Contours Examples Source Picture (300x600 = 180000 pts total) Retrieved Contours (<1800 pts total) After Approximation (<180 pts total) And it is rather fast: ~70 FPS for 640x480 on complex scenes

  30. Contour Processing • Approximation: • RLE algorithm (chain code) • Teh-Chin approximation (polygonal) • Douglas-Peucker approximation (polygonal); • Contour moments (central and normalized up to order 3) • Matching of contours

  31. Contours matching • Matching based on hierarchical representation of contours

  32. Object Recognition: Eigen Image

  33. Object Recognition: HMM • One person – one HMM • Stage 1 – Train every HMM • Stage 2 – Recognition Pi - probability Choose max(Pi) 1 … n i

  34. Motion Analysis and Object Tracking • Background subtraction • Motion templates • Optical flow • Active contours • Estimators

  35. Background Subtraction • Background: any static or periodically moving parts of a scene that remain static or periodic over the period of interest. How about waving trees, light on/off..?!?

  36. Background statistics functions • Average • Standard deviation • Connect component

  37. Background Subtraction Example

  38. Motion Templates • Object silhouette • Motion history images • Motion history gradients • Motion segmentation algorithm MHG silhouette MHI

  39. Motion Templates Example • Motion templates allow to retrieve the dynamic characteristics of the moving object

  40. Objecttracking • Mean-shift • Choose a search window (width and location) • Compute the mean of the data in the search window • Center the search window at the new mean location • Repeat until convergence • Cam-shift: Continuously Adaptive Mean SHIFT

  41. Region of interest Mean shift Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

  42. Region of interest Mean shift Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

  43. Region of interest Mean shift Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

  44. Region of interest Mean shift Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

  45. Region of interest Mean shift Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

  46. Region of interest Mean shift Center of mass Mean Shift vector Slide by Y. Ukrainitz & B. Sarel

  47. Region of interest Mean shift Center of mass Slide by Y. Ukrainitz & B. Sarel

  48. Optical Flow Velocity vectors Objecttracking • Optical flow, LK • Particle filter Optical flow is the relation of the motion field. It is a 2D projection of the physical movement of points relative to the observer

  49. OpenCV shape classification capabilities • Contour approximation • Moments (image&contour) • Convexity analysis • Pair-wise geometrical histogram • Fitting functions (line, ellipse)

  50. Using contours and geometry to classify shapes • Given the contour classify the geometrical figure shape (triangle, circle, etc)

More Related