Code owners
Assign users and groups as approvers for specific file changes. Learn more.
opencv 2.59 KiB
point2f(y,x) # inverted!
BGR #not rgb ...
Scalar = 4 element vector
CV_RGB(r, g, b) #from bgs
Types:
#depth
CV_8U unsigned char
CV_8S char
CV_16U unsigned short
CV_16S short
CV_32S int
CV_32F float
CV_64F double
# + channels C1..4 eg RGBA:
# eg Mat M(2,2, CV_8UC3, Scalar(0,0,255));
0 to 255 for CV_8U images
0 to 65535 for CV_16U images
0 to 1 for CV_32F images
Camera Calibration:
distortion_coefficients - 5 values
camera_matrix - 3x3 matrix - eg focal length etc.
different methods:
https://docs.opencv.org/4.x/d7/d21/tutorial_interactive_calibration.html
https://docs.opencv.org/4.x/d6/d55/tutorial_table_of_content_calib3d.html
# using chess board, to get values
https://github.com/abidrahmank/OpenCV2-Python-Tutorials/blob/master/source/py_tutorials/py_calib3d/py_calibration/py_calibration.rs
roi - region of interest
x, y, w, h
// roi as subset of full data image
Mat D (A, Rect(10, 10, 100, 100) ); // using a rectangle
Mat E = A(Range::all(), Range(1,3)); // using row and column boundaries
Matrix
Fill matrix with random values
Mat R = Mat(3, 2, CV_8UC3);
randu(R, Scalar::all(0), Scalar::all(255));
Formatted output
cout << "R (csv) = " << endl << format(R, Formatter::FMT_CSV ) << endl << endl;
#sa FMT_C/PYTHON/NUMPY/CSV
MISC
glob( dir, file )
CommandLineParser
randu() # https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga1ba1026dca0807b27057ba6a49d258c0
cvtColor(img, img, COLOR_BGR2Luv); #convert color
BS:
https://docs.opencv.org/4.x/da/d5c/tutorial_canny_detector.html
https://docs.opencv.org/4.x/d1/dc5/tutorial_background_subtraction.html
https://web.archive.org/web/20140418093037/http://bmc.univ-bpclermont.fr/
https://web.archive.org/web/20140221195750/http://docs.opencv.org/trunk/doc/tutorials/video/background_subtraction/background_subtraction.html
https://www.pyimagesearch.com/2020/07/27/opencv-grabcut-foreground-segmentation-and-extraction/
https://learnopencv.com/applications-of-foreground-background-separation-with-semantic-segmentation/
https://docs.opencv.org/4.x/d2/d55/group__bgsegm.html
https://docs.opencv.org/4.x/d5/de8/samples_2cpp_2segment_objects_8cpp-example.html#_a15
tuts:))
https://docs.opencv.org/4.x/d6/d00/tutorial_py_root.html
https://datahacker.rs/opencv-thresholding/
# median frame as bg + frame difference
https://learnopencv.com/simple-background-estimation-in-videos-using-opencv-c-python/
https://learnopencv.com/contour-detection-using-opencv-python-c/
https://learnopencv.com/deep-learning-with-opencvs-dnn-module-a-definitive-guide/
moments
https://docs.opencv.org/4.x/d0/d49/tutorial_moments.html