cc31d7f56d6cd8569a5f7b47c254d89a85e8691b,skimage/transform/pyramids.py,,pyramid_laplacian,#Any#Any#Any#Any#Any#Any#Any#Any#,215
Before Change
// automatically determine sigma which covers > 99% of distribution
sigma = 2 * downscale / 6.0
layer = 0
current_shape = image.shape
smoothed_image = _smooth(image, sigma, mode, cval, multichannel)
yield image - smoothed_image
// build downsampled images until max_layer is reached or downscale process
// does not change image size
while layer != max_layer:
layer += 1
out_shape = tuple(
[math.ceil(d / float(downscale)) for d in current_shape])
if multichannel:
out_shape = out_shape[:-1]
resized_image = resize(smoothed_image, out_shape,
order=order, mode=mode, cval=cval)
smoothed_image = _smooth(resized_image, sigma, mode, cval,
multichannel)
prev_shape = np.asarray(current_shape)
current_shape = np.asarray(resized_image.shape)
// no change to previous pyramid layer
if np.all(current_shape == prev_shape):
break
yield resized_image - smoothed_image
After Change
// build downsampled images until max_layer is reached or downscale process
// does not change image size
if max_layer == -1:
max_layer = int(np.ceil(math.log(np.max(current_shape), downscale)))
for layer in range(max_layer):
out_shape = tuple(
[math.ceil(d / float(downscale)) for d in current_shape])
if multichannel:
out_shape = out_shape[:-1]
resized_image = resize(smoothed_image, out_shape,
order=order, mode=mode, cval=cval)
smoothed_image = _smooth(resized_image, sigma, mode, cval,
multichannel)
current_shape = np.asarray(resized_image.shape)
yield resized_image - smoothed_image
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: scikit-image/scikit-image
Commit Name: cc31d7f56d6cd8569a5f7b47c254d89a85e8691b
Time: 2017-04-17
Author: grlee77@gmail.com
File Name: skimage/transform/pyramids.py
Class Name:
Method Name: pyramid_laplacian
Project Name: instacart/lore
Commit Name: a294465b5e021ff9e482a04a2bc030c53d46fee7
Time: 2018-01-10
Author: montanalow@users.noreply.github.com
File Name: lore/io/connection.py
Class Name: Connection
Method Name: insert
Project Name: tsurumeso/waifu2x-chainer
Commit Name: 6e4be1285888e9caa90fa483e10b869ceb3157d4
Time: 2017-03-03
Author: nstm101339@gmail.com
File Name: waifu2x.py
Class Name:
Method Name: upscale_image