久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

霍夫圓檢測精度很低

Hough circle detection accuracy very low(霍夫圓檢測精度很低)
本文介紹了霍夫圓檢測精度很低的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試從看起來具有非常好的清晰度的圖像中檢測圓形.我確實意識到圓圈的一部分丟失了,但從我讀到的關于霍夫變換的內容來看,這似乎不會導致我遇到的問題.

I am trying to detect a circular shape from an image which appears to have very good definition. I do realize that part of the circle is missing but from what I've read about the Hough transform it doesn't seem like that should cause the problem I'm experiencing.

輸入:

輸出:

代碼:

// Read the image
Mat src = Highgui.imread("input.png");

// Convert it to gray
Mat src_gray = new Mat();
Imgproc.cvtColor(src, src_gray, Imgproc.COLOR_BGR2GRAY);

// Reduce the noise so we avoid false circle detection
//Imgproc.GaussianBlur( src_gray, src_gray, new Size(9, 9), 2, 2 );

Mat circles = new Mat();

/// Apply the Hough Transform to find the circles
Imgproc.HoughCircles(src_gray, circles, Imgproc.CV_HOUGH_GRADIENT, 1, 1, 160, 25, 0, 0);

// Draw the circles detected
for( int i = 0; i < circles.cols(); i++ ) {
    double[] vCircle = circles.get(0, i);

    Point center = new Point(vCircle[0], vCircle[1]);
    int radius = (int) Math.round(vCircle[2]);

    // circle center
    Core.circle(src, center, 3, new Scalar(0, 255, 0), -1, 8, 0);
    // circle outline
    Core.circle(src, center, radius, new Scalar(0, 0, 255), 3, 8, 0);
}

// Save the visualized detection.
String filename = "output.png";
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, src);

我已將高斯模糊注釋掉,因為(直覺上相反)它大大增加了找到的同樣不準確的圓圈的數量.

I have Gaussian blur commented out because (counter intuitively) it was greatly increasing the number of equally inaccurate circles found.

我的輸入圖像有什么問題會導致 Hough 不能像我預期的那樣工作嗎?我的參數有問題嗎?

Is there anything wrong with my input image that would cause Hough to not work as well as I expect? Are my parameters way off?

第一個答案提出了一個關于 Hough 的最小/最大半徑提示的好點.我拒絕添加這些參數,因為這篇文章中的示例圖像只是數千張圖像中的一張,這些圖像的半徑從大約 20 到幾乎無窮大不等.

first answer brought up a good point about the min/max radius hint for Hough. I resisted adding those parameters as the example image in this post is just one of thousands of images all with varying radii from ~20 to almost infinity.

推薦答案

如果你能正確設置 minRadiusmaxRadius 參數,它會給你很好的結果.

If you'd set minRadius and maxRadius paramaeters properly, it'd give you good results.

對于您的圖像,我嘗試了以下參數.

For your image, I tried following parameters.

method - CV_HOUGH_GRADIENT
minDist - 100
dp - 1
param1 - 80
param2 - 10
minRadius - 250
maxRadius - 300

我得到以下輸出

  • 注意:我在 C++ 中嘗試過.

這篇關于霍夫圓檢測精度很低的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數據庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 激情综合五月 | 国产午夜精品一区二区三区嫩草 | 亚洲成人综合在线 | 成人免费视频网站在线看 | 色婷婷激情综合 | 欧美日韩在线高清 | 亚洲欧美一区二区三区在线 | 韩日一区二区三区 | www.亚洲精品| 国产一级在线 | 国产成人精品免费视频 | 国产精品99久久久久久人 | 97福利在线 | 久久久高清 | 91亚洲国产成人久久精品网站 | 欧美美女二区 | 欧美一级三级在线观看 | 亚洲第一区久久 | 国产一区在线视频 | 欧美成年黄网站色视频 | 91精品免费 | 国产精品国产三级国产aⅴ中文 | 伊人色综合久久天天五月婷 | 伊人亚洲| 午夜精品久久久久久久星辰影院 | h视频在线播放 | 久久国产精品一区二区三区 | 国产精品久久久久久久久久久新郎 | 国产丝袜一区二区三区免费视频 | 精品欧美一区二区三区久久久 | 久久久久av | 国产在线观看一区二区三区 | 国产精品成人在线播放 | 欧美日韩福利视频 | 欧美精品欧美精品系列 | 涩涩片影院 | 欧美一级二级三级视频 | 久久精品黄色 | 成人免费在线观看 | 亚洲精品久久久一区二区三区 | 成人久久久久 |