2017年4月16日 一周AnswerOpenCV佳作赏析

1、HelloHow to smooth edge of text in binary image, based on threshold.Something like anti-aliasing by openCv?example

题目:图片去毛刺

优质解答:

#;
    }
    )
        radius;
    Mat mInput,mOutput;
    Mat mChannel[];
    split(mInput_Bgr,mChannel);
    ; i ; i,mOutput_Bgr);
    ;
    }
    )
        radius;
    Mat mGSmooth,mDiff,mAbsDiff;
    mOutput ,),radius); 
    ,THRESH_BINARY_INV);
    mDiff.setTo(Scalar(),mAbsDiff);
    )
         ;
    ; id  ; i );
    RNG rng();
    ;
    }
    mSmoothEdge);
    threshold(mSource,mThres,,,THRESH_BINARY_INV);
    imshow(;
    .;
    findContours( mThres.clone(), contours, hierarchy, RETR_TREE, CV_CHAIN_APPROX_SIMPLE );
    ; i])), , , vector, Point() );
        }
        ])), , , vector, Point() );
        }
    }
    );
    SmoothEdgeSingleChannel(mThres,mSmoothEdge,.,.,);
    imshow("2) Smooth Edges",mSmoothEdge);
 
    waitKey();
}

   

解析:

这个效果是不错的,但是废话太多了;精华部分值得体会。注意在做“边界获得”运算后,适当放大后加回了原始图像。

#;
    }
    )
        radius;
    Mat mGSmooth,mDiff,mAbsDiff;
    mOutput ,),radius); 
    ,THRESH_BINARY_INV);
    mDiff.setTo(Scalar(),mAbsDiff);
    );
    Mat dst;
    imshow(.,.,);
    imshow("dst",dst);
    waitKey();
}
    
 
 

Hi,

In my project, I apply findcontours function to detect a rectangular object within a region of interest in the image. I am doing it in real time. Subsequently, I enclose the detected contour by a boundedrect which gives me its four vertices. However, the position of these vertices is not stable, it is changing very fast. Looks like the contour area is growing and shrinking, and have variations which causes the vertices' position to change. I have tried following solutions, but to no avail.

  1. Low pass filtering on the output of pixel positions.
  2. Median and Gaussian blur within the ROI.
  3. FastNlmeansDenoising: which is too slow for my application.
, , CV_THRESH_BINARY_INV ,));

,), Scalar());

, , );

dilate(img, img, Mat(), Point(,));

//cout << "Inside corrected corners p3.5" << endl;

findContours(img, contours, CV_RETR_LIST, CV_CHAIN_APPROX_NONE);

// cout<<contours.size()<<endl;

//  Mat tempimg(img.rows, img.cols, CV_8U, cv::Scalar(0));

//  drawContours( tempimg, contours, -1, Scalar(255), 3, CV_AA );

//  namedWindow("contours", CV_WINDOW_NORMAL);

//  imshow("contours", tempimg);

//  cout << "Inside corrected corners p4" << endl;

这个问题在AnswerOpenCV上也是讨论的很激烈,但是大多数还是从去噪音这个思路来说的 。

我认为在实时项目中(比如android),如果还是用静态图片的同样的处理方法来处理图片和寻找轮廓,肯定是会出现“颠簸”的情况。因此在考虑单幅图片的时候,还要同时考虑前面的/后面的图片;如果转换,也需要平滑处理。这些应该都是图像处理以外的东西了。

最新文章

  1. SIMLock锁卡功能解析
  2. 如何把Qlik Sense嵌入到Web应用中
  3. 关系数据库常用SQL语句语法大全
  4. {CSDN}{英雄会}{火车调度}
  5. Spring MVC设计模式
  6. NOIP2004 虫食算
  7. android开发实现静默安装(fota升级)
  8. iOS-音频格式转换-b
  9. 用mac自带的safari浏览器下载excel文件后面自带了.exe后缀
  10. Bzoj 1901: Zju2112 Dynamic Rankings 树套树,线段树,平衡树,Treap
  11. COM 浅谈
  12. 跑ssis分组差错:没有关联“”。假设无法找到一个特定的连接元件,Connections 这种错误发生的收集
  13. html5权威指南:表格元素
  14. SpringMVC上传压缩文件,解压文件,并检测上传文件中是否有index.html
  15. 一种使用GDI+对图片尺寸和质量的压缩方法
  16. springboot 服务工程,前端服务调用接口报跨域错误
  17. 插入排序Java版
  18. TOP100summit2017:网易测试总监钱蓓蕾——新时代测试正走向精英化、自动化、智能化
  19. 自定义cnblogs样式小结
  20. 【小程序开发】上拉加载更多demo

热门文章

  1. 并发编程 - 协程 - 1.协程概念/2.greenlet模块/3.gevent模块/4.gevent实现并发的套接字通信
  2. 剑指Offer——复杂链表的复制
  3. java基础04 Scanner的使用
  4. JXL导出Excel工具类
  5. UILocalNotification 的使用
  6. 前台js加密实例
  7. JavaWeb—基于Token的身份验证
  8. 如何查看java class文件的jdk版本
  9. SAMA5D3 Xplained Board
  10. Jenkins+Ant+Jmeter自动化测试平台