Difference between revisions of "OpenCV/Basics/MatrixProperties"

From ProgrammingExamples
Jump to: navigation, search
(Created page with '==MatrixProperties.cxx== <source lang="cpp"> #include "cv.h" #include <iostream> int main() { cv::Mat A(3,3,CV_32FC1); std::cout << A.depth() << std::endl; // float seems …')
 
m (CMakeLists.txt)
 
(One intermediate revision by the same user not shown)
Line 32: Line 32:
  
 
ADD_EXECUTABLE(MatrixProperties MatrixProperties.cxx)
 
ADD_EXECUTABLE(MatrixProperties MatrixProperties.cxx)
TARGET_LINK_LIBRARIES(MatrixProperties opencv_core opencv_highgui
+
TARGET_LINK_LIBRARIES(MatrixProperties ${OpenCV_LIBS})
opencv_flann opencv_imgproc opencv_highgui opencv_ml opencv_video opencv_objdetect
+
          opencv_features2d opencv_calib3d opencv_legacy opencv_contrib
+
)
+
  
 
</source>
 
</source>

Latest revision as of 16:46, 21 January 2011

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