Skip to content

Instantly share code, notes, and snippets.

View bezero's full-sized avatar

Nekruzjon Maxudov bezero

  • Abu-Dhabi/UAE
View GitHub Profile
@bezero
bezero / pca.py
Created June 11, 2019 09:45
PCA using opencv
import cv2
import numpy as np
points = np.array([[0, 20], [980, 1020], [1020, 980], [20, 0]], dtype=np.float)
mean, eigenvectors = cv2.PCACompute(data=points, mean=None, maxComponents=1)
print(points)
print(eigenvectors)
theta = np.arctan((eigenvectors[0, 1])/(eigenvectors[0, 0]))
print('theta: ', theta)
@bezero
bezero / CMakeLists.txt
Created April 19, 2017 15:40 — forked from erikzenker/CMakeLists.txt
CMake CUDA + C++ in separate files
# CMAKE FILE to separatly compile cuda and c++ files
# with the c++11 standard
#
#
# Folder structure:
#
# |
# +--main.cpp (with C++11 content)
# +--include/
# | |