Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 reshape after phase 1. thanks a lot image text in transcribed
image text in transcribed
image text in transcribed
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

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

Recommended Textbook for

Power Bi And Azure Integrating Cloud Analytics For Scalable Solutions

Authors: Kiet Huynh

1st Edition

B0CMHKB85L, 979-8868959943

Students also viewed these Databases questions