-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ocrd_page: invalidate
AlternativeImage
s automatically…
- whenever overwriting `Border`'s `Coords` or `Coords/@points`, remove all the `Page`'s derived images with `cropped` - whenever overwriting `Region`'s or `TextLine`'s or `Word`'s or `Glyph`'s `Coords` or `Coords/@points`, remove all its derived images - whenever overwriting `Page`'s or `Region`'s `@orientation`, remove all its derived images with `deskewed` - add a warning to the GdsCollector each time
- Loading branch information
Showing
5 changed files
with
275 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
def set_Coords(self, Coords): | ||
""" | ||
Set coordinate polygon by given object. | ||
Moreover, invalidate self's AlternativeImages | ||
(because they will have been cropped with a bbox | ||
of the previous polygon). | ||
""" | ||
if hasattr(self, 'invalidate_AlternativeImage'): | ||
# RegionType, TextLineType, WordType, GlyphType: | ||
self.invalidate_AlternativeImage() | ||
elif hasattr(self, 'parent_object_') and hasattr(self.parent_object_, 'invalidate_AlternativeImage'): | ||
# BorderType: | ||
self.parent_object_.invalidate_AlternativeImage(feature_selector='cropped') | ||
self.Coords = Coords |
Oops, something went wrong.