Code covered by the BSD License  

Highlights from
Character Recognition Example (I&II): Pre-processing of Image

  • char1.mCharacter Recognition Example (I):Image Pre-processing
  • char2.mCharacter Recognition Example (II):Automating Image Pre-processing
  • View all files
image thumbnail

Character Recognition Example (I&II): Pre-processing of Image

by

 

02 Oct 2005 (Updated )

This demo shows some examples for image pre-processing before the recognition stage.

char1.m
%% Character Recognition Example (I):Image Pre-processing

%% Manual Cropping 
img = imread('sample.bmp');
imshow(img)
imgGray = rgb2gray(img);
imgCrop = imcrop(imgGray);
imshow(imgCrop)

%% Resizing
imgLGE = imresize(imgCrop, 5, 'bicubic');
imshow(imgLGE)

%% Rotation
imgRTE = imrotate(imgLGE, 35);
imshow(imgRTE)

%% Binary Image
imgBW = im2bw(imgLGE, 0.90455);
imshow(imgBW)

Contact us