@ekyc_qoobiss/qbs-ect-cmp 4.7.22 → 4.7.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -592,6 +592,7 @@ const IdAutoCapture = class {
592
592
  // Method for continuous video frame processing with OpenCV
593
593
  this.processVideoFrame = () => {
594
594
  if (this.videoElement && this.processingCanvasElement && this.opencvReady && this.isDetecting) {
595
+ console.log('Processing frame. cv.Mat is a constructor:', typeof cv.Mat === 'function');
595
596
  const video = this.videoElement;
596
597
  const processingCanvas = this.processingCanvasElement;
597
598
  const context = processingCanvas.getContext('2d');
@@ -600,7 +601,8 @@ const IdAutoCapture = class {
600
601
  context.drawImage(video, 0, 0, processingCanvas.width, processingCanvas.height);
601
602
  const imageData = context.getImageData(0, 0, processingCanvas.width, processingCanvas.height);
602
603
  // --- OpenCV.js processing starts here ---
603
- let src = cv.matFromImageData(imageData);
604
+ let src = new cv.Mat(processingCanvas.height, processingCanvas.width, cv.CV_8UC4);
605
+ src.data.set(imageData.data);
604
606
  let gray = new cv.Mat();
605
607
  let blurred = new cv.Mat();
606
608
  let edges = new cv.Mat();
@@ -733,10 +735,6 @@ const IdAutoCapture = class {
733
735
  this.loadOpenCVScript();
734
736
  // Listen for the custom event dispatched by global.ts (ensures global.ts sets up window.Module)
735
737
  document.addEventListener('opencv:ready', this.handleOpencvReady);
736
- // Initial check in case opencv.js loads very fast and event was already dispatched
737
- if (typeof cv !== 'undefined' && cv.Mat) {
738
- this.handleOpencvReady();
739
- }
740
738
  }
741
739
  disconnectedCallback() {
742
740
  if (this.mediaStream) {
@@ -757,7 +755,7 @@ const IdAutoCapture = class {
757
755
  }
758
756
  }
759
757
  loadOpenCVScript() {
760
- if (!this.opencvScriptElement) {
758
+ if (!document.querySelector('script[src="https://docs.opencv.org/4.x/opencv.js"]')) {
761
759
  // Only load if not already loaded
762
760
  this.opencvScriptElement = document.createElement('script');
763
761
  this.opencvScriptElement.type = 'text/javascript';
@@ -766,6 +764,9 @@ const IdAutoCapture = class {
766
764
  document.body.appendChild(this.opencvScriptElement); // Append to body or head
767
765
  console.log('Dynamically loaded opencv.js');
768
766
  }
767
+ else {
768
+ console.log('OpenCV.js script already present in the DOM.');
769
+ }
769
770
  }
770
771
  // Method to get user media (camera stream)
771
772
  async getMedia() {
@@ -790,7 +791,7 @@ const IdAutoCapture = class {
790
791
  if (TranslationUtils.state.device.isDesktop) {
791
792
  cameraVideoClass = 'cameraVideoSelfieDesk';
792
793
  }
793
- return (index.h("div", { key: '4bb0f88b1af2b60c0340d193e5b55b20216959f4', class: "container flex center" }, index.h("div", { key: '91edb8cd88cc514d356f6dbc33d42a0fd4c59403', class: "px-2 w-100" }, index.h("h1", { key: 'ddfd52905a3f4e57140a77eead1019d0a5f8fd8d', class: this.titleStyle, innerHTML: this.titleMesage }), index.h("div", { key: '11a1eba365aa8cac67127daf11c8773c9ebb18d7', hidden: this.verified }, index.h("div", { key: '710dbd4a39607139ef8f9b9bfaa6e8a753e7cb84', class: "w-100 h-100 rounded" }, index.h("div", { key: 'b48ac855f6ea3c2244160bc8c2c0ed76c0eaaea0', class: "camera rounded" }, index.h("video", { key: '688fa43c1a703449cafae6b1039768dc271b65aa', id: "video", loop: true, autoplay: true, playsinline: true, muted: true, class: cameraVideoClass, ref: el => (this.videoElement = el) }), index.h("canvas", { key: 'ed924ec293a47f69a1a61d3b3d5e745e92a5419b', id: "output", ref: el => (this.canvasElement = el), style: { display: 'none' } }), index.h("canvas", { key: 'f6807b2574c3e981f915228b45af3f8bd7ee5c9d', id: "processingCanvasElement", ref: el => (this.processingCanvasElement = el), style: { display: 'none' } }), index.h("div", { key: '812da2b6ad46757f8af703ec236996019f40480d', class: "id-guide-rectangle" }), this.isCapturing && index.h("div", { key: 'aa58dc533dac04f7917c2dba9626ff2213a298bc', class: "capture-flash-overlay" }), this.countdown > 0 && (index.h("div", { key: 'f0a3e788cc150037b2a9540f4656ba733f276bd5', class: "absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center" }, index.h("span", { key: '8c22c9ef5dd0763cc6b0fb967e25759ca6a0f8f0', class: "text-white text-9xl font-bold animate-bounce" }, this.countdown)))))), index.h("div", { key: '0b7ee521152325ef637809a009a5ad719ed4286e', class: "footer text-center" }, index.h("img", { key: 'bbd817f0b9460e4be2121501a1b87e8bbc15831a', src: Cameras.logoOntraceSvg })))));
794
+ return (index.h("div", { key: '0b0333b5c7b20a216319cf081a9f49111012596e', class: "container flex center" }, index.h("div", { key: 'e7980ea76bddf47ac73f865b3c4cb609d4597cbd', class: "px-2 w-100" }, index.h("h1", { key: 'd5a97b44269a80d3a3cee564ff48cf543d3bfc04', class: this.titleStyle, innerHTML: this.titleMesage }), index.h("div", { key: 'e52e5f59f446be42bba3ae25377fbbe7e2b87d87', hidden: this.verified }, index.h("div", { key: 'f680400952063d743350a607e2f503bc57fdcdff', class: "w-100 h-100 rounded" }, index.h("div", { key: '237debd548236f0a12c71ac73b61ff420bd91203', class: "camera rounded" }, index.h("video", { key: 'db25e8012fc4639d785a175a449ac4ec5130d113', id: "video", loop: true, autoplay: true, playsinline: true, muted: true, class: cameraVideoClass, ref: el => (this.videoElement = el) }), index.h("canvas", { key: 'd2c08faa9f71bf7c8b5f161fd76d49a99960a73e', id: "output", ref: el => (this.canvasElement = el), style: { display: 'none' } }), index.h("canvas", { key: '1882ca42f1716dd6573e28ffb289958000d8e23a', id: "processingCanvasElement", ref: el => (this.processingCanvasElement = el), style: { display: 'none' } }), index.h("div", { key: 'ed29e8ff7706909244dfc6ef8ef2a3529e010628', class: "id-guide-rectangle" }), this.isCapturing && index.h("div", { key: '4df9ad4556cd2d57b0a5e18d0fe18b10b61cd55b', class: "capture-flash-overlay" }), this.countdown > 0 && (index.h("div", { key: 'c06a98f7a785bdefeba161a39a701eb7257a90d6', class: "absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center" }, index.h("span", { key: '63407cf0373b92248eef073d863b12536c6f9cfc', class: "text-white text-9xl font-bold animate-bounce" }, this.countdown)))))), index.h("div", { key: '047ebeeb0b61d05f95f51b23e48a14eed82dbb31', class: "footer text-center" }, index.h("img", { key: 'deeea20a5acf6618ee24fbfa6919b8a5a38bb1d0', src: Cameras.logoOntraceSvg })))));
794
795
  }
795
796
  get el() { return index.getElement(this); }
796
797
  };
@@ -855,7 +856,7 @@ const IdSelection = class {
855
856
  };
856
857
  IdSelection.style = idSelectionCss;
857
858
 
858
- const version$1 = "4.7.22";
859
+ const version$1 = "4.7.24";
859
860
  var packageJson = {
860
861
  version: version$1};
861
862