-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
image API: respect order of derived image features #524
Comments
I understand the general problem and that we'll have to adapt |
To elaborate: core currently only implements 1, and this is fine as long as there is no workflow with deskewing before cropping. This can only happen on the page level, but since Also, I don't think it would be a good idea to just forbid 2. When cropping after deskewing, the resulting image will need much less (masked) margin if rotation happens first. |
Yes it is, and for the levels below page, it's the only one (because rotation on region level needs to be around the center of the region polygon, so you virtually always crop first; plus we have no
the problem is that this section is hopelessly underspecified. We should have cast the solution from core into spec long ago... |
The functions
Workspace.image_from_page
andimage_from_segment
must crop according toPage/Border/Coords
orTextRegion/Coords
, and they must rotate according toPage/@orientation
orTextRegion/@orientation
.But what if the segment has both?
These 2 approaches create different images and different coordinates. So whatever gets used, must be used consistently.
Now core is always responsible for the coordinate transformations, but not always responsible for producing derived images (as processors can create and annotate AlternativeImage themselves, which will have priority over core-generated ones if they meet all requested features). Thus, it has to know which ordering of both operations has been applied when some
AlternativeImage
has both.The only choice we have IMHO is making
AlternativeImage/@comments
order-sensitive. That is,'binarized,cropped,deskewed'
is 1 and'binarized,deskewed,cropped'
is 2.When there is no AlternativeImage yet, the decision is up to core.
For the implementation, this unfortunately means a large restructuring of both functions.
Or am I missing something?
The text was updated successfully, but these errors were encountered: