Skip to content

This Repository is for basic computer vision(Detection, Recognition, Tracking).

Notifications You must be signed in to change notification settings

hwk06023/Basic_CV

Repository files navigation

Basic_CV

This Repository is for basic computer vision(Detection, Recognition, Tracking).
Honestly, This Repository is for reference when I develop something (about CV)

OUTLINE

Basic process

Point processing for brightness and contrast

cv2.add(src1, src2[, dst[, mask[, dtype]]]) -> dst

opencv docs

cv2.subtract(src1, src2[, dst[, mask[, dtype]]]) -> dst

opencv docs

cv2.multiply(src1, src2[, dst[, scale[, dtype]]]) -> dst

opencv docs

cv2.divide(src1, src2[, dst[, scale[, dtype]]]) -> dst

opencv docs


Histogram

cv2.calcHist(images, channels, mask, histSize, ranges[, hist[, accumulate]]) -> hist

opencv docs

cv2.equalizeHist(src[, dst]) -> dst

opencv docs

cv2.compareHist(H1, H2, method) -> retval

opencv docs





Geometric transform

Translation

cv2.warpAffine(src, M, dsize[, dst[, flags[, borderMode[, borderValue]]]]) -> dst

opencv docs

Rotation

cv2.getRotationMatrix2D(center, angle, scale) -> retval

opencv docs

Affine transform

cv2.getAffineTransform(src, dst) -> retval

opencv docs

Perspective transform

cv2.getPerspectiveTransform(src, dst[, solveMethod]) -> retval

opencv docs

Remapping

cv2.remap(src, map1, map2, interpolation[, dst[, borderMode[, borderValue]]]) -> dst

opencv docs





Filltering

Mean filter (blurring)

Mean filter is a simple filter that is usually used for blurring.
It is also called box filter.

cv2.blur(src, ksize[, dst[, anchor[, borderType]]]) -> dst

opencv docs

Gaussian filter (blurring)

Gaussian filter is a filter that is usually used for blurring.
Different from mean filter, it is more effective for blurring.

cv2.GaussianBlur(src, ksize, sigmaX[, dst[, sigmaY[, borderType]]]) -> dst

opencv docs

Unsharp masking (sharpening)

cv2.addWeighted(src1, alpha, src2, beta, gamma[, dst[, dtype]]) -> dst

opencv docs

Laplacian filter (sharpening)

cv2.Laplacian(src, ddepth[, dst[, ksize[, scale[, delta[, borderType]]]]]) -> dst

opencv docs

Median filter (noise removal)

cv2.medianBlur(src, ksize[, dst]) -> dst

opencv docs

Bilateral filter (noise removal)

cv2.bilateralFilter(src, d, sigmaColor, sigmaSpace[, dst[, borderType]]) -> dst

opencv docs

Image Pyramids

Useful for image blending, image resizing, image compression, image reconstruction

cv2.pyrUp(src[, dst[, dstsize[, borderType]]]) -> dst
cv2.pyrDown(src[, dst[, dstsize[, borderType]]]) -> dst

opencv docs





Extract feature

Edge detection & Derivative (Sobel, Laplacian, Canny)

Sobel

cv2.Sobel(src, ddepth, dx, dy[, dst[, ksize[, scale[, delta[, borderType]]]]]) -> dst

opencv docs

Laplacian

cv2.Laplacian(src, ddepth[, dst[, ksize[, scale[, delta[, borderType]]]]]) -> dst

opencv docs

Canny

  1. Compute x and y derivatives of image

  2. Compute magnitude of gradient at every pixel

  3. Eliminate pixels that are not local maxima of gradient magnitude

  4. Hysteresis thresholding

  • Select the pixels such That the gradient magnitude is larger than a high threshold

  • Select the pixels such that the gradient magnitude is larger than a low threshold and that are connected to high threshold pixels


cv2.Canny(image, threshold1, threshold2[, edges[, apertureSize[, L2gradient]]]) -> edges

opencv docs

Hough transform

Hough line transform

cv2.HoughLines(image, rho, theta, threshold[, lines[, srn[, stn[, min_theta[, max_theta]]]]]) -> lines

opencv docs

Hough circle transform

cv2.HoughCircles(image, method, dp, minDist[, circles[, param1[, param2[, minRadius[, maxRadius]]]]]) -> circles

opencv docs





ImageSegmentation ObjectDetection

GrabCut

cv2.grabCut(img, mask, rect, bgdModel, fgdModel, iterCount[, mode]) -> mask, bgdModel, fgdModel

opencv docs

Moments

cv2.moments(array[, binaryImage]) -> retval

opencv docs

Template matching

cv2.matchTemplate(image, templ, method[, result[, mask]]) -> result

opencv docs

Cascade classifier

cv2.CascadeClassifier([filename]) -> <CascadeClassifier object>

opencv docs

HOG (Histogram of Oriented Gradients)

cv2.HOGDescriptor([_winSize[, _blockSize[, _blockStride[, _cellSize[, _nbins[, _derivAperture[, _winSigma[, _histogramNormType[, _L2HysThreshold[, _gammaCorrection[, _nlevels[, _signedGradient]]]]]]]]]]]]) -> <HOGDescriptor object>

opencv docs





feature-point(keypoints) Detect and match

Harris corner detection

cv2.cornerHarris(src, blockSize, ksize, k[, dst[, borderType]]) -> dst

opencv docs

Shi-Tomasi corner detection

cv2.goodFeaturesToTrack(image, maxCorners, qualityLevel, minDistance[, corners[, mask[, blockSize[, useHarrisDetector[, k]]]]]) -> corners

opencv docs

Descriptor (SIFT, SURF, ORB, BRISK, BRIEF, FREAK ..)

SIFT (Scale-Invariant Feature Transform)

  1. Scale-space extrema detection: The first stage of computation searches over all scales and image locations. It is implemented efficiently by using a difference-of-Gaussian function to identify potential interest points that are invariant to scale and orientation.

  2. Keypoint localization: At each candidate location, a detailed model is fit to determine location and scale. Keypoints are selected based on measures of their stability.

  3. Orientation assignment: One or more orientations are assigned to each keypoint lo- cation based on local image gradient directions. All future operations are performed on image data that has been transformed relative to the assigned orientation, scale, and location for each feature, thereby providing invariance to these transformations.

  4. Keypoint descriptor: The local image gradients are measured at the selected scale in the region around each keypoint. These are transformed into a representation that allows for significant levels of local shape distortion and change in illumination.


cv2.SIFT_create([, nfeatures[, nOctaveLayers[, contrastThreshold[, edgeThreshold[, sigma]]]]]) -> retval

opencv docs 1

opencv docs 2

SURF (Speeded-Up Robust Features)

cv2.SURF_create([, hessianThreshold[, nOctaves[, nOctaveLayers[, extended[, upright]]]]]) -> retval

opencv docs

ORB (Oriented FAST and Rotated BRIEF)

cv2.ORB_create([, nfeatures[, scaleFactor[, nlevels[, edgeThreshold[, firstLevel[, WTA_K[, scoreType[, patchSize[, fastThreshold]]]]]]]]]) -> retval

opencv docs

BRISK (Binary Robust Invariant Scalable Keypoints)

cv2.BRISK_create([, thresh[, octaves[, patternScale]]]) -> retval

opencv docs

BRIEF (Binary Robust Independent Elementary Features)

cv2.BriefDescriptorExtractor_create([, bytes[, use_orientation]]) -> retval

opencv docs

FREAK (Fast Retina Keypoint)

cv2.FREAK_create([, orientationNormalized[, scaleNormalized[, patternScale[, nOctaves[, selectedPairs]]]]]) -> retval

opencv docs


Matcher(Brute-Force, FLANN)

Brute-Force

cv2.BFMatcher([, normType[, crossCheck]]) -> <BFMatcher object>

opencv docs

FLANN (Fast Library for Approximate Nearest Neighbors)

cv2.FlannBasedMatcher([, indexParams[, searchParams]]) -> <FlannBasedMatcher object>

opencv docs





Object tracking and Motion vector

BackgroundSubtraction

MOG1, MOG2 (Mixture of Gaussian)

Gaussian Mixture-based Background/Foreground Segmentation Algorithm

cv.bgsegm.createBackgroundSubtractorMOG([, history[, nmixtures[, backgroundRatio[, noiseSigma]]]]) -> retval

opencv docs

cv.createBackgroundSubtractorMOG2([, history[, varThreshold[, detectShadows]]]) -> retval

opencv docs

GMG (Gaussian Mixture-based Background/Foreground Segmentation Algorithm)

cv.bgsegm.createBackgroundSubtractorGMG([, initializationFrames[, decisionThreshold]]) -> retval

opencv docs

Moving Average

cv2.accumulate(src, dst[, mask]) -> dst

opencv docs

cv2.accumulateWeighted(src, dst, alpha[, mask]) -> dst

opencv docs

MeanShift

cv2.meanShift(probImage, window, criteria) -> retval, window

opencv docs

CamShift

cv2.CamShift(probImage, window, criteria) -> retval, window

opencv docs

Lucas-Kanade

OpticalFlow

Dense Optical Flow





(+) Binarization

Otsu's Binarization

Adaptive thresholding

Watershed transform

Morphology

Erosion

Dilation

Opening

Closing

Connected Component Labeling

Contour detection

Convex Hull

About

This Repository is for basic computer vision(Detection, Recognition, Tracking).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages