A real-time edge detection viewer that demonstrates integration between Android native development, OpenCV C++ processing, OpenGL ES rendering, and TypeScript web components.
- Camera Integration: Real-time camera feed using CameraX API
 - JNI Bridge: Seamless Java β C++ communication
 - OpenCV Processing: Canny edge detection implemented in C++
 - OpenGL ES Rendering: Hardware-accelerated frame rendering
 - FPS Counter: Real-time performance monitoring
 - Toggle Controls: Switch between raw and processed views
 
- Frame Display: HTML5 Canvas-based frame rendering
 - Performance Stats: Real-time FPS, resolution, and processing time display
 - Interactive Controls: Toggle between raw/processed views
 - Frame Saving: Export processed frames as PNG
 - Responsive Design: Mobile-friendly interface
 
- Modular Structure: Clean separation of concerns
 - Native Performance: C++ OpenCV processing for optimal speed
 - Cross-Platform: Android native + web viewer
 - Real-time Processing: 10-15 FPS target performance
 
android-opencv-opengl-assessment/
βββ app/                          # Android Application
β   βββ src/main/
β   β   βββ java/com/example/opencvapp/
β   β   β   βββ MainActivity.kt           # Main Android activity
β   β   β   βββ jni/OpenCVProcessor.kt   # JNI bridge
β   β   βββ cpp/
β   β   β   βββ CMakeLists.txt           # CMake configuration
β   β   βββ res/                         # Android resources
β   β   βββ AndroidManifest.xml
β   βββ build.gradle                     # App build configuration
βββ jni/                          # Native C++ Code
β   βββ opencv_processor.cpp      # OpenCV processing implementation
βββ gl/                           # OpenGL Renderer
β   βββ OpenGLRenderer.kt         # OpenGL ES 2.0 renderer
βββ web/                          # TypeScript Web Viewer
β   βββ src/
β   β   βββ index.ts              # Main web application
β   β   βββ FrameViewer.ts        # Frame display logic
β   β   βββ StatsDisplay.ts       # Performance statistics
β   βββ index.html                # Web interface
β   βββ package.json              # Web dependencies
β   βββ tsconfig.json             # TypeScript configuration
βββ README.md                     # This file
- Android Studio (latest version)
 - Android NDK (r25c or later)
 - OpenCV for Android (4.8.0 or later)
 - Node.js (18+ for web viewer)
 - TypeScript (5.0+)
 
- 
Clone and Open Project
git clone <repository-url> cd android-opencv-opengl-assessment
 - 
Open in Android Studio
- Open Android Studio
 - Select "Open an existing project"
 - Navigate to the project directory
 
 - 
Configure OpenCV
- Download OpenCV for Android from opencv.org
 - Extract to 
app/libs/opencv - Update 
app/build.gradleto include OpenCV module:implementation project(':opencv') 
 - 
Configure NDK
- Ensure Android NDK is installed
 - Set NDK path in Android Studio: File β Project Structure β SDK Location
 
 - 
Build and Run
./gradlew assembleDebug
 
- 
Navigate to Web Directory
cd web - 
Install Dependencies
npm install
 - 
Build TypeScript
npm run build
 - 
Start Web Server
npm start
 - 
Open in Browser
- Navigate to 
http://localhost:8080 - View the web interface
 
 - Navigate to 
 
- Camera Capture β Android CameraX captures frames
 - JNI Bridge β Frames passed to native C++ code
 - OpenCV Processing β Canny edge detection applied
 - OpenGL Rendering β Processed frames rendered using OpenGL ES
 - Web Integration β Frame data can be sent to web viewer
 
- Java Side: 
OpenCVProcessor.kthandles frame conversion and JNI calls - C++ Side: 
opencv_processor.cppimplements OpenCV algorithms - Bridge: Seamless data transfer between Java and C++
 
- Canny Edge Detection: Primary processing algorithm
 - Gaussian Blur: Noise reduction preprocessing
 - Memory Management: Efficient frame buffer handling
 - Performance: Optimized for real-time processing
 
- OpenGL ES 2.0: Hardware-accelerated rendering
 - Shader Programs: Vertex and fragment shaders
 - Texture Management: Efficient frame-to-texture conversion
 - Real-time Performance: 10-15 FPS target
 
- Modular Design: Clean separation of concerns
 - Canvas Rendering: HTML5 Canvas for frame display
 - Performance Monitoring: Real-time statistics
 - Interactive Controls: User interface for testing
 
- Modular Architecture: Clear separation of Android, native, and web code
 - Documentation: Comprehensive setup and usage instructions
 - Git History: Meaningful commit messages and development process
 
- Real-time camera feed with edge detection overlay
 - FPS counter and performance metrics
 - Toggle button for raw/processed view switching
 
- Clean, modern interface with performance statistics
 - Interactive frame display with toggle controls
 - Responsive design for various screen sizes
 
- Frame Rate: 10-15 FPS minimum
 - Processing Time: < 50ms per frame
 - Memory Usage: Optimized for mobile devices
 - Battery Life: Efficient processing to minimize drain
 
- 
OpenCV Not Found
- Ensure OpenCV is properly linked in 
build.gradle - Check that native libraries are in correct location
 
 - Ensure OpenCV is properly linked in 
 - 
NDK Build Errors
- Verify NDK version compatibility
 - Check CMakeLists.txt configuration
 
 - 
Camera Permissions
- Ensure camera permission is granted
 - Check AndroidManifest.xml permissions
 
 - 
Web Viewer Not Loading
- Verify TypeScript compilation
 - Check browser console for errors
 
 
- Modular commits for each feature
 - Clear, descriptive commit messages
 - Separate commits for Android, native, and web components
 
- Unit tests for individual components
 - Integration tests for JNI bridge
 - Performance testing for real-time processing
 - Cross-platform compatibility testing