- We start from the colored image
- We turn it to gray
- We thresh it
- We resize it (smaller)
- We store it in a file, custom format
- We can then display the image on the led matrix (oled screen here)
| Original | Grayed |
|
|
| Threshed | Resized |
|
|
threshold part.
See in
OpenCVSwingColor2BW.java:
// threshold
Mat threshed = new Mat();
Imgproc.threshold(gray,
threshed,
150, // 127,
255,
0);
Tweaking the thresh parameter (150 above) leads to different results.
The final result is stored in a binary file (
image.dat).
The matrix used here is 128x64 pixels big. The file will contain 64 lines of 2
longs.
A Java
long has 64 bits, 2 longs make 128 bits, that's all we need to encode one line of 128 leds on the screen.
See the code in
OpenCVSwingColor2BW.java for details.
Adios Papou




No comments:
Post a Comment