Preview

OPEN CV

Good Essays
Open Document
Open Document
1626 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
OPEN CV
OpenCV 2.4 Cheat Sheet (C++)
The OpenCV C++ reference manual is here: http: // docs. opencv. org . Use Quick Search to find descriptions of the particular functions and classes

Key OpenCV Classes
Point_
Point3_
Size_
Vec
Matx
Scalar
Rect
Range
Mat

SparseMat
Ptr

Template 2D point class
Template 3D point class
Template size (width, height) class
Template short vector class
Template small matrix class
4-element vector
Rectangle
Integer value range
2D or multi-dimensional dense array
(can be used to store matrices, images, histograms, feature descriptors, voxel volumes etc.)
Multi-dimensional sparse array
Template smart pointer class

Mat dyImage(image.size(), image.type()); for(int y = 1; y < image.rows-1; y++) {
Vec3b* prevRow = image.ptr(y-1);
Vec3b* nextRow = image.ptr(y+1); for(int x = 0; x < image.cols; x++) for(int c = 0; c < 3; c++) dyImage.at(y,x)[c] = saturate_cast( nextRow[x][c] - prevRow[x][c]);
}
Mat_::iterator it = image.begin(), itEnd = image.end(); for(; it != itEnd; ++it)
(*it)[1] ^= 255;

Matrix Manipulations: Copying,
Shuffling, Part Access

src.copyTo(dst)
Copy matrix to another one src.convertTo(dst,type,scale,shift) Scale and convert to another datatype
Matrix Basics
m.clone()
Make deep copy of a matrix
Create a matrix
m.reshape(nch,nrows) Change matrix dimensions and/or numMat image(240, 320, CV_8UC3); ber of channels without copying data
[Re]allocate a pre-declared matrix
m.row(i), m.col(i)
Take a matrix row/column image.create(480, 640, CV_8UC3);
m.rowRange(Range(i1,i2)) Take a matrix row/column span
Create a matrix initialized with a constant
m.colRange(Range(j1,j2))
Mat A33(3, 3, CV_32F, Scalar(5));
m.diag(i)
Take a matrix diagonal
Mat B33(3, 3, CV_32F); B33 = Scalar(5); m(Range(i1,i2),Range(j1,j2)),Take a submatrix
Mat C33 = Mat::ones(3, 3, CV_32F)*5.; m(roi) Mat D33 = Mat::zeros(3, 3, CV_32F) + 5.;
m.repeat(ny,nx)
Make a bigger matrix from a smaller one
Create a

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Pt1420 Unit 6 Lab Report

    • 288 Words
    • 2 Pages

    Step 6 : Break the input string into square matrices of maximum possible size of…

    • 288 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    CODE FOR THE ABOVE FRAGMENT addi $t6, $zero, 101 # the loop termination value add $t0, $zero, $zero # i = 0 addi $t2, $a0, 0 # ptr to current A[i] addi $t3, $a1, 0 # ptr to current B[i] loop: lw $t4, 0($t3) # load B[i] add $t4, $t4, $s0 # B[i] + c sw $t4, 0($t2) # store in A[i] addi $t0, $t0, 1 # i++ addi $t2, $t2, 4 # ptr to next A[i] addi $t3, $t3, 4 # ptr to next B[i] bne $t0, $t6, loop # if i < 101, goto loop IF ANY QUERIES REGARDING CODE…

    • 107 Words
    • 1 Page
    Powerful Essays
  • Powerful Essays

    How Does Glfloat Shape

    • 376 Words
    • 2 Pages

    Leg void tableLeg(double thick, double len) { glPushMatrix(); glTranslated(0, len/2, 0); glScaled(thick, len, thick); glutSolidCube(1.0);…

    • 376 Words
    • 2 Pages
    Powerful Essays
  • Good Essays

    to 65,536, and columns are labeled with letters. Column 1 is A, Column 26 is Z,…

    • 2650 Words
    • 11 Pages
    Good Essays
  • Satisfactory Essays

    Personal's Resume

    • 343 Words
    • 2 Pages

    To obtain a part-time or full time position that will enable me to use my work experiences, educational background and ability to work well with people.…

    • 343 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    linotype

    • 314 Words
    • 2 Pages

    individual matrix machine which allowed lines of type to be created and be used to print multiple…

    • 314 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    3. This method of multiplication can be expanded to matrices other that 2x2. However, due to space constraints, on a test, usually you will only see a 2 x2 matrix or smaller.…

    • 320 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    where B is the extended matrix created by inserting vector b as the n+1 column of…

    • 3080 Words
    • 13 Pages
    Good Essays
  • Good Essays

    MATLAB intro exercise

    • 2748 Words
    • 11 Pages

    >> A=[-2 1 00; 3 4 7 -2; 1 0 0 1; 6 7 -2 0; 5 3 1 0];…

    • 2748 Words
    • 11 Pages
    Good Essays
  • Satisfactory Essays

    CV

    • 259 Words
    • 2 Pages

    A polite, hard working individual, able to converse in a confident and polite manner, contributes well to team work, able to follow clear instructions, passionate about excellent customer service.…

    • 259 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    I wish to participate in VSCS in order to further my knowledge in STEM and to feed my passion and curiosity for the science and engineering behind space exploration. Exploring space has always been a dream of mine since I was young so being able to participate in a program that enriches the science and engineering behind it brings me a step closer to accomplishing my dream. To start, I would be successful in this program based on the fact that I am very dedicated and self-sufficient in my work ethic, as well as organized and responsible. This helps me work to the best of my ability and harness any subject given to me through the means of meticulous and organized work. Also, I am excellent at critical thinking and being adaptable in my abilities…

    • 265 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Ib Math Sl Type Ii Ia

    • 1192 Words
    • 5 Pages

    As indicated, inputting the number 6, as the requested sixth row, for n gives the solution of 21.…

    • 1192 Words
    • 5 Pages
    Better Essays
  • Powerful Essays

    PII: S 0 3 7 8 - 4 2 6 6 ( 9 8 ) 0 0 0 8 1 - 8…

    • 5499 Words
    • 22 Pages
    Powerful Essays
  • Satisfactory Essays

    Cv- Outline

    • 552 Words
    • 3 Pages

    those papers that are in press, so indicate under the words "In Press" providing only…

    • 552 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Matrix eigenvector

    • 1011 Words
    • 5 Pages

    If you like, just consider this step as, “subtract from each diagonal element of the matrix in the question”.…

    • 1011 Words
    • 5 Pages
    Good Essays

Related Topics