# Kindly, help me to understand the given MIPS programming problem

#### user366312

Gold Member
Problem Statement
I am given a project of MIPS assembly programming. But, I am not being able to understand what it says.
Relevant Equations
Histogram, and Mode.
The input BMP image (24-bit RGB) contains one of three food types from the given set
(Table 1). Your task is to recognize the food and print in the console window its three-
character code given in Table 1.
The recognition should be performed in two three steps:
1. Preparation of the histogram of given color component (table 1). The histogram
contains number of pixels for each value of given color component.
2. Based on the histogram the mode should be calculated. Mode of a set of data values
is the value that appears most often.
3. Mode ranges of images belonging to different food types are different. So, you can
make decision which food type the image should be assigned to.
I don't think I understood the problem clearly.

What I understood is this:
1. Each food item has a specific major color-component (and, hence, a fixed mode-value of that specific color component). First, I need to calculate all mode values, and use them as constants in my program.
2. When I am given a sample image as an input, 1st I need to see which component is major (based on its mode-value).
3. Then, I need to compare that mode-value with previously computed constant mode values.
4. Closest one matches the food.

Am I correct?

If that is so, what is the purpose of that table with 12 rows? What is it given for?

Especially, take a look at 11th row of the table where all pictures are red, but says green-component.

#### Attachments

• 272.2 KB Views: 9
Last edited:
Related Engineering and Comp. Sci. Homework News on Phys.org

#### Mark44

Mentor
Problem doesn't seem to be clearly stated to me. What I get from the description (in the PDF) is that you are given an image file of 200px across by (up to) 200px down. Part of the file is the image data, which shows the colors used in each pixel, in 24 bits. I'm guessing that your program needs to find the image data, and then go through it pixel by pixel, figuring out what is the major color component.

I don't know what the purpose of the table is, nor do I know why the 11th says green component, but possibly the green component is the strongest and it's mixed with some amounts of red and blue.

"Kindly, help me to understand the given MIPS programming problem"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving