编程语言
首页 > 编程语言> > python,opencv,8位图转24位图

python,opencv,8位图转24位图

作者:互联网

# -*- coding: utf-8 -*-
"""
Created on Tue Sep 11 18:50:42 2018

@author: LX
"""

import cv2
import os
def data_eight_twentyfor(filedir,savedir,i):
    list=os.listdir(filedir)
    print(len(list))
   """
    for file in os.listdir(filedir):
        img=cv2.imread(file)
        bgr2gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
        aa = cv2.cvtColor(bgr2gray,cv2.COLOR_GRAY2BGR)
        cv2.imwrite(savedir+i+'.jpg',aa)
        i=i+1
"""


if __name__=='__main__':
    filedir='D:\\thumbimg'
    savedir='D:\\newresult\\'
    i=0
    data_eight_twentyfor(filedir,savedir,i)

 

标签:__,aa,python,cv2,opencv,savedir,filedir,位图,os
来源: https://www.cnblogs.com/lely/p/10364439.html