For realistic results you need to:
1) Recognize what is and isn't part of that surface. If the lighting or texture are anything less than perfectly flat, this becomes an exercise in edge detection -- or asking the user to help outline the affected area.
2) Recognize what variations are part of the surface texture and should be removed, versus which are lighting effects and must be retained and applied to the new surface treatment.
3) If the new surface has texture, recognize what the size and orientation of this surface is, so you know how scale/stretch/skew the texture to correctly reflect perspective and dimensions.
4) use all that information to process your new texture onto the area of the image occupied by that surface.
Doing a manually assisted version of this isn't bad; it's a suitable final project for an introductory class in image processing. Automating it gets tough.
The various manufacturers of wall treatments, shingles, siding and so on sometimes offer free tools which will do some of this. There are also some tools that take semi-standardized data files from manufacturers and do this; a reduced-function version of that may be available as freeware. I'd suggest doing some market research -- find and try out a few of those, decide what you do and don't like about them, and use that to guide your own design.
There's also going to be a lot of discussion of this sort of process in older editions of the SIGGRAPH proceedings, back when we were still figuring all of this out. Some books on computer graphics may also discuss texture replacement.
Have fun!