Skip to content

Commit

Permalink
More dynamic bar detection offset & Always display "Detection: Certai…
Browse files Browse the repository at this point in the history
…nty threshold"
  • Loading branch information
WesselKroos committed Oct 8, 2024
1 parent c262c08 commit 9597366
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
12 changes: 8 additions & 4 deletions src/scripts/libs/bar-detection.js
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,8 @@ const workerCode = function () {
xOffset
) => {
const partSizeBorderMultiplier =
allowedAnomaliesPercentage > 20 ? 0.6 : 0.1;
-0.1 + (2 * allowedAnomaliesPercentage) / 100;
// .1 .6 .6 .6
// xOffset = partSizeBorderMultiplier ? xOffset * .5 : xOffset

const partSize = Math.floor(
Expand Down Expand Up @@ -953,6 +954,9 @@ const workerCode = function () {
// // https://www.youtube.com/watch?v=64FVUoGCxWw
// // https://www.youtube.com/watch?v=37-6GeQg2xY

// Bars keep cropping long texts in the next 4 graphs (because the white space between text and orange/red bar is not seen as different?)
// https://youtu.be/CIQe2jdYAJ0?si=yFWu2SD5eVRSG9CB&t=366

// console.log(JSON.stringify(topEdges), JSON.stringify(bottomEdges))

// console.log(topEdges, bottomEdges)
Expand Down Expand Up @@ -1274,7 +1278,7 @@ export default class BarDetection {
if (!this.worker) {
this.worker = workerFromCode(workerCode);
this.worker.onmessage = (e) => {
if(this.onWorkerMessageListener) {
if (this.onWorkerMessageListener) {
return this.onWorkerMessageListener(e);
}
if (e.data.id !== -1) {
Expand All @@ -1286,11 +1290,11 @@ export default class BarDetection {
}
};
this.worker.onerror = (err) => {
if(this.onWorkerRejectListener) {
if (this.onWorkerRejectListener) {
return this.onWorkerRejectListener(err);
}
SentryReporter.captureException(err);
}
};
}

// Ignore previous percentages in cases: new video src, seeked or setting changed
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/libs/canvas-webgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class WebGLContext {
if (!this.ctx) {
this.ctxOptions = {
failIfMajorPerformanceCaveat: false,
preserveDrawingBuffer: false,
preserveDrawingBuffer: false, // Allows the browser to swap the visible- and drawbuffers, which is faster
// alpha: false, // Decreases performance on some platforms
depth: false,
antialias: false,
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/libs/projector-webgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export default class ProjectorWebGL {
if (!this.ctx) {
this.ctxOptions = {
failIfMajorPerformanceCaveat: true,
preserveDrawingBuffer: false,
preserveDrawingBuffer: false, // Allows the browser to swap the visible- and drawbuffers, which is faster
premultipliedAlpha: false,
alpha: true,
depth: false,
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/libs/settings-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,14 @@ Click on the questionmark for more and updated information about these artifacts
label: 'Detection: Certainty threshold',
questionMark: {
title:
'At 10% only full sized bars are removed.\nA higher percentage can also remove bars with squared elements in the corners \nor crop to a squared element in the center.',
'At 10% only clear bars are removed.\nA higher percentage can also remove bars with some elements.\nAnd an even higher percentage can crop to a squared element in the center.',
},
type: 'list',
default: 30,
default: 20,
min: 10,
max: 90,
step: 10,
advanced: true,
// advanced: true,
},
{
name: 'barSizeDetectionAllowedUnevenBarsPercentage',
Expand Down

0 comments on commit 9597366

Please sign in to comment.