本文介绍了阈值技术/图像二值化的建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在一些图像中应用二值化过程。到目前为止,我只测试了三种技术的阈值在OpenCV(Otsu,自适应和固定)和自适应是什么得到更好的结果,但仍然不如预期。我想知道从某人谁工作与图像处理,一些建议,我可以做一些测试。我做了一个搜索,发现了很多方式,甚至很多,这么多,我不知道从哪里开始。所以,这里我要求那些理解这个主题的人的建议。



图片示例:

解决方案

以下步骤给了我最好的结果:


  1. 提取图片的绿色/蓝色频道。\



    Mat> (3);

    拆分(框架,频道);


  2. 应用高斯模糊。



    GaussianBlur(channels [0],channels [0],Size(7,7) ,0,0);

    p> threshold(channels [0],channels [0],-1,255,THRESH_BINARY + THRESH_OTSU);

    / ol>

    另请参阅以下有关阈值的信息:和


    I need to apply a binarization process in some images. So far I've only tested three techniques of thresholding in OpenCV (Otsu, adaptive and fixed) and adaptive was what got better results but still not as good as expected. I would like to know from someone who works with image processing, some suggestions that I can do some tests. I did a search and found many ways, even many, so many that I do not know where to start. So, here I am asking for suggestions from those who understand the subject.

    Example of the image:

    解决方案

    The following steps gave me the best result:

    1. Extract green/blue channel of image.\

      vector< Mat > channels(3);
      split(frame, channels);

    2. Apply gaussian blur.

      GaussianBlur(channels[0], channels[0], Size(7, 7), 0, 0);

    3. Apply thresholding with THRESH_OTSU flag.

      threshold(channels[0], channels[0], -1, 255, THRESH_BINARY+THRESH_OTSU);

    Also see these posts on thresholding: Adaptive threshold of blurry image and Threshold of blurry image - part 2

    这篇关于阈值技术/图像二值化的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 15:27