Difference between revisions of "OpenCV/Basics/Matrix3Channel"
From ProgrammingExamples
< OpenCV
Daviddoria (Talk | contribs) m (moved OpenCV/Matrix3Channel to OpenCV/Basics/Matrix3Channel) |
Daviddoria (Talk | contribs) m |
||
Line 49: | Line 49: | ||
ADD_EXECUTABLE(Matrix3Channel Matrix3Channel.cxx) | ADD_EXECUTABLE(Matrix3Channel Matrix3Channel.cxx) | ||
− | TARGET_LINK_LIBRARIES(Matrix3Channel | + | TARGET_LINK_LIBRARIES(Matrix3Channel ${OpenCV_LIBS}) |
− | + | ||
− | + | ||
− | ) | + | |
</source> | </source> |
Latest revision as of 16:46, 21 January 2011
Matrix3Channel.cxx
#include "cv.h" #include <iostream> int main() { cv::Mat myMatrix(3,3,CV_32FC3); std::cout << "Input:" << std::endl; for(unsigned int i = 0; i < 3; i++) { for(unsigned int j = 0; j < 3; j++) { cv::Point3f myPoint; myPoint.x = 1; myPoint.y = 2; myPoint.z = 3; myMatrix.at<cv::Point3f>(i,j) = myPoint; } } std::cout << "Output:" << std::endl; for(unsigned int i = 0; i < 3; i++) { for(unsigned int j = 0; j < 3; j++) { std::cout << myMatrix.at<cv::Point3f>(i,j) << std::endl; } } return 0; }
CMakeLists.txt
cmake_minimum_required(VERSION 2.6) PROJECT(Matrix3Channel) FIND_PACKAGE(OpenCV REQUIRED ) INCLUDE_DIRECTORIES( ${OPENCV_INCLUDE_DIR} ) ADD_EXECUTABLE(Matrix3Channel Matrix3Channel.cxx) TARGET_LINK_LIBRARIES(Matrix3Channel ${OpenCV_LIBS})