Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
iiif-image-manipulation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labs-team
iiif-image-manipulation
Commits
3abc0a44
Commit
3abc0a44
authored
4 years ago
by
smayer
Browse files
Options
Downloads
Patches
Plain Diff
Added sketch for tiling algorithm.
parent
c048ae96
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
stitching/create_tiles.py
+47
-0
47 additions, 0 deletions
stitching/create_tiles.py
with
47 additions
and
0 deletions
stitching/create_tiles.py
0 → 100644
+
47
−
0
View file @
3abc0a44
from
scan
import
*
class
Tile
:
def
__init__
(
self
,
side_length
=
100
,
top_left
=
(
0
,
0
),
roi
=
(
0
,
0
,
100
,
100
),
img_names
=
None
):
self
.
side_length
=
side_length
self
.
top_left
=
top_left
self
.
roi
=
roi
self
.
img_names
=
img_names
def
draw
(
self
):
if
self
.
img_names
is
None
:
raise
EmptyTileError
pass
def
load_image
(
self
,
img_name
,
directory
):
pass
def
move
(
self
):
if
self
.
is_out_of_roi
():
raise
OutOfBoundsError
def
is_out_of_roi
(
self
):
pass
def
has_overlap
(
self
,
vertices
):
pass
def
check_intersections
(
self
,
data
):
pass
class
EmptyTileError
(
Exception
):
pass
class
OutOfBoundsError
(
Exception
):
pass
if
__name__
==
'
__main__
'
:
with
open
(
'
10pct_stitch_data.json
'
,
'
r
'
)
as
fp
:
all_comp
=
json
.
load
(
fp
)
print
(
get_roi
(
all_comp
))
scaled_all
=
scale_data
(
all_comp
,
10
)
for
dat
in
all_comp
:
print
(
dat
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment