Things You'll Need
Instructions
Orient the camera so that the border of the two different scene regions lines up vertically with respect to the camera.
Record an image of the scene. This could be a satellite image of two adjacent agricultural fields, an X-ray of a square plastic plate held in an imaging tray, or a digital camera picture of a white index card on a sheet of black construction paper.
Transfer the image to a numerical array. You need some method of looking at a numerical representation of the image. If you take a webcam image and convert it to a .bmp (bitmap) file, you will end up with a binary file that you can open with a hex editor, available on the web.
Find the rows that correspond to a region where the image transitions from one intensity to another. The pixels in this row could have a pattern something like this: 123, 121, 132, 186, 214, 214. There would be many more pixels, but you need only read the pixels close to the region where the reading is significantly changing.
Average several rows together. This will smooth out the effects due to the pixels not lining up perfectly with the vertical column of pixels. For example, to go with the readings above, you might have a couple other rows, such as: 122, 122, 158, 205, 212, 213; and another: 121, 123, 143, 194, 212, 211. Averaging all three rows results in: 122, 122, 145, 195, 213, 212.
Calculate the absolute value of the change from pixel to pixel in your average. For the example problem, the changes are: 122-122 = 0, 145-122 = 23, 195-145 = 50, 213-195 = 18, 213-212 = 1.
Calculate the average intensity in each of the two separate regions, then find the intensity difference. The average in the lower intensity region is 122, in the higher, it̵7;s 212. The difference is 90.
Divide the differences calculated in Step 6 by the difference calculated in Step 7. For the example problem, this is 0/90, 23/90, 50/90, 18/90, 1/90 = 0, 0.25, 0.56, 0.20, 0.01. That̵7;s the estimated PSF in the horizontal direction.
Repeat the procedure for a horizontal line in the image to get the PSF in the vertical direction. Multiply the PSF(x) times the PSF(y) to get PSF(x,y).