In [1]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
In [2]:
PATH = 'lilacsat1-data/'
In [3]:
yy = np.fromfile(PATH + '654_dk3wn.jpg', dtype='uint8')[:0x3b72]
y = np.fromfile(PATH + '654.jpg', dtype='uint8')[:0x3b72]
x = np.fromfile(PATH + '654_dk3wn_2.jpg', dtype='uint8')[:0x3b72]
In [4]:
plt.imshow((x==0)[:x.size//64*64].reshape((-1,64)), aspect = 0.2)
Out[4]:
In [5]:
plt.imshow((yy==0)[:yy.size//64*64].reshape((-1,64)), aspect = 0.2)
Out[5]:
In [6]:
missing = np.all((x==0)[:x.size//64*64].reshape((-1,64)), axis=1)
In [7]:
plt.imshow((y==0)[:y.size//64*64].reshape((-1,64)), aspect = 0.2)
Out[7]:
In [8]:
z = x.copy()
z[:z.size//64*64].reshape((-1,64))[missing,:] = y[:y.size//64*64].reshape((-1,64))[missing,:]
In [9]:
missing = np.all((z==0)[:z.size//64*64].reshape((-1,64)), axis=1)
z[:z.size//64*64].reshape((-1,64))[missing,:] = yy[:yy.size//64*64].reshape((-1,64))[missing,:]
In [10]:
plt.imshow((z==0)[:z.size//64*64].reshape((-1,64)), aspect = 0.2)
Out[10]:
In [11]:
z.tofile(PATH + '654_fixed.jpg')
In [12]:
x = np.fromfile(PATH + '653.jpg', dtype='uint8')[:0x4324]
y = np.fromfile(PATH + '653_dk3wn.jpg', dtype='uint8')[:0x4324]
yy = np.fromfile(PATH + '653_2.jpg', dtype='uint8')[:0x4324]
In [13]:
plt.imshow((x==0)[:x.size//64*64].reshape((-1,64)), aspect = 0.2)
Out[13]:
In [14]:
missing = np.all((x==0)[:x.size//64*64].reshape((-1,64)), axis=1)
In [15]:
plt.imshow((y==0)[:y.size//64*64].reshape((-1,64)), aspect = 0.2)
Out[15]:
In [16]:
z = x.copy()
z[:z.size//64*64].reshape((-1,64))[missing,:] = y[:y.size//64*64].reshape((-1,64))[missing,:]
In [17]:
plt.imshow((z==0)[:z.size//64*64].reshape((-1,64)), aspect = 0.2)
Out[17]:
In [18]:
plt.imshow((yy==0)[:yy.size//64*64].reshape((-1,64)), aspect = 0.2)
Out[18]:
In [19]:
missing = np.all((z==0)[:z.size//64*64].reshape((-1,64)), axis=1)
z[:z.size//64*64].reshape((-1,64))[missing,:] = yy[:yy.size//64*64].reshape((-1,64))[missing,:]
In [20]:
plt.imshow((z==0)[:z.size//64*64].reshape((-1,64)), aspect = 0.2)
Out[20]:
In [21]:
plt.imshow((z!=yy)[:z.size//64*64].reshape((-1,64))[105:140,:], aspect = 1)
Out[21]:
In [22]:
z[:z.size//64*64].reshape((-1,64))[105:107,:] = y[:y.size//64*64].reshape((-1,64))[105:107,:]
z[:z.size//64*64].reshape((-1,64))[129,:] = yy[:y.size//64*64].reshape((-1,64))[129,:]
In [23]:
plt.imshow((z!=yy)[:z.size//64*64].reshape((-1,64))[129:135,:], aspect = 1)
Out[23]:
In [24]:
z.tofile(PATH + '653_fixed.jpg')