###前提・実現したいこと
画像を-1/2,0,1/2のマスクで下方向に微分、ができません。助けてください。
###該当のソースコード
java
1 double filter[] ={-1.0/2.0,0,1.0/2.0}; 2 3 double level; 4 5 for(int y=1; y<height-1; y++) { 6 for(int x=1; x<width-1; x++) { 7 level=0; 8 for(int i=-1; i<=1; i++){ 9 level+=((double)img.pixel[y+i][x]) 10 *filter[i+1]; 11 if(level<0){ 12 level=0; 13 } 14 } 15 img0.pixel[y][x] =(int) level; 16 } 17 }
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。