OpenCV/Basics/MatrixProperties

From ProgrammingExamples
< OpenCV
Revision as of 16:46, 21 January 2011 by Daviddoria (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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})