Skip to content

Commit 75202fe

Browse files
test
1 parent 910d737 commit 75202fe

File tree

64 files changed

+1328
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1328
-169
lines changed

dynamsoft_barcode_reader_bundle/core.py

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "4.0.40.6511"
1+
__version__ = "4.0.40.6625"
22

33
import sys
44

@@ -288,6 +288,7 @@ class EnumRegionObjectElementType(IntEnum):
288288
ROET_SOURCE_IMAGE = _DynamsoftCore.ROET_SOURCE_IMAGE
289289
ROET_TARGET_ROI = _DynamsoftCore.ROET_TARGET_ROI
290290
ROET_ENHANCED_IMAGE = _DynamsoftCore.ROET_ENHANCED_IMAGE
291+
ROET_AUXILIARY_REGION = _DynamsoftCore.ROET_AUXILIARY_REGION
291292
class EnumTransformMatrixType(IntEnum):
292293
TMT_LOCAL_TO_ORIGINAL_IMAGE = _DynamsoftCore.TMT_LOCAL_TO_ORIGINAL_IMAGE
293294
TMT_ORIGINAL_TO_LOCAL_IMAGE = _DynamsoftCore.TMT_ORIGINAL_TO_LOCAL_IMAGE
@@ -1656,6 +1657,72 @@ def get_label_name(self) -> str:
16561657
return _DynamsoftCore.CPredetectedRegionElement_GetLabelName(self)
16571658

16581659
_DynamsoftCore.CPredetectedRegionElement_register(PredetectedRegionElement)
1660+
1661+
class AuxiliaryRegionElement(RegionObjectElement):
1662+
"""
1663+
The AuxiliaryRegionElement class represents a region element that is auxiliary to a predetected region element.
1664+
It is a subclass of the CRegionObjectElement.
1665+
1666+
Methods:
1667+
get_name(self) -> str: Gets the name of this auxiliary region.
1668+
get_confidence(self) -> int: Gets the confidence level of this auxiliary region detection.
1669+
set_name(self, name: str) -> None: Sets the name/type of this auxiliary region.
1670+
set_location(self, location: Quadrilateral) -> int: Sets the location of the auxiliary region element.
1671+
set_confidence(self, confidence: int) -> None: Sets the confidence level of this auxiliary region detection.
1672+
"""
1673+
def __init__(self):
1674+
_DynamsoftCore.Class_init(self, _DynamsoftCore.CImageProcessingModule_CreateAuxiliaryRegionElement())
1675+
1676+
def get_name(self) -> str:
1677+
"""
1678+
Gets the name of this auxiliary region.
1679+
1680+
Returns:
1681+
Returns a string representing the region name (e.g., "PortraitZone", "SignatureArea").
1682+
"""
1683+
return _DynamsoftCore.CAuxiliaryRegionElement_GetName(self)
1684+
1685+
def get_confidence(self) -> int:
1686+
"""
1687+
Gets the confidence level of this auxiliary region detection.
1688+
1689+
Returns:
1690+
Returns the confidence value, typically in the range [0, 100].
1691+
"""
1692+
return _DynamsoftCore.CAuxiliaryRegionElement_GetConfidence(self)
1693+
1694+
def set_name(self, name: str) -> None:
1695+
"""
1696+
Sets the name/type of this auxiliary region.
1697+
1698+
Args:
1699+
name(str): The region name to set (e.g., "PortraitZone", "SignatureArea").
1700+
"""
1701+
_DynamsoftCore.CAuxiliaryRegionElement_SetName(self, name)
1702+
1703+
def set_location(self, location: Quadrilateral) -> int:
1704+
"""
1705+
Sets the location of this auxiliary region.
1706+
1707+
Args:
1708+
location(Quadrilateral): A quadrilateral defining the region boundaries.
1709+
1710+
Returns:
1711+
Returns 0 if success, otherwise an error code.
1712+
"""
1713+
return _DynamsoftCore.CAuxiliaryRegionElement_SetLocation(self, location)
1714+
1715+
def set_confidence(self, confidence: int) -> None:
1716+
"""
1717+
Sets the confidence level of this auxiliary region detection.
1718+
1719+
Args:
1720+
confidence(int): The confidence value to set, typically in the range [0, 100].
1721+
"""
1722+
return _DynamsoftCore.CAuxiliaryRegionElement_SetConfidence(self, confidence)
1723+
1724+
_DynamsoftCore.CAuxiliaryRegionElement_register(AuxiliaryRegionElement)
1725+
16591726
class IntermediateResultUnit:
16601727
"""
16611728
The IntermediateResultUnit class represents an intermediate result unit used in image processing.

dynamsoft_barcode_reader_bundle/cvr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "3.2.50.6511"
1+
__version__ = "3.4.10.6625"
22

33
if __package__ or "." in __name__:
44
from .core import *

dynamsoft_barcode_reader_bundle/dbr.py

Lines changed: 114 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "11.2.50.6511"
1+
__version__ = "11.4.10.6625"
22

33
if __package__ or "." in __name__:
44
from .core import *
@@ -672,6 +672,48 @@ def __init__(self, rows: int = -1, columns: int = -1, layer_number: int = -1):
672672

673673

674674
_DynamsoftBarcodeReader.CAztecDetails_register(AztecDetails)
675+
class ECISegment:
676+
"""
677+
Represents the Extended Channel Interpretation (ECI) information within a barcode.
678+
679+
Attributes:
680+
eci_value (int): ECI assignment number as defined by ISO/IEC 15424.
681+
charset_encoding (str): Charset encoding name defined by IANA (e.g. "UTF-8", "ISO-8859-1").
682+
start_index (int): Start index of this ECI segment in the decoded barcode bytes.
683+
length (int): Length (in bytes) of this segment within the decoded barcode bytes.
684+
"""
685+
_thisown = property(
686+
lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
687+
)
688+
eci_value: int = property(
689+
_DynamsoftBarcodeReader.CECISegment_eciValue_get,
690+
_DynamsoftBarcodeReader.CECISegment_eciValue_set,
691+
doc="ECI assignment number as defined by ISO/IEC 15424.",
692+
)
693+
charset_encoding: str = property(
694+
_DynamsoftBarcodeReader.CECISegment_charsetEncoding_get,
695+
_DynamsoftBarcodeReader.CECISegment_charsetEncoding_set,
696+
doc="Charset encoding name defined by IANA (e.g. \"UTF-8\", \"ISO-8859-1\").",
697+
)
698+
start_index: int = property(
699+
_DynamsoftBarcodeReader.CECISegment_startIndex_get,
700+
_DynamsoftBarcodeReader.CECISegment_startIndex_set,
701+
doc="Start index of this ECI segment in the decoded barcode bytes.",
702+
)
703+
length: int = property(
704+
_DynamsoftBarcodeReader.CECISegment_length_get,
705+
_DynamsoftBarcodeReader.CECISegment_length_set,
706+
doc="Length (in bytes) of this segment within the decoded barcode bytes.",
707+
)
708+
def __init__(self):
709+
_DynamsoftBarcodeReader.Class_init(
710+
self, _DynamsoftBarcodeReader.new_CECISegment()
711+
)
712+
713+
__destroy__ = _DynamsoftBarcodeReader.delete_CECISegment
714+
715+
716+
_DynamsoftBarcodeReader.CECISegment_register(ECISegment)
675717

676718
class BarcodeResultItem(CapturedResultItem):
677719
"""
@@ -689,6 +731,8 @@ class BarcodeResultItem(CapturedResultItem):
689731
get_details(self) -> BarcodeDetails: Gets the details of the decoded barcode result.
690732
is_dpm(self) -> bool: Gets whether the decoded barcode is a DPM code.
691733
is_mirrored(self) -> bool: Gets whether the decoded barcode is mirrored.
734+
get_eci_segments_count(self) -> int: Gets the number of ECI segments in the barcode.
735+
get_eci_segment(self, index: int) -> ECISegment: Gets the ECI segment at the specified index.
692736
"""
693737
_thisown = property(
694738
lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
@@ -796,7 +840,41 @@ def is_mirrored(self) -> bool:
796840
"""
797841
return _DynamsoftBarcodeReader.CBarcodeResultItem_IsMirrored(self)
798842

843+
def get_eci_segments_count(self) -> int:
844+
"""
845+
Gets the number of ECI segments in the barcode.
846+
847+
Returns:
848+
The count of ECI segments. Returns 0 if no ECI information is present.
849+
"""
850+
return _DynamsoftBarcodeReader.CBarcodeResultItem_GetECISegmentsCount(self)
851+
852+
def get_eci_segment(self, index: int) -> ECISegment:
853+
"""
854+
Gets the ECI segment at the specified index.
855+
856+
Args:
857+
index: The zero-based index of the ECI segment to retrieve.
799858
859+
Returns:
860+
An ECISegment object, or None if the index is out of range.
861+
"""
862+
return _DynamsoftBarcodeReader.CBarcodeResultItem_GetECISegment(self, index)
863+
864+
def get_eci_segments(self) -> List[ECISegment]:
865+
"""
866+
Gets all the ECI segments in the barcode.
867+
868+
Returns:
869+
A list of ECISegment objects.
870+
"""
871+
count = self.get_eci_segments_count()
872+
result = []
873+
for i in range(count):
874+
eci = self.get_eci_segment(i)
875+
if eci is not None:
876+
result.append(eci)
877+
return result
800878
_DynamsoftBarcodeReader.CBarcodeResultItem_register(BarcodeResultItem)
801879

802880
class DecodedBarcodesResult(CapturedResultBase):
@@ -923,8 +1001,42 @@ def set_confidence(self, confidence: int) -> None:
9231001
def set_location(self, location: Quadrilateral) -> int:
9241002
return _DynamsoftBarcodeReader.CDecodedBarcodeElement_SetLocation(self, location)
9251003

1004+
def get_eci_segments_count(self) -> int:
1005+
"""
1006+
Gets the number of ECI segments in the barcode.
1007+
1008+
Returns:
1009+
The count of ECI segments. Returns 0 if no ECI information is present.
1010+
"""
1011+
return _DynamsoftBarcodeReader.CDecodedBarcodeElement_GetECISegmentsCount(self)
1012+
1013+
def get_eci_segment(self, index: int) -> ECISegment:
1014+
"""
1015+
Gets the ECI segment at the specified index.
1016+
1017+
Args:
1018+
index(int): The zero-based index of the ECI segment to retrieve.
1019+
1020+
Returns:
1021+
An ECISegment object, or None if the index is out of range.
1022+
"""
1023+
return _DynamsoftBarcodeReader.CDecodedBarcodeElement_GetECISegment(self, index)
1024+
1025+
def get_eci_segments(self) -> List[ECISegment]:
1026+
"""
1027+
Gets all the ECI segments in the barcode.
1028+
1029+
Returns:
1030+
A list of ECISegment objects.
1031+
"""
1032+
count = self.get_eci_segments_count()
1033+
result = []
1034+
for i in range(count):
1035+
eci = self.get_eci_segment(i)
1036+
if eci is not None:
1037+
result.append(eci)
1038+
return result
9261039

927-
# Register CDecodedBarcodeElement in _DynamsoftBarcodeReader:
9281040
_DynamsoftBarcodeReader.CDecodedBarcodeElement_register(DecodedBarcodeElement)
9291041
class ExtendedBarcodeResult(DecodedBarcodeElement):
9301042
_thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

dynamsoft_barcode_reader_bundle/dip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "3.0.30.6511"
1+
__version__ = "3.0.30.6625"
22

33
if __package__ or "." in __name__:
44
from . import _DynamsoftImageProcessing

dynamsoft_barcode_reader_bundle/dnn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "2.0.30.6511"
1+
__version__ = "2.0.30.6625"
22

33
if __package__ or "." in __name__:
44
from . import _DynamsoftNeuralNetwork

dynamsoft_barcode_reader_bundle/license.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "4.0.30.6511"
1+
__version__ = "4.0.30.6625"
22

33
if __package__ or "." in __name__:
44
from . import _DynamsoftLicense

dynamsoft_barcode_reader_bundle/utility.py

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "2.0.40.6511"
1+
__version__ = "2.0.40.6625"
22

33
if __package__ or "." in __name__:
44
from .cvr import *
@@ -219,6 +219,30 @@ def is_latest_overlapping_enabled(self, type: int) -> bool:
219219
self, type
220220
)
221221

222+
def set_result_cross_verification_criteria(self, result_item_types: int, frame_window: int, min_consistent_frames: int) -> None:
223+
"""
224+
This function allows customization of the multi-frame verification parameters,
225+
controlling how many frames are analyzed and how many consistent results are required.
226+
227+
Args:
228+
result_item_types (int): A bitwise OR combination of one or more values from the EnumCapturedResultItemType enumeration.
229+
frame_window (int): The number of frames to consider for cross-verification.
230+
min_consistent_frames (int): The minimum number of frames that must contain consistent results for verification to succeed.
231+
"""
232+
return _DynamsoftUtility.CMultiFrameResultCrossFilter_SetResultCrossVerificationCriteria(self, result_item_types, frame_window, min_consistent_frames)
233+
234+
def get_result_cross_verification_criteria(self, result_item_type: EnumCapturedResultItemType) -> Tuple[int, int]:
235+
"""
236+
Gets the cross-verification criteria for a specified result item type.
237+
238+
Args:
239+
result_item_type (int): The result item type to query (CapturedResultItemType value).
240+
241+
Returns:
242+
A tuple containing the frame window size and the minimum consistent frames.
243+
"""
244+
return _DynamsoftUtility.CMultiFrameResultCrossFilter_GetResultCrossVerificationCriteria(self, result_item_type)
245+
222246
_DynamsoftUtility.CMultiFrameResultCrossFilter_register(MultiFrameResultCrossFilter)
223247

224248
class ProactiveImageSourceAdapter(ImageSourceAdapter, ABC):
@@ -594,13 +618,19 @@ def save_to_numpy(self, image_data: ImageData) -> Tuple[int, str, "numpy.ndarray
594618
elif format == EnumImagePixelFormat.IPF_BGR_888:
595619
arr = np.frombuffer(image_bytes, dtype=np.uint8).reshape((height, width, 3))
596620
arr = arr[:, :, ::-1]
621+
elif format == EnumImagePixelFormat.IPF_GRAYSCALED \
622+
or format == EnumImagePixelFormat.IPF_BINARY \
623+
or format == EnumImagePixelFormat.IPF_BINARYINVERTED \
624+
or format == EnumImagePixelFormat.IPF_BINARY_8 \
625+
or format == EnumImagePixelFormat.IPF_BINARY_8_INVERTED:
626+
arr = np.frombuffer(image_bytes, dtype=np.uint8).reshape((height, width))
597627
else:
598628
err = EnumErrorCode.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH
599629
if __package__ or "." in __name__:
600630
from . import _DynamsoftCore
601631
else:
602632
import _DynamsoftCore
603-
err_str = _DynamsoftCore.DC_GetErrorString()
633+
err_str = _DynamsoftCore.DC_GetErrorString(err)
604634
arr = None
605635
return err, err_str, arr
606636

@@ -785,14 +815,14 @@ def convert_to_binary_global(self, image_data: ImageData, threshold: int = -1, i
785815
"""
786816
return _DynamsoftUtility.CImageProcessor_ConvertToBinaryGlobal(self, image_data, threshold, invert)
787817

788-
def convert_to_binary_local(self, image_data: ImageData, block_size: int = 0, compensation: int = 0, invert: bool = False) ->ImageData:
818+
def convert_to_binary_local(self, image_data: ImageData, block_size: int = 0, compensation: int = 10, invert: bool = False) ->ImageData:
789819
"""
790820
Converts a grayscale image to binary image using local (adaptive) binarization.
791821
792822
Args:
793823
image_data (ImageData): The image data to be converted.
794824
block_size (int): Size of the block for local binarization (default is 0).
795-
compensation (int): Adjustment value to modify the threshold (default is 0).
825+
compensation (int): Adjustment value to modify the threshold (default is 10).
796826
invert (bool): If true, invert the binary image (black becomes white and white becomes black).
797827
798828
Returns:

include/DynamsoftBarcodeReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ typedef void* HANDLE;
1818

1919
#include "DynamsoftCore.h"
2020

21-
#define DBR_VERSION "11.4.10.6634"
21+
#define DBR_VERSION "11.4.10.6659"
2222

2323
/**Enumeration section*/
2424

include/DynamsoftCaptureVisionRouter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "DynamsoftCodeParser.h"
2828
//#endif
2929

30-
#define DCV_VERSION "3.4.10.6634"
30+
#define DCV_VERSION "3.4.10.6659"
3131

3232
/**Enumeration section*/
3333

include/DynamsoftCodeParser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#endif
1212
#include "DynamsoftCore.h"
1313

14-
#define DCP_VERSION "3.4.10.6634"
14+
#define DCP_VERSION "3.4.10.6659"
1515
/**
1616
* @enum MappingStatus
1717
*

0 commit comments

Comments
 (0)