to mark edges on an blackwhite image ??
in
Programming Questions
•
3 years ago
Hey guys , i've got a problem .
I just want mark the egdes on a random blackwhite picture and i have to work with a average value.
The problem is that i don't know the value so i cannot compare the current average value with the usual average value.
Here is the source :
so what I want is to mark the pixel if the average value of the pixel (with the neighbouringpixels ) is very different
than the usual average value .
How to do ?
please help me ! =)
I just want mark the egdes on a random blackwhite picture and i have to work with a average value.
The problem is that i don't know the value so i cannot compare the current average value with the usual average value.
Here is the source :
PImage laa;
void setup () {
size (344,400);
laa = loadImage("xyz.jpg");
noLoop();
}
void draw(){
image(laa ,0 , 0);
for(int x=0; x<344; x++){
for(int y=0; y<400; y++){
float mitte = blue(get(x,y));
float rechts = blue(get(x+1,y));
float links = blue(get(x-1,y));
float oben = blue(get(x,y+1));
float unten = blue(get(x,y-1));
float mw = (oben+unten+rechts+links+mitte)/5;
color i = get(x,y);
float r = red(i);
float g = green(i);
float b = blue(i);
stroke(r,g,b);
point(x,y);
}
}
}
so what I want is to mark the pixel if the average value of the pixel (with the neighbouringpixels ) is very different
than the usual average value .
How to do ?
please help me ! =)
1