go - 如何使用 gocv 将图像的 Alpha 通道转换为白色?
问题描述
如何使用 gocv 将图像的 Alpha 通道转换为白色?抱歉,我找不到文档。
package main
import (
"fmt"
"os"
"gocv.io/x/gocv"
)
func main() {
inputs := "test.png"
img := gocv.IMRead(inputs, gocv.IMReadUnchanged)
defer img.Close()
if img.Empty() {
fmt.Printf("cannot read image %s\n", inputs)
os.Exit(1)
}
// how to convert alpha channel of the image to white color
gocv.Split(img)
}
解决方案
推荐阅读
- android - 使用 Ffmpeg 与多个图像交叉淡入淡出动画
- facebook-graph-api - 卡在“广告 API 访问级别:开发”上
- javascript - 以编程方式触发量角器测试
- python - 变量不随程序变化
- php - 不推荐将声明复制为标头,并将从 v4.0 中删除 - lcobucci/jwt 包中的 Laravel Passport 问题
- osgi - Proguard 保留选项来处理 OSGi 声明式服务
- c - 如何添加 for 循环的所有元素?
- c++ - 完美的转发和移动
- sql - TypeORM 减去日期 00:00:00 的 1 天(可能是一个繁琐的错误)
- c++ - Linux IPC机制在多个进程中同时触发事件?