Im trying to make a program that makes a 16x16 matrix from a selected part of my capturing webcam. After that the program "pixelates" it and gets the average color.
Output:" [0] -1479261 / [1] 207713 / [2] 278041 ..."
I seperate the average color array to three seprerate arrays (R+G+B). Now I want to print the RGB-Values from these arrays (red [255] / green [255] / blue [255]).
But I'm only getting strange values printed.
Output:" [I@4c9d22fc / [I@6063f5af / [I@4296e599 ").
Can you tell me how to print the three arrays after each other (red [0] / green [0] / blue[0]; red [1] / green [1] / blue [1];...red [255] / green [255] / blue [255]) to match them if their are even right?
int xposp = 0;
int yposp = 0;
//evtl ausklammern falls andere version funktioniert
//int farbevar = 0;
int colorwert = 0;
// Maus-Positons Variablen / 4x x,y
int[] pointed = new int[8];
//Video Import
import processing.video.*;
Capture cam;
void setup (){
size (1280, 960, P2D);
// Variable Kameraliste
String[] cameras = Capture.list();
// Kameraliste erstellen
if (cameras.length == 0) {
println("There are no cameras available for capture.");
exit();
}
else {
//println("Available cameras:");
for (int i = 0; i < cameras.length; i++) {
//println(cameras[i]);
}
// Kamera initalisieren und wiedergeben
// Im Array aus Liste --> list():
cam = new Capture(this, cameras[37]);
cam.start();
}
}
// Bekomme Mausposition
void mousePressed(){
xposp = mouseX;
yposp = mouseY;
// Setzte Mauspositionswerte in Array
if (pointed[0] == 0) {
pointed[0] = xposp;
pointed[1] = yposp;
}
else if (pointed[2] == 0 ) {
pointed[2] = xposp;
pointed[3] = yposp;
}
else if (pointed[4] == 0 ) {
pointed[4] = xposp;
pointed[5] = yposp;
}
else{
pointed[6] = xposp;
pointed[7] = yposp;
}
}
void draw() {
cursor(CROSS);
// Gebe Mausklickwerte aus
//println(pointed);
// Kamera ausgeben
if (cam.available() == true) {
cam.read();
}
image(cam, 0, 0);
// Variabele für Startposition Bricks
int firstpixelx = 0;
int firstpixely = 0;
// Variable eine Brickgröße
int bricky = 0;
int brickx = 0;
int langex = 0;
int langey = 0;
// Nach Markieren wird längere X-Kante wird ausgewählt
if (pointed[6] - pointed[0] >= pointed[4] - pointed[2]) {
langex = pointed[6] - pointed[0];
}
else { langex = pointed[4] - pointed[2];
}
// Nach Markieren wird längere Y-Kante wird ausgewählt
if (pointed[3] - pointed[1] >= pointed[5] - pointed[7]) {