当前位置:网站首页>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)
边栏推荐
猜你喜欢
随机推荐
Use the numbers 5, 5, 5, 1 to perform four operations. Each number should be used only once, and the operation result value is required to be 24
Driving test Baodian and its spokesperson Huang Bo appeared together to call for safe and civilized travel
Openfeign facile à utiliser
PCL calculates the intersection of three mutually nonparallel planes
Data asset management function
Solution of Xiaomi TV's inability to access computer shared files
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
Sqli labs level 8 (Boolean blind note)
ARP and ARP Spoofing
C Baidu map, Gaode map, Google map (GPS) longitude and latitude conversion
History of Web Technology
File upload Labs
Minecraft安装资源包
Tensorflow2 keras classification model
Oracle 相关统计
Installing Oracle database 19C RAC on Linux
Web security -- Logical ultra vires
Gateway is easy to use
Sqli labs Level 2
Use Wireshark to grab TCP three handshakes