Skip to content

Commit

Permalink
reduced running through matrix once
Browse files Browse the repository at this point in the history
  • Loading branch information
r00tat committed Oct 9, 2014
1 parent 5f1ab93 commit 7316682
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/org/openstreetmap/josm/plugins/areaselector/ImageAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -606,23 +606,15 @@ public boolean[][] applyKernelDiff(boolean [][] src, int[] kernel){
// apply the kernel to get edge pixels
boolean[][] dest=applyKernel(src,kernel);



// and now erase the found pixels
boolean[][] erased=new boolean[src.length][src[0].length];
// make a deep copy
for(int y=0;y<src.length;y++){
for (int x=0; x<src[y].length; x++){
erased[y][x]=src[y][x];
}
}


for(int y=0;y<dest.length;y++){
for (int x=0; x<dest[y].length; x++){

if(dest[y][x]){
erased[y][x]=false;
}else {
erased[y][x]=src[y][x];
}
}
}
Expand Down

0 comments on commit 7316682

Please sign in to comment.