• opencv inrange 和 mix


    opencv inrange:

    http://blog.csdn.net/xiaoyufei117122/article/details/53572904

    http://blog.csdn.net/wejoncy/article/details/50599640?locationNum=2&fps=1

    Python中如果是单通道,假设lower=[0],upper=[128],那么,对每个数在0-128之间为255,否则为0;

    如果是多通道,假设lower=[0,0,0],upper=[128,128,128,128],那么,对每一行,对任意一个数,如果在范围内,则255,否则0,最后的几个数相与,因此如果都是255,为255,否则为0

    opencv mixchannels:

    http://www.cnblogs.com/ruic/archive/2015/10/31/4926254.html

    opencv calchist:

    http://blog.csdn.net/ubunfans/article/details/23619771

     // Object has been selected by user, set up CAMShift search properties once
                        Mat roi(hue, selection), maskroi(mask, selection);
                        calcHist(&roi, 1, 0, maskroi, hist, 1, &hsize, &phranges);
                        normalize(hist, hist, 0, 255, NORM_MINMAX);
    
                        trackWindow = selection;
                        trackObject = 1; // Don't set up again, unless user selects new ROI
    
                        histimg = Scalar::all(0);
                        int binW = histimg.cols / hsize;
                        Mat buf(1, hsize, CV_8UC3);
                        for( int i = 0; i < hsize; i++ )
                            buf.at<Vec3b>(i) = Vec3b(saturate_cast<uchar>(i*180./hsize), 255, 255);
                        cvtColor(buf, buf, COLOR_HSV2BGR);
    
                        for( int i = 0; i < hsize; i++ )
                        {
                            int val = saturate_cast<int>(hist.at<float>(i)*histimg.rows/255);
                            rectangle( histimg, Point(i*binW,histimg.rows),
                                       Point((i+1)*binW,histimg.rows - val),
                                       Scalar(buf.at<Vec3b>(i)), -1, 8 );
                        }
    

      

  • 相关阅读:
    hibernate关联关系映射
    java单例模式
    HTML如何给table添加滚动条
    jquery的几种ajax方式对比
    JQuery Selectors 方法说明
    jQuery遍历对象/数组/集合
    Jquery常用函数
    【刷题】【省选】ZJOI2017_仙人掌_LOJ2250/Luogu3687_圆方树/dp计数/树形dp
    【学习笔记】圆方树学习笔记
    【模板】【刷题】差分与前缀和_LuoguP5488_多项式
  • 原文地址:https://www.cnblogs.com/hong2016/p/7634444.html
Copyright © 2020-2023  润新知