public void pretreatMagnitudeAndDirectionImgs() {
magnitudes = new ImagePixelArray[this.smoothedImgs.length - 1];// 梯度的数组
directions = new ImagePixelArray[this.smoothedImgs.length - 1];// 方向的数组
for (int s = 1; s < (this.smoothedImgs.length - 1); s++) {
magnitudes[s] = new ImagePixelArray(this.smoothedImgs[s].width, this.smoothedImgs[s].height);
directions[s] = new ImagePixelArray(this.smoothedImgs[s].width, this.smoothedImgs[s].height);
int w = smoothedImgs[s].width;
int h = smoothedImgs[s].height;
for (int y = 1; y < (h - 1); ++y) {
for (int x = 1; x < (w - 1); ++x) {
magnitudes[s].data[y * w + x] = (float) Math.sqrt(Math.pow(smoothedImgs[s].data[y * w + x + 1]