mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
add examples to PikaCV
This commit is contained in:
parent
554bd00302
commit
108dbebace
10
examples/PikaCV/PikaCV_test1.py
Normal file
10
examples/PikaCV/PikaCV_test1.py
Normal file
@ -0,0 +1,10 @@
|
||||
import PikaCV as cv
|
||||
import binascii
|
||||
img = cv.Image()
|
||||
img.read("test/assets/test.jpg")
|
||||
|
||||
cv.Converter.toRGB565(img)
|
||||
print(str(binascii.b2a_hex(img.data())))
|
||||
cv.Converter.toBMP(img)
|
||||
img.write("test/out/test.bmp")
|
||||
|
17
examples/PikaCV/PikaCV_test2.py
Normal file
17
examples/PikaCV/PikaCV_test2.py
Normal file
@ -0,0 +1,17 @@
|
||||
import PikaCV as cv
|
||||
import binascii
|
||||
img = cv.Image()
|
||||
img.read("test/assets/test.jpg")
|
||||
cv.Converter.toRGB888(img)
|
||||
|
||||
Channel = img.split()
|
||||
R = Channel[0]
|
||||
G = Channel[1]
|
||||
B = Channel[2]
|
||||
|
||||
cv.Converter.toBMP(R)
|
||||
cv.Converter.toBMP(G)
|
||||
cv.Converter.toBMP(B)
|
||||
R.write("test/out/R.bmp")
|
||||
G.write("test/out/G.bmp")
|
||||
B.write("test/out/B.bmp")
|
18
examples/PikaCV/PikaCV_test3.py
Normal file
18
examples/PikaCV/PikaCV_test3.py
Normal file
@ -0,0 +1,18 @@
|
||||
import PikaCV as cv
|
||||
import binascii
|
||||
img = cv.Image()
|
||||
img.read("test/assets/test.jpg")
|
||||
cv.Converter.toRGB888(img)
|
||||
|
||||
Channel = img.split()
|
||||
R = Channel[0]
|
||||
G = Channel[1]
|
||||
B = Channel[2]
|
||||
|
||||
img1 = cv.Image()
|
||||
cv.Converter.toRGB888(img1)
|
||||
img1.merge(R,G,B)
|
||||
cv.Converter.toBMP(img1)
|
||||
img1.write("test/out/merge.bmp")
|
||||
|
||||
print("Merge done")
|
Loading…
x
Reference in New Issue
Block a user