• 大小: 98.63MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-03-11
  • 语言: 其他
  • 标签: opencv  程序  

资源简介

OpenCV计算机视觉编程攻略/(加) Robert Laganière著 相银初译。。。opencv计算机视觉编程攻略第三版程序代码,压缩包包含各章节源程序和pdf图片

资源截图

代码片段和文件信息

/*------------------------------------------------------------------------------------------*\
This file contains material supporting chapter 1 of the book:
OpenCV3 Computer Vision Application Programming Cookbook
Third Edition
by Robert Laganiere Packt Publishing 2016.

This program is free software; permission is hereby granted to use copy modify
and distribute this source code or portions thereof for any purpose without fee
subject to the restriction that the copyright notice may not be removed
or altered from any source or altered source distribution.
The software is released on an as-is basis and without any warranties of any kind.
In particular the software is not guaranteed to be fault-tolerant or free from failure.
The author disclaims all warranties with regard to this software any use
and any consequent failure is purely the responsibility of the user.

Copyright (C) 2016 Robert Laganiere www.laganiere.name
\*------------------------------------------------------------------------------------------*/

#include 

#include 
#include 
#include 


void onMouse( int event int x int y int flags void* param) {

cv::Mat *im= reinterpret_cast(param);

    switch (event) { // dispatch the event

case cv::EVENT_LBUTTONDOWN: // mouse button down event

// display pixel value at (xy)
std::cout << “at (“ << x << ““ << y << “) value is: “ 
      << static_cast(im->at(cv::Point(xy))) << std::endl;
break;
}
}

int main() {

cv::Mat image; // create an empty image
std::cout << “This image is “ << image.rows << “ x “ 
              << image.cols << std::endl;

// read the input image as a gray-scale image
image=  cv::imread(“puppy.bmp“ cv::IMREAD_GRAYSCALE); 

    if (image.empty()) {  // error handling
        // no image has been created...
// possibly display an error message
// and quit the application 
std::cout << “Error reading image...“ << std::endl;
return 0;
}

std::cout << “This image is “ << image.rows << “ x “ 
  << image.cols << std::endl;
std::cout << “This image has “ 
              << image.channels() << “ channel(s)“ << std::endl; 

// create image window named “My Image“
    cv::namedWindow(“Original Image“); // define the window (optional)
cv::imshow(“Original Image“ image); // show the image

// set the mouse callback for this image
cv::setMouseCallback(“Original Image“ onMouse reinterpret_cast(&image));

cv::Mat result; // we create another empty image
cv::flip(imageresult1); // positive for horizontal
                          // 0 for vertical                     
                          // negative for both

cv::namedWindow(“Output Image“); // the output window
cv::imshow(“Output Image“ result);

cv::waitKey(0); // 0 to indefinitely wait for a key pressed
                // specifying a positive value will wait for
                // the given amount of msec

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-10-20 16:56  opencv计算机视觉编程攻略第三版(完整版)程序代码\
     文件    23907980  2018-10-20 16:56  opencv计算机视觉编程攻略第三版(完整版)程序代码\0d2b5f0b-e9b0-4f37-b3c1-93ecfb177fc7.pdf
     目录           0  2018-10-20 16:55  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\
     文件         378  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\.gitattributes
     文件         649  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\.gitignore
     文件        1131  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\CMakeLists.txt
     目录           0  2018-10-20 16:55  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter01\
     文件         749  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter01\CMakeLists.txt
     文件         420  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter01\README.txt
     文件        3862  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter01\loadDisplaySave.cpp
     文件        2341  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter01\logo.cpp
     文件        3399  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter01\mat.cpp
     目录           0  2018-10-20 16:55  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter02\
     文件         941  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter02\CMakeLists.txt
     文件         676  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter02\README.txt
     文件        2192  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter02\addImages.cpp
     文件       14418  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter02\colorReduce.cpp
     文件        4692  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter02\contrast.cpp
     文件        2157  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter02\remapping.cpp
     文件        3214  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter02\saltImage.cpp
     目录           0  2018-10-20 16:55  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter03\
     文件         815  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter03\CMakeLists.txt
     文件         563  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter03\README.txt
     文件        3720  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter03\colorDetection.cpp
     文件        2089  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter03\colordetector.cpp
     文件        4599  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter03\colordetector.h
     文件        2468  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter03\extractobject.cpp
     文件        5687  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter03\huesaturation.cpp
     目录           0  2018-10-20 16:55  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter04\
     文件        1571  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter04\CMakeLists.txt
     文件         999  2017-02-06 18:59  opencv计算机视觉编程攻略第三版(完整版)程序代码\OpenCV3-Computer-Vision-Application-Programming-Cookbook-Third-Edition-master\Chapter04\README.txt
............此处省略563个文件信息

评论

共有 条评论