teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

文言修正

2021/01/22 13:08

投稿

SHOMI
SHOMI

スコア4079

answer CHANGED
@@ -1,6 +1,6 @@
1
- [前の質問](https://teratail.com/questions/317077#reply-441512)
1
+ [前の質問](https://teratail.com/questions/317077#reply-441512)でも書きましたが`cv::imread()`の第2引数を省略して(デフォルト引数の`IMREAD_COLOR`により)3channel BGRとして読み込んでいるのですからアルファチャンネルがないのは当然です。
2
- でも書きましたが`cv::imread`の第2引数を省略して3channel BGRとして読み込んでいるのですからアルファチャンネルがないのは当然です。
3
- [`IMREAD_UNCHANGED`](https://docs.opencv.org/4.5.1/d8/d6a/group__imgcodecs__flags.html#ga61d9b0126a3e57d9277ac48327799c80)を指定してください。
2
+ アルファチャンネルも読み込みたいのであれば[`IMREAD_UNCHANGED`](https://docs.opencv.org/4.5.1/d8/d6a/group__imgcodecs__flags.html#ga61d9b0126a3e57d9277ac48327799c80)を指定してください。
4
3
  |Enumerator||
5
4
  |:--|:--|
5
+ |IMREAD_COLOR|If set, always convert image to the 3 channel BGR color image.|
6
6
  |IMREAD_UNCHANGED|If set, return the loaded image as is (with alpha channel, otherwise it gets cropped). Ignore EXIF orientation.|