没有输出压缩图像的功能

时间:2018-09-04 08:25:54

标签: compression

我正在尝试用haarwavelet来填充图片。该功能应该可以正常工作,但是当我尝试打印时却没有任何输出,没有错误,没有任何错误...

    kvinna=sm.imread('kvinna.jpg', True)
    def imagefix(image):
a=list(np.shape(image)) #makes the shape into a list
if a[0]%2==0: #if even number of rows
    pass
else:
    image=np.delete(image, 0, 0) #delete first row
if a[1]%2==0: #if even number of columns
    pass
else:
    image=np.delete(image, 0, 1)#delete first column
return(image)

    def nomulti(picture):
a=imagefix(picture)
b=zeros(a.shape)
row=a.shape[0]
col=a.shape[1]#måste göra en lista med uddatal
udda=[]
mitt=int(col/2)
for n in range(0,col):
    if n%2!=0:
        udda.append(n)
for n in range (0,row-1):
    for k in range(0,mitt-1):
        for h in (udda):
            b[n][k]=(a[n][h-1]+a[n][h])/2
            b[n][mitt+k]=(a[n][h-1]-a[n][h])/2
return b 

0 个答案:

没有答案