Person wey carry the Kakaaki of the King, e remain where he wan blow am because no where wen he go blow am wey nobody no go hear am and the kain beating wey den go beat am…..dem go first give am energy drink because na Bandit beating e go collect. ARNOD SWARCHZINGA 1609
FAKE TAX CARD DETECTION USING OpenCV
Make we quick run this Project based on say, if LASTMA collect person moto for offence like say the person throw pure water nylon for street, normal way to claim the moto back na to present your Lagos State Tax Card and them go con tear receipt for you for the price wey you go pay for your offence.
E beta make the person present original tax card to LASTMA people sha because if by chance LASTMA People read this website and dem read this Project and dem load the card wey the person carry give them and dem run the card for the code wey dey here; the similarity index score con less than 80%. Na im be say them go first give the person broom make hin first sweep from Jibowu Under Bridge to Ikorodu Garage before he go con face the main charges.
Pikin get sense, adult get sense na how dem take create Ile-Ife. LAYONEL RICHIE 1902
OUR APPROACH

Fig 1.
First thing be say we go launch our Google Colab or Jupyter Notebook then roll up our sleeves so we go get chance scatter the coding.
Check Fig 1 well well, you don see Motivation and Our Approach? Oya nau, read am again.
CODE BREAKDOWN
You know say if some people wan do party, no how wey dem no go need souvenirs. In fact, dem dey go as far as importing toothpick and matches wey den go share for the party! If you ask dem why? Den go say NA IMPORTED!
But we, we no go import toothpick and matches abeg, na the package wey go help us detect fake or original card we go import. Their names na structural_similarity, imutils, cv2, Image plus including requests.

Fig 2.
If you see a code wey talk say for example:
from skimage.metrics import structural_similarity
Wetin e mean no hard, e mean say STRUCTURAL SIMILARITY dey stay inside one country wey dem dey call SKIMAGE.METRICS, and the only way to import am if you need am na to call am from him country.
Just like:
from akwa.ibom import etiembom
Or you fit import Ogùnlèwè from Akwa-Ibom? Make I hia!
Plus the one wey just get import for the side e.g. import cv2 mean say you dey import the whole cv2 country put for your project be that.
CREATE A FOLDER WHERE WE WILL KEEP OUR CARD SAMPLES
The only formula wey you fit take create folder na mkdir (dem carry am from Make Directory).

You know say no be msword we dey do, so we no fit copy and paste our image, na formula we go take do everything.

# Fetch the images and assign them to a value
original = Image.open(requests.get(‘https://rasheedatoba.com.ng/wp-content/uploads/2024/03/original-tax-card.jpeg’, stream=True).raw)
fake = Image.open(requests.get(‘https://rasheedatoba.com.ng/wp-content/uploads/2024/03/fake-tax-card.jpeg’, stream=True).raw)
So wetin dey sup here be say we keep our fake and original cards for a file inside rasheedatoba.com.ng so that e go dey easy for us to find. If you like, you fit keep your fake and original card anywhere as long as e get https:// before it. E fit even be Google, Facebook but no be under your bed or inside ya toilet.
We con say ORIGINAL dey equal to the place wey we keep our Original card wey dey rasheedatoba.com.ng. Same thing goes with FAKE equals to. You dey ask me wetin be stream=True).raw? Just know say for now, na so dem dey write am. No sweat you hia?
Image.open(requests.get nkor? You no know say we don import Image and requests before? Oya check Fig 1.
CHECKING AND RESIZING THE IMAGES

Fig 4.
Person wey wan present fake something dey make sure say e go look alike with the original, E mean to say if original get k-leg, fake too must get k-leg. But our Project wan con cast this person wey dey present fake cards up and dan
If e no be Panadol, e no fit be like Panadol.ALBET EHNSTIN 1906

Fig 5.
FINAL OPERATION
After we don complete several operations on the cards like checking the format and size of the images, displaying them and reading the images with opencv wey we import before wey be cv2 na the guy wey go do amebo for us be that.
The reward for ameboism is what? Guess and win 2 Tomtoms.
Make we finish our coding step by step. Grab your popcorn o…..

Fig 6.
Our SSIM wey we also know as Structural Similarity Index na 26.9% which is 26.9/100 chai. E mean say the card na fake.

Fig 7.
SUMMARY
Finding out structural similarity of the images helped us in finding the difference or similarity in the shape of the images. Similarly, finding out the threshold and contours based on those threshold for the images converted into grayscale binary also helped us in shape analysis and recognition.
As, our SSIM is ~26.9% we can determine that the card the user provided is fake or original.
Finally we visualized the differences and similarities between the images using by displaying the images with contours, difference and threshold.
Long and short of this long grammar be say this person present fake tax card which means e go sweep from Obalende to Iyana Oworo be that before e go con face the charges of wetin carry am go LASTMA Office.
Project Video: Click Here
Original Image Credit: Click Here
Code Download: Click Here
Do you have a feedback for me? Kindly click the t.me link at the footer. Thanks
PS: If you’ve read and understood this project, please feel free to add to your CV. Success wishes!