xdd=-4.5 ydd=-4.5
xmid=6 ymid=6
xd=xdd+xmid; yd=ydd+ymid;
A=imread('1.tiff')
xd1=floor(xd); xd2=ceil(xd); yd1=floor(yd); yd2=ceil(yd);
val1=A(xd1,yd1) val2=A(xd2,yd1) val3=A(xd1,yd2) val4=A(xd2,yd2)
xd_abs=abs(xd) yd_abs=abs(yd)
xd_fract=xd_abs-floor(xd_abs) yd_fract=xd_abs-floor(xd_abs)
new_row0 = ((val3 – val1) * xd_fract) + val1 new_row1 = ((val4 – val2) * xd_fract) + val2
new_pxl_val =((new_row1 – new_row0) * yd_fract) + new_row0
where A =
253 203 187 186 230 251 225 228 250 254 253243 145 164 141 184 246 206 212 240 255 252243 152 167 147 190 243 192 197 235 255 252249 122 98 90 189 225 179 218 230 253 253248 127 110 102 189 231 196 217 226 252 253248 126 109 97 182 248 218 231 234 255 252248 126 109 97 184 238 216 217 206 255 252248 126 108 100 187 254 240 239 228 255 252248 128 110 101 189 247 223 244 239 255 252248 121 102 92 185 247 223 229 221 255 251250 159 144 138 203 255 250 240 237 254 252
val1 =
253
val3 =
203 val3-val1
ans =
0
Best Answer