extract table in images
Asked on 06/16/2025
2 searches
To extract tables from images, you can use the Vision framework's Recognized Documents request. This API allows you to detect and extract structured elements like tables from documents. Here's a brief overview of how it works:
-
Capture the Image: Take a photo of the document using a device like an iPad.
-
Create a Recognized Documents Request: Use this request to detect tables within the image. The request will return a document observation, which contains the structure of the document, including tables.
-
Extract Table Structure: Access the
tables
property on the document observation to extract tables. Each table is composed of a 2D array of cells, which can be accessed by rows or columns. The table's boundary is defined as the bounding region, providing coordinates relative to the image. -
Access Table Content: Each cell in the table has properties indicating its row and column. The content of a cell can include text, tables, lists, or barcodes. You can extract text from each cell using the transcript, which provides all text in a cell as a single string.
For more detailed information, you can refer to the session "Read documents using the Vision framework" from WWDC 2025. Here's a link to the session where table extraction is discussed in detail.

Read documents using the Vision framework
Learn about the latest advancements in the Vision framework. We’ll introduce RecognizeDocumentsRequest, and how you can use it to read lines of text and group them into paragraphs, read tables, etc. And we’ll also dive into camera lens smudge detection, and how to identify potentially smudged images in photo libraries or your own camera capture pipeline.

Code-along: Elevate an app with Swift concurrency
Learn how to optimize your app’s user experience with Swift concurrency as we update an existing sample app. We’ll start with a main-actor app, then gradually introduce asynchronous code as we need to. We’ll use tasks to optimize code running on the main actor, and discover how to parallelize code by offloading work to the background. We’ll explore what data-race safety provides, and work through interpreting and fixing data-race safety errors. Finally, we’ll show how you can make the most out of structured concurrency in the context of an app.

Improve memory usage and performance with Swift
Discover ways to improve the performance and memory management of your Swift code. We’ll explore ways to refine your code – from making high-level algorithmic changes to adopting the new InlineArray and Span types for finer control over memory and allocations.