Diferencias
Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
wiki:2.-desarrollo-app:2.5.-controles-by-xone:ocr:start [2021/03/04 12:56] ary [Tabla] |
wiki:2.-desarrollo-app:2.5.-controles-by-xone:ocr:start [2021/03/04 13:53] (actual) ary [OCR by XOne] |
||
---|---|---|---|
Línea 3: | Línea 3: | ||
===== OCR ===== | ===== OCR ===== | ||
|< | |< | ||
- | ^ OCR | + | ^ OCR |
- | | [[wiki: | + | | [[wiki: |
- | | [[wiki: | + | | [[wiki: |
- | | [[wiki: | + | | [[wiki: |
\\ | \\ | ||
====OCR by XOne==== | ====OCR by XOne==== | ||
Línea 18: | Línea 18: | ||
\\ | \\ | ||
+ | **Ejemplos de Implementación y Uso** | ||
+ | <code javascript> | ||
- | ====Integración | + | <coll name=" |
+ | <group name=" | ||
+ | <frame name=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | <prop type=" | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | <action name=" | ||
+ | <script language=" | ||
+ | Dim contentImagenes, | ||
+ | contentImagenes = this.Contents(" | ||
+ | filemanager = CreateObject(" | ||
+ | lst = filemanager.ListFiles() | ||
+ | If Not lst Is Nothing Then | ||
+ | For i = 0 To UBound(lst) | ||
+ | obj = contentImagenes.createObject | ||
+ | contentImagenes.addItem(obj) | ||
+ | obj(" | ||
+ | Next | ||
+ | Else | ||
+ | ui.ShowToast "No hay nada..." | ||
+ | End If | ||
+ | contentImagenes.lock | ||
+ | ui.refresh | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <field name=" | ||
+ | <action name=" | ||
+ | < | ||
+ | // | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <action name=" | ||
+ | <script language=" | ||
+ | ui.startCamera " | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <action name=" | ||
+ | < | ||
+ | ui.refresh(); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <salir refresh=" | ||
+ | <action name=" | ||
+ | < | ||
+ | appData.failWithMessage(-11888, | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <action name=" | ||
+ | < | ||
+ | let ventana = ui.getView(self); | ||
+ | let result = escanearMatricula(self.MAP_SELECTORIMAGENES); | ||
+ | self.MAP_MATRICULA = result; | ||
+ | self.MAP_HIJO_SELECCIONADO.MAP_MATRICULA = result; | ||
+ | if (result != "" | ||
+ | self.MAP_HIJO_SELECCIONADO.MAP_RECONOCIDO = 1; | ||
+ | } else { | ||
+ | self.MAP_HIJO_SELECCIONADO.MAP_RECONOCIDO = 0; | ||
+ | } | ||
+ | ventana.refreshContentSelectedRow(" | ||
+ | ventana.refresh(" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <action name=" | ||
+ | < | ||
+ | escanearMatriculaCamara(); | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <action name=" | ||
+ | < | ||
+ | let result | ||
+ | self.MAP_TEXTO | ||
+ | ui.refresh(" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
- | Desde XOne nos hemos integrado a través de SDK con la tecnología OCR de **Vaxtor**, empresa desarrolladora de productos y soluciones de reconocimiento óptico de caracteres de alto rendimiento, | + | <code javascript> |
+ | function escanearMatricula(rutaImagen) { | ||
+ | let ocr = getXOneOCR(); | ||
+ | |||
+ | let opciones = { | ||
+ | // | ||
+ | ocr_img_size_percent : 1.33333333, | ||
+ | state_id_img_size_percent : 2.0, | ||
+ | max_plate_width_percent : 100, | ||
+ | max_plate_height_percent : 100, | ||
+ | detection_iteration_increase : 1.5, | ||
+ | detection_strictness : 2, | ||
+ | max_detection_input_width : 4000, | ||
+ | max_detection_input_height : 3000, | ||
+ | opencl_enabled : 1, | ||
+ | multithreading_cores : 8, | ||
+ | max_plate_angle_degrees : 15, | ||
+ | ocr_min_font_point : 6, | ||
+ | postprocess_min_confidence : 65, | ||
+ | postprocess_confidence_skip_level : 80, | ||
+ | postprocess_max_substitutions : 2, | ||
+ | postprocess_min_characters : 4, | ||
+ | postprocess_max_characters : 8, | ||
+ | |||
+ | //Debug | ||
+ | general | ||
+ | timing | ||
+ | state_id | ||
+ | plate_lines | ||
+ | plate_corners : 0, | ||
+ | char_regions | ||
+ | char_segment | ||
+ | char_analysis : 0, | ||
+ | color_filter | ||
+ | ocr : 0, | ||
+ | postprocess | ||
+ | show_images | ||
+ | pause_on_frame : 0, | ||
+ | |||
+ | //EU | ||
+ | char_analysis_min_pct : 0.35, | ||
+ | char_analysis_height_range : 0.15, | ||
+ | char_analysis_height_step_size : 0.10, | ||
+ | char_analysis_height_num_steps : 5, | ||
+ | segmentation_min_box_width_px : 5, | ||
+ | segmentation_min_charheight_percent : 0.4, | ||
+ | segmentation_max_segment_width_percent_vs_average : 2.0, | ||
+ | plate_width_mm : 520, | ||
+ | plate_height_mm : 110, | ||
+ | char_height_mm : 80, | ||
+ | char_width_mm : 53, | ||
+ | char_whitespace_top_mm : 10, | ||
+ | char_whitespace_bot_mm : 10, | ||
+ | template_max_width_px : 184, | ||
+ | template_max_height_px : 46, | ||
+ | plateline_sensitivity_vertical : 18, | ||
+ | plateline_sensitivity_horizontal : 55, | ||
+ | min_plate_size_width_px : 5, | ||
+ | min_plate_size_height_px : 5, | ||
+ | multiline : 1, | ||
+ | ocr_language : " | ||
+ | }; | ||
+ | return ocr.scanLicensePlate(rutaImagen, | ||
+ | //return ocr.scanLicensePlate(rutaImagen); | ||
+ | } | ||
+ | |||
+ | function escanearMatriculaCamara(rutaImagen) { | ||
+ | let ocr = getXOneOCR(); | ||
+ | let opciones = { | ||
+ | withCamera : true, | ||
+ | mode: 1, | ||
+ | onResult : function(sData) { | ||
+ | ui.showToast(" | ||
+ | self.MAP_MATRICULA = sData; | ||
+ | let ventana = ui.getView(self); | ||
+ | ventana.refresh(" | ||
+ | } | ||
+ | }; | ||
+ | ocr.scanLicensePlate(rutaImagen, | ||
+ | } | ||
+ | |||
+ | function scanWithV3() { | ||
+ | let ocr = new XOneOCR(); | ||
+ | let options = { | ||
+ | mode : 3, | ||
+ | detections: 5, | ||
+ | regex: | ||
+ | onResult : function(sData) { | ||
+ | ui.showToast(" | ||
+ | self.MAP_MATRICULA = sData; | ||
+ | let ventana = ui.getView(self); | ||
+ | ventana.refresh(" | ||
+ | }, | ||
+ | }; | ||
+ | ocr.scanLicensePlate(appData.getFilesPath(), | ||
+ | } | ||
+ | |||
+ | const REGEX_MATRICULA_MODERNA = " | ||
+ | |||
+ | function scanWithRegex() { | ||
+ | let ocr = new XOneOCR(); | ||
+ | let options = { | ||
+ | // Pueden ser varias expresiones regulares | ||
+ | regex : [REGEX_MATRICULA_MODERNA], | ||
+ | // Si detectar una matrícula y cerrar, o si continuar hasta que se diga | ||
+ | oneShot | ||
+ | onResult : function(jsResult) { | ||
+ | self.MAP_MATRICULA = jsResult[REGEX_MATRICULA_MODERNA]; | ||
+ | //Usar jsResult[sLaRegexUsada] si se especificaron varias | ||
+ | // | ||
+ | ui.showToast(" | ||
+ | } | ||
+ | }; | ||
+ | ocr.startScan(options); | ||
+ | } | ||
+ | |||
+ | function escanearTexto(rutaImagen) { | ||
+ | let ocr = getXOneOCR(); | ||
+ | return ocr.scanText(rutaImagen, | ||
+ | characterWhitelist: | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | function getXOneOCR() { | ||
+ | //return createObject(" | ||
+ | return new XOneOCR(); | ||
+ | } | ||
+ | </ | ||
+ | ====Integración OCR con VAXTOR==== | ||
+ | |||
+ | \\ | ||
+ | Desde XOne nos hemos integrado a través de SDK con la tecnología OCR de {{: | ||
\\ | \\ | ||
Esta tecnología es ampliamente reconocida como una de las más avanzadas del mundo por poseer OCR con características y beneficios de Alta precisión, | Esta tecnología es ampliamente reconocida como una de las más avanzadas del mundo por poseer OCR con características y beneficios de Alta precisión, | ||
+ | \\ | ||
+ | Para su integración se genera un plugin XOne para relacionarnos con SDK de VAXTOR. | ||
\\ | \\ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | Para su integración se genera un plugin XOne para relacionarnos con SDK de VAXTOR y para esta integración es necesario poseer licencia de VAXTOR. | + | Para esta integración es necesario poseer licencia de VAXTOR. |
</ | </ | ||
\\ | \\ | ||
====Integración OCR con IMENSE==== | ====Integración OCR con IMENSE==== | ||
- | Otra de las integraciones de XOne de OCR por SDK se ha realizado con la empresa | + | Otra de las integraciones de XOne de OCR por SDK se ha realizado con la empresa |
+ | \\ | ||
+ | \\ | ||
+ | Para su integración se genera un plugin XOne para relacionarnos con SDK de IMENSE. | ||
+ | \\ | ||
+ | <WRAP center round important 60%> | ||
+ | Para esta integración es necesario poseer licencia de IMENSE. | ||
+ | </ | ||
+ | \\ |