(Solved) : C Programming Language Problem Title Introduction Computer Vision Jojo Outstanding Student Q43951609 . . .
C Programming Language
Problem Title: Introduction to ComputerVision
Jojo is an outstanding student who is currently pursuing hisComputer Science degree. In one of his Computer Vision lectures,his lecturer tackled a topic about binary
thresholding.
For simplicity, binary thresholding is an image filtering methodused to separate low val-
ued pixels (dark) from high valued pixels (bright). Each pixels inan image is classified
as low or high based on a certain threshold K. If a pixel Pij ≤K, then it is classified as
low pixel, otherwise it is considered as high pixel.
The problem with binary thresholding method is that the value of Kmay varies from
images. If K is set too a very low value, then a lot of pixels inthe image will be considered
high valued pixels, likewise the opposite case. Thus Jojowants to find the value of K
such that the absolute difference between the amount of dark pixelsand bright pixels is
minimum.
Format Input
The program is expected to read a file”testdata.txt” which contains at most 500 test cases
of inputs, each containing 2 integers N, M which defines dimensionof the image. Each
test case contains N lines of M integers, where each valuerepresents the image pixel
value.
Format Output
Output should be expressed in format ”Case #X: Y ” – X is thenumber of the test
case, and followed by Y rounded to the nearest integer number, suchthat when binary
threshold Y is applied to the image, the absolute differencebetween the amount of dark
pixels and bright pixels in the filtered image is minimum..
Constraints
• 1 ≤ T ≤ 500
• 1 ≤ N , M ≤ 100
• 1 ≤ |S| ≤ 100
• 0 ≤ Pi j ≤ 255
Sample Input(testdata.txt)
2
19 3
1 235 160
2 159 113
162 46 106
108 216 124
22 189 16
60 119 185
156 16 239
76 123 113
83 60 25
52 3 80
184 233 53
168 162 135
6 9 214
124 250 200
195 49 48
8 13 164
91 236 108
229 166 176
58 107 43
7 11
169 127 197 173 160 172 132 202 25 5 79
111 17 106 100 120 231 32 218 43 218 88
238 80 172 106 94 204 102 143 185 160 19
32 1 215 244 178 109 246 110 54 193 89
163 212 229 95 52 7 54 146 61 105 232
44 14 229 54 2 241 22 21 43 44 39
34 235 97 138 200 195 227 106 16 79 167
Sample Output(Standard Output)
Case #1: 113
Case #2: 109
Expert Answer
Answer to C Programming Language Problem Title: Introduction to Computer Vision Jojo is an outstanding student who is currently pu…
OR