We have AFM 2D and 3D structures of our prepared thin film ZnTe, I have seen some of the formula to find roughness of thin film. How to calculate roughness values by using formula.
Some free softwares like Gwydion can calculate surface roughness for you. If you want to calculate the roughness values by yourself, you need 3D height information. First, fit a plane to height data and remove it so that any tilt errors do not deteriorate the result. Second, Find mean surface height ( sum of all data points/number of data points). Depending on which surface roughness value you need, you can use the proper formulation directly.
surface roughness is typically characterized by root mean square (rms) roughness. There are many free softwares available. Gwyddion is a very good choice as suggested by Recep Onler. If the 3D height profiles are available one can get the rms roughness by calculating the standard deviation of these height profiles after the linear fit subtraction from each line (row). The linear fit subtraction is necessary to eliminate tilt error. The software can do this for you. Note that the average (or mean of these heights) roughness is NOT a good measure of roughness because there is no absolute ground (z=0 plane) for the surfaces. Also worth to mention: if you plan to compare the roughness of two or more surfaces, always compare the rms roughness calculated over the same surface area (or the scan size). This is because, if the surface has fractal characteristics, the rms roughness in small length scales may also depend on the area of the surface (or scan size) over which the rms roughness is calculated.