A modern iOS application built with SwiftUI that combines optical character recognition (OCR) with real-time translation capabilities. Select an image, extract text using Apple's Vision framework, and translate it instantly using the built-in Translation API.
- Image Gallery: Browse through a collection of sample images with text
- Photo Picker: Select custom images from your photo library for analysis
- Text Recognition: Extract text from images using Apple's advanced Vision framework
- Real-time Translation: Translate recognized text into multiple languages
- Modern UI: Clean, intuitive interface built with SwiftUI
- Custom Theme: Beautiful background design with consistent styling
- Progress Indicators: Visual feedback during text processing
- SwiftUI: Modern declarative UI framework
- PhotosUI: Native photo picker for custom image selection
- Vision Framework: Apple's machine learning framework for text recognition
- Translation API: Built-in iOS translation capabilities
- Swift: Native iOS development language
- iOS 17.0+: Minimum deployment target
The app includes a gallery of sample images (sign1-sign9) that demonstrate various text recognition scenarios.
ImageRecongnitionApp/
├── App/
│ └── ImageRecongnitionAppApp.swift # Main app entry point
├── Core/
│ ├── Models/
│ │ └── TextRecognizer.swift # OCR logic using Vision framework
│ ├── Views/
│ │ ├── ContentView.swift # Main navigation view
│ │ ├── ImageGalleryView.swift # Image selection grid
│ │ ├── TextRecognitionView.swift # Image display and processing
│ │ └── TranslationView.swift # Text display and translation
│ └── Modifiers/
│ └── TrailTheme.swift # Custom theme modifier
└── Resources/
└── Assets.xcassets/ # Images and app assets
- Xcode 15.0 or later
- iOS 17.0 or later
- macOS Ventura or later
- Clone the repository:
git clone https://github.com/dmakarau/ImageRecognitionApp.git- Open the project in Xcode:
cd ImageRecognitionApp
open ImageRecongnitionApp.xcodeproj- Build and run the project:
- Select your target device or simulator
- Press
Cmd + Rto build and run
- Launch the App: Open the app to see the main gallery view
- Choose an Image:
- Predefined Images: Tap on any sample image from the 3x3 grid to analyze it
- Custom Images: Tap the "Select Custom Image" button to choose a photo from your library
- View Results: The app will automatically extract text from the selected image
- Translate: Tap the "Translate" button to open the translation interface
- Choose Language: Select your target language and view the translation
The heart of the OCR functionality, using Apple's Vision framework:
- Supports both
ImageResource(bundled images) andUIImage(custom photos) - Processes images with high accuracy recognition level
- Extracts text observations and candidates
- Returns recognized text as a concatenated string
A responsive layout with both predefined and custom image options:
- 3x3 grid of navigation-enabled sample image thumbnails
- PhotosPicker integration for selecting custom images from photo library
- Seamless navigation to text recognition views
- Rounded corners and visual styling for enhanced UX
Handles the translation workflow:
- Displays recognized text with loading states
- Integrates with iOS Translation API
- Provides accessible translation interface
- Custom Theme: Consistent background and styling throughout the app
- Responsive Layout: Adapts to different screen sizes and orientations
- Loading States: Visual feedback during processing
- Navigation: Intuitive flow between screens
- iOS 17.0+
- Xcode 15.0+
- Swift 5.9+
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Camera integration for live photo capture
- Support for multiple image formats
- Text editing capabilities before translation
- History of recognized texts and custom images
- Batch processing of multiple images
- Export functionality for recognized text
- Save custom images to app's local storage
- Enhanced photo picker with cropping capabilities
This project was created as a learning exercise to explore:
- SwiftUI's modern declarative syntax
- Apple's Vision framework capabilities
- iOS Translation API integration
- Clean architecture patterns in iOS development
⭐ If you found this project helpful, please consider giving it a star!