当前位置:网站首页>Gocv split color channel
Gocv split color channel
2022-07-02 08:51:00 【Tutu is a cat】
gocv Split picture color channel
Open the window
window := gocv.NewWindow("Hello")
Set window mode adaptation
window.SetWindowProperty(gocv.WindowPropertyAutosize,gocv.WindowAutosize)
Read the picture
read := gocv.IMRead("image/front.jpg", gocv.IMReadColor)
View picture type
fmt.Println(read.Type())
Split color channel ( After the image is split 3 The channels are BGR)
var rgbChan1 []gocv.Mat
bgrChan := gocv.Split(read)
The color of each channel after image splitting
//blue:= bgrChan[0]
green := bgrChan[1]
//red := bgrChan[2]
New black picture
back_ch := gocv.Zeros(read.Rows(),read.Cols(),gocv.MatTypeCV8UC1)
Combine this channel with the black picture 3 Channel picture
rgbChan1 = append(rgbChan1,back_ch)
rgbChan1 = append(rgbChan1,green)
rgbChan1 = append(rgbChan1,back_ch)
establish 3 Channel new picture
image := gocv.NewMatWithSize(read.Rows(),read.Cols(),gocv.MatTypeCV8UC3)
Combine the above channels with pictures and show
gocv.Merge(rgbChan1,&image)
window.IMShow(image)
window.WaitKey(0)
边栏推荐
- gocv图片读取并展示
- Using recursive functions to solve the inverse problem of strings
- Judge whether it is Sudoku
- Sqli labs level 1
- OpenShift 容器平台社区版 OKD 4.10.0部署
- Luogu greedy part of the backpack line segment covers the queue to receive water
- Classes and objects (instantiation of classes and classes, this, static keyword, encapsulation)
- Honeypot attack and defense drill landing application scheme
- 群辉 NAS 配置 iSCSI 存储
- Hcia - Application Layer
猜你喜欢

Aneng logistics' share price hit a new low: the market value evaporated by nearly 10 billion yuan, and it's useless for chairman Wang Yongjun to increase his holdings

Hcia - Application Layer

HCIA—应用层

kubeadm部署kubernetes v1.23.5集群

C nail development: obtain all employee address books and send work notices

整理秒杀系统的面试必备!!!

Minecraft module service opening

Kubesphere virtualization KSV installation experience

sqli-labs第8关(布尔盲注)

群辉 NAS 配置 iSCSI 存储
随机推荐
Openfeign facile à utiliser
Getting started with k8s: building MySQL with Helm
Luogu greedy part of the backpack line segment covers the queue to receive water
Solid principle: explanation and examples
路由基础—动态路由
Select sort and insert sort
gocv opencv exit status 3221225785
[blackmail virus data recovery] suffix Rook3 blackmail virus
1、 QT's core class QObject
Tensorflow2 keras classification model
IP协议与IP地址
kubernetes部署loki日志系统
Finishing the interview essentials of secsha system!!!
Web技术发展史
Googlenet network explanation and model building
HCIA—应用层
OpenFeign 简单使用
sqli-labs(POST类型注入)
C#钉钉开发:取得所有员工通讯录和发送工作通知
队列的基本概念介绍以及典型应用示例