Skip to content

Commit 95777c4

Browse files
committed
8.6.0
1 parent 56f616c commit 95777c4

File tree

3 files changed

+101
-2
lines changed

3 files changed

+101
-2
lines changed

3.settings/3.blurred-small-barcodes.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ <h2>Blurry or Small Codes</h2>
6262
<label for="deepAnalysis"> Deep Analysis (32)</label> <br>
6363
<input type="checkbox" id="sharpening" name="debMode" value="DM_SHARPENING">
6464
<label for="sharpening"> Sharpening (64)</label> <br>
65+
<input type="checkbox" id="basedOnLocBin" name="debMode" value="DM_BASED_ON_LOC_BIN">
66+
<label for="sharpening"> Based on the binary image from the localization process (128)</label> <br>
67+
<input type="checkbox" id="sharpeningSmoothing" name="debMode" value="DM_SHARPENING_SMOOTHING">
68+
<label for="sharpening"> Sharpening And Smoothing (256)</label> <br>
6569
<input type="checkbox" id="skipDeblur" name="debMode" value="DM_SKIP">
6670
<label for="skipDeblur"> Skip (0)</label> <br>
6771
</form>
@@ -183,6 +187,12 @@ <h2>Blurry or Small Codes</h2>
183187
case "DM_SHARPENING":
184188
settings.deblurModes[deblurModeCount] = Dynamsoft.DBR.EnumDeblurMode.DM_SHARPENING;
185189
break;
190+
case "DM_BASED_ON_LOC_BIN":
191+
settings.deblurModes[deblurModeCount] = Dynamsoft.DBR.EnumDeblurMode.DM_BASED_ON_LOC_BIN;
192+
break;
193+
case "DM_SHARPENING_SMOOTHING":
194+
settings.deblurModes[deblurModeCount] = Dynamsoft.DBR.EnumDeblurMode.DM_SHARPENING_SMOOTHING;
195+
break;
186196
case "DM_SKIP":
187197
settings.deblurModes[deblurModeCount] = Dynamsoft.DBR.EnumDeblurMode.DM_SKIP;
188198
break;

3.settings/5.regionOfInterest-regionPredetection.html

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,32 @@ <h2>Define or Detect the Region</h2>
122122
min="1" max="32" value="5"><span id="sibGrayDisplay"></span></br>
123123
</div>
124124

125+
<input type="checkbox" id="hsvContrast" name="rpMode" value="RPM_GENERAL_HSV_CONTRAST">
126+
<label for="hsvContrast" class="tooltip"
127+
aria-label="Detects region using the general algorithm based on HSV colour contrast."
128+
data-balloon-pos="down" data-balloon-length="fit"> General HSV Contrast Mode (16) </label><br />
129+
130+
<!-- Mode Arguments for the hsv contrast pre-detection mode-->
131+
<div class="hsvContrastForm arguments">
132+
<label for="midHSV" class="tooltip"
133+
aria-label="If the image dimension is larger than the given value, the library will enable the feature of pre-detecting barcode regions. Otherwise, it will skip this step when searching for barcodes."
134+
data-balloon-pos="down" data-balloon-length="fit">Minimum Image Dimension</label>
135+
<input type="range" id="midHSV" name="minImageDim" data-require-pair="#hsvContrast" min="16384"
136+
max="2147483647" value="262144"><span id="midHSVDisplay"></span></br>
137+
138+
<label for="sensHSV" class="tooltip"
139+
aria-label="The higher the sensitivity, the more effort the library will take to detect regions."
140+
data-balloon-pos="down" data-balloon-length="fit">Sensitivity</label>
141+
<input type="range" id="sensHSV" name="sensitivity" data-require-pair="#hsvContrast" min="1"
142+
max="9" value="1"><span id="sensHSVDisplay"></span></br>
143+
144+
<label for="sibHSV" class="tooltip"
145+
aria-label="The block size used for region predetection would be 2 to the power of N, with N being the SpatialIndexBlockSize"
146+
data-balloon-pos="down" data-balloon-length="fit">Spatial Index Block Size</label>
147+
<input type="range" id="sibHSV" name="SpatialIndexBlockSize" data-require-pair="#hsvContrast"
148+
min="1" max="32" value="5"><span id="sibHSVDisplay"></span></br>
149+
</div>
150+
125151
<input type="checkbox" id="autoRPM" name="rpMode" value="RPM_AUTO">
126152
<label for="autoRPM" class="tooltip"
127153
aria-label="Lets the library choose an algorithm automatically to detect region."
@@ -209,6 +235,12 @@ <h2>Define or Detect the Region</h2>
209235
grayContrastForm[0].style.display = "block";
210236
settings.furtherModes.regionPredetectionModes[rpmCount] = Dynamsoft.DBR.EnumRegionPredetectionMode.RPM_GENERAL_GRAY_CONTRAST;
211237
break;
238+
case "RPM_GENERAL_HSV_CONTRAST":
239+
// First, display the mode arguments form for HSV Contrast mode the update the settings
240+
let hsvContrastForm = document.getElementsByClassName("hsvContrastForm");
241+
hsvContrastForm[0].style.display = "block";
242+
settings.furtherModes.regionPredetectionModes[rpmCount] = Dynamsoft.DBR.EnumRegionPredetectionMode.RPM_GENERAL_HSV_CONTRAST;
243+
break;
212244
case "RPM_GENERAL":
213245
settings.furtherModes.regionPredetectionModes[rpmCount] = Dynamsoft.DBR.EnumRegionPredetectionMode.RPM_GENERAL;
214246
break;
@@ -301,7 +333,6 @@ <h2>Define or Detect the Region</h2>
301333
}
302334
}
303335
}
304-
305336
/* Done with mode arguments for the RGB Contrast mode */
306337

307338
/* Now for the mode arguments of the Gray contrast mode, which are the same as the RGB contrast mode */
@@ -362,6 +393,64 @@ <h2>Define or Detect the Region</h2>
362393
}
363394
}
364395
/* Done with the mode arguments for the gray contrast pre-detection mode */
396+
397+
let midHSV = document.getElementById("midHSV");
398+
midHSV.onchange = async function () {
399+
document.getElementById("midHSVDisplay").innerHTML = midHSV.value.toString();
400+
let settings = await scanner.getRuntimeSettings();
401+
// Get the index of the HSV Contrast mode in the scale up modes array
402+
for (var i = 0; i <= 8; i++) {
403+
try {
404+
if (settings.scaleUpModes[i] == Dynamsoft.DBR.EnumRegionPredetectionMode.RPM_GENERAL_HSV_CONTRAST)
405+
//once the index is found, use the index to set the mode argument.
406+
await scanner.setModeArgument("RegionPredetectionMode", i, "MinImageDimension", midHSV.value.toString()); // set the min image dimension
407+
else
408+
continue; // if not HSV contrast, skip to next iteration
409+
} catch (ex) {
410+
console.log(ex.message);
411+
}
412+
}
413+
}
414+
415+
// Then, the sensitivity
416+
let sensitivityHSV = document.getElementById("sensHSV");
417+
sensitivityHSV.onchange = async function () {
418+
document.getElementById("sensHSVDisplay").innerHTML = sensitivityHSV.value.toString();
419+
let settings = await scanner.getRuntimeSettings();
420+
// Get the index of the HSV Contrast mode in the scale up modes array
421+
for (var i = 0; i <= 8; i++) {
422+
try {
423+
if (settings.scaleUpModes[i] == Dynamsoft.DBR.EnumRegionPredetectionMode.RPM_GENERAL_HSV_CONTRAST)
424+
//once the index is found, use the index to set the mode argument.
425+
await scanner.setModeArgument("RegionPredetectionMode", i, "Sensitivity", sensitivityHSV.value.toString()); // set the min image dimension
426+
else
427+
continue; // if not HSV contrast, skip to next iteration
428+
} catch (ex) {
429+
console.log(ex.message);
430+
}
431+
}
432+
}
433+
434+
// Now for the spatial index block size
435+
let sibHSV = document.getElementById("sibHSV");
436+
sibHSV.onchange = async function () {
437+
document.getElementById("sibHSVDisplay").innerHTML = sibHSV.value.toString();
438+
let settings = await scanner.getRuntimeSettings();
439+
// Get the index of the HSV Contrast mode in the scale up modes array
440+
for (var i = 0; i <= 8; i++) {
441+
try {
442+
if (settings.scaleUpModes[i] == Dynamsoft.DBR.EnumRegionPredetectionMode.RPM_GENERAL_HSV_CONTRAST)
443+
//once the index is found, use the index to set the mode argument.
444+
await scanner.setModeArgument("RegionPredetectionMode", i, "SpatialIndexBlockSize", sibHSV.value.toString()); // set the min image dimension
445+
else
446+
continue; // if not HSV contrast, skip to next iteration
447+
} catch (ex) {
448+
console.log(ex.message);
449+
}
450+
}
451+
}
452+
453+
/* Done with mode arguments for the HSV Contrast mode */
365454
}
366455
</script>
367456
</body>

3.settings/settings-css.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ strong {
8383

8484
/* All of the mode arguments of these options stay hidden until the user includes the option in its corresponding array/modes */
8585

86-
.localBlockForm, .thresholdForm, .liForm, .nniForm, .rgbContrastForm, .grayContrastForm {
86+
.localBlockForm, .thresholdForm, .liForm, .nniForm, .rgbContrastForm, .grayContrastForm, .hsvContrastForm {
8787
display: none;
8888
padding-left: 5px;
8989
}

0 commit comments

Comments
 (0)