blinkid-android icon indicating copy to clipboard operation
blinkid-android copied to clipboard

How to differentiate scan document

Open samirpramanik opened this issue 4 years ago • 4 comments

Description

We are using your sample - BlinkID-CustomCombinedSample and the recognizer - BlinkIdCombinedRecognizer. We understand that this is a common recognizer for all documents, but we wish to restrict the recognizer to scan a specific type of document. Can this be achieved using any filters? For example while scanning passport, it should not recognize id card mrz.

samirpramanik avatar Jan 25 '21 14:01 samirpramanik

Hi @samirpramanik

You can filter which document you want to scan with the classInfo feature with the BlinkID recognizer.

With this feature, you can get the document type, country, and region.

More information here: https://blinkid.github.io/blinkid-android/com/microblink/entities/recognizers/blinkid/generic/BlinkIdCombinedRecognizer.html#setClassFilter-com.microblink.entities.recognizers.blinkid.generic.ClassFilter-

For instance, if you want to limit the scanning to only be for the Belgium ID, the sample code would be:


      recognizer = new BlinkIdCombinedRecognizer();
        
        recognizer.setClassFilter(new ClassFilter() {
            @Override
            public boolean classFilter(@NonNull ClassInfo classInfo) {
                return classInfo.getCountry().equals(Country.BELGIUM) && classInfo.getType().equals(Type.ID);
            }
            @Override
            public int describeContents() {
                return 0;
            }
            @Override
            public void writeToParcel(Parcel dest, int flags) {
            }
        });

Let me know if you have any additional questions.

Regards, Milan

mparadina avatar Jan 26 '21 11:01 mparadina

Hello @samirpramanik,

Just wanted to make a follow-up here, is there anything else we could assist with?

Best regards, Anja

anjapenic avatar Jun 02 '21 13:06 anjapenic

I have tried using the class filter, but it still scans a document with class type NONE and country NONE.

however im looking for class type ID only and country egypt

private val classFilter = object : ClassFilter {
        override fun describeContents(): Int {
            return 0
        }

        override fun writeToParcel(dest: Parcel?, flags: Int) {
            // no-op
        }

        override fun classFilter(classInfo: ClassInfo): Boolean {
            return classInfo.country == Country.EGYPT && classInfo.type == Type.ID
        }
    }

mohamadbadr avatar Sep 15 '21 12:09 mohamadbadr

Hi @mohamadbadr,

Could you please contact us at [email protected] so we could inspect your license key and see where's the issue here?

Best regards, Anja

anjapenic avatar Sep 16 '21 07:09 anjapenic

This issue was closed because it has been inactive for such a long time. If the issue persists, please open a new one.

krizaa avatar Jan 02 '23 12:01 krizaa