zoukankan      html  css  js  c++  java
  • OPENCV 初探(三)

    Code
    GUI
    窗口函数:
          cvNamedWindow(const char* name,
                                   int flags = CV_WINDOW_AUTOSIZE);   flags=0 可拉伸

          cvDestroyWindow();

          void* cvGetWindowHandle( const char* name );
          const char* cvGetWindowName( void* window_handle );

          void cvResizeWindow(
          const char* name,
          int width,
          int height
          );

          void cvMoveWindow( const char* name, int x, int y );
          void cvDestroyAllWindows( void );
          int cvStartWindowThread( void );

    等待键盘:
         while( 1 ) {
                if( cvWaitKey(100)==27 ) break;                   cvWaitKey(0) 一直等待
          }


    鼠标:
          void CvMouseCallback(
          int event,
          int x,
          int y,
          int flags,
          void* param
          );

          void cvSetMouseCallback(
          const char* window_name,
          CvMouseCallback on_mouse,
          void* param = NULL
          );

    滑动条:
          int cvCreateTrackbar(
          const char* trackbar_name,
          const char* window_name,
          int* value,
          int count,
          CvTrackbarCallback on_change
          );

          void (*callback)( int position )

          int cvGetTrackbarPos(
          const char* trackbar_name,
          const char* window_name
          );

          void cvSetTrackbarPos(
          const char* trackbar_name,
          const char* window_name,
          int pos
          );


    HARDWARE
          CvCapture* cvCreateFileCapture( const char* filename );
          CvCapture* cvCreateCameraCapture( int index );    -1 可打开列表供选择
          int cvGrabFrame( CvCapture* capture );  1 }                                          
                                                                                        }   <=>IplImage* cvQueryFrame( CvCapture* capture );
          IplImage* cvRetrieveFrame( CvCapture* capture );2}
          
          void cvReleaseCapture( CvCapture** capture );

           double cvGetCaptureProperty(
          CvCapture* capture,
          int property_id
          );
          int cvSetCaptureProperty(
          CvCapture* capture,
          int property_id,
          double value
          );

          CvVideoWriter* cvCreateVideoWriter(
          const char* filename,
          int fourcc,
          double fps,
          CvSize frame_size,
          int is_color = 1
          );

          int cvWriteFrame(
          CvVideoWriter* writer,
          const IplImage* image
          );

          void cvReleaseVideoWriter(
          CvVideoWriter** writer
          );
    FILE SYSTEM

          IplImage* cvLoadImage(
                const char* filename,
                int iscolor = CV_LOAD_IMAGE_COLOR (自动转换为3channelsx8bits)                   
                                 //CV_LOAD_IMAGE_GRAYSCALE
                                 //CV_LOAD_IMAGE_ANYCOLOR,
                                 //CV_LOAD_IMAGE_UNCHANGED,  ///+CV_LOAD_IMAGE_ANYDEPTH
                );
              
               CV_LOAD_IMAGE_COLOR | CV_LOAD_IMAGE_ANYDEPTH.(设置色深)
              
          int cvSaveImage(
                const char* filename,
                const CvArr* image
          );

    图像转换:
          void cvConvertImage(
          const CvArr* src,
          CvArr* dst,
          int flags = 0                                        flip the image vertically
          );
        
     
  • 相关阅读:
    车标知识学习网页开发,与Flask通过base64展示二进制图片 #华为云·寻找黑马程序员#
    大型情感剧集Selenium:3_元素定位 #华为云·寻找黑马程序员#
    大型情感剧集Selenium:2_options设置 #华为云·寻找黑马程序员#
    【nodejs原理&源码赏析(9)】用node-ssh实现轻量级自动化部署
    大型情感剧集Selenium:1_介绍 #华为云·寻找黑马程序员#
    使用Python开发小说下载器,不再为下载小说而发愁 #华为云·寻找黑马程序员#
    #华为云·寻找黑马程序员#【代码重构之路】如何“消除”if/else
    #华为云·寻找黑马程序员#【代码重构之路】如何优雅的关闭外部资源
    走近深度学习,认识MoXing:初识华为云ModelArts的王牌利器 — MoXing
    开启 J2EE(一)—‘全明星队伍’
  • 原文地址:https://www.cnblogs.com/westwind/p/1533322.html
Copyright © 2011-2022 走看看