欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

Read an Image in OpenCV ( Python, C++ )

系統 1655 0
原文鏈接: https://www.learnopencv.com/read-an-image-in-opencv-python-cpp/

In OpenCV you can easily read in images with different file formats (JPG, PNG, TIFF etc.) using? imread . The basic usage is shown below

C++

?

Mat imread( const string& filename, int flags=IMREAD_COLOR )

Python

?

image = cv2.imread(filename, flags = cv2.IMREAD_COLOR)

The? flags ?option is used to control how the image is read. Let’s look at some common examples. In all the examples below, make sure you use the right namespace for C++ and import OpenCV for Python.
C++

?

using namespace cv;

Python

?

import cv2

Read as 8-bit / channel Color Image ( without Alpha Channel)

A vast majority of images are 8-bit per channel ( or 24-bit ) images. They can be read using default flags.

C++

?

Mat image = imread( "image.jpg" );

Python

?

image = cv2.imread( "image.jpg" )

Read as 8-bit Grayscale Image

C++

?

Mat image = imread( "image.jpg" , IMREAD_GRAYSCALE);

Python

?

image = cv2.imread( "image.jpg" , cv2.IMREAD_GRAYSCALE)

Read 16-bit / channel Color Image

Most digital SLR cameras are capable of recording images at a higher bit depth than 8-bits / channel. The raw images from these cameras can be converted to 16-bit / channel PNG or TIFF images. These 16-bit / channel images can be read using
C++

?

Mat image = imread( "image.png" , IMREAD_ANYCOLOR | IMREAD_ANYDEPTH);

Python

?

im = cv2.imread( "image.png" , cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH)

You may also use the flag IMREAD_UNCHANGED instead. See an example below.

Read a Transparent PNG or TIFF in OpenCV

A transparent image has four channels — 3 for color, and one for transparency. These images can be read in OpenCV using the IMREAD_UNCHANGED flag.
C++

?

Mat image = imread( "image.png" , IMREAD_UNCHANGED);

Python

?

im = cv2.imread( "image.png" , cv2.IMREAD_UNCHANGED)

NOTE :? CV_LOAD_IMAGE_COLOR, CV_LOAD_IMAGE_GRAYSCALE, CV_LOAD_IMAGE_ANYCOLOR, CV_LOAD_IMAGE_ANYDEPTH, and CV_LOAD_IMAGE_UNCHANGED will be removed in future versions of OpenCV.


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 色倩网站 | 中文字幕免费 | 欧美激情精品久久久久久变态 | 日韩一区二区av | 天天色踪合 | 久久女人被添全过程A片 | 国产h视频在线观看高清 | 香港三日本三级三级三级 | 久久亚洲这里只有精品18 | 久久成人一区 | 91精品国产色综合久久 | 婷婷色婷婷 | 男女啪啪免费观看无遮挡动态图片 | 久久免费看少妇高潮A片麻豆 | 国产无线乱码一区二三区 | 欧美一区2区三区4区公司二百 | 国产成人精品永久免费视频 | hdbbwsexvideo| 黄色免费高清网站 | 成人免费视频网址 | 精品免费在线视频 | 亚洲天堂久久 | 热久久免费 | 日韩精品小视频 | 中国一级毛片在线视频 | 啪啪激情婷婷久久婷婷色五月 | 天天操91| 午夜精品久久久久久91 | 午夜影库| 黄色精品 | 欧美a级毛毛片免费视频试播 | 高清国产一区二区三区四区五区 | 国产亚洲精品久久久久久小说 | 日韩大尺度电影在线观看 | 欧美日韩一区二区三区自拍 | 国产亚洲欧美一区二区 | 久久久久久一区 | 国产欧美日韩 | 国产精品久久久久久久午夜 | 五月久久婷婷综合片丁香花 | 精品国产91亚洲一区二区三区www |