Python opencv 讀取圖片

      網(wǎng)友投稿 767 2022-05-30

      Python opencv 讀取圖片

      環(huán)境信息

      ModelArts

      Notebook - pytorch1.4-cuda10.1-cudnn7-ubuntu18.04

      JupyterLab - Notebook - Conda-python3

      OpenCV 讀取圖片

      import cv2 --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) in ----> 1 import cv2 ModuleNotFoundError: No module named 'cv2'

      !pip install opencv-python Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple Collecting opencv-python Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/6b/73/a8921d221a673600dc744033786eeab56ed5116686a1b932b724a33003c6/opencv_python-4.5.3.56-cp37-cp37m-manylinux2014_x86_64.whl (49.9 MB) |████████████████████████████████| 49.9 MB 54.2 MB/s eta 0:00:01 | 7.1 MB 54.2 MB/s eta 0:00:01 | 9.7 MB 54.2 MB/s eta 0:00:01 | 11.8 MB 54.2 MB/s eta 0:00:01 | 15.5 MB 54.2 MB/s eta 0:00:014.2 MB/s eta 0:00:01 | 25.8 MB 54.2 MB/s eta 0:00:01 | 31.1 MB 54.2 MB/s eta 0:00:01??█████▏ | 37.6 MB 54.2 MB/s eta 0:00:01??███████████████████▎ | 44.2 MB 54.2 MB/s eta 0:00:01 Requirement already satisfied: numpy>=1.14.5 in /home/ma-user/modelarts-sdk (from opencv-python) (1.21.0) Installing collected packages: opencv-python Successfully installed opencv-python-4.5.3.56

      import cv2 img = cv2.imread("1.png") img array([[[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]], [[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]], [[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]], ..., [[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]], [[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]], [[255, 255, 255], [255, 255, 255], [255, 255, 255], ..., [255, 255, 255], [255, 255, 255], [255, 255, 255]]], dtype=uint8)

      help

      help(cv2.imread) Help on built-in function imread: imread(...) imread(filename[, flags]) -> retval . @brief Loads an image from a file. . . @anchor imread . . The function imread loads an image from the specified file and returns it. If the image cannot be . read (because of missing file, improper permissions, unsupported or invalid format), the function . returns an empty matrix ( Mat::data==NULL ). . . Currently, the following file formats are supported: . . - Windows bitmaps - \*.bmp, \*.dib (always supported) . - JPEG files - \*.jpeg, \*.jpg, \*.jpe (see the *Note* section) . - JPEG 2000 files - \*.jp2 (see the *Note* section) . - Portable Network Graphics - \*.png (see the *Note* section) . - WebP - \*.webp (see the *Note* section) . - Portable image format - \*.pbm, \*.pgm, \*.ppm \*.pxm, \*.pnm (always supported) . - PFM files - \*.pfm (see the *Note* section) . - Sun rasters - \*.sr, \*.ras (always supported) . - TIFF files - \*.tiff, \*.tif (see the *Note* section) . - OpenEXR Image files - \*.exr (see the *Note* section) . - Radiance HDR - \*.hdr, \*.pic (always supported) . - Raster and Vector geospatial data supported by GDAL (see the *Note* section) ......

      相關(guān)鏈接

      Python入門篇

      Python進階篇

      Python應(yīng)用篇

      幫助文檔-AI開發(fā)平臺ModelArts

      【生長吧!Python】有獎?wù)魑幕馃徇M行中

      備注

      歡迎各位同學一起來交流學習心得^_^

      在線課程、沙箱實驗、認證、論壇和直播,其中包含了許多優(yōu)質(zhì)的內(nèi)容,推薦了解與學習。

      AI開發(fā)平臺ModelArts OpenCV Python

      版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔相應(yīng)法律責任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實的內(nèi)容,請聯(lián)系我們jiasou666@gmail.com 處理,核實后本網(wǎng)站將在24小時內(nèi)刪除侵權(quán)內(nèi)容。

      上一篇:手把手教Golang小白搭建小米SOAR開發(fā)環(huán)境
      下一篇:數(shù)據(jù)安全是指什么?有什么意義?
      相關(guān)文章
      国产亚洲精品AA片在线观看不加载| 国产成人亚洲精品蜜芽影院| 亚洲色大成网站WWW久久九九| 亚洲爆乳成av人在线视菜奈实 | 亚洲精品美女网站| 亚洲第一成年网站大全亚洲| 亚洲国产一区在线| 亚洲第一成年男人的天堂| 久久精品亚洲综合| 亚洲国产一区国产亚洲| 久久亚洲精品成人AV| 中文字幕亚洲免费无线观看日本| 久久青青草原亚洲av无码app| 亚洲精品高清视频| 亚洲色图校园春色| 亚洲国产精品成人久久久| 亚洲人成在线中文字幕| 亚洲综合校园春色| 亚洲欧美aⅴ在线资源| 欧洲亚洲综合一区二区三区| 无码亚洲成a人在线观看| 国产亚洲精品美女久久久久| 亚洲成a人一区二区三区| 国产亚洲精品不卡在线| 亚洲精品美女久久久久99| 久久精品亚洲综合| 亚洲性一级理论片在线观看| 麻豆狠色伊人亚洲综合网站| 亚洲人成网站免费播放| MM1313亚洲国产精品| 亚洲一级Av无码毛片久久精品| 浮力影院亚洲国产第一页| 久久精品亚洲视频| 亚洲国产精品成人久久久| 最新国产精品亚洲| 国产亚洲综合一区二区三区| 亚洲色无码专区在线观看| 亚洲五月六月丁香激情| 亚洲免费在线视频观看| 亚洲欧美乱色情图片| 亚洲裸男gv网站|