最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

【BadApple】badApple但壞掉的我并且是800年前畫質(zhì),新人爛活

2023-06-23 03:34 作者:落魄小程序員  | 我要投稿

#代碼極其簡(jiǎn)單:

import CV2 as cv

import os

import time


def PlayVideo(fileName):

? ? # 替換字符列表

? ? ascii_char = list(r" █")

? ? char_len = len(ascii_char)

? ? # 加載視頻

? ? cap = cv.VideoCapture(fileName)

? ? termSize = os.get_terminal_size()

? ? texts = []

? ? while True:

? ? ? ? # 讀取視頻每一幀 跳幀

? ? ? ? for i in range(3):

? ? ? ? ? ? hasFrame, frame = cap.read()

? ? ? ? if not hasFrame:

? ? ? ? ? ? break

? ? ? ? # 視頻長(zhǎng)寬

? ? ? ? width = frame.shape[0]

? ? ? ? height = frame.shape[1]

? ? ? ? # 轉(zhuǎn)灰度圖

? ? ? ? img_gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)

? ? ? ? # 縮小圖片并調(diào)整長(zhǎng)寬比

? ? ? ? img_resize = cv.resize(img_gray, (termSize.columns, termSize.lines - 1))

? ? ? ? text = ''

? ? ? ? # 遍歷圖片中的像素

? ? ? ? for row in img_resize:

? ? ? ? ? ? for pixel in row:

? ? ? ? ? ? ? ? # 根據(jù)像素值,選取對(duì)應(yīng)的字符

? ? ? ? ? ? ? ? text += ascii_char[int(pixel / 256 * char_len)]

? ? ? ? ? ? text += '\n'

? ? ? ? texts.append(text)

? ? ? ?

? ? for text in texts:

? ? ? ? # 清屏

? ? ? ? os.system('clear')

? ? ? ? print(text)

? ? ? ? time.sleep(0.005)

# PlayVideo END


filename = input("視頻文件名:")

PlayVideo(filename)

【BadApple】badApple但壞掉的我并且是800年前畫質(zhì),新人爛活的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
泰州市| 望江县| 玉屏| 宝坻区| 安国市| 成都市| 四川省| 巫溪县| 阿图什市| 灵璧县| 区。| 甘孜县| 清流县| 当阳市| 仁怀市| 遵义市| 长乐市| 湘潭市| 昂仁县| 清流县| 慈溪市| 措美县| 云梦县| 棋牌| 昌乐县| 松溪县| 吉隆县| 武平县| 安阳县| 南充市| 弥勒县| 隆化县| 阿拉善右旗| 宁海县| 扶绥县| 安国市| 大冶市| 西贡区| 许昌市| 祁东县| 宁河县|