Open CV Mat

Open CV Mat

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2019 Nov 19 7:59
Editor
Edited
Edited
2023 Mar 1 14:56
Refs
Refs
Language
Language

  • Mat::empty needed
  • Save
    • vector field
    • point cloud
    • histogram
    • ... usually 2d video data
  • mat(vector) return 1 col → need to .t
 
 
  • MatExpr
What is the purpose of cv::MatExpr?
Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share your research! Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. To learn more, see our tips on writing great answers.
What is the purpose of cv::MatExpr?
 
 

Create


  • eye
  • one
  • zero
  • create, setTo (init)
 
 
OpenCV Mat Edit
 
 

Copy


= is shallow copy (share pixel data)
  • ~mat inverts pixcel data
  • copyTo, clone is deep copy
 
 

Get


  • roi(region of interest) = Rect or (rowRange, colRange)
  • colRange - shallow
  • rowRange- shallow
  • row - shallow
  • col - shallow

Pixel

  • at<uchar>(y, x) - Slow
  • ptr<>(y) return start pointer uchar* can access by p[i] - Faster
  • MatIterator - Slow
    • mat::begin() - first pixel location
    • mat::end() - next of final pixel location
 
 

Normalization


  • convertTo - data by alpha and beta
  • reshape - new row or or channel
  • resize - new row and initialize
  • pop_back - nelem remove row count
 
 
 

Data


  • Scalar sum
  • Scalar mean
  • minMAxLoc(ation)
 
 
 
 
 
 
 
 

Recommendations