remove dead code from aardgl, basic settings for aardGl
This commit is contained in:
parent
43709cef34
commit
ee57799005
@ -151,11 +151,6 @@ var ExtensionConf = {
|
|||||||
},
|
},
|
||||||
sampleCols: 32,
|
sampleCols: 32,
|
||||||
canvasDimensions: {
|
canvasDimensions: {
|
||||||
blackframeCanvas: { // smaller than sample canvas, blackframe canvas is used to recon for black frames
|
|
||||||
// it's not used to detect aspect ratio by itself, so it can be tiny af
|
|
||||||
width: 16,
|
|
||||||
height: 9,
|
|
||||||
},
|
|
||||||
sampleCanvas: { // size of image sample for detecting aspect ratio. Bigger size means more accurate results,
|
sampleCanvas: { // size of image sample for detecting aspect ratio. Bigger size means more accurate results,
|
||||||
// at the expense of performance. Width == sample texture size (size of webGL canvas is pegged
|
// at the expense of performance. Width == sample texture size (size of webGL canvas is pegged
|
||||||
// on sample count)
|
// on sample count)
|
||||||
@ -206,11 +201,6 @@ var ExtensionConf = {
|
|||||||
thresholdStep: 8, // when failing to set aspect ratio, increase threshold by this much
|
thresholdStep: 8, // when failing to set aspect ratio, increase threshold by this much
|
||||||
increaseAfterConsecutiveResets: 2 // increase if AR resets this many times in a row
|
increaseAfterConsecutiveResets: 2 // increase if AR resets this many times in a row
|
||||||
},
|
},
|
||||||
sampling: {
|
|
||||||
staticCols: 9, // we take a column at [0-n]/n-th parts along the width and sample it
|
|
||||||
randomCols: 0, // we add this many randomly selected columns to the static columns
|
|
||||||
staticRows: 9, // forms grid with staticSampleCols. Determined in the same way. For black frame checks
|
|
||||||
},
|
|
||||||
guardLine: { // all pixels on the guardline need to be black, or else we trigger AR recalculation
|
guardLine: { // all pixels on the guardline need to be black, or else we trigger AR recalculation
|
||||||
// (if AR fails to be recalculated, we reset AR)
|
// (if AR fails to be recalculated, we reset AR)
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@ -229,22 +219,6 @@ var ExtensionConf = {
|
|||||||
switches: 2, // we can switch this many times
|
switches: 2, // we can switch this many times
|
||||||
period: 2.0 // per this period
|
period: 2.0 // per this period
|
||||||
},
|
},
|
||||||
edgeDetection: {
|
|
||||||
sampleWidth: 8, // we take a sample this wide for edge detection
|
|
||||||
detectionThreshold: 4, // sample needs to have this many non-black pixels to be a valid edge
|
|
||||||
confirmationThreshold: 1, //
|
|
||||||
singleSideConfirmationThreshold: 3, // we need this much edges (out of all samples, not just edges) in order
|
|
||||||
// to confirm an edge in case there's no edges on top or bottom (other
|
|
||||||
// than logo, of course)
|
|
||||||
logoThreshold: 0.15, // if edge candidate sits with count greater than this*all_samples, it can't be logo
|
|
||||||
// or watermark.
|
|
||||||
edgeTolerancePx: 1, // we check for black edge violation this far from detection point
|
|
||||||
edgeTolerancePercent: null, // we check for black edge detection this % of height from detection point. unused
|
|
||||||
middleIgnoredArea: 0.2, // we ignore this % of canvas height towards edges while detecting aspect ratios
|
|
||||||
minColsForSearch: 0.5, // if we hit the edge of blackbars for all but this many columns (%-wise), we don't
|
|
||||||
// continue with search. It's pointless, because black edge is higher/lower than we
|
|
||||||
// are now. (NOTE: keep this less than 1 in case we implement logo detection)
|
|
||||||
},
|
|
||||||
pillarTest: {
|
pillarTest: {
|
||||||
ignoreThinPillarsPx: 5, // ignore pillars that are less than this many pixels thick.
|
ignoreThinPillarsPx: 5, // ignore pillars that are less than this many pixels thick.
|
||||||
allowMisaligned: 0.05 // left and right edge can vary this much (%)
|
allowMisaligned: 0.05 // left and right edge can vary this much (%)
|
||||||
|
@ -330,8 +330,7 @@ class AardGl {
|
|||||||
|
|
||||||
//
|
//
|
||||||
// [2] SETUP WEBGL STUFF —————————————————————————————————————————————————————————————————————————————————
|
// [2] SETUP WEBGL STUFF —————————————————————————————————————————————————————————————————————————————————
|
||||||
//
|
//#region webgl setup
|
||||||
|
|
||||||
this.gl = this.canvas.getContext("webgl");
|
this.gl = this.canvas.getContext("webgl");
|
||||||
|
|
||||||
// load shaders and stuff. PixelSize for horizontalAdder should be 1/sample canvas width
|
// load shaders and stuff. PixelSize for horizontalAdder should be 1/sample canvas width
|
||||||
@ -373,7 +372,7 @@ class AardGl {
|
|||||||
// tho we could do it for every frame
|
// tho we could do it for every frame
|
||||||
this.canvasScaleFactor = cheight / this.video.videoHeight;
|
this.canvasScaleFactor = cheight / this.video.videoHeight;
|
||||||
|
|
||||||
|
//#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
// [3] detect if we're in the fallback mode and reset guardline
|
// [3] detect if we're in the fallback mode and reset guardline
|
||||||
@ -451,7 +450,7 @@ class AardGl {
|
|||||||
this._exited = false;
|
this._exited = false;
|
||||||
|
|
||||||
// set initial timestamps so frame check will trigger the first time we run the loop
|
// set initial timestamps so frame check will trigger the first time we run the loop
|
||||||
let lastFrameCheckStartTime = Date.now() - (this.settings.active.arDetect.timers.playing << 1);
|
let lastFrameCheckStartTime = Date.now() - (this.settings.active.aardGl.timers.playing << 1);
|
||||||
|
|
||||||
const frameCheckTimes = new Array(10).fill(-1);
|
const frameCheckTimes = new Array(10).fill(-1);
|
||||||
let frameCheckBufferIndex = 0;
|
let frameCheckBufferIndex = 0;
|
||||||
@ -501,7 +500,6 @@ class AardGl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var startTime = performance.now();
|
var startTime = performance.now();
|
||||||
let sampleCols = this.sampleCols.slice(0);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// [0] blackframe tests (they also determine whether we need fallback mode)
|
// [0] blackframe tests (they also determine whether we need fallback mode)
|
||||||
@ -551,6 +549,7 @@ class AardGl {
|
|||||||
this.logger.log('info', 'arDetect_verbose', `%c[AardGl::frameCheck] canvas.drawImage seems to have worked`, "color:#000; backgroud:#2f5;");
|
this.logger.log('info', 'arDetect_verbose', `%c[AardGl::frameCheck] canvas.drawImage seems to have worked`, "color:#000; backgroud:#2f5;");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [1]
|
||||||
|
|
||||||
this.clearImageData(imageData);
|
this.clearImageData(imageData);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user