OpenCV/Basics/MatrixProperties
From ProgrammingExamples
< OpenCV(Redirected from OpenCV/MatrixProperties)
MatrixProperties.cxx
#include "cv.h" #include <iostream> int main() { cv::Mat A(3,3,CV_32FC1); std::cout << A.depth() << std::endl; // float seems to be depth 5 cv::Mat B(3,3,CV_64FC1); std::cout << B.depth() << std::endl; // float seems to be depth 6 return 0; }
CMakeLists.txt
cmake_minimum_required(VERSION 2.6) PROJECT(MatrixProperties) FIND_PACKAGE(OpenCV REQUIRED ) INCLUDE_DIRECTORIES( ${OPENCV_INCLUDE_DIR} ) ADD_EXECUTABLE(MatrixProperties MatrixProperties.cxx) TARGET_LINK_LIBRARIES(MatrixProperties ${OpenCV_LIBS})