# Find how smooth or rough a surface in an image is

Greetings all.

I am trying to determine from a given image how smooth or rough an object is. This could be a wall, garment, human skin, leather e.t.c. I would also like to determine if it is all one color or there are variations however minimal 'to the extent possible'.

I want then to assign a score say from 1 -10 1 being very smooth and similar color and 10 being rough and / or dotted with places of different hues.

I have an idea to use a smoothing filter. I would load two objects of the same image and smooth one a bit more 'heavily' that the other. I would then subtract the two images. I can imagine that if the image is very smooth, the result of the subtraction will be more or less zero, while for rough objects it will be a lot of noise.

I haven't tried it out yet and I don't know if it would work but it seems too 'simplistic'. Would anyone have a better idea on how this could be achieved? Especially the part of determining smoothness? I am assuming this process of determining smoothness will also give me areas with color disparity. Am I right? Is there a better way to do this?

As an example of an image I would process, see below. These are images of sections of a building walls.

Relatively Smooth Wall

Rough Wall

edit retag close merge delete

Sort by ยป oldest newest most voted

In my opinion might be much simpler, you can use Canny edge detection method for doing this. As we know, the smooth object give less edge and rough object give more edges compared to smooth. The above method may work well for lower threshold values. After finding edge you can divide your image to number of blocks and check for strong edges(roughness) by counting pixels on each blocks. Then you can vote for each block and can decide whether the image is rough or not. From below image you can see that the the smooth object results less edges while the rough one cause more edges after Canny edge detection.

Smooth.jpg

Rough.jpg

I am not sure does it work for image with many other object or with verity of colours even if it smooth. But it should work with the similar image as the above.

more

That was very helpful. Thank you.

( 2013-01-11 01:58:51 -0500 )edit

Canny is highly non-linear and also difficult to control: An approach like this will not yield a continuous score - which is desirable. It is probably better to compute a measure based directly on gradient strengths.

( 2013-01-11 06:14:03 -0500 )edit

Thanks SR. Could you please explain what you mean? I am some newbie in all this. I am getting up to speed and trying to read as much as I can. I tried to do the canny, then I have found that the same image with different lighting / shadow produces different results even after applying a smoothing filter before the canny. I would much appreciate some further direction.

( 2013-01-11 12:47:58 -0500 )edit

Official site

GitHub

Wiki

Documentation

## Stats

Asked: 2013-01-10 08:52:38 -0500

Seen: 4,716 times

Last updated: Jan 11 '13