You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VisionX is an Android app that uses device camera and applies filters like grayscale, edge detection, blur, invert colors in real-time. It combines Java (for the app), OpenGL shaders (for fast graphics), and OpenCV (for image processing) while using native C++ code via JNI.
Features Implemented
Raw camera feed — See the camera feed as it is.
Grayscale mode — Turns colors into black & white.
Canny edge detection — Detects and draws edges (like sketch lines, White over Black).
git clone https://github.com/ughrima/VisionX.git
cd VisionX
Install Prerequisites
Android Studio (latest stable version recommended)
NDK + CMake
Open Android Studio
Go to Tools > SDK Manager > SDK Tools
Check NDK (Side by side) and CMake
OpenCV
libopencv_java4.so files are included under app/src/main/jniLibs/
No extra download needed.
3️⃣ Build and run
Open the folder in Android Studio
Let Gradle sync — it will recognize the NDK and C++ setup
Make sure Your device is connected via USB and USB debugging is ON.
Allow the app to use camera.
Press the green Run button, or Build an APK via
Build > Build Bundle(s) / APK(s) > Build APK(s)
Done! The app will open on your device.
How it works
Frame flow
graph TD;
A[Camera2 API gets frames] ==> B[Send frame to native code via JNI]
B ==> C[OpenCV applies filters]
C ==> D[Return frame to Java and display via GLSurfaceView]
D ==> E[Shaders apply fast color effects]
Loading
Files
MainActivity.java — The main screen. Opens camera, sets up buttons, FPS counter, and works with the native code.
native-lib.cpp — C++ code that uses OpenCV to process images (grayscale, edge detection etc).
CMakeLists.txt — Tells CMake how to build C++ code for Android.
build.gradle.kts — The Gradle build file. Handles dependencies, build settings.
AndroidManifest.xml — Declares app permissions (like camera), app name, etc.
Render.java — Handles OpenGL drawing. Displays processed frames on screen.
Shade.java — Loads shader files (fragment/vertex) into OpenGL.
fragment.glsl — Shader for coloring pixels (invert, grayscale).
vertex.glsl — Shader for positioning (where things are drawn).
activity_main.xml — Defines where button, FPS text, camera view go on screen.
VisionX is an Android app that uses device camera and applies filters like grayscale, edge detection, blur, invert colors in real-time. It combines Java (for the app), OpenGL shaders (for fast graphics), and OpenCV (for image processing) while using native C++ code via JNI.