11
- August
2022
No Comments
OpenCV Python Samples
OpenCV comes with a number of sample programs, in the samples\python
directory. Below is a brief description of each. The more interesting demos are marked in bold. The list is by no means detailed and gives an overview from a brief skim through, without knowing what is going on in the backend. The purpose in composing this list was to become aware of what demos exist before learning how to use OpenCV.
Note: Press escape on each to quit most applications.
Program | Description |
---|---|
asifit.py | Draws lines between pictures in different orientations, matching features. E.g. an aerial photo from different angles. |
audio_spectrogram.py | Library – For drawing audio graphics |
browse.py | Called with an image file, shows a thumbnail with high resolution zoom on mouse over. |
calibrate.py | Camera calibration for distorted images. |
camshift.py | Tracks an object, blacking out most of the rest of the image |
coherence.py | Draws coherence lines from an image, similar to the pencil drawing style filters in GIMP. Drag sliders and press space to redraw. |
color_histogram.py | Draws a live colour histogram of the video feed. |
common.py | Library: Common routines used by samples |
contours.py | Finds contour lines in an image |
deconvolution.py | Demonstrates deconvolution |
demo.py | Browse and launch sample programs, with descriptions. Similar to this list but interactive. |
dft.py | Performs a fourier transform. No further information if it is interactive or not. |
digits_adjust.py | Digit recognition adjustment. Produces a NPZ file. More details needed. |
digits.py | Matches digits in an image |
digits_video.py | Recognises digits in a video stream |
dis_opt_flow.py | Shows optical flow / movement. Moving objects displayed by pressing 2 |
distrans.py | Distance transform sample |
drawing.py | Demonstrates various drawing tools |
edge.py | Live edge detection |
facedetect.py | Detects faces |
feature_homography.py | Feature detection |
find_obj.py | Finds an object from one image in another |
fitline.py | Various line fitting algorithms, ignoring outliers |
floodfill.py | Flood fill an area of an image |
gabor_threads.py | “use of multiple Gabor filter convolutions to get Fractalius-like image effect”. Takes an image, detects edges and gives them a neon style glow. Gives some very interesting effects. |
gaussian_mix.py | Unclear what this is doing! |
grabcut.py | Marks foreground and background areas, but not clear exactly how to work this. |
hist.py | Demo for drawing histograms |
houghcircles.py | Detects circles in an image |
houghlines.py | Hough transforms to detect lines in image |
inpaint.py | Attempts to repair damage to an image |
kalman.py | Tracks a moving point |
kmeans.py | K-means cluster sample |
laplace.py | Laplace point and edge detection |
lappyr.py | Laplacian Pyramid construction and merging |
letter_replace.py | DB training for letter recognition/ Random Trees Classifier demo |
lk_homography.py | Lucas-Kanade homography tracker. Tracks features |
lk_track.py | Lucas-Kanade sparse optical flow demo. Feature / movement tracking |
logpolar.py | Plots image as logPolar and linearPolar |
morphology.py | Morphology operations |
mosse.py | This sample implements correlation-based tracking approach |
mouse_and_match.py | Matches parts of an image with that selected by the mouse |
mser.py | MSER edge/feature detection |
opencv_version.py | Prints the OpenCV version and build options |
opt_flow.py | Optical flow demo – motion detection |
peopledetect.py | Detects people in still images |
plane_ar.py | Draws augmented reality over a image tracking feed |
plane_tracker.py | Motion tracking |
qrcode.py | Detects and decodes QR codes |
squares.py | Detect squares in images |
stereo_match.py | Simple example of stereo image matching and point cloud generation |
stitching_detailed.py | Show how to use the Stitcher API from python (not tried) |
stitching.py | Another stitching example, create panoramas (not tried) |
text_skewness_correction.py | Demonstrates how to correct skewness (rotation) in text and correct |
texture_flow.py | Shows the flow of textures in an image. |
tracker.py | Tracks a region of interest through a video |
tst_scene_render.py | Unclear what this is doing! |
turing.py | Demo of cyclical Turing patterns |
video.py | VideoCapture class, shows video stream and captures stills |
video_threaded.py | Demonstrates multithreaded video capture and processing |
video_v4l2.py | Demo of Video 4 Linux backend |
watershed.py | Demo of OpenCV watershed segmentation algorithm |