fix syntax

This commit is contained in:
Tamius Han 2024-10-23 01:23:37 +02:00
parent bf182c65ad
commit dcbeecc8cf
3 changed files with 25 additions and 10 deletions

View File

@ -166,9 +166,9 @@ export interface AardSettings {
gradientTestMinDelta: number, // if last pixels of the test sample is less than this brighter than the first -> not gradient gradientTestMinDelta: number, // if last pixels of the test sample is less than this brighter than the first -> not gradient
thresholds: { thresholds: {
edgeDetectionLimit: 8, // during scanning of the edge, quit after edge gets detected at this many points edgeDetectionLimit: number, // during scanning of the edge, quit after edge gets detected at this many points
minQualitySingleEdge: 6, // At least one of the detected must reach this quality minQualitySingleEdge: number, // At least one of the detected must reach this quality
minQualitySecondEdge: 3, // The other edge must reach this quality (must be smaller or equal to single edge quality) minQualitySecondEdge: number, // The other edge must reach this quality (must be smaller or equal to single edge quality)
} }
maxLetterboxOffset: 0.1, // Upper and lower letterbox can be different by this many (% of height) maxLetterboxOffset: 0.1, // Upper and lower letterbox can be different by this many (% of height)

View File

@ -89,8 +89,14 @@ const ExtensionConf: SettingsInterface = {
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
}, },
blackLevels: {
defaultBlack: 16,
blackTolerance: 4,
imageDelta: 16,
},
sampling: { sampling: {
staticCols: 9, // we take a column at [0-n]/n-th parts along the width and sample it edgePosition: 0.25,
staticCols: 16, // 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 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 staticRows: 9, // forms grid with staticSampleCols. Determined in the same way. For black frame checks
}, },
@ -103,16 +109,25 @@ const ExtensionConf: SettingsInterface = {
edgeTolerancePx: 2, // black edge violation is performed this far from reported 'last black pixel' edgeTolerancePx: 2, // black edge violation is performed this far from reported 'last black pixel'
edgeTolerancePercent: null // unused. same as above, except use % of canvas height instead of pixels edgeTolerancePercent: null // unused. same as above, except use % of canvas height instead of pixels
}, },
fallbackMode: {
enabled: true,
safetyBorderPx: 5, // determines the thickness of safety border in fallback mode
noTriggerZonePx: 8 // if we detect edge less than this many pixels thick, we don't correct.
},
arSwitchLimiter: { // to be implemented arSwitchLimiter: { // to be implemented
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: { edgeDetection: {
slopeTestWidth: 8,
gradientTestSamples: 8,
gradientTestBlackThreshold: 16,
gradientTestDeltaThreshold: 32,
gradientTestMinDelta: 8,
thresholds: {
edgeDetectionLimit: 8,
minQualitySingleEdge: 6,
minQualitySecondEdge: 3,
},
maxLetterboxOffset: 0.1,
sampleWidth: 8, // we take a sample this wide for edge detection 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 detectionThreshold: 4, // sample needs to have this many non-black pixels to be a valid edge
confirmationThreshold: 1, // confirmationThreshold: 1, //

View File

@ -37,7 +37,7 @@ export function resetGradientSamples(samples: AardGradientSamples) {
} }
} }
if (samples.left) { if (samples.left) {
for (let i = 0; i < samples.left.length, i++) { for (let i = 0; i < samples.left.length; i++) {
for (let j = 0; j < samples.left[i].length; j++) { for (let j = 0; j < samples.left[i].length; j++) {
samples.left[i][j] = 0; samples.left[i][j] = 0;
} }