mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 14:36:36 +08:00
JS examples - FFT didn't work for non-square images because rows/cols were switched, Histogram example misspelled point
This commit is contained in:
parent
047764f476
commit
50e8f91064
@ -56,7 +56,7 @@ let plane0 = new cv.Mat();
|
||||
padded.convertTo(plane0, cv.CV_32F);
|
||||
let planes = new cv.MatVector();
|
||||
let complexI = new cv.Mat();
|
||||
let plane1 = new cv.Mat.zeros(padded.cols, padded.rows, cv.CV_32F);
|
||||
let plane1 = new cv.Mat.zeros(padded.rows, padded.cols, cv.CV_32F);
|
||||
planes.push_back(plane0);
|
||||
planes.push_back(plane1);
|
||||
cv.merge(planes, complexI);
|
||||
|
@ -61,9 +61,9 @@ let dst = new cv.Mat.zeros(src.rows, histSize[0] * scale,
|
||||
// draw histogram
|
||||
for (let i = 0; i < histSize[0]; i++) {
|
||||
let binVal = hist.data32F[i] * src.rows / max;
|
||||
let pioint1 = new cv.Point(i * scale, src.rows - 1);
|
||||
let pioint2 = new cv.Point((i + 1) * scale - 1, src.rows - binVal);
|
||||
cv.rectangle(dst, pioint1, pioint2, color, cv.FILLED);
|
||||
let point1 = new cv.Point(i * scale, src.rows - 1);
|
||||
let point2 = new cv.Point((i + 1) * scale - 1, src.rows - binVal);
|
||||
cv.rectangle(dst, point1, point2, color, cv.FILLED);
|
||||
}
|
||||
cv.imshow('canvasOutput', dst);
|
||||
src.delete(); dst.delete(); srcVec.delete(); mask.delete(); hist.delete();
|
||||
|
Loading…
Reference in New Issue
Block a user