I've checked the cmake file and it looks like we're including the java wrapper in the Android path but not in Linux x86_64.
You can open a ticket on the tracker but this is easy to fix. Use the attached file to create a new shared library exporting the JNI functions. GCC commands should look like this (may contains typos):
gcc -c -fpic ultimateMRZ-SDK-API-PUBLIC-SWIG_java.cxx
-IultimateMRZ/SDK_dist/c++ -LultimateMRZ/binaries/linux/x86_64
-lultimate_mrz-sdk
gcc -shared -o libMRZ_with_for_jni.so
ultimateMRZ-SDK-API-PUBLIC-SWIG_java.o
Change https://github.com/DoubangoTelecom/ultimateMRZ-SDK/blob/master/java/org/doubango/ultimateMrz/Sdk/ultimateMrzSdkJNI.java#L14
to load "libMRZ_with_for_jni.so" instead of
"libultimate_mrz-sdk.so"
--
You received this message because you are subscribed to the Google Groups "doubango-ai" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doubango-ai...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/d9b923ff-8687-4254-9869-f62b6671a25co%40googlegroups.com.
I downloaded `ultimateMRZ-SDK-API-PUBLIC-SWIG_java.cxx`Then ran first one command:
gcc -c -fpic ultimateMRZ-SDK-API-PUBLIC-SWIG_java.cxx -IultimateMRZ/SDK_dist/c++ -LultimateMRZ/binaries/linux/x86_64 -lultimate_mrz-sdk
… and received `ultimateMRZ-SDK-API-PUBLIC-SWIG_java.o`Then ran second command:
gcc -shared -o libMRZ_with_for_jni.so ultimateMRZ-SDK-API-PUBLIC-SWIG_java.o
… and received next stacktrace:/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ultimateMRZ-SDK-API-PUBLIC-SWIG_java.o:ultimateMRZ-SDK-API-PUBLIC-SWIG_java.cxx:(.text+0x1485): undefined reference to `ultimateMrzSdk::UltMrzSdkResult::~UltMrzSdkResult()'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ultimateMRZ-SDK-API-PUBLIC-SWIG_java.o:ultimateMRZ-SDK-API-PUBLIC-SWIG_java.cxx:(.text+0x1499): undefined reference to `ultimateMrzSdk::UltMrzSdkResult::~UltMrzSdkResult()'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ultimateMRZ-SDK-API-PUBLIC-SWIG_java.o:ultimateMRZ-SDK-API-PUBLIC-SWIG_java.cxx:(.text+0x14bf): undefined reference to `ultimateMrzSdk::UltMrzSdkResult::~UltMrzSdkResult()'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ultimateMRZ-SDK-API-PUBLIC-SWIG_java.o:ultimateMRZ-SDK-API-PUBLIC-SWIG_java.cxx:(.text$_ZN14ultimateMrzSdk15UltMrzSdkResultaSERKS0_[_ZN14ultimateMrzSdk15UltMrzSdkResultaSERKS0_]+0x1c): undefined reference to `ultimateMrzSdk::UltMrzSdkResult::operatorAssign(ultimateMrzSdk::UltMrzSdkResult const&)'
collect2: error: ld returned 1 exit statusCould you please help me to execute second command (how to apply all needed dependencies).Another question concerning last sequence:» Change https://github.com/DoubangoTelecom/ultimateMRZ-SDK/blob/master/java/org/doubango/ultimateMrz/Sdk/ultimateMrzSdkJNI.java#L14 to load "libMRZ_with_for_jni.so" instead of "libultimate_mrz-sdk.so"As I understand I need .dll file to chnage in ultimateMrzSdkJNI.java#L14but the result of command
gcc -shared -o libMRZ_with_for_jni.so ultimateMRZ-SDK-API-PUBLIC-SWIG_java.o
… is .so file (`libMRZ_with_for_jni.so`)Could you please explain me how to configure then ultimateMrzSdkJNI.java
Windows 10 Pro x64jdk1.8.0_211
--
You received this message because you are subscribed to the Google Groups "doubango-ai" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doubango-ai...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/1e0961f1-2820-44f6-a478-96fd790487b1o%40googlegroups.com.
Try Windows and Linux x86_64 binaries at
https://doubango.org/deep_learning/ultimateMRZ-2.3.0-java.zip
they contain Java wrapper
--
You received this message because you are subscribed to the Google Groups "doubango-ai" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doubango-ai...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/1e0961f1-2820-44f6-a478-96fd790487b1o%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to douba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/a96e437c-586f-4dfd-a6fb-f0a7121d08cco%40googlegroups.com.
Sorry but you don't seem to be familiar with Java and if you want help you **MUST ALWAYS** add the logs instead of saying "I can't get it to work".
This said, JNI requires direct buffer. Calling "ByteBuffer.wrap"
won't create a direct duffer which means the C++ pointer null be
null. You have to use "ByteBuffer.allocateDirect". Please check https://github.com/DoubangoTelecom/ultimateMRZ-SDK/blob/master/samples/android/benchmark/src/main/java/org/doubango/ultimateMrz/benchmark/MrzBenchmarkActivity.java#L285
on how to use read a file into direct buffer using Java
To unsubscribe from this group and stop receiving emails from it, send an email to doubango-ai...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/d85847a7-dde8-4c5c-b9af-79dbd84be90ao%40googlegroups.com.
Just to make it clear: The error is the same ("Invalid parameter") but not the same cause. Sharing the logs would have helped us.
- Before, you had the error because you were using stride value equal to 1
- Now, you have the error because you're passing a null
imageData
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/4ee270f6-3c95-8888-8b59-bc7e267721b8%40doubango.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/d85847a7-dde8-4c5c-b9af-79dbd84be90ao%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "doubango-ai" group.
To unsubscribe from this group and stop receiving emails from it, send an email to douba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/4ee270f6-3c95-8888-8b59-bc7e267721b8%40doubango.org.
Good to see you've managed to get it to work. Sorry if my
response was rude and don't hesitate if you have issues or any
technical question.
To unsubscribe from this group and stop receiving emails from it, send an email to doubango-ai...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/1dde76f9-c7fe-46fa-b763-1141be68ea77o%40googlegroups.com.
RESULT -> code: 0, phrase: OK, numZones: 0, json: {"duration":35,"frame_id":0}*[COMPV INFO]: [UltMrzSdkEngine] Call: ultimateMrzSdk::UltMrzSdkEngine::init
*[COMPV INFO]: [UltMrzSdkEngine] jsonConfig: {"debug_level": "verbose","debug_write_input_image_enabled": false,"debug_internal_data_path": ".","num_threads": -1,"gpgpu_enabled": true,"gpgpu_workload_balancing_enabled": true,"segmenter_accuracy": "high","interpolation": "bilinear","min_num_lines": 2,"roi": [0, 0, 0, 0],"min_score": 0.0}
*[COMPV INFO]: [UltMrzSdkEngine] **** Copyright (C) 2011-2020 Doubango Telecom <https://www.doubango.org> ****
ultimateMRZ-SDK <https://github.com/DoubangoTelecom/ultimateMRZ-SDK> version 2.3.0
*[COMPV INFO]: [CompVBase] Initializing [base] modules (v 1.0.0, nt -1)...
*[COMPV INFO]: [CompVBase] sizeof(compv_scalar_t)= #8
*[COMPV INFO]: [CompVBase] sizeof(float)= #4
*[COMPV INFO]: [CompVBase] Windows dwMajorVersion=10, dwMinorVersion=0
*[COMPV INFO]: Initializing window registery
*[COMPV INFO]: [ImageDecoder] Initializing image decoder...
*[COMPV INFO]: [CompVCpu] Hardware: 'GenuineIntel', Serial: '***', Model: '', ModelName: ''
*[COMPV INFO]: [CompVBase] CPU features: (intel);[x86];[x64];mmx;sse;sse2;sse3;ssse3;sse41;sse42;avx;avx2;fma3;erms;bmi1;bmi2;popcnt;cmov;aes;rdrand;
*[COMPV INFO]: [CompVBase] CPU cores: #4
*[COMPV INFO]: [CompVBase] CPU cache1: line size: #64B, size :#32KB
*[COMPV INFO]: [CompVBase] CPU Phys RAM size: #16249GB
*[COMPV INFO]: [CompVBase] CPU endianness: LITTLE
*[COMPV INFO]: [CompVBase] Binary type: X86_64
*[COMPV INFO]: [CompVBase] Intrinsic enabled
*[COMPV INFO]: [CompVBase] Assembler enabled
*[COMPV INFO]: [CompVBase] Math Fast Trig.: true
*[COMPV INFO]: [CompVBase] Math Fixed Point: true
*[COMPV INFO]: [CompVMathExp] Init
*[COMPV INFO]: [CompVBase] Default alignment: #64
*[COMPV INFO]: [CompVBase] Best alignment: #64
*[COMPV INFO]: [CompVBase] Heap limit: #831982KB (#812MB)
*[COMPV INFO]: [CompVParallel] Initializing [parallel] module...
*[COMPV INFO]: /!\ Code in file 'compv_mem.cxx' in function 'compv::CompVMemZero_C' starting at line #501: Not optimized -> No SIMD implementation found
*[COMPV INFO]: [CompVAsyncTask11] compv::CompVAsyncTask11::run(coreId:requested=0,set=useless, threadId:0000000000002BD4, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVThreadDispatcher] Thread dispatcher created with #4 threads/#4 cores
*[COMPV INFO]: [CompVAsyncTask11] compv::CompVAsyncTask11::run(coreId:requested=1,set=useless, threadId:0000000000004754, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVAsyncTask11] compv::CompVAsyncTask11::run(coreId:requested=2,set=useless, threadId:00000000000037C4, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVParallel] [Parallel] module initialized
*[COMPV INFO]: [CompVBase] [Base] modules initialized
*[COMPV INFO]: [CompVCore] Initializing [core] module (v 1.0.0)...
*[COMPV INFO]: [CompVAsyncTask11] compv::CompVAsyncTask11::run(coreId:requested=3,set=useless, threadId:00000000000005BC, kThreadSetAffinity:false) - ENTER
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 1 and name = 'FAST (Features from Accelerated Segment Test)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 8 and name = 'ORB (Oriented FAST and Rotated BRIEF)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 27 and name = 'Sobel edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 28 and name = 'Scharr edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 29 and name = 'Prewitt edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 20 and name = 'Canny edge detector'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 30 and name = 'Hough standard (STD)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 31 and name = 'Kernel-based Hough transform (KHT)'...
*[COMPV INFO]: [CompVFeature] Registering feature factory with id = 41 and name = 'Standard Histogram of oriented gradients (S-HOG)'...
*[COMPV INFO]: [CompVMatcher] Registering matcher factory with id = 0 and name = 'Brute force matcher'...
*[COMPV INFO]: [CompVConnectedComponentLabeling] Registering connected component labeling factory with id = 1 and name = 'PLSL (Parallel Light Speed Labeling)'...
*[COMPV INFO]: [CompVConnectedComponentLabeling] Registering connected component labeling factory with id = 19 and name = 'LMSER (Linear Time Maximally Stable Extremal Regions)'...
*[COMPV INFO]: [CompVGL] Initializing [gl] module (v 1.0.0)...
*[COMPV INFO]: [CompVGL] GL module initialized
*[COMPV INFO]: [CompVGpu] Initializing [gpu] module (v 1.0.0)...
*[COMPV INFO]: [CompVCamera] Initializing [camera] module (v 1.0.0)...
*[COMPV INFO]: [CompVCamera] Camera plugin path: C:\work\projects\ultimateMRZ-SDK\CompVPluginMFoundation.dll
*[COMPV INFO]: [CompVDrawing] Initializing [drawing] module (v 1.0.0)...
*[COMPV INFO]: [CompVDrawing] /!\ No jpeg decoder found
*[COMPV INFO]: [CompVDrawing] Drawing module initialized
*[COMPV INFO]: [CompVGpu] GPU enabled: true
*[COMPV INFO]: /!\ Code in file 'source\ultimate_base_engine.cxx' in function 'ultimateBase::UltBaseEngine::init' starting at line #26: Not optimized for GPU -> GPGPU computing not enabled or deactivated
*[COMPV INFO]: [UltBaseOpenCL] Trying to load [OpenCL.dll]
*[COMPV INFO]: Loaded shared lib: OpenCL.dll
*[COMPV INFO]: [UltBaseOpenCL] Loaded [OpenCL.dll], looksLikeValid: yes...
*[COMPV INFO]: [UltBaseOpenCLUtils] Selected platform vendor: Intel(R) Corporation
*[COMPV INFO]: [UltBaseOpenCLUtils] deviceCount=1
*[COMPV INFO]: [UltBaseOpenCLUtils] Device -> name: Intel(R) HD Graphics 530, id: 000000001EDB46A0
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT=1
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE=1
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_COMPUTE_UNITS=23
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS=3
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_WORK_ITEM_SIZES=256, 256, 256,
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_WORK_GROUP_SIZE=256
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_CLOCK_FREQUENCY=950 MHz
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE=64 B
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_GLOBAL_MEM_SIZE=6815600640 B (6499 MB)
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_LOCAL_MEM_SIZE=65536 B (64 KB)
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_MAX_MEM_ALLOC_SIZE=3249 MB
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_PLATFORM_VERSION=OpenCL 2.1
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_VERSION=OpenCL 2.1 NEO
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DRIVER_VERSION=26.20.100.7323
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_OPENCL_C_VERSION=OpenCL C 2.0
***[COMPV ERROR]: function: "ultimateBase::UltBaseOpenCLUtils::init()"
file: "source\opencl\ultimate_base_opencl_utils.cxx"
line: "96"
message: [UltBaseOpenCLUtils] OpenCL operation failed (-30 -> CL_INVALID_VALUE) ->
***[COMPV ERROR]: function: "ultimateBase::UltBaseOpenCLUtils::init()"
file: "source\opencl\ultimate_base_opencl_utils.cxx"
line: "106"
message: Operation Failed (COMPV_ERROR_CODE_E_UNKNOWN) ->
*[COMPV INFO]: [UltBaseOpenCL] Failed to hook functions using [OpenCL.dll] library
*[COMPV INFO]: [UltMrzSdkEnginePrivate] **** Copyright (C) 2011-2020 Doubango Telecom <https://www.doubango.org> ****
You're using an unlicensed version of ultimateMRZ-SDK <https://github.com/DoubangoTelecom/ultimateMRZ-SDK>
without the rights to include the SDK in any form of commercial product.
*[COMPV INFO]: [CompVCpu] Enabling asm code
*[COMPV INFO]: [CompVCpu] Enabling intrinsic code
*[COMPV INFO]: [UltLstmNetwork] Old local: C, new local: C
*[COMPV INFO]: [UltLstmNetwork] Create LSTM engine for thread 0
*[COMPV INFO]: [UltLstmNetwork] Create LSTM engine for thread 1
*[COMPV INFO]: [UltLstmNetwork] Create LSTM engine for thread 2
*[COMPV INFO]: /!\ Code in file 'compv_mem.cxx' in function 'compv::CompVMemCopy_C' starting at line #953: Not optimized -> No SIMD implementation found. On ARM consider http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka13544.html
*[COMPV INFO]: [UltBaseMachineLearningPredictRBF] Elapsed time (loading model) = [[[ 28 millis ]]]
*[COMPV INFO]: [UltBaseMachineLearningPredictRBF] Newly created RBF binary predictor is GPGPU accelerated: false
bytesPerPixel -> 3
imageType -> ULTMRZ_SDK_IMAGE_TYPE_RGB24
imageWidthInSamples -> 1280
imageHeightInSamples -> 720
*[COMPV VERBOSE]: [UltTextSegmenterTmms] Converting input to grayscale
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_Large_Small_OddAspectRatio collected 1151 indexes
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_Large_Small_OddAspectRatio collected 27 indexes
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_Large_Small_OddAspectRatio collected 739 indexes
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_ExtentSegments collected 9 indexes
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_Large_Small_OddAspectRatio collected 5 indexes
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_GreyLevelBorderContrastSegments collected 0 indexes
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_GreyLevelHomogeneitySegments collected 0 indexes
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_EccentricitySegments collected 0 indexes
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 16
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 24
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 10
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 16
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 12
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 10
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 14
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 16
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 10
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 10
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 10
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 16
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 10
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 12
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 12
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 16
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 10
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 8
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 6
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 2
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltBaseStroke] Number of touching segments: 4
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_ExtentSegments collected 38 indexes
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_GreyLevelBorderContrastSegments collected 0 indexes
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_GreyLevelHomogeneitySegments collected 0 indexes
*[COMPV VERBOSE]: [UltTextFilter] ultimateText::UltTextFilter::collect_EccentricitySegments collected 0 indexes
*[COMPV VERBOSE]: [UltTextSegmenterTmms] Num CCs: 347
*[COMPV VERBOSE]: [UltTextGroupUtils] ultimateText::UltTextGroupUtils::all::<lambda_31e0768970b932acfa5ef21e9340b32a>::operator () collected 0 group(s) using 2 partition(s) and 2 thread(s)
*[COMPV INFO]: [UltMrzSdkEngine] Call: ultimateMrzSdk::UltMrzSdkEngine::deInit
*[COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)...
*[COMPV INFO]: [Thread] Thread with id=0000000000002BD4 will join
*[COMPV INFO]: [CompVAsyncTask11] compv::CompVAsyncTask11::run(threadId:0000000000002BD4) - EXIT
*[COMPV INFO]: Thread with id=0000000000002BD4 will join
*[COMPV INFO]: [Thread] ***Thread with id=0000000000002BD4 destroyed***
*[COMPV INFO]: [Thread] Thread with id=0000000000004754 will join
*[COMPV INFO]: [CompVAsyncTask11] compv::CompVAsyncTask11::run(threadId:0000000000004754) - EXIT
*[COMPV INFO]: Thread with id=0000000000004754 will join
*[COMPV INFO]: [Thread] ***Thread with id=0000000000004754 destroyed***
*[COMPV INFO]: [Thread] Thread with id=00000000000037C4 will join
*[COMPV INFO]: [CompVAsyncTask11] compv::CompVAsyncTask11::run(threadId:00000000000037C4) - EXIT
*[COMPV INFO]: Thread with id=00000000000037C4 will join
*[COMPV INFO]: [Thread] ***Thread with id=00000000000037C4 destroyed***
*[COMPV INFO]: [Thread] Thread with id=00000000000005BC will join
*[COMPV INFO]: [CompVAsyncTask11] compv::CompVAsyncTask11::run(threadId:00000000000005BC) - EXIT
*[COMPV INFO]: Thread with id=00000000000005BC will join
*[COMPV INFO]: [Thread] ***Thread with id=00000000000005BC destroyed***
*[COMPV INFO]: [CompVBase] Base modules deinitialized
*[COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)...
*[COMPV INFO]: [CompVBase] Base modules deinitialized
*[COMPV INFO]: Drawing module deinitialized
*[COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)...
*[COMPV INFO]: [CompVBase] Base modules deinitialized
*[COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)...
*[COMPV INFO]: [CompVBase] Base modules deinitialized
*[COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)...
*[COMPV INFO]: [CompVBase] Base modules deinitialized
*[COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)...
*[COMPV INFO]: [CompVBase] Base modules deinitialized
*[COMPV INFO]: [CompVBase] DeInitializing base modules (v 1.0.0)...
*[COMPV INFO]: [CompVBase] Base modules deinitialized
RESULT -> code: 0, phrase: OK, numZones: 0, json: {"duration":35,"frame_id":0}
private static MrzImage loadImage() throws IOException {
File imageFile = new File("c:\\work\\projects\\ultimateMRZ-SDK\\assets\\images\\Passport-Australia_1280x720.jpg");
BufferedImage originalImage = ImageIO.read(imageFile);
ColorModel colorModel = originalImage.getColorModel();
int width = originalImage.getWidth();
int height = originalImage.getHeight();
int bytesPerPixel = colorModel.getPixelSize() >> 3;
if (bytesPerPixel != 1 && bytesPerPixel != 3 && bytesPerPixel != 4) {
System.err.println(" Invalid BPP:" + bytesPerPixel);
return null;
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageIO.write(originalImage, "jpg", out);
ByteBuffer imageData = ByteBuffer.allocateDirect(width * height * 4);
imageData.put(out.toByteArray());
imageData.rewind();
ULTMRZ_SDK_IMAGE_TYPE imageType = (bytesPerPixel == 1)
? ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_Y
: (bytesPerPixel == 4
? ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_BGRA32
: ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_RGB24);
return new MrzImage(ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_RGBA32, imageData, width, height);
}
public class MrzService {
private final static String CONFIG = "{" +
"\"debug_level\": \"verbose\"," +
"\"debug_write_input_image_enabled\": false," +
"\"debug_internal_data_path\": \".\"," +
"" +
"\"num_threads\": -1," +
"\"gpgpu_enabled\": true," +
"\"gpgpu_workload_balancing_enabled\": true," +
"" +
"\"segmenter_accuracy\": \"high\"," +
"\"interpolation\": \"bilinear\"," +
"\"min_num_lines\": 2," +
"\"roi\": [0, 0, 0, 0]," +
"\"min_score\": 0.0" +
"}";
public static void main(String[] args) throws IOException {
UltMrzSdkResult initResult = UltMrzSdkEngine.init(CONFIG);
System.out.println(" INIT result -> " + resultToString(initResult));
MrzImage image = loadImage();
UltMrzSdkResult mrzResult = UltMrzSdkEngine.process(
image.mType,
image.mBuffer,
image.mWidth,
image.mHeight
);
System.out.println(" MRZ result -> " + resultToString(mrzResult));
UltMrzSdkResult deInitResult = UltMrzSdkEngine.deInit();
System.out.println(" DEINIT result -> " + resultToString(deInitResult));
}
private static String resultToString(final UltMrzSdkResult result) {
return (result == null)
? "null"
: "code: " + result.code() + ", phrase: " + result.phrase() + ", numZones: " + result.numZones() + ", json: " + result.json();
}
private static MrzImage loadImage() throws IOException {
File imageFile = new File("c:\\work\\projects\\ultimateMRZ-SDK\\assets\\images\\Passport-Australia_1280x720.jpg");
BufferedImage originalImage = ImageIO.read(imageFile);
ColorModel colorModel = originalImage.getColorModel();
int width = originalImage.getWidth();
int height = originalImage.getHeight();
int bytesPerPixel = colorModel.getPixelSize() >> 3;
if (bytesPerPixel != 1 && bytesPerPixel != 3 && bytesPerPixel != 4) {
System.err.println(" Invalid BPP:" + bytesPerPixel);
return null;
}
ByteBuffer imageData;
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
ImageIO.write(originalImage, "jpg", out);
imageData = ByteBuffer.allocateDirect(width * height * 4);
imageData.put(out.toByteArray());
imageData.rewind();
}
ULTMRZ_SDK_IMAGE_TYPE imageType = (bytesPerPixel == 1)
? ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_Y
: (
bytesPerPixel == 4
? ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_BGRA32
: ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_RGB24
);
System.out.println(" bytesPerPixel -> " + bytesPerPixel);
System.out.println(" imageType -> " + imageType);
System.out.println(" imageWidthInSamples -> " + width);
System.out.println(" imageHeightInSamples -> " + height);
int orientation = 0;
return new MrzImage(ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_RGBA32, imageData, width, height, orientation);
}
private static class MrzImage {
final ULTMRZ_SDK_IMAGE_TYPE mType;
final ByteBuffer mBuffer;
final int mWidth;
final int mHeight;
final int mJpegOrient;
private MrzImage(final ULTMRZ_SDK_IMAGE_TYPE type, final ByteBuffer buffer, final int width, final int height, final int jpegOrient) {
mType = type;
mBuffer = buffer;
mWidth = width;
mHeight = height;
mJpegOrient = jpegOrient;
}
}
}
...
static final String FILE_NAME_POSITIVE = "Passport-Australia_1280x720.jpg";
...
MrzImage readFile(final String name) {
...
return new MrzImage(ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_RGBA32, nativeBuffer, width, height,orientation);
}
...
*[COMPV INFO]: [UltBaseOpenCLUtils] CL_DEVICE_OPENCL_C_VERSION=OpenCL C 2.0
***[COMPV ERROR]: function: "ultimateBase::UltBaseOpenCLUtils::init()"
file: "source\opencl\ultimate_base_opencl_utils.cxx"
line: "96"
message: [UltBaseOpenCLUtils] OpenCL operation failed (-30 -> CL_INVALID_VALUE) ->
***[COMPV ERROR]: function: "ultimateBase::UltBaseOpenCLUtils::init()"
file: "source\opencl\ultimate_base_opencl_utils.cxx"
line: "106"
message: Operation Failed (COMPV_ERROR_CODE_E_UNKNOWN) ->
*[COMPV INFO]: [UltBaseOpenCL] Failed to hook functions using [OpenCL.dll] library
*[COMPV INFO]: [UltMrzSdkEnginePrivate] **** Copyright (C) 2011-2020 Doubango Telecom <https://www.doubango.org> ****
...To unsubscribe from this group and stop receiving emails from it, send an email to douba...@googlegroups.com.
UltMrzSdkEngine.process(
image.mType,
image.mBuffer,
image.mWidth,
image.mHeight
);
imageData = ByteBuffer.allocateDirect(width * height * bytesPerPixel);
imageData.put(out.toByteArray());
imageData.rewind();
}
ULTMRZ_SDK_IMAGE_TYPE imageType = (bytesPerPixel == 1)
? ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_Y
: (
bytesPerPixel == 4
? ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_BGRA32
: ULTMRZ_SDK_IMAGE_TYPE.ULTMRZ_SDK_IMAGE_TYPE_RGB24
);
System.out.println(" bytesPerPixel -> " + bytesPerPixel);
System.out.println(" imageType -> " + imageType);
System.out.println(" imageWidthInSamples -> " + width);
System.out.println(" imageHeightInSamples -> " + height);
int orientation = 0;
return new MrzImage(imageType, imageData, width, height, orientation);
}
private static class MrzImage {To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/156f8272-bda1-4a7a-b6d9-dcadd4ec8da7o%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/89762cd8-af01-4d37-97ed-e51a0324e150o%40googlegroups.com.
I don't have access to a PC to check everything but what looks sure is that you're not decoding the image.
"ImageIO.write(originalImage, "jpg", out);" -> don't know why you have this line of code
You have to decode the image, on the benchmark sample it's done at https://github.com/DoubangoTelecom/ultimateMRZ-SDK/blob/master/samples/android/benchmark/src/main/java/org/doubango/ultimateMrz/benchmark/MrzBenchmarkActivity.java#L292
To unsubscribe from this group and stop receiving emails from it, send an email to doubango-ai...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/14a7d163-f064-43d1-8211-173a4d77e076o%40googlegroups.com.
File imageFile = new File("c:\\work\\projects\\ultimateMRZ-SDK\\assets\\images\\Passport-Australia_1280x720.jpg");
BufferedImage originalImage = ImageIO.read(imageFile);
* @return a <code>BufferedImage</code> containing the decoded
* contents of the input, or <code>null</code>.
ImageIO.write(originalImage, "jpg", out);
...
imageData.put(out.toByteArray());
...
I have added Java sample for Windows and Linux in version 2.3.4.
No change is needed, just checkout the source code and follow https://github.com/DoubangoTelecom/ultimateMRZ-SDK/blob/master/samples/java/recognizer/README.md
Only two commands, 1 to build and 1 to run:
javac @sources.txt -d .java Recognizer --image ../../../assets/images/Czech_passport_2005_MRZ_orient1_1300x1002.jpg --assets ../../../assets
To unsubscribe from this group and stop receiving emails from it, send an email to doubango-ai...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/d55b5516-1f2f-46c9-b4f6-6fe1daab9101o%40googlegroups.com.