|
| 1 | +# LiteCam: Java Camera SDK + Barcode Scanner |
| 2 | + |
| 3 | +This project provides two main components: a lightweight **Java Camera SDK** for cross-platform video capture and a complete **Java Barcode Scanner** application demonstrating real-time barcode detection. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | +- **Java JDK 8+** and **Maven 3.6+** |
| 7 | +- **Camera device** (for scanner application) |
| 8 | +- Platform dependencies: Windows (Visual Studio), Linux (`libx11-dev libv4l-dev`), macOS (Xcode) |
| 9 | + |
| 10 | + |
| 11 | +## Components |
| 12 | + |
| 13 | +### 1. LiteCam Java Camera SDK |
| 14 | +Lightweight cross-platform camera capture library with JNI bridge. |
| 15 | + |
| 16 | +```bash |
| 17 | +# 1. Build Camera SDK |
| 18 | +.\build-jar.ps1 # Windows |
| 19 | +./build-jar.sh # Linux/macOS |
| 20 | + |
| 21 | +# 2. Run Tests |
| 22 | +.\run-litecam.ps1 # Windows |
| 23 | +./run-litecam.sh # Linux/macOS |
| 24 | +``` |
| 25 | + |
| 26 | +**Features:** |
| 27 | +- Cross-platform video capture (Windows/Linux/macOS) |
| 28 | +- Direct RGB frame access via ByteBuffer |
| 29 | +- Multiple resolution support |
| 30 | +- Minimal overhead JNI implementation |
| 31 | + |
| 32 | +### 2. Java Barcode Scanner Application |
| 33 | +Complete barcode scanning application built with the Camera SDK, Dynamsoft Barcode Reader and ZXing. |
| 34 | + |
| 35 | +```bash |
| 36 | +# 1. Build Barcode Scanner |
| 37 | +.\build.ps1 # Windows |
| 38 | +./build.sh # Linux/macOS |
| 39 | + |
| 40 | +# 2. Run the app |
| 41 | +.\run.ps1 # Windows |
| 42 | +./run.sh # Linux/macOS |
| 43 | +``` |
| 44 | + |
| 45 | +**Features:** |
| 46 | +- Real-time camera scanning with visual overlays |
| 47 | +- Dual engines: ZXing (open-source) + Dynamsoft Barcode Reader (enterprise) |
| 48 | +- File processing mode with drag-and-drop |
| 49 | +- 25+ barcode formats (1D/2D/Postal) |
| 50 | + |
| 51 | + |
| 52 | +## Quick Start |
| 53 | + |
| 54 | +```java |
| 55 | +// List cameras |
| 56 | +String[] devices = LiteCam.listDevices(); |
| 57 | + |
| 58 | +// Open camera |
| 59 | +LiteCam cam = new LiteCam(); |
| 60 | +cam.openDevice(0); |
| 61 | +cam.setResolution(640, 480); |
| 62 | + |
| 63 | +// Capture frames |
| 64 | +ByteBuffer buffer = ByteBuffer.allocateDirect(640 * 480 * 3); |
| 65 | +if (cam.grabFrame(buffer)) { |
| 66 | + // Process RGB data |
| 67 | + byte[] frameData = new byte[buffer.remaining()]; |
| 68 | + buffer.get(frameData); |
| 69 | +} |
| 70 | + |
| 71 | +cam.close(); |
| 72 | +``` |
| 73 | + |
| 74 | + |
| 75 | + |
0 commit comments