Skip to content

OpenCV Examples

PruebasVisilab edited this page Feb 9, 2017 · 12 revisions
  1. Introduction
  2. List of examples
  3. Expected output
  4. Benchmarks

Introduction

This application runs several examples using the OpenCV library. In most cases, the user needs to check the results saved in the SD card. Assertions check some common execution errors.

The contents of the testFiles folder (OpenCVTests) must be copied to the SD card (/mnt/sdcard/) resulting in mnt/sdcard/OpenCVTests.

List of examples

  1. Canny edge detector
    1. Files required:
      • File: /mnt/sdcard/OpenCVTests/data/nature.png
    2. Output:
      • File: /mnt/sdcard/OpenCVTests/results/resultEdge.png
  2. Haar-based Cascade Face Detector
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/lena.png
      • /mnt/sdcard/OpenCVTests/data/haarface.xml
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/resultFaceDetection.png
  3. K-means algorithm
    1. Output:
      • /mnt/sdcard/OpenCVTests/results/resultTestKmeans.png
  4. Contours
    1. Files required:
      • /mnt/sdcard/OpenCVTests/results/resultTestContours_1.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/resultTestContours_1.png
      • /mnt/sdcard/OpenCVTests/results/resultTestContours_2.png
  5. Histogram/LUT
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/baboon.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/resultDemHist.png
  6. Delaunay Triangulation
    1. Output:
      • /mnt/sdcard/OpenCVTests/results/delaunay/delaunay[n].png ([n]={0,1,2})
      • /mnt/sdcard/OpenCVTests/results/delaunay/delaunay[n]_s.png ([n]={0,1,2})
      • /mnt/sdcard/OpenCVTests/results/delaunay/voronoi.png
  7. testPyramidSegmentation
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/fruits.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/resultPyramidSegmentation.png
  8. testSquareDetector
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/pic[n].png ([n]={1,2,3,4,5,6})
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/squares/ResultSquarespic[n].png ([n]={1,2,3,4,5,6})
  9. Watershed
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/fruits.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/resultWatershed.png
  10. Morphological Operations
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/baboon.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/morphology/baboon_E_OC.png
      • /mnt/sdcard/OpenCVTests/results/morphology/baboon_E_ED.png
      • /mnt/sdcard/OpenCVTests/results/morphology/baboon_R_OC.png
      • /mnt/sdcard/OpenCVTests/results/morphology/baboon_R_ED.png
      • /mnt/sdcard/OpenCVTests/results/morphology/baboon_C_OC.png
      • /mnt/sdcard/OpenCVTests/results/morphology/baboon_C_ED.png
  11. Fourier
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/suit.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/dftres2.png
  12. Inpainting
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/lena.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/inpainted.png
  13. Min Area Rectangle
    1. Output:
      • /mnt/sdcard/OpenCVTests/results/rectCircle.png
  14. Lucas Kanade
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/suit.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/LKDemo.png
  15. DOG
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/DunLoghaire_320x240.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/DOG.png
  16. Dilation
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/lena_512x512_luma.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/dilate2.png
  17. Harris Corners
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/lena_512x512_luma.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/cornerharris.png
  18. Median Filter
    1. Files required:
      • /mnt/sdcard/OpenCVTests/data/ref_chroma_median_out_512x512_P444_8bpp.png
    2. Output:
      • /mnt/sdcard/OpenCVTests/results/medianfilter.png

Expected output

UART: Thread 1 created
UART: Starting run
UART: SD card mounted? 1
UART: + Test 1 passed. OK
UART: + Test 2 passed. OK
UART: + Test 3 passed. OK
UART: + Test 4 passed. OK
UART: + Test 5 passed. OK
UART: + Test 6 passed. OK
UART: + Test 7 passed. OK
UART: + Test 8 passed. OK
UART: + Test 9 passed. OK
UART: + Test 10 passed. OK
UART: + Test 11 passed. OK
UART: + Test 12 passed. OK
UART: + Test 13 passed. OK
UART: + Test 14 passed. OK
UART: TEST 15 Usec CPU time: 181010
UART: TEST 16 Usec CPU time: 574738
UART: TEST 17 Usec CPU time: 1079811
UART: TEST 18 Usec CPU time: 598534
UART: Unmounting SD card...
UART: Tests ended

Benchmarks

The following examples of the MvCV library of the MDK have been implemented using OpenCV:

  1. SimpleCrossCompilableCVPipe
  2. SippTutC0
  3. testHWHarrisCorners
  4. testHwMedian

The computational time in seconds used for the OpenCV version VS the MvCv version can be shown in the following graph:
benchmark

Clone this wiki locally