Closed ritzqureshi closed 1 month ago
any sample project that reproduces the problem?
i have created my own in flutter and iam using like this
//Gallery image picked usiing image pciker
static Future<Uint8List?> imagePicker() async {
try {
final XFile? image = await picker.pickImage(source: ImageSource.gallery);
if (image != null) {
return await image.readAsBytes(); // Return the image as bytes
} else {
print('No image selected.');
return null;
}
} catch (e) {
print('Error picking image: $e');
return null;
}
}
//-----selected from gallery ---
final galleryImageBytes = await ImageHelper.imagePicker();
//---Asset image----
final ByteData imageData = await rootBundle.load('assets/images/7.png');
final Uint8List imageBytes = imageData.buffer.asUint8List();
//-----Both Image are same.....
final request = AnnotateImageRequest()
..image = (Image()..contentAsBytes = imageBytes)
..features = [
(Feature()
..type = 'TEXT_DETECTION'
..maxResults = 10)
];
I'm not sure I understand the case. So, here you loaded an image from the gallery, then used some AnnotateImageRequest()
and requested a 'TEXT_DETECTION'
from it. Is the output a list of strings?
That's how you may use the mrz_parser
package:
final mrz = [
'P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<',
'L898902C36UTO7408122F1204159ZE184226B<<<<<10',
];
final result = MRZParser.tryParse(mrz);
The mrz
is a list of strings you get from somewhere.
can you please help me out ,Now mrz give me only limited data from that string is there any other way to get complete data , now mrz only fetch data from this pattern final mrz = [ 'P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<', 'L898902C36UTO7408122F1204159ZE184226B<<<<<10', ]; although we need to extract full data in key value pair from passport .... here is the string 'वीजा / VISA भारत गणराज्य / REPUBLIC OF INDIA टाईप / Type P कोड / Code IND राष्ट्रीयता / Nationality भारतीय / INDIAN पासपोर्ट न. / Passport No. Y3109867 Qureshi उपनाम / Surname QURESHI दिया गया नाम / Given Name(s) RIZWAN जन्मतिथि / Date of Birth 02/05/1995 जन्म स्थान / Place of Birthd लिंग / Sex M MEERUT, UTTAR PRADESH जारी करने का स्थान / Place of Issue DELHI जारी करने की तिथि / Date of Issue 6/03/2022 समाप्ति की तिथि / Date of Expiry 05/03/2032 P<INDQURESHI<<RIZWAN<<<<<<<<<<<<<<<<<<<<<<<< Y3109867<4IND9707081M34060941069704190024<78' i want to get everything as key value pair
give me only limited data from that string
What makes you think that the data is limited?
data is limited because we cannot get Date of Issue, Place of Issue and Place of Birth can you help me to get these field also?
This information is not encoded in MRZ, you may read about the format here https://en.wikipedia.org/wiki/Machine-readable_passport.
is:issue is:open when we use image from assets folder it works fine but when we pick image from gallery it shows an error 'Invalid MRZ parser input. If you think this is a mistake, please file an issue https://github.com/olexale/mrz_parser/issues'