freelance processing assistance needed
in
Events and Opportunities
•
1 year ago
Hello forum,
I would need assistance from a freelance processing expert for a project I am doing. The mission is to read an image, convert it to some kind of mosaic and than export data for the different sectors detected into a data file. I am afraid that with my learning curve I will not make it in time for the project, but I really want to learn processing for other personal projects.
Does anyone want to assist me in this? I will of course pay for the work done!! If you feel that you just want to make the program, that is an option as well.
I have this code up to now, but much of it is pseudo code and possibly I am doing this completely wrong. I am now stuck in the part where I have to read a 4 on 4 zone of the image and put it in a 16 pixel array.
Thanks for answering!
Tim
PImage img;
int bigSector = 4;
int mediumSector = 2;
int smallSector = 1;
int updown = 0;
int leftright = 0;
int zoom = 1;
int r=0;
int g=0;
int b=0;
void setup() {
size(960, 1240);
smooth();
img = loadImage("source.png");
noStroke();
}
void draw() {
scale(zoom);
translate(leftright, updown);
image(img,0,0);
getDataFromImage(); //translate image color info to data file
}
void getDataFromImage()
{
img.loadPixels();
int sectorX=1; // the first part of the sectorname which is sectorX_sectorY -> 1_1 or 3_6
int x = 0;
while (x<img.width); // to be delayed in every step otherwise the program crashes
{
int y = 0;
int sectorY = 1 // the second part of the sectorname which is sectorX_sectorY -> 1_1 or 3_6
while (y<img.height); // to be delayed in every step otherwise the program crashes
{
renderSectors();
}
renderSectors() {
int sectorNumber = 1;
for (int i=x ; i< sectorNumber * bigSector; i++){ // read 4 pixels horizontal
for(int j=y; j< sectorNumber * bigSector; j++){ // read 4 pixels vertical
// arraysomething = pixels(); // make array with bigSector * bigSector times pixel color value values
// if all color values are equal
outputSectorData();
// fill(uniform color of pixels)
rect(x,y,bigTile,bigTile)
// else divide subsector to subsector with sectorSize = 2 by 2
// if all color values are equal
outputSectorData();
// fill(uniform color of pixels)
// else divide subsector to sectorSize = 1 by 1
outputSectorData();
}
}
}
void outputSectorData() // oemfto woemfti that will be a lot of data
{
System.Out.println("Sectorname =" + sectorX + "_" + sectorY);
System.Out.println("Sector Position X =" +x);
System.Out.println("Sector Position Y =" +y);
System.Out.println("sector number" + sectorNumber + "is of size" + sectorSize + "and has X position"+ x + "and Y position" + y);
}
void keyPressed() {
if (key == CODED) {
if (keyCode == UP) {
updown = updown-30;
} else
if (keyCode == DOWN) {
updown = updown+30;
} else
if (keyCode == LEFT) {
leftright = leftright-30;
} else
if (keyCode == RIGHT) {
leftright = leftright+30;
}
}
if(key == '+') {
zoom = zoom +1;
}
else if (key == '-') {
if (zoom > 1) {
zoom = zoom -1;
}
Else {
zoom = 1;
}
}
}
1