Difference between revisions of "OpenCV/Basics/Scalar"
From ProgrammingExamples
< OpenCV
Daviddoria (Talk | contribs) (Created page with '==Scalar.cxx== <source lang="cpp"> #include "opencv2/calib3d/calib3d.hpp" #include <iostream> int main() { cv::Scalar myScalar; myScalar.val[0] = 1; myScalar.val[1] = 2;…') |
Daviddoria (Talk | contribs) m |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
==Scalar.cxx== | ==Scalar.cxx== | ||
<source lang="cpp"> | <source lang="cpp"> | ||
| − | #include " | + | #include "cv.h" |
#include <iostream> | #include <iostream> | ||
| Line 29: | Line 29: | ||
ADD_EXECUTABLE(Scalar Scalar.cxx) | ADD_EXECUTABLE(Scalar Scalar.cxx) | ||
| − | TARGET_LINK_LIBRARIES(Scalar | + | TARGET_LINK_LIBRARIES(Scalar ${OpenCV_LIBS}) |
| − | + | ||
| − | + | ||
| − | ) | + | |
</source> | </source> | ||
Latest revision as of 15:34, 21 January 2011
Scalar.cxx
#include "cv.h" #include <iostream> int main() { cv::Scalar myScalar; myScalar.val[0] = 1; myScalar.val[1] = 2; myScalar.val[2] = 3; std::cout << myScalar.val[0] << " " << myScalar.val[1] << " " << myScalar.val[2] << std::endl; return 0; }
CMakeLists.txt
cmake_minimum_required(VERSION 2.6) PROJECT(Scalar) FIND_PACKAGE(OpenCV REQUIRED ) INCLUDE_DIRECTORIES( ${OPENCV_INCLUDE_DIR} ) ADD_EXECUTABLE(Scalar Scalar.cxx) TARGET_LINK_LIBRARIES(Scalar ${OpenCV_LIBS})