private static LeadRect RestrictZoneBoundsToPage(IOcrPage ocrPage, LeadRect bounds) { if (bounds.IsEmpty) { return(bounds); } LeadRect pageBounds = new LeadRect(0, 0, ocrPage.Width, ocrPage.Height); bounds = LeadRect.Intersect(pageBounds, bounds); return(bounds); }