Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I WILL THUMBS UP IF SOLVE PERFECTLY IN C LANGUAGE!!! A special camera is launched into Mars' orbit to identify and label points of interest

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

I WILL THUMBS UP IF SOLVE PERFECTLY IN C LANGUAGE!!!

A special camera is launched into Mars' orbit to identify and label points of interest" (POI for short), which are essentially pattern files (smaller matrix), within the source image file for scientific research. The camera produces black and white images in varying resolutions in the form of large matrices with integer values between 0 and 255. You must create a program that is capable of reading a file containing such an image and search it for any POI provided by the user through a file as well. Once a POI has been identified, you must mark it by inverting its values (make them negative e.g. 155 becomes -155). Finally after all such Pol's have been found and marked, output the entire matrix to a new file specified by user. Your program must adhere to the following guidelines:- a) Must be dynamic to allow for files of any size to be processed b) Store matrices using appropriate structs (with appropriate initialization functions) c) No memory leakage d) Allow user to choose multiple POI files to mark for a single source image file e) You can assume number of columns of the matrix is provided at the start of the file (but no row count data) Bonus functionality: a) POIs may be rotated either 90, 180, or 270 degrees b) POIs may overlap c) Neither row nor column data is provided in the file Sample run: Input file: 101 175 (123 52 78 184 202 8 219 15 49 254 86 62 156 213 41 200 123 131 252 186 108 116 39 205 243 120 218 239 201 109 52 173 244 58 185 18 64 209 165 222 81 136 247 149 183 206 164 214 179 121 176 200 89 128 61 224 221 103 114 170 88 133 117 30 104 46 19 151 99 111 41 180 188 1 32 27 100 241 97 56 22 10 26 238 248 155 154 106 123 52 78 66 125 225 193 190 54 127 159 3 34 152 41 200 123 146 94 90 195 199 105 191 212 23 194 207 1201 109 52) 231 95 250 150 55 51 227 204 36 80 253 160 215 153 236 124 71 98 75 24947 168 13 211 59 87 240 228 68 63 218 156 101 148 141 91 115 40 38 197 137 83 123 158 239 213 175 157 129 12 5 147 109 33 134 77 144 (101 175 123 123 135 177 9 45 (123 52 78 118 73 232 156 213 123 182 167 162 96 174 41 200 123 11 16 122 218 239 175 161 139 132 44 25 201 109 52 201 216 78 142 138 84 234 72 4 29 52 119 79 42 233 235 140 112 187 21 198 Green boxes highlight non bonus example where submatrices are always oriented straight up and never overlap Blue boxes highlight bonus example where top blue matrix has been rotated by 90 degrees clockwise and bottom blue matrix is oriented straight up Yellow portion highlights overlap occurring between the two blue boxes POI file (non-bonus): 123 52 78 41 200 123 201 109 52 POI file (with-bonus): 101 175 123 156 213 123 218 239 175 Output file: 101 175 -123 -52 -78 184 202 8 219 15 49 254 86 62 156 213 -41 -200 -123 131 252 186 108 116 39 205 243 120 218 239 -201 -109-52 173 244 58 185 18 64 209 165 222 81 136 247 149 183 206 164 214 179 121 176 200 89 128 61 224 221 103 114 170 88 133 117 30 104 46 19 151 99 111 41 180 188 1 32 27 100 241 97 56 22 10 26 238 248 155 154 106 -123 -52-78 66 125 225 193 190 54 127 159 3 34 152 -41 -200 -123 146 94 90 195 199 105 191 212 23 194 207 -201 -109-52 231 95 250 150 55 51 227 204 36 80 253 160 215 153 236 124 98 75 249 47 168 13 211 59 87 240 228 68 63 -218 -156-101 148 141 91 115 40 38 197 137 83 123 158 -239 -213 -175 157 129 12 5 147 109 33 134 77 144 -101 -175 -123-123 135 177 9 45 -123 -52 -78 118 73 232 -156 -213 -123 182 167 162 96 174 -41 -200 -123 11 16 122 -218 -239 -175 161 139 132 44 25 -201 -109-52 201 216 78 142 138 84 234 4 52 119 79 42 233 235 140 112 187 21 198 71 72 29 A special camera is launched into Mars' orbit to identify and label points of interest" (POI for short), which are essentially pattern files (smaller matrix), within the source image file for scientific research. The camera produces black and white images in varying resolutions in the form of large matrices with integer values between 0 and 255. You must create a program that is capable of reading a file containing such an image and search it for any POI provided by the user through a file as well. Once a POI has been identified, you must mark it by inverting its values (make them negative e.g. 155 becomes -155). Finally after all such Pol's have been found and marked, output the entire matrix to a new file specified by user. Your program must adhere to the following guidelines:- a) Must be dynamic to allow for files of any size to be processed b) Store matrices using appropriate structs (with appropriate initialization functions) c) No memory leakage d) Allow user to choose multiple POI files to mark for a single source image file e) You can assume number of columns of the matrix is provided at the start of the file (but no row count data) Bonus functionality: a) POIs may be rotated either 90, 180, or 270 degrees b) POIs may overlap c) Neither row nor column data is provided in the file Sample run: Input file: 101 175 (123 52 78 184 202 8 219 15 49 254 86 62 156 213 41 200 123 131 252 186 108 116 39 205 243 120 218 239 201 109 52 173 244 58 185 18 64 209 165 222 81 136 247 149 183 206 164 214 179 121 176 200 89 128 61 224 221 103 114 170 88 133 117 30 104 46 19 151 99 111 41 180 188 1 32 27 100 241 97 56 22 10 26 238 248 155 154 106 123 52 78 66 125 225 193 190 54 127 159 3 34 152 41 200 123 146 94 90 195 199 105 191 212 23 194 207 1201 109 52) 231 95 250 150 55 51 227 204 36 80 253 160 215 153 236 124 71 98 75 24947 168 13 211 59 87 240 228 68 63 218 156 101 148 141 91 115 40 38 197 137 83 123 158 239 213 175 157 129 12 5 147 109 33 134 77 144 (101 175 123 123 135 177 9 45 (123 52 78 118 73 232 156 213 123 182 167 162 96 174 41 200 123 11 16 122 218 239 175 161 139 132 44 25 201 109 52 201 216 78 142 138 84 234 72 4 29 52 119 79 42 233 235 140 112 187 21 198 Green boxes highlight non bonus example where submatrices are always oriented straight up and never overlap Blue boxes highlight bonus example where top blue matrix has been rotated by 90 degrees clockwise and bottom blue matrix is oriented straight up Yellow portion highlights overlap occurring between the two blue boxes POI file (non-bonus): 123 52 78 41 200 123 201 109 52 POI file (with-bonus): 101 175 123 156 213 123 218 239 175 Output file: 101 175 -123 -52 -78 184 202 8 219 15 49 254 86 62 156 213 -41 -200 -123 131 252 186 108 116 39 205 243 120 218 239 -201 -109-52 173 244 58 185 18 64 209 165 222 81 136 247 149 183 206 164 214 179 121 176 200 89 128 61 224 221 103 114 170 88 133 117 30 104 46 19 151 99 111 41 180 188 1 32 27 100 241 97 56 22 10 26 238 248 155 154 106 -123 -52-78 66 125 225 193 190 54 127 159 3 34 152 -41 -200 -123 146 94 90 195 199 105 191 212 23 194 207 -201 -109-52 231 95 250 150 55 51 227 204 36 80 253 160 215 153 236 124 98 75 249 47 168 13 211 59 87 240 228 68 63 -218 -156-101 148 141 91 115 40 38 197 137 83 123 158 -239 -213 -175 157 129 12 5 147 109 33 134 77 144 -101 -175 -123-123 135 177 9 45 -123 -52 -78 118 73 232 -156 -213 -123 182 167 162 96 174 -41 -200 -123 11 16 122 -218 -239 -175 161 139 132 44 25 -201 -109-52 201 216 78 142 138 84 234 4 52 119 79 42 233 235 140 112 187 21 198 71 72 29

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

Principles Of External Auditing

Authors: Brenda Porter, Jon Simon, David Hatherly

4th Edition

0470974451, 9780470974452

More Books

Students also viewed these Accounting questions

Question

=+b) Check the conditions for making a confidence interval.

Answered: 1 week ago

Question

=+Does it make you feel cool?

Answered: 1 week ago