1. Forgot to convert to double. I mentioned that if you use ‘imread’ to read in an image, it will be in uint8 format. This format is less reliable than double because it does not “support” floating-point operation. It is a good idea to convert images to double format before any calculation of quantities such as MSE.
2. Pitfall with imwrite. Sometimes imwrite(x,…) does not produce the correct result. You need imwrite(x/255,…) instead.
3. imrotate: there are two directions – clockwise (negative angle) and anti-clockwise (positive angle).
4. hough: “[H, THETA, RHO] = HOUGH(BW) computes the SHT of the binary image BW. THETA (in degrees) and RHO are the arrays of rho and theta values over which the Hough transform matrix, H, was generated.” If you have carefully read this help information, THETA and RHO are not relevant to peak detection in the Hough transform domain.
5. noise power calculation: given a clean image x and a noisy image y (assuming impulse noise), the noise power is the percentage of x~=y (not x==y).


Dear Prof. Xin Li
Congratulations and thank you very much for your weblog! It is very interesting, insightful and useful.
Gonçalo Valadão (finishing PhD in Portugal)