See the image on the next page to figure out why we add 0.5 to the coordinates.
(x,y) is the top left corner of the pixel, we add 0.5 to move it to the center of the pixel.
o0WeiyuFeng0o
If you change +0.5 to -0.5, it will also work; however, the image is shifted 1 pixel to left. - But this is a slight difference that you may not be able to notice.
abhim00
We add 0.5 and 0.5 to center the input at the center of the pixel.
See the image on the next page to figure out why we add 0.5 to the coordinates. (x,y) is the top left corner of the pixel, we add 0.5 to move it to the center of the pixel.
If you change +0.5 to -0.5, it will also work; however, the image is shifted 1 pixel to left. - But this is a slight difference that you may not be able to notice.
We add 0.5 and 0.5 to center the input at the center of the pixel.