(x0, x1)
| 34 | |
| 35 | // Mean absolute difference (over RGB) between two columns. |
| 36 | function colDiff(x0, x1) { |
| 37 | let sum = 0; |
| 38 | for (let y = 0; y < H; y++) |
| 39 | for (let c = 0; c < 3; c++) sum += Math.abs(at(x0, y, c) - at(x1, y, c)); |
| 40 | return sum / (H * 3); |
| 41 | } |
| 42 | function rowDiff(y0, y1) { |
| 43 | let sum = 0; |
| 44 | for (let x = 0; x < W; x++) |