﻿# Cropping OCR corners as keypoints can leave incomplete word quadrilaterals

A practical investigation of cropping OCR corners as keypoints can leave incomplete word quadrilaterals, with explicit observations, control cases and evidence limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/field-synthetic-albumentations-keypoint-removal-ocr-quad-membership/
Language: en

## The generated-data scenario

A synthetic OCR pipeline represents each word quadrilateral as a flat sequence of corner keypoints. After cropping, it groups every surviving block of corners back into a word. If some points disappeared, a block can combine corners from different original words. The images remain valid, and coordinate bounds may pass, while the exported transcription belongs to an invented polygon.

## The generation mechanism

Albumentations documents remove_invisible as removing keypoints outside the augmented visible area, enabled by default. Associated label_fields travel with keypoints through processing. Those labels can preserve point membership, but the library does not thereby enforce the application rule that a word requires a complete ordered corner set. Point filtering and word-level annotation policy are separate operations.

## Define the dataset contract

Attach a stable word identifier and corner role to every input point. Define the intended outcome for partially cropped words: exclude the word, preserve an explicitly supported clipped geometry or use another declared target representation. Do not reconstruct groups by current list position. Retain the transcription-to-word relation independently so removing geometry cannot shift text labels onto the next surviving polygon.

## A step-by-step protocol

Prepare adjacent words with distinctive text and a crop passing through a boundary word. Apply the exact augmentation with membership labels included. Reassemble by word identity and corner role, then enforce the declared completeness policy. Overlay the reconstructed geometry and text on the output image. Include a fully visible control and a fully removed word to inspect filtering behavior.

## Evidence required for acceptance

Acceptance requires an input-to-output membership table, retained corner roles and the reason each word was kept, clipped or excluded. Check that every exported transcription has exactly the geometry required by its schema. Counting surviving keypoints or checking coordinates alone is insufficient: a numerically valid polygon assembled from unrelated corners is still a false synthetic annotation.

## Failure cases and limits

Keeping invisible points can support some downstream representations, but it does not automatically make them valid for a consumer requiring visible complete words. Record the chosen behavior rather than relying on a library default. Reading order, text shaping and later geometric transforms require separate checks. This proposed protocol establishes annotation membership preservation, not achieved OCR accuracy or general robustness to cropping.

## Primary references and related reading

Preserve word and corner membership when invisible keypoints are removed. [Albumentations invisible keypoint removal and labels](https://albumentations.ai/docs/3-basic-usage/keypoint-augmentations/); [Albumentations keypoint filtering contract](https://albumentations.ai/docs/api-reference/albumentations/core/keypoints_utils/).

The proposed investigation of albumentations keypoint removal ocr quad membership is a proposed dataset-contract review; no production dataset was generated or evaluated. Related reading: [LayoutLMv3: align external OCR words, boxes, and the rendered page](/journal/fg2-layoutlmv3-external-ocr-coordinate-contract/); [SuperPoint features: keep each descriptor attached to its selected keypoint](/journal/fg2-superpoint-keypoint-descriptor-mask-alignment/).
