<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Surajkumbhar on Medium]]></title>
        <description><![CDATA[Stories by Surajkumbhar on Medium]]></description>
        <link>https://medium.com/@surajkumbhar904?source=rss-75d8be7a1dcf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ocF3AkDhjgShsKJY</url>
            <title>Stories by Surajkumbhar on Medium</title>
            <link>https://medium.com/@surajkumbhar904?source=rss-75d8be7a1dcf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:21:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@surajkumbhar904/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[iOS 26: Apple Adds Native Table Detection to Vision Framework]]></title>
            <link>https://medium.com/@surajkumbhar904/ios-26-apple-adds-native-table-detection-to-vision-framework-142558ab086a?source=rss-75d8be7a1dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/142558ab086a</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[vision]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-26]]></category>
            <dc:creator><![CDATA[Surajkumbhar]]></dc:creator>
            <pubDate>Wed, 18 Jun 2025 15:36:19 GMT</pubDate>
            <atom:updated>2025-06-18T15:36:19.561Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Apple finally introduces native table detection with VisionKit. Here’s how it works and compares to the workarounds we’ve used for years.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*0VgFB3fcOUat1By6UYZCew.jpeg" /></figure><h3><strong>Introduction</strong></h3><p>If you’ve ever tried to extract structured data like tables from scanned documents or images using Apple’s Vision framework, you know how painful it used to be.</p><p>In my <a href="https://medium.com/@surajkumbhar904/-7565816fbd7c"><strong>previous article</strong></a> on reading table data using Vision and bounding box tricks, I explored how we manually identified rows and columns using VNRecognizeTextRequest geometry. That approach worked — but barely.</p><p>With iOS 26, Apple changes the game.</p><h3>Before iOS 26: The Workaround Era</h3><p>Before native table detection was introduced, detecting tabular structures required manual implementation. A typical approach involved:</p><ul><li>Detecting all text blocks using VNRecognizeTextRequest</li><li>Identifying potential table headers such as “Name”, “Email”, “Phone”, or numeric patterns</li><li>Extending bounding boxes across the page to estimate column and row boundaries</li><li>Grouping nearby text elements based on X- and Y-axis positions</li><li>Reconstructing the table structure manually from these grouped elements</li></ul><h3>Problems with this approach:</h3><ul><li>Merged cells would break it.</li><li>Misalignment or skewed scans led to misclassifications.</li><li>Row detection was unreliable without consistent spacing.</li></ul><h3><strong>What’s New: Native Table Detection in iOS 26</strong></h3><p>With the release of iOS 26, Apple introduced RecognizeDocumentsRequestIt automatically identifies tables, their rows, and columns.</p><p>You can now access an DocumentObservation object that includes an array of detected tables, complete with structure and content.</p><pre>func extractTable(from image: Data) async throws -&gt; DocumentObservation.Container.Table {<br>    let request = RecognizeDocumentsRequest()<br>    let observations = try await request.perform(on: image)<br><br>    guard let document = observations.first?.document else {<br>        throw AppError.noDocument<br>    }<br>    <br>    guard let table = document.tables.first else {<br>        throw AppError.noTable<br>    }<br>    <br>    return table<br>}</pre><h3>Parsing the Table into Structured Contacts</h3><p>Here’s how I used this to extract contact data from a scanned table:</p><pre>private func parseTable(_ table: DocumentObservation.Container.Table) -&gt; [Contact] {<br>    var contacts = [Contact]()<br>    <br>    for row in table.rows {<br>        guard let firstCell = row.first else { continue }<br>        let name = firstCell.content.text.transcript<br><br>        var detectedPhone: String? = nil<br>        var detectedEmail: String? = nil<br>        <br>        for cell in row.dropFirst() {<br>            let allDetectedData = cell.content.text.detectedData<br>            for data in allDetectedData {<br>                switch data.match.details {<br>                case .emailAddress(let email):<br>                    detectedEmail = email.emailAddress<br>                case .phoneNumber(let phoneNumber):<br>                    detectedPhone = phoneNumber.phoneNumber<br>                default:<br>                    break<br>                }<br>            }<br>        }<br><br>        if let email = detectedEmail {<br>            let contact = Contact(name: name, email: email, phoneNumber: detectedPhone)<br>            contacts.append(contact)<br>        }<br>    }<br>    return contacts<br>}</pre><h3>This gives you structured data, including:</h3><ul><li>Table bounding boxes</li><li>Rows and columns</li><li>Text content and detected types (email, phone, etc.)</li></ul><h3>Use Cases That Will Shine</h3><ul><li>Medical reports with structured test results</li><li>Expense sheets and receipts</li><li>Tabular data in contracts or legal documents</li><li>Contact info from printed directories</li></ul><p>With iOS 26, Apple has taken a big step forward in document understanding by finally introducing native table detection in the Vision framework. This update eliminates the need for complex and error-prone workarounds, making it dramatically easier to extract structured data from scanned documents.</p><p>Whether you’re building apps for document scanning, data extraction, or form processing, this new API saves time and increases accuracy — and it’s just the beginning of what’s possible with VisionKit.</p><p>If you’re working with OCR or planning to build smarter document workflows, now is the perfect time to explore what iOS 26 has to offer.</p><p>Full code: <a href="https://developer.apple.com/documentation/Vision/recognize-tables-within-a-document">Recognising tables within a document</a></p><h3><strong>Let’s Connect</strong></h3><p>Thanks for reading! If you found this helpful:</p><ul><li>Connect with me on <a href="https://www.linkedin.com/in/suraj-kumbhar-7148401ab/">LinkedIn</a></li><li>Explore my projects on <a href="https://github.com/SurajKumbhar905">GitHub</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=142558ab086a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Add Rain and Snow Effect to iOS Apps (Swift)]]></title>
            <link>https://medium.com/@surajkumbhar904/how-to-add-rain-and-snow-effect-to-ios-apps-swift-2199945c351f?source=rss-75d8be7a1dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/2199945c351f</guid>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[rain]]></category>
            <category><![CDATA[snow]]></category>
            <category><![CDATA[whether]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Surajkumbhar]]></dc:creator>
            <pubDate>Mon, 24 Feb 2025 06:47:31 GMT</pubDate>
            <atom:updated>2025-02-24T06:47:31.035Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/206/1*ojCYJ2AcanJmkYG3X_p0PQ.gif" /><figcaption>Demo app using <strong>WhetherEffectKit Framework</strong></figcaption></figure><p>Weather animations can add an immersive touch to mobile applications, making them feel more alive and engaging. When I set out to build <strong>WhetherEffectKit</strong>, I aimed to create a lightweight and easy-to-use framework that allows developers to integrate realistic weather effects into their iOS apps with minimal effort. In this article, I’ll take you through the journey of building <strong>WhetherEffectKit</strong> and how you can use it to enhance your iOS applications.</p><h3>🌟 The Idea Behind WhetherEffectKit</h3><p>I’ve always been fascinated by dynamic weather animations in apps and games. However, most existing solutions were either too complex or resource-intensive. I wanted to create a framework that was:</p><p>✅ Lightweight and efficient<br>✅ Easy to integrate with just a few lines of code<br>✅ Customizable for different weather conditions</p><p>With these goals in mind, <strong>WhetherEffectKit</strong> was born! 🚀</p><h3>🛠 How to Use WhetherEffectKit in Your App</h3><h3>1️ . Installation</h3><p>You can easily integrate <strong>WhetherEffectKit</strong> using <strong>Swift Package Manager</strong>:</p><ul><li>Open Xcode and navigate to <strong>File &gt; Add Packages</strong></li><li>Enter the repository URL:</li></ul><pre>https://github.com/SurajKumbhar905/WhetherEffectKit.git</pre><ul><li>Choose <strong>Add Package</strong> and you’re ready to go!</li></ul><h3>2️ . Adding Weather Effects</h3><p>Now, adding a weather effect is as simple as this:</p><ul><li><strong>Rain Effect</strong></li></ul><pre>WeatherEffectView(effectType: .rain, intensity: .moderate)</pre><ul><li>Supports light, moderate, and heavy intensity</li><li><strong>The Snow Effect </strong>Creates a peaceful winter ambience</li><li><strong>Lightning Bolts </strong>Automatically appear in moderate and heavy rain modes for realism</li></ul><h3>3️ . Enabling Ground Effects</h3><p>Enhance the realism by adding a <strong>ground interaction effect</strong>:</p><ul><li><strong>Rainfall or Snowfall Landing Effect</strong></li></ul><pre>RoundedRectangle(cornerRadius: 6)     <br>       .frame(width: 100, height: 200)     <br>       .overlay(         <br>                  WeatherEffectView(effectType: .rainLanding, intensity: .moderate) // or .snowLanding    <br>               )</pre><ul><li>helps create a more immersive experience by simulating the impact of precipitation on surfaces.</li></ul><h3>🏆 Final Thoughts</h3><p>WhetherEffectKit is designed to be a <strong>plug-and-play</strong> framework that effortlessly helps iOS developers add stunning weather effects. Whether you want a gentle snowfall or a dramatic thunderstorm, this framework makes it possible with just a few lines of code.</p><p>I built this to make weather effects <strong>simple and powerful</strong> for everyone. Give it a try and bring immersive weather animations to your iOS app! 🌦❄⚡</p><p>👉 Check out the GitHub repository: <a href="https://github.com/SurajKumbhar905/WhetherEffectKit.git">WhetherEffectKit</a><br>👉 Check out the Demo Project: <a href="https://github.com/SurajKumbhar905/WhetherEffectKitDemo">WhetherEffectKitDemo</a></p><p>Let me know what you think in the comments! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2199945c351f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[        …]]></title>
            <link>https://medium.com/@surajkumbhar904/-7565816fbd7c?source=rss-75d8be7a1dcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/7565816fbd7c</guid>
            <category><![CDATA[vision-kit]]></category>
            <category><![CDATA[table]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[vision]]></category>
            <dc:creator><![CDATA[Surajkumbhar]]></dc:creator>
            <pubDate>Sat, 02 Mar 2024 16:49:43 GMT</pubDate>
            <atom:updated>2024-03-02T16:49:43.124Z</atom:updated>
            <content:encoded><![CDATA[<h3>𝐂𝐫𝐞𝐚𝐭𝐢𝐧𝐠 𝐚𝐧 𝐢𝐎𝐒 𝐀𝐩𝐩 𝐟𝐨𝐫 𝐄𝐱𝐭𝐫𝐚𝐜𝐭𝐢𝐧𝐠 𝐓𝐚𝐛𝐥𝐞 𝐅𝐨𝐫𝐦𝐚𝐭 𝐃𝐚𝐭𝐚 𝐟𝐫𝐨𝐦 𝐈𝐦𝐚𝐠𝐞𝐬 𝐔𝐬𝐢𝐧𝐠 𝐕𝐢𝐬𝐢𝐨𝐧 𝐊𝐢𝐭</h3><figure><img alt="Table Text Extraction" src="https://cdn-images-1.medium.com/max/1024/1*9_kHXiKbN6xSPd0O2YKDMw.png" /></figure><p><strong>Introduction:</strong></p><p>In the realm of mobile applications, the ability to extract and interpret data from images is a game-changer. Whether it’s scanning receipts, extracting text from documents, or recognizing objects, this capability opens up a world of possibilities for developers. However, when it comes to extracting tabular data from images, the challenge becomes more complex. Traditional OCR (Optical Character Recognition) techniques may struggle to accurately interpret tables. Fortunately, with the advent of Vision Kit in iOS, developers now have a powerful tool at their disposal to tackle this challenge head-on.</p><p><strong>Understanding Vision Kit:</strong></p><p>Vision Kit is a framework provided by Apple that allows developers to perform high-level image analysis tasks on iOS devices. It offers a wide range of capabilities, including face detection, object tracking, text recognition, and more. With its sophisticated algorithms and integration with Core ML, Vision Kit empowers developers to build advanced computer vision applications with ease.</p><p><strong>Here’s a brief overview of how to get started:</strong></p><p><strong>Create a New Project In Xcode</strong></p><p>We will develop a product shopping app using Swift. To initiate a new iOS project in Xcode, start by naming your product and selecting your preferred interface option: Storyboard or SwiftUI. In this tutorial, I’ve chosen Storyboard and opted for the Swift language. Once you’ve made your selections, proceed by clicking the “Next” button.</p><p><strong>Step 1: Import vision to access vision features</strong></p><pre>import Vision</pre><p><strong>Step 2: Write a function to extract the data from the table image</strong></p><pre>func recognizeTextFromTableVertical(in image: UIImage) {<br>   // Code Logic Here<br>}</pre><p><strong>Step 3: Make sure your image is supported by cgImage. Create VNImageRequestHandler and calculate the size and bounds of the image</strong></p><pre>guard let cgImage = image.cgImage else { return }<br>let size = CGSize(width: cgImage.width, height: cgImage.height)<br>let bounds = CGRect(origin: .zero, size: size)<br>        <br>let imageRequestHandler = VNImageRequestHandler(cgImage: cgImage, orientation: .up)<br>// The orientation is according to you image in this i we are using the .up <br>// if your using the imagePicker or any ather library to access image conferm their orientation first</pre><p><strong>Step 4: Converting the bounding box according to your image width and height</strong></p><pre> func convert(boundingBox: CGRect, to bounds: CGRect) -&gt; CGRect {<br>        let imageWidth = bounds.width<br>        let imageHeight = bounds.height<br>        <br>        // Begin with input rect.<br>        var rect = boundingBox<br>        <br>        // Reposition origin.<br>        rect.origin.x *= imageWidth<br>        rect.origin.x += bounds.minX<br>        rect.origin.y = (1 - rect.maxY) * imageHeight + bounds.minY<br>        <br>        // Rescale normalized coordinates.<br>        rect.size.width *= imageWidth<br>        rect.size.height *= imageHeight<br>        <br>        return rect<br>    }</pre><p><strong>Step 5: Creating a VNRecognizeTextRequest for extracting text from the image</strong></p><pre>let request = VNRecognizeTextRequest { [self] request, error in<br>    guard let results = request.results as? [VNRecognizedTextObservation],<br>     error == nil<br>     else { return }<br><br> let rects = results.map {<br>   convert(boundingBox: $0.boundingBox, to: CGRect(origin: .zero, size: size))<br>   // Converting Bounding Box according to image height and width<br>  }</pre><p><strong>Step 6: We want to create an algorithm to find the text</strong></p><p>We want to create an algorithm to find the text, and if the text is found, we want to adjust their bounding box according to our needs and attach that bounding box to targetBoundingBoxes to key as that word.</p><pre>for targetWord in keyWordArray {<br>    for result in results {<br>        if let candidate = result.topCandidates(1).first, candidate.string.lowercased() == targetWord.lowercased() {<br>           var boundingBox = convert(boundingBox: result.boundingBox, to: CGRect(origin: .zero, size: size))<br><br>           boundingBox.size.height += bounds.width <br>           // Extend the height by imageWidth so the bounding box extend till the image height and boundimg box width is word width<br><br>           targetBoundingBoxes[targetWord] = boundingBox<br><br>         }<br>       }<br>    }</pre><p><strong>Step 7: Extract the particular column or row</strong></p><p>Currently, we are identifying all words whose bounding boxes intersect with each of the target bounding boxes. and put the text into a variable, and then draw the target bounding boxes with green colour and the rest of the in red colour on the image.</p><pre>            for (_, boundingBox) in targetBoundingBoxes {<br>                var textInsideTargetBox = &quot;&quot;<br>                for result in results {<br>                      // get all word bounding boxes<br>                    let boundingBox1 = convert(boundingBox: result.boundingBox, to: CGRect(origin: .zero, size: size))<br>                    if boundingBox.intersects(boundingBox1), let text = result.topCandidates(1).first?.string {<br>                       // if word boundingBox intersect with the word bounding box get that word and store that word<br>                        textInsideTargetBox += &quot;\(text)\n&quot; <br>                    }<br>                    <br>                }<br>                <br>                DispatchQueue.main.async { [self] in<br>                    resultTextLabel.text = textInsideTargetBox<br>                    // here we display the word <br>                }<br>                <br>                <br>                let format = UIGraphicsImageRendererFormat()<br>                format.scale = 1<br>                let finalImage = UIGraphicsImageRenderer(bounds: bounds, format: format).image { _ in<br>                    image.draw(in: bounds)<br>                    UIColor.green.setStroke()<br>                    // main bounding box with green color<br>                    let path = UIBezierPath(rect: boundingBox)<br>                    path.lineWidth = 9<br>                    path.stroke()<br>                    UIColor.red.setStroke()<br>                   // word bounding box with green color<br>                    for rect in rects {<br>                        let path = UIBezierPath(rect: rect)<br>                        path.lineWidth = 1<br>                        path.stroke()<br>                    }<br>                }<br>                DispatchQueue.main.async { [self] in<br>                    ImageView.image = finalImage<br>                    // here we display the image with bounding boxes<br>                }<br>            }<br>} // request bracket</pre><p><strong>Step 8: Now perform the VNRecognizeTextRequest in VNImageRequestHandler</strong></p><pre> DispatchQueue.global(qos: .userInitiated).async {<br>       do {<br>           try imageRequestHandler.perform([request])<br>           // Perform the imageRequestHandler <br>       } catch {<br>           print(&quot;Failed to perform image request: \(error)&quot;)<br>           return<br>       }<br>   }</pre><p><strong>Full Function for the Column / Vertical text extraction</strong></p><pre>   func recognizeTextFromTableVertical(in image: UIImage) {<br>        <br>        guard let cgImage = image.cgImage else { return }<br>        let size = CGSize(width: cgImage.width, height: cgImage.height)<br>        let bounds = CGRect(origin: .zero, size: size)<br>        <br>        let imageRequestHandler = VNImageRequestHandler(cgImage: cgImage, orientation: .up)<br>        let request = VNRecognizeTextRequest { [self] request, error in<br>            guard<br>                let results = request.results as? [VNRecognizedTextObservation],<br>                error == nil<br>            else { return }<br>            <br>            let rects = results.map {<br>                convert(boundingBox: $0.boundingBox, to: CGRect(origin: .zero, size: size))<br>            }<br>            <br>            <br>            var targetBoundingBoxes: [String: CGRect] = [:]<br>            let keyWordArray :[String] = [&quot;Salesperson&quot;]<br>            <br>            for targetWord in keyWordArray {<br>                for result in results {<br>                    if let candidate = result.topCandidates(1).first, candidate.string.lowercased() == targetWord.lowercased() {<br>                        var boundingBox = convert(boundingBox: result.boundingBox, to: CGRect(origin: .zero, size: size))<br>                        boundingBox.size.height += bounds.width // Extend the width by xExtension<br>                        targetBoundingBoxes[targetWord] = boundingBox<br>                        <br>                    }<br>                }<br>            }<br>            <br>            <br>            for (_, boundingBox) in targetBoundingBoxes {<br>                var textInsideTargetBox = &quot;&quot;<br>                for result in results {<br>                    let boundingBox1 = convert(boundingBox: result.boundingBox, to: CGRect(origin: .zero, size: size))<br>                    if boundingBox.intersects(boundingBox1), let text = result.topCandidates(1).first?.string {<br>                        textInsideTargetBox += &quot;\(text)\n&quot;<br>                    }<br>                    <br>                }<br>                <br>                DispatchQueue.main.async { [self] in<br>                    resultTextLabel.text = textInsideTargetBox<br>                }<br>                <br>                <br>                <br>                <br>                let format = UIGraphicsImageRendererFormat()<br>                format.scale = 1<br>                let finalImage = UIGraphicsImageRenderer(bounds: bounds, format: format).image { _ in<br>                    image.draw(in: bounds)<br>                    UIColor.green.setStroke()<br><br>                    let path = UIBezierPath(rect: boundingBox)<br>                    path.lineWidth = 9<br>                    path.stroke()<br>                    UIColor.red.setStroke()<br>                    for rect in rects {<br>                        let path = UIBezierPath(rect: rect)<br>                        path.lineWidth = 1<br>                        path.stroke()<br>                    }<br><br>                }<br>                DispatchQueue.main.async { [self] in<br>                    ImageView.image = finalImage<br>                }<br>            }<br>            <br>            <br>        }<br>        <br>        DispatchQueue.global(qos: .userInitiated).async {<br>            do {<br>                try imageRequestHandler.perform([request])<br>            } catch {<br>                print(&quot;Failed to perform image request: \(error)&quot;)<br>                return<br>            }<br>        }<br>    }<br><br>    func convert(boundingBox: CGRect, to bounds: CGRect) -&gt; CGRect {<br>        let imageWidth = bounds.width<br>        let imageHeight = bounds.height<br>        <br>        // Begin with input rect.<br>        var rect = boundingBox<br>        <br>        // Reposition origin.<br>        rect.origin.x *= imageWidth<br>        rect.origin.x += bounds.minX<br>        rect.origin.y = (1 - rect.maxY) * imageHeight + bounds.minY<br>        <br>        // Rescale normalized coordinates.<br>        rect.size.width *= imageWidth<br>        rect.size.height *= imageHeight<br>        <br>        return rect<br>    }</pre><p>You can detect the row/ Horizontal text also you need to just modify the algorithm and you are done.</p><p><strong>here is the code</strong></p><pre>    func recognizeTextFromTableHorizhontal(in image: UIImage) {<br>        guard let cgImage = image.cgImage else { return }<br>        let imageRequestHandler = VNImageRequestHandler(cgImage: cgImage, orientation: .up)<br>        <br>        let size = CGSize(width: cgImage.width, height: cgImage.height)<br>        let bounds = CGRect(origin: .zero, size: size)<br>        let request = VNRecognizeTextRequest { [self] request, error in<br>            guard<br>                let results = request.results as? [VNRecognizedTextObservation],<br>                error == nil<br>            else { return }<br>            <br>            let rects = results.map {<br>                convert(boundingBox: $0.boundingBox, to: CGRect(origin: .zero, size: size))<br>            }<br>            <br>            <br>            var targetBoundingBoxes: [String: CGRect] = [:]<br>            let keyWordArray :[String] = [&quot;Bromley&quot;]<br>            for targetWord in keyWordArray {<br>                for result in results {<br>                    if let candidate = result.topCandidates(1).first, candidate.string.lowercased() == targetWord.lowercased() {<br>                        var boundingBox = convert(boundingBox: result.boundingBox, to: CGRect(origin: .zero, size: size))<br>                        boundingBox.size.width += bounds.width  <br>                      // Extend the width by bunding box width <br>                        targetBoundingBoxes[targetWord] = boundingBox<br>                        <br>                    }<br>                }<br>            }<br>            <br>            <br>            for (word, boundingBox) in targetBoundingBoxes {<br>                print(&quot;Bounding box of &#39;\(word)&#39;: \(boundingBox)&quot;)<br>                <br>                var textInsideTargetBox = &quot;&quot;<br>                for result in results {<br>                    let boundingBox1 = convert(boundingBox: result.boundingBox, to: CGRect(origin: .zero, size: size))<br>                    if boundingBox.intersects(boundingBox1), let text = result.topCandidates(1).first?.string {<br>                        textInsideTargetBox += &quot;\(text)\n &quot;<br>                    }<br>                    <br>                }<br>                DispatchQueue.main.async { [self] in<br>                    resultTextLabel.text = textInsideTargetBox<br>                }<br>                <br>                <br>                <br>                <br>                let format = UIGraphicsImageRendererFormat()<br>                format.scale = 1<br>                let final = UIGraphicsImageRenderer(bounds: bounds, format: format).image { _ in<br>                    image.draw(in: bounds)<br>                    UIColor.green.setStroke()<br>                    let path = UIBezierPath(rect: boundingBox)<br>                    path.lineWidth = 9<br>                    path.stroke()<br>                    UIColor.red.setStroke()<br>                    for rect in rects {<br>                        let path = UIBezierPath(rect: rect)<br>                        path.lineWidth = 1<br>                        path.stroke()<br>                    }<br>                }<br>                DispatchQueue.main.async { [self] in<br>                    ImageView.image = final<br>                }<br>            }<br>            <br>            <br>            <br>        }<br>        <br>        DispatchQueue.global(qos: .userInitiated).async {<br>            do {<br>                try imageRequestHandler.perform([request])<br>            } catch {<br>                print(&quot;Failed to perform image request: \(error)&quot;)<br>                return<br>            }<br>        }<br>    }<br><br> func convert(boundingBox: CGRect, to bounds: CGRect) -&gt; CGRect {<br>        let imageWidth = bounds.width<br>        let imageHeight = bounds.height<br>        <br>        // Begin with input rect.<br>        var rect = boundingBox<br>        <br>        // Reposition origin.<br>        rect.origin.x *= imageWidth<br>        rect.origin.x += bounds.minX<br>        rect.origin.y = (1 - rect.maxY) * imageHeight + bounds.minY<br>        <br>        // Rescale normalized coordinates.<br>        rect.size.width *= imageWidth<br>        rect.size.height *= imageHeight<br>        <br>        return rect<br>    }</pre><p><strong>Conclusion:</strong></p><p>With the power of Vision Kit in iOS, developers can now unlock the potential to extract table format data from images with unprecedented accuracy and efficiency. By leveraging advanced image analysis techniques and machine learning algorithms, developers can build innovative applications that transform how we interact with visual information. Whether it’s digitizing receipts, extracting data from documents, or analyzing financial reports, the possibilities are endless. So why wait? Start exploring the capabilities of Vision Kit today and revolutionize your data extraction workflows on iOS.</p><p>here is the full code <a href="https://github.com/SurajKumbhar905/VisionTableReader"><strong>Github</strong></a> also check my <a href="https://www.linkedin.com/in/suraj-kumbhar-7148401ab/"><strong><em>LinkedIn</em></strong></a> Profile</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7565816fbd7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>