- C/C++の宿題片付けます 167代目
543 : ◆0qAv26otVI [sage]:2014/06/23(月) 02:09:05.13 ID:KutcWFSB - >>514
// 先鋭化フィルタ for(y=1;y<YSIZE-1;y++) for(x=1;x<XSIZE-1;x++) if(x<2 || x>253 || y<2 || y>253) out_image[y][x]=in_image[y][x]; else{ wa = in_image[y][x] * 5; wa-= in_image[y][x-1] + in_image[y][x+1] + in_image[y-1][x] + in_image[y+1][x]; out_image[y][x] = wa; } // ラプラシアンフィルタ for(y=1;y<YSIZE-1;y++) for(x=1;x<XSIZE-1;x++) if(x<2 || x>253 || y<2 || y>253) out_image[y][x]=in_image[y][x]; else{ wa = in_image[y][x-1] + in_image[y][x+1] + in_image[y-1][x] + in_image[y+1][x]; wa-= in_image[y][x] * 4; out_image[y][x] = wa; }
|
|