国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(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ó)家法律
泰和县| 仁布县| 东丽区| 秦安县| 江山市| 五河县| 灌云县| 连云港市| 南通市| 尚志市| 山阴县| 资溪县| 石狮市| 文安县| 龙江县| 台东市| 灵丘县| 迁安市| 平乡县| 乌兰浩特市| 汤阴县| 福州市| 务川| 清涧县| 比如县| 麦盖提县| 疏附县| 酒泉市| 名山县| 黄冈市| 靖江市| 剑河县| 长沙县| 湖州市| 师宗县| 泸西县| 台前县| 颍上县| 林周县| 通许县| 长宁区|