当前位置:网站首页>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)
边栏推荐
- Analysis of the use of comparable, comparator and clonable interfaces
- Npoi export word font size correspondence
- Web security -- Logical ultra vires
- Programmer training, crazy job hunting, overtime ridiculed by colleagues deserve it
- Use Wireshark to grab TCP three handshakes
- gocv边界填充
- C# 将网页保存为图片(利用WebBrowser)
- Loadbalancer dynamically refreshes Nacos server
- File upload Labs
- HCIA - application layer
猜你喜欢

Programmer training, crazy job hunting, overtime ridiculed by colleagues deserve it

STM32 new project (refer to punctual atom)

队列的基本概念介绍以及典型应用示例

Sqli labs level 8 (Boolean blind note)

Linux安装Oracle Database 19c

Googlenet network explanation and model building

OpenFeign 簡單使用

IP协议与IP地址

Web security -- core defense mechanism

Qt——如何在QWidget中设置阴影效果
随机推荐
Illegal use of crawlers, an Internet company was terminated, the police came to the door, and 23 people were taken away
Installing Oracle database 19C for Linux
Oracle 相关统计
Minecraft plug-in service opening
Qt——如何在QWidget中设置阴影效果
sqli-labs第1关
C# 调用系统声音 嘀~
Benefits of ufcs of D
Qt的connect函数和disconnect函数
Loadbalancer dynamically refreshes Nacos server
Gateway is easy to use
[blackmail virus data recovery] suffix Hydra blackmail virus
PCL calculates the intersection of three mutually nonparallel planes
Openshift container platform community okd 4.10.0 deployment
OpenShift 部署应用
Learning C
Web security -- Logical ultra vires
Classes and objects (instantiation of classes and classes, this, static keyword, encapsulation)
Web security -- core defense mechanism
kubeadm部署kubernetes v1.23.5集群