Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 2 0 points ) The US Postal Service handles over 1 5 0 , 0 0 0 , 0 0 0 , 0 0

(20 points) The US Postal Service handles over 150,000,000,000 pieces of mail every year. With this sort of volume, it is impractical if not impossible for every destination address to be read and analyzed by a person. The natural solution? Computerized handwriting recognition software. In this problem, you will be writing a program which will automatically identify a series of five numbers, such as would be found in a zip code.
It is necessary for our system to know what different numbers look like. This is done by normalizing and analyzing a set of "test" images. Each number is made approximately the same size and stored in a 2828 matrix, with each element corresponding to a grayscale value between 0 and black, 1=white). Then all the matrices associated with one number are analyzed to determine what an average handwritten number looks like. Fortunately, this has already been done so you can start with a set of reference numbers to compare with, which are shown here:
Note that these are a little fuzzy around the edges, as all handwritten numbers look a bit different. The goal is that one of these reference numbers is more similar to the number we are trying to identify than the others, and we will then assign the handwritten number the value of the most similar reference number.
Start by downloading the file input mat from Canvas. Contained in this file you will find an array of cells called digit_avg, which stores the reference numbers, and the series of numbers you are to decipher, sample. Accessing a reference numbers is as easy as calling the number you want with curly brackets. For example digit_avg{1} returns the reference matrix for the number one, digit_avg{2} returns the matrix for the number
2
two, and so on. The exception is zero, which is stored as digit_avg{10}. You can plot a single reference digit with the following command, here for "3":
imshow(digit_avg {3})
If you want this to be bigger, use
imshow(digit_avg{3}, 'InitialMagnification', 400)
The numbers to be identified, in samplo are:
12358
Recall that each number is a 2828 matrix, so the first 28 columns are the first number, the next 28 columns are the second number and so on.
First, write in function called digit_comparo.m which takes as input two 2828 matrices, and returns the sum of the squares of the differences between the corresponding elements. For example, for the matrices d and D, it should calculate
i=128j=128(dij-Dij)2
This function can be used to give a sealar measurement of how similar two images of numbers are to each other, with a smaller result meaning that they are more similar. For example, compare
digit comparo(samplo(; ,1:28, digit avg(1)
to
digit comparo(samplo(; ,1:28), digit_avg (2)
Next, write a program called handyriting_id. w which successively considers pach of the five numbers in sampto from left to right, comparing earh to the 10 possible reference numbers in digit avg to determine which is most similar - here you''ll want to make calls the commanand window,
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started