2011年4月16日土曜日
2011年4月15日金曜日
New feature in my program
if (second()%10==0){
for(int y=0; y<height; y++){
for(int x=0; x<width; x++){
if (abs(brightness(motionD[width*y+x])-brightness(get(x,y)))>20){
counter++;
}
motionD[width*y+x]=get(x,y);
}
}
println("Different"+counter);//number of differnt pix
counter=0;
}
for(int y=0; y<height; y++){
for(int x=0; x<width; x++){
if (abs(brightness(motionD[width*y+x])-brightness(get(x,y)))>20){
counter++;
}
motionD[width*y+x]=get(x,y);
}
}
println("Different"+counter);//number of differnt pix
counter=0;
}
///END
This program check the pixel every 10 second and if the brightnesses are significantly different this program return huge number.
It is possible to apply this program to detect a existence of human in front of static background.
登録:
投稿 (Atom)