OpenCV

June 13, 2019 · View on GitHub

OpenCV is an image processing library created by Intel and later supported by Willow Garage and now maintained by Itseez. It is available on Mac, Windows, Linux. Works in C, C++, and Python.

The most important thing is that it's Open Source and free.

For more image processing basics, please check my Image_Processing_100_Questions repository:

This repository contains some code files copied from some online courses and web tutorials. I modified these files so that it's more clear and easy for beginners to learn. The original links are listed below:

  1. OpenCV Python Tutorials

  2. OpenCV Python Tutorial For Beginners

  3. Pysource

  4. Learn OpenCV

Installation

  1. Download this repository and extract it:

    git clone git@github.com:KuKuXia/OpenCV_for_Beginners.git
    
  2. Download the anaconda and install it.

  3. Create a virtual environment:

    conda create -n CV python=3.6
    
  4. Install the packages:

    cd OpenCV_for_Beginners/
    pip install -r requirements.txt
    
  5. Open one file and enjoy your journey.

Note

  1. Python scalar operations are faster than Numpy scalar operations. So for operations including one or two elements, Python scalar is better than Numpy arrays. Numpy takes advantage when size of array is a little bit bigger.
  2. Normally, OpenCV functions are faster than Numpy functions. So for same operation, OpenCV functions are preferred. But, there can be exceptions, especially when Numpy works with views instead of copies.

Content

The fully documented files are listed below. I'm working on adding more comments to my codes.

NameNote
01_Basics_Read_and_Write_ImageRead and write image
01_Color_Spaces_in_OpenCVUsing RealSense to learn the color space
02_Read_and_Write_Images_from_CameraRead and write images from a camera
03_Draw_Geometric_Shapes_on_ImageDraw draw geometric shapes on image
04_Read_Camera_Frame_RateRead camera frame rate
04_Set_Camera_PropertiesSet the properties of the camera
05_Show_Date_and_Time_on_VideosShow date and time on videos
06_Show_Pixel_Details_using_MouseShow pixel details by callback function
07_Draw_Lines_using_MouseDraw lines using callback function
07_Draw_Shapes_using_MouseDraw rectangle and circle using callback function
08_Basic_Properties_and_OperationsBasic properties and operations on images
09_Arithmetic_OperationsArithmetic operation on images
10_Trackerbar_RGB_ChanelsLearn RGB channels with trackerbar
10_Trackerbar_Switch_and_TextTrackerbar with switch and text
11_Object_Detection_and_Object_Tracking_using_RealSenseUsing RealSense to do real time object tracking and detection
12_Image_Global_ThresholdingImage thresholding
12_Image_Thresholding_with_MatplotlibImage thresholding with matplotlib
13_Adaptive_thresholdingAdaptive thresholding
14_Otsu's_BinarizationOtsu's Binarization
31_HomographyHomography between two images
31_Object_Tracking_AdvancedObject tracking
31_Multi_Object_TrackingMulti object tracking
39_Shape_MatchingShape matching using Hu moments
42_Blob_DetectionBlob detection
42_Find_the_Center(Centroid)_of_a_BlobFind the center(centroid) of a blob using moment
43_Seamless_CloningSeamless cloning
43_Seamless_Cloning_with_Different_Clone_ModeSeamless cloning with different clone mode
44_Non_Photorealistic_RenderingNon-Photorealistic Rendering using domain transform for edge-aware filtering
45_ApplyColorMap_for_PseudocoloringApply color map for pseudo coloring
46_Filling_Holes_in_an_ImageFilling holes in an image
47_Delaunay_Triangulation_and_Voronoi_DiagramDelaunay Triangulation and Voronoi Diagram
48_Image_Alignment_based_on_ORB_FeaturesImage alignment based on ORB features
48_Image_Alignment_using_ECC_EuclideanImage alignment using ECC Maximization(Euclidean)
48_Image_Alignment_using_ECC_HomographyImage alignment using ECC Maximization(Homography)
49_Warp_One_Triangle_to_AnotherWarp one triangle to another
50_Rotation_Matrix_to_Euler_AnglesRotation matrix to Euler angles
51_Select_ROISelect region of interest
52_Automatic_Red_Eye_RemoverAutomatic red Eye remover
53_Virtual_KeyboardRealSense virtual keyboard
54_Alpha_BlendingAlpha blending
55_Selective_Search_for_Object_DetectionSelective search for object detection
56_High_Dynamic_RangeHigh dynamic range
57_Exposure_FusionExposure Fusion
58_OCR_using_tesseractOCR using tesseract
59_Convex_HullConvex Hull
60_Heatmap_for_Logo_DetectionHeatmap for logo detection