Question: hello, thx for reading this complex problem, we need to use c(pelles c) to write this program, i was wondering how to write subfunction for


In this project, students need to finish a program that can recognize an image with handwriting digit, for example, The image is stored in a file. To recognize the image, the image information in the file must be read and stored in a two-dimensional array (matrix), and a certain algorithm is used to calculate the similarity of the handwriting digit to 10 digits from 0 to 9 . The digit with highest similarity will be the output. For example, Figure 1 From Image to array, then from array to digit In this project, students can finish Phase I and Phase II as described below to finish the recognition of a handwriting digit. Phase I: From image file to matrix Input: A file that stores an image with 2828 pixels. Each pixel can be represented as an integer between 0 and 255 (inclusive). Output: Matrix A (2828), Steps from the file to the matrix: 1. Declare an array float A[28][28]. 2. Use the fgets function to skip the first four lines in the file, which are some basic information about this image. 3. Use fgetc function repeatedly to read each pixel from the fifth line until 784 chars have been obtained. Store these chars in the 2828 array. 4. Normalize each pixel value by dividing 255.0 and store into array (Matrix A). Matrix A will be used in Phase II. pixel=fgetc(fp)pixel=pixel/255.0 Example: Phase Figure 2 Phase I. From image to array Phase II: From Matrix A to digit output 1. Reshape Input: Matrix A (2828) from Phase I. Output: Matrix B ( 1784 array). Reshape: B[m28+n]=A[m][n]. Example
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
