| 103 | } |
| 104 | |
| 105 | void sobelFilter(array &mag, array &dir, const array &in) { |
| 106 | // Find the gradients |
| 107 | array Gy, Gx; |
| 108 | af::sobel(Gx, Gy, in); |
| 109 | |
| 110 | // Find magnitude and direction |
| 111 | mag = hypot(Gx, Gy); |
| 112 | dir = atan2(Gy, Gx); |
| 113 | } |
| 114 | |
| 115 | void normalizeImage(array &in) { |
| 116 | float min = af::min<float>(in); |