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

OpenCV findChessboardCorners 函數(shù)在(顯然)簡單的場景中

OpenCV findChessboardCorners function is failing in a (apparently) simple scenario(OpenCV findChessboardCorners 函數(shù)在(顯然)簡單的場景中失敗)
本文介紹了OpenCV findChessboardCorners 函數(shù)在(顯然)簡單的場景中失敗的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我正在嘗試使用 OpenCV 找到棋盤的角.

I'm trying to find the corners of a chessboard using OpenCV.

我使用的圖像包含兩個(gè)棋盤,但我只對其中一個(gè)的子區(qū)域感興趣.下圖為原圖.

The image I'm using contains two chessboards, but I'm interested only in a sub-region of one of those. The following image shows the original image.

使用 GIMP,然后我選擇了感興趣的區(qū)域,并將所有其他像素設(shè)置為默認(rèn)值.

Using GIMP, I've then selected the area of interest and I've set all the other pixel to a default value.

我實(shí)際上并沒有裁剪圖像,因?yàn)槲乙呀?jīng)使用此圖像尺寸校準(zhǔn)了相機(jī)并且我不想更改它.該操作應(yīng)該等同于更改圖像矩陣中的值,但我更喜歡使用 GIMP 進(jìn)行操作.這是一個(gè)一次性的實(shí)驗(yàn),使用圖形工具而不是使用代碼執(zhí)行該操作更快.

I haven't actually cropped the image because I've already calibrated the camera using this image size and I didn't want to change it. The operation should be equivalent to change the values in the image matrix, but I preferred to do it with GIMP. It is a one time experiment and it is faster to do that operation with a graphic tool instead of using the code.

生成的圖像包含一個(gè) 24x5 角的棋盤,但函數(shù) findChessboardCorners 找不到任何東西.

The resulting image contains a chessboard with 24x5 corners, but the function findChessboardCorners is not able to find anything.

這是我正在使用的 Python 代碼:

Here is the Python code I'm using:

>>> img = cv2.imread('C:\Path\To\C4-Cropped.png', 0)
>>> cv2.findChessboardCorners(img, (24, 5))
(False, None)
>>> cv2.findChessboardCorners(img, (5, 24))
(False, None)

我也試過設(shè)置自適應(yīng)閾值,但還是不行

I also tried to set the adaptive threshold, but it is still not working

>>> cv2.findChessboardCorners(img, (24, 5), flags=cv2.cv.CV_CALIB_CB_ADAPTIVE_THRESH)
(False, None)

這看起來很奇怪.我過去曾多次使用過 OpenCV 的這個(gè)功能,它總是有效,即使圖像看起來比這個(gè)復(fù)雜得多.復(fù)雜.該區(qū)域的照明不是均勻的,但函數(shù)應(yīng)該足夠強(qiáng)大以處理它.

That seems really strange. I used this function of OpenCV many times in the past and it always worked, even with images that looked much more complicated than this one. The illumination of the area is not homogeneous but the function should be robust enough to handle that.

使用 GIMP 臨時(shí)創(chuàng)建的 人工 圖像有什么問題嗎?我怎樣才能找到角落?

Is there any problem with the artificial image created ad hoc with GIMP? How can I find the corners?

任何建議將不勝感激.

推薦答案

需要進(jìn)行兩項(xiàng)更改才能使該圖像為非常挑剔的 cv2.findChessboardCorners 函數(shù)所接受.首先,棋盤需要白色背景.我只是通過調(diào)整圖像的對比度來獲得這個(gè).其次,我還必須將連接棋盤頂部和底部黑色方塊的黑色水平線涂成白色.這是生成的圖像:

There are two changes needed to make that image acceptable to the very finicky cv2.findChessboardCorners function. First, the chess board needs a white background. I obtained this simply by adjusting the contrast on your image. Second, I also had to white-out the dark horizontal line that connects the black squares at the top and bottom of your chess board. This is the resulting image:

通過這些增強(qiáng)功能,cv2.findChessboardCorners 可以成功分析圖像.結(jié)果是:

With these enhancements, cv2.findChessboardCorners can successfully analyze the image. The results were:

camera matrix =
    [[  1.67e+04   0.00e+00   1.02e+03]
    [  0.00e+00   1.70e+04   5.45e+02]
    [  0.00e+00   0.00e+00   1.00e+00]]

distortion coefficients = [ -4.28e+00   1.38e+03  -8.59e-03  -1.49e-02   6.93e+00]

(圖像增強(qiáng)方式的微小變化可以極大地改變上述結(jié)果.只有一張小棋盤的圖像,這些結(jié)果是不可信的.)

(Small changes to how the image is enhanced can change the above results greatly. With only one image of a small chess board, these results are not to be trusted.)

如您所述,cv2.findChessboardCorners 接受旨在幫助識別棋盤的標(biāo)志(自適應(yīng)閾值、filter_quads 和規(guī)范化).我嘗試了所有方法,但它們在這里沒有任何區(qū)別.

As you noted, cv2.findChessboardCorners accepts flags (adaptive threshold, filter_quads, and normalization) that are intended to help with chess board recognition. I tried all but they made no difference here.

這篇關(guān)于OpenCV findChessboardCorners 函數(shù)在(顯然)簡單的場景中失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

How to draw a rectangle around a region of interest in python(如何在python中的感興趣區(qū)域周圍繪制一個(gè)矩形)
How can I detect and track people using OpenCV?(如何使用 OpenCV 檢測和跟蹤人員?)
How to apply threshold within multiple rectangular bounding boxes in an image?(如何在圖像的多個(gè)矩形邊界框中應(yīng)用閾值?)
How can I download a specific part of Coco Dataset?(如何下載 Coco Dataset 的特定部分?)
Detect image orientation angle based on text direction(根據(jù)文本方向檢測圖像方向角度)
Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 檢測圖像中矩形的中心和角度)
主站蜘蛛池模板: 三级av网址 | 97伦理 | 中文字幕视频在线 | 亚洲免费在线 | 国产精品亚洲一区二区三区在线 | 成人国产一区二区三区精品麻豆 | 亚洲欧美激情网 | 黄色大片免费看 | 91高清在线观看 | 91免费在线 | 综合精品久久久 | 91精品国产综合久久小仙女图片 | 欧美亚洲国产精品 | 日韩成人在线视频 | 国产精品亚洲一区 | 欧美a视频| 亚洲网站在线播放 | 少妇性l交大片免费一 | 中文字幕一区二区三区四区五区 | 成人a免费 | 精品久久影院 | 亚洲免费在线观看视频 | 欧洲一级毛片 | 欧美电影免费观看高清 | 精品久久av | 一本综合久久 | 99精品久久 | 综合久久av | 久久亚洲国产精品日日av夜夜 | 日本精品一区二区三区在线观看视频 | 国产一级电影在线观看 | 精品日韩 | 精品国产1区2区3区 一区二区手机在线 | 午夜a√| 91偷拍精品一区二区三区 | 国产精品久久国产愉拍 | 草久久| 欧美日韩国产在线观看 | 欧美精品在线看 | 婷婷色网 | 国产情侣激情 |