In a paper currency I want to check the strip is broken or solid line. For that I took a picture with
the background a strong light. And I got the following two pictures, one a genuine currency and
the other a fake one. I cropped the image at the position where the strip exist and did opening-
closing reconstruction, and finally to count the black pixels. But the result is not as I desired.
Any help?
Here are the images:
%Code for the thine strip
clear all;
close all;
I = imread('IMG_4267.jpg');
imageSize = size(I);
croppedImage = imcrop(I,[300 0 30 570]);
gray=rgb2gray(croppedImage);
se1 = strel('square',2);
I1e = imerode(gray, se1);
I1e = imreconstruct(I1e, gray);
I1b = imdilate(I1e, se1);
I1c = imreconstruct(imcomplement(I1b), imcomplement(I1e));
I1d = imcomplement(I1c);
Edge2=edge(I1d,'canny');
BW1 = im2bw(Edge2);
nBlack = sum(BW1(:));
Here is my rather botched attempt at determining whether your bank note is fake or real. One
thing I have noticed between the notes is that the real note has its thin strip to be more or less
continuous while the fake strip has fragmented thin lines in the strip. One could say that the fake
note has more than one line in the thin strip while the real note only has one line. Let's try and
get our image so that we detect the strip itself (as you have also have tried) and we count how