Skip to content

Latest commit

 

History

History
108 lines (73 loc) · 3.1 KB

notes.md

File metadata and controls

108 lines (73 loc) · 3.1 KB

everyone starts somewhere

opencv

cv2.imread()

  • returns an numpy.ndarray

cv2.resize()

  • resizes image

cv2.normalize()

cv2.flatten()

  • converts 3d array into 1d array

cv2.calcHist()

calculates histograms of images.

colored histograms and greyscale histograms have different uses cases. this project uses grey scale histograms for the purpose of image segmentation.

cv2.cvtColor()

used to convert an image from one color space to another.

cv2.HOGDescriptor()

The cv2.HOGDescriptor() is a function in the OpenCV library in Python. HOG stands for Histogram of Oriented Gradients, which is a feature descriptor used in computer vision and image processing for the purpose of object detection.

default args

cv2.HOGDescriptor(win_size=(64, 128),
                  block_size=(16, 16),
                  block_stride=(8, 8),
                  cell_size=(8, 8),
                  nbins=9,
                  win_sigma=DEFAULT_WIN_SIGMA,
                  threshold_L2hys=0.2,
                  gamma_correction=true,
                  nlevels=DEFAULT_NLEVELS)

win_size: Size of detection window in pixels (width, height). Defines the region of interest.

block_size: Block size in pixels (width, height). Defines how many cells are in each block.

block_stride: Block stride in pixels (horizontal, vertical). defines the distance between adjecent blocks.

cell_size: Cell size in pixels (width, height). Determines the size fo your cell

nbins: Number of bins for the histograms. Determines the number of angular bins used to make the histograms HOG uses unsigned gradients, so the angular bins will have values between 0 and 180 degrees

numpy

numpy.ndarray

  • ndarray is short for N-dimensional array
  • homogonus datatype int32, float64 & complex128
  • immutable, fixed size

matplotlib

sklearn

KNeighborsClassifier

MLPClassifier

svm.LinearSVC

model.fit()

in model.fit() the model is a sklearn.neural_network._multilayer_perceptron.MLPClassifier