Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
aecfcd35
Commit
aecfcd35
authored
Sep 23, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improc: ass2 draw border around affine transformed region in original image.
parent
2393aae2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
improc/ass2/affine.py
improc/ass2/affine.py
+9
-2
No files found.
improc/ass2/affine.py
View file @
aecfcd35
from
interpolation
import
pv
from
interpolation
import
pv
from
pylab
import
array
,
matrix
,
zeros
,
show
from
pylab
import
array
,
matrix
,
zeros
,
show
,
subplot
,
plot
,
figure
from
numpy.linalg
import
lstsq
,
inv
from
numpy.linalg
import
lstsq
# url: http://www.leptonica.com/affine.html
# url: http://www.leptonica.com/affine.html
...
@@ -56,5 +56,12 @@ if __name__ == '__main__':
...
@@ -56,5 +56,12 @@ if __name__ == '__main__':
result
=
affine_transform
(
image
,
(
0.
,
half_height
),
(
half_width
,
0.
),
result
=
affine_transform
(
image
,
(
0.
,
half_height
),
(
half_width
,
0.
),
(
image
.
shape
[
0
],
half_height
),
128
,
128
)
(
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'
)
imshow
(
result
,
cmap
=
'gray'
)
show
()
show
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment