zoukankan      html  css  js  c++  java
  • 图像处理小知识随手记

    1.阈值常采用OTSU方法,其主要思想是利用图像的灰度直方图,以目标和背景的方差最大来动态的确定图像分割的阈值。

    2.matlab里处理单个区域的有regionprops函数,opencv里可以用findContours实现针对单个区域处理,见代码如下:

     1 findContours(aftColorResult, contours, hierarchy, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
     2     // fill external contours
     3     if (!contours.empty() && !hierarchy.empty())
     4     {
     5         for (int idx = 0; idx < contours.size(); idx++)
     6         {
     7 
     8             drawContours(aftColorResult, contours, idx, Scalar(255), CV_FILLED, 8);//filled the region
     9             Mat eachBianryRegion(aftColorResult.size(), CV_8U, Scalar(0));//建立个空的Mat矩阵
    10             drawContours(eachBianryRegion, contours, idx, Scalar(255), CV_FILLED, 8);
    11             12 
    13         }
  • 相关阅读:
    ajax请求超时
    tp5去重统计某字段的数量
    html本地存储 localStorge
    json、obj转换
    关于数组的合并arr.push() arr.push.apply()
    curl内容
    js 回车键登录
    tp5 前置操作
    STL容器
    c++文件的读写
  • 原文地址:https://www.cnblogs.com/ggYYa/p/6230525.html
Copyright © 2011-2022 走看看