Reputation: 27
How to find the matrix value from this signature picture?
how to find the matrix value from:
- RGB image to Gray Scale
- Gray Scale to Binary Image
- Binary Image to Inverted Binary Image
- Inverted Binary Image with clean border
- Inverted Binary Image with clean border to extract bounding box
I already know the code from RGB to extract bounding box:
%// Read in image and convert to binary
%// Also clear the borders
im = imread('http://postimg.org/image/qptg2jgsz/2a2705fb/');
im_bw = imclearborder(im2bw(rgb2gray(im)));
%// Find those non-zero pixel locations
[rows, cols] = find(im_bw);
min_row = min(rows);
max_row = max(rows);
min_col = min(cols);
max_col = max(cols);
%// Now extract the bounding box
bb = im_bw(min_row:max_row, min_col:max_col);
%// Show the image
imshow(bb);
Upvotes: 0
Views: 503
Reputation: 35525
Edit: Actually in your code you already have the binary image... BW stands for Black and white...
Have you tried the basic Matlab example?
BW = im2bw(I, level);
In case you want an automatic choice of threshold level try Otsu's method.
level = graythresh(I)
Upvotes: 1