Skip to content

Commit

Permalink
melhorias no componente de histograma
Browse files Browse the repository at this point in the history
  • Loading branch information
Piemontez committed May 2, 2024
1 parent 1f7b9ae commit 73873bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/plugins/utils/HistogramCalcComponent.ts
Expand Up @@ -70,8 +70,14 @@ export class HistogramCalcComponent extends CVFComponent {

let lastPoint = undefined as Point | undefined;
for (let i = 0; i < this.histSize; i++) {
const binVal = this.histHeight - ((hist.data32F[i] * image.rows) / max) * scale;
if (lastPoint === undefined || !hist.data32F[i]) {
if (!hist.data32F[i]) {
lastPoint = undefined;
continue;
}
const binVal = this.histHeight - (hist.data32F[i] * this.histHeight) / max;
if (channels === 1) {
lastPoint = new cv.Point(i, this.histSize);
} else if (lastPoint === undefined) {
lastPoint = new cv.Point(i, binVal);
}
const point = new cv.Point(i, binVal);
Expand Down

0 comments on commit 73873bb

Please sign in to comment.