subject

The problem: You are to search a bitmap in RGB format and count the number of pixels which match a set of colors. The bitmap will be 1024 by 1024 pixels for the purposes of explaining this problem. The set of colors will comprise 64 entries.
Input:
You shall process a file named CS546.bmp located in the C:\Temp directory. Note that your program will be tested with different sized bit maps. You will also receive a file containing the 64 colors, formatted as three integer values in the range of 0 to 255 (for red, green, and blue), along with a color name. The color name is a string which may contain spaces and apostrophes. For example:
79 105 198 Indigo
95 167 119 Forest Green
0 204 204 Robin's Egg Blue
This file will be named Colors64.txt and it will be located in the C:\Temp directory. You should assume that the number of colors in the file may vary. You should reject any input which has a negative value, or a value greater than 255 and display an appropriate message.
Processing:
1) Open the input files. End the program execution if either open fails. Initialize CPU time and
storage usage measurements.

2.) Read the color file and construct an appropriate container. (For example, an array of structures would be appropriate here. CS532 students may substitute a more sophisticated method.) Initialize the color array (or whatever technique is used) with the contents of the color file. Include an integer count initialized to zero for each entry.
Read the bitmap array. For each pixel in the bitmap, determine if it matches one of the color entries. Maintain a count of the comparisons, matching or not. If it does, add one to the count associated with that entry. If it does not match any entries in the table, add one to a separate count of unmatched color entries.
Output
When all pixels in the bitmap have been evaluated, print out the color name and count of matches from the color array (or whatever other data structure you have chosen). Print the count of comparisons.
The following is the colors. txt file you may use for testing:
Apricot 253 213 177
Aquamarine 149 224 232
Bittersweet 254 111 94
Black 0 0 0
Blue 46 180 230
Blue-Gray 200 200 205
Blue-Green 0 149 183
Blue-Violet 100 86 183
Brick Red 198 45 66
Brown 175 89 62
Burnt Orange 255 112 52
Burnt Sienna 233 116 81
Cadet Blue 169 178 195
Carnation Pink 255 166 201
Copper 218 138 103
Cornflower 147 204 234
Forest Green 95 167 119
Gold 146 146 110
Goldenrod 252 214 103
Gray 139 134 128
Green 58 166 85
Green-Blue 40 135 200
Green-Yellow 241 231 136
Lavender 191 143 204
Lemon Yellow 255 255 159
Magenta 246 83 166
Mahogany 202 52 53
Maize 242 198 73
Maroon 195 33 72
Melon 254 186 173
Midnight Blue 0 70 140
Mulberry 200 80 155
Navy Blue 0 102 204
Olive Green 181 179 92
Orange 255 136 100
Orange-Red 255 63 52
Orange-Yellow 248 213 104
Orchid 226 156 210
Peach 255 203 164
Periwinkle 195 205 230
Pine Green 1 120 111
Plum 142 49 121
Raw Sienna 210 125 70
Raw Umber 102 82 51
Red 237 10 63
Red-Orange 255 104 31
Red-Violet 187 51 133
Salmon 255 145 164
Scarlet 253 14 53
Sea Green 147 223 184
Sepia 158 91 64
Silver 201 192 187
Sky Blue 118 215 234
Spring Green 236 235 189
Tan 217 154 108
Thistle 235 176 215
Turquoise Blue 108 218 231
Violet 115 46 108
Violet-Blue 118 110 200
Violet-Red 247 70 138
White 255 255 255
Yellow 252 232 131
Yellow-Green 197 225 122
Yellow-Orange 255 174 66

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:00
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runners’ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
question
Computers and Technology, 23.06.2019 10:00
What is estimated time of arrival (eta)? a device that measures the acceleration (the rate of change of velocity) of an item and is used to track truck speeds or taxi cab speeds a gps technology adventure game that posts the longitude and latitude location for an item on the internet for users to find a north/south measurement of position the time of day of an expected arrival at a certain destination and is typically used for navigation applications
Answers: 3
question
Computers and Technology, 24.06.2019 03:00
Using a conditional expression, write a statement that increments numusers if updatedirection is 1, otherwise decrements numusers. ex: if numusers is 8 and updatedirection is 1, numusers becomes 9; if updatedirection is 0, numusers becomes 7.
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
Text or graphics that print at the bottom of every page are called footings footers headers headings
Answers: 1
You know the right answer?
The problem: You are to search a bitmap in RGB format and count the number of pixels which match a...
Questions
question
English, 01.07.2019 11:00
Questions on the website: 13722362