国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

復(fù)現(xiàn)路上的花開(kāi)花落(2)cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function ‘line‘

這篇具有很好參考價(jià)值的文章主要介紹了復(fù)現(xiàn)路上的花開(kāi)花落(2)cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function ‘line‘。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

復(fù)現(xiàn)complex yolo

運(yùn)行檢測(cè)程序報(bào)錯(cuò)

Traceback (most recent call last):
  File "test_detection.py", line 152, in <module>
    bev_utils.drawRotatedBox(RGB_Map, int(x), int(y), int(w), l, int(yaw), cnf.colors[int(cls_pred)])
  File "E:\IDM下載\conplex yolo\Complex-YOLOv3\utils\kitti_bev_utils.py", line 174, in drawRotatedBox
    cv2.line(img, (corners_int[0, 0], corners_int[0, 1]), (corners_int[3, 0], corners_int[3, 1]), (255, 255, 0), 2)
cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function 'line'
> Overload resolution failed:
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type

原因:類型出錯(cuò)

解決辦法:

第一種:將報(bào)錯(cuò)語(yǔ)句中所有能改類型的值全加上int強(qiáng)制轉(zhuǎn)成整型

第二句更正為:

cv2.line(img, (int(corners_int[0, 0]), int(corners_int[0, 1])), (int(corners_int[3, 0]), int(corners_int[3, 1])), (255, 255, 0), 2)

第二種:opencv-python版本過(guò)高導(dǎo)致,降低版本

參考別的博主,從4.6.0降下來(lái),親測(cè)該版本可行

pip install opencv-python==4.5.1.48

參考鏈接:

無(wú)法解析“pt1”。索引為 0 的序列項(xiàng)的類型錯(cuò)誤 ·問(wèn)題 #48 ·Maudzung/Complex-YOLOv4-Pytorch (github.com)

【YOLOv4運(yùn)行demo.py報(bào)錯(cuò)】:cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function ‘rectangle‘_碼上出奇跡的博客-CSDN博客文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-587963.html

到了這里,關(guān)于復(fù)現(xiàn)路上的花開(kāi)花落(2)cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function ‘line‘的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • cv2保存圖片類型錯(cuò)誤執(zhí)行報(bào)錯(cuò)cv2. error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function ‘imwrite‘ - img i

    硬件環(huán)境(Ascend/GPU/CPU): GPU 軟件環(huán)境: – MindSpore 版本: 1.7.0 執(zhí)行模式: 靜態(tài)圖(GRAPH) – Python 版本: 3.7.6 – 操作系統(tǒng)平臺(tái): linux 將優(yōu)化好的圖像用cv2進(jìn)行圖片保存,由于沒(méi)有將tensor轉(zhuǎn)換為numpy,導(dǎo)致cv2.imwrite運(yùn)行失敗。 adversarial_tensor, mask_tensor = adversarial.train(attack_method) cv2.imwrit

    2024年02月17日
    瀏覽(22)
  • 【Python】cv2.error: OpenCV(4.8.0) :-1: error: (-5:Bad argument) in function ‘cvtColor‘ > Overload res

    【Python】cv2.error: OpenCV(4.8.0) :-1: error: (-5:Bad argument) in function ‘cvtColor‘ > Overload res

    代碼片段為: 我的代碼出現(xiàn)了報(bào)錯(cuò): 錯(cuò)誤信息提示 cv2.error: (-5:Bad argument) in function ‘cvtColor’,這是因?yàn)樵趯D像從原始路徑加載并轉(zhuǎn)換為灰度圖時(shí),傳遞給 cv2.cvtColor 的參數(shù)不正確。 修改代碼: 主要更改包括: 將圖片路徑作為參數(shù)傳遞給 cv2.imread 函數(shù),以正確加載圖片。

    2024年02月10日
    瀏覽(37)
  • cv2.line使用報(bào)錯(cuò)【已解決】error: OpenCV(4.7.0) :-1: error: (-5:Bad argument) in function ‘line‘ > Overload

    cv2.line使用報(bào)錯(cuò)【已解決】error: OpenCV(4.7.0) :-1: error: (-5:Bad argument) in function ‘line‘ > Overload

    cv2.line: image = cv2.line(image, 直線起點(diǎn)坐標(biāo), 直線終點(diǎn)坐標(biāo), 顏色, 粗細(xì)) 使用cv2.line時(shí),報(bào)告了如下錯(cuò)誤 error提示索引為1的參數(shù)類型錯(cuò)誤,即(weigh, right_y), (0, left_y) 通過(guò)打印發(fā)現(xiàn)weigh、right_y、left_y數(shù)據(jù)類型為float 將數(shù)據(jù)類型修改為int后不在報(bào)錯(cuò)

    2024年02月11日
    瀏覽(24)
  • 【YOLOv4運(yùn)行demo.py報(bào)錯(cuò)】:cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function ‘rectangle‘

    【YOLOv4運(yùn)行demo.py報(bào)錯(cuò)】:cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function ‘rectangle‘

    最近在linux服務(wù)器上部署YOLOv4項(xiàng)目(https://github.com/Tianxiaomo/pytorch-YOLOv4),配置好環(huán)境以后,運(yùn)行demo.py進(jìn)行測(cè)試,報(bào)錯(cuò)如下: 報(bào)錯(cuò)顯示,在調(diào)用函數(shù)cv2.rectangle時(shí),無(wú)法分析“pt2”參數(shù)。索引為0的序列項(xiàng)的類型錯(cuò)誤,去opencv官網(wǎng)查看用法如下: 這下對(duì)應(yīng)上了,是第二個(gè)參數(shù)

    2024年02月12日
    瀏覽(76)
  • error: OpenCV(4.8.0) :-1: error: (-5:Bad argument) in function ‘line‘

    在python中讀取matlab保存的mat文件,然后進(jìn)行一些處理出現(xiàn)上面報(bào)錯(cuò)。 此原因可能由于 matlab和python存儲(chǔ)方式不同。 Pascal, C,C++,Python都是行優(yōu)先存儲(chǔ)的,而Fortran,MatLab是列優(yōu)先存儲(chǔ)的。 即 C order ?指的是 行優(yōu)先的順序(Row-major Order) ,即內(nèi)存中同行的元素存在一起, Fortran

    2024年02月04日
    瀏覽(49)
  • error: OpenCV(4.7.0) :-1: error: (-5:Bad argument) in function ‘knnMatch‘> Overload resolution fail

    ?各位大佬,我正在用Sobel、SIFT feature extraction、Color histogram去做圖像分類檢索。想輸入一張圖片去檢索相類似的圖像,出現(xiàn)了以下錯(cuò)誤,請(qǐng)問(wèn)該怎么解決呢?萬(wàn)分感謝 # Define a function to find similar images def find_similar_images(image_path, k=5): ? ? # Load input image and compute descriptors ? ?

    2023年04月20日
    瀏覽(25)
  • cv2.error: OpenCV(4.6.0) :-1: error

    cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function \\\'imwrite\\\' Overload resolution failed: - img is not a numpy array, neither a scalar - Expected Ptrcv::UMat for argument \\\'img\\\' 報(bào)錯(cuò)的程序是上面那行,錯(cuò)誤原因是第一個(gè)逗號(hào),刪掉逗號(hào)就可以了

    2024年02月15日
    瀏覽(27)
  • bug:cv2.error: OpenCV(4.7.0)

    bug:cv2.error: OpenCV(4.7.0)

    cv2.error: OpenCV(4.7.0) D:aopencv-pythonopencv-pythonopencvmodulesobjdetectsrccascadedetect.cpp:1689: error: (-215:Assertion failed) !empty() in function \\\'cv::CascadeClassifier::detectMultiScale\\\' (1)路徑寫(xiě)錯(cuò)了,多了斜杠 (2)img = cv2.imread(“…/data/lena.jpg”) 路徑中不能有中文 路徑不對(duì)也會(huì)報(bào)錯(cuò)

    2024年02月11日
    瀏覽(21)
  • opencv cv2.imread()報(bào)錯(cuò): error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor‘

    opencv cv2.imread()報(bào)錯(cuò): error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor‘

    問(wèn)題: pycharm中使用opencv , 執(zhí)行cv2.imread(filepath)讀取圖片時(shí)報(bào)錯(cuò): cv2.error: OpenCV(4.7.0) D:aopencv-pythonopencv-pythonopencvmodulesimgprocsrccolor.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor’ 解決方案: 嘗試以下幾種方法: 1.查圖片路徑中是否有中文,盡量不要含中

    2024年02月13日
    瀏覽(28)
  • cv2.error: OpenCV(4.6.0) (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor‘

    OpenCV(4.6.0) imread 讀取空 問(wèn)題解決方法小記 詳情如下: 解決方案 1. 安裝imageio模塊 2. 代碼修改 材料參考 cv2.imread獲取圖片為空 2022-11-03關(guān)于cv2.imread()讀取圖片返回None的原因及解決辦法

    2024年03月13日
    瀏覽(99)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包