modified logic in ocr
This commit is contained in:
@@ -729,6 +729,7 @@ function cameraCapture() {
|
||||
|
||||
<div class="flex space-x-4 mt-2">
|
||||
<x-filament::button color="primary" @click="switchCamera">Switch Camera</x-filament::button>
|
||||
<x-filament::button color="primary" @click="retakePhoto" x-show="photoTaken" class="inline-flex w-auto">Retake</x-filament::button>
|
||||
<x-filament::button color="success" @click="capturePhoto">Capture Photo</x-filament::button>
|
||||
<x-filament::button color="warning" @click="verifyPhoto">Verify</x-filament::button>
|
||||
</div>
|
||||
@@ -839,7 +840,7 @@ function cameraCapture() {
|
||||
// this.stopDetection();
|
||||
// },
|
||||
|
||||
capturePhoto() {
|
||||
capturePhoto() {
|
||||
const video = this.$refs.video;
|
||||
const canvas = this.$refs.canvas;
|
||||
const snapshot = this.$refs.snapshot;
|
||||
@@ -932,6 +933,14 @@ capturePhoto() {
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
async retakePhoto() {
|
||||
this.photoTaken = false;
|
||||
this.$refs.snapshot.classList.add('hidden');
|
||||
this.$refs.video.classList.remove('hidden');
|
||||
await this.initCamera();
|
||||
},
|
||||
|
||||
startDetection() {
|
||||
if (this.textDetectionInterval) clearInterval(this.textDetectionInterval);
|
||||
this.textDetectionInterval = setInterval(() => this.detectText(), 1000);
|
||||
|
||||
Reference in New Issue
Block a user