Skip to content
Snippets Groups Projects
Commit aecfcd35 authored by Sander Mathijs van Veen's avatar Sander Mathijs van Veen
Browse files

improc: ass2 draw border around affine transformed region in original image.

parent 2393aae2
No related branches found
No related tags found
No related merge requests found
from interpolation import pv
from pylab import array, matrix, zeros, show
from numpy.linalg import lstsq, inv
from pylab import array, matrix, zeros, show, subplot, plot, figure
from numpy.linalg import lstsq
# url: http://www.leptonica.com/affine.html
......@@ -56,5 +56,12 @@ if __name__ == '__main__':
result = affine_transform(image, (0., half_height), (half_width, 0.),
(image.shape[0], half_height), 128, 128)
figure(1)
subplot(121)
x = [0, half_width, image.shape[0], half_width, 0]
y = [half_height, 0, half_height, image.shape[1], half_height]
plot(x, y, '-')
imshow(image, cmap='gray')
subplot(122)
imshow(result, cmap='gray')
show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment