Skip to content

Commit 50e8f91

Browse files
author
Chris Hall
committed
JS examples - FFT didn't work for non-square images because rows/cols were switched, Histogram example misspelled point
1 parent 047764f commit 50e8f91

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/js_tutorials/js_assets/js_fourier_transform_dft.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h2>Image DFT Example</h2>
5656
padded.convertTo(plane0, cv.CV_32F);
5757
let planes = new cv.MatVector();
5858
let complexI = new cv.Mat();
59-
let plane1 = new cv.Mat.zeros(padded.cols, padded.rows, cv.CV_32F);
59+
let plane1 = new cv.Mat.zeros(padded.rows, padded.cols, cv.CV_32F);
6060
planes.push_back(plane0);
6161
planes.push_back(plane1);
6262
cv.merge(planes, complexI);

doc/js_tutorials/js_assets/js_histogram_begins_calcHist.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ <h2>Image Histogram Example</h2>
6161
// draw histogram
6262
for (let i = 0; i < histSize[0]; i++) {
6363
let binVal = hist.data32F[i] * src.rows / max;
64-
let pioint1 = new cv.Point(i * scale, src.rows - 1);
65-
let pioint2 = new cv.Point((i + 1) * scale - 1, src.rows - binVal);
66-
cv.rectangle(dst, pioint1, pioint2, color, cv.FILLED);
64+
let point1 = new cv.Point(i * scale, src.rows - 1);
65+
let point2 = new cv.Point((i + 1) * scale - 1, src.rows - binVal);
66+
cv.rectangle(dst, point1, point2, color, cv.FILLED);
6767
}
6868
cv.imshow('canvasOutput', dst);
6969
src.delete(); dst.delete(); srcVec.delete(); mask.delete(); hist.delete();

0 commit comments

Comments
 (0)