Processing an input image using probability
I'm not familiar with the algorithm, so I can't say whether there is a radically different approach which will improve performance. That said:


With such short variable names it's hard to know what things are. What is c0 actually? What does the "t" in rt and ct mean? Also, the structure and semantics of prob is completely opaque. I can guess that it's related to probability in some way, but why do you only care about the third index of its shape and what is prob[r0, c0, c]?
Try compressing the calculation into a single expression to avoid reassigning so many times. This should be optimised away, but see point 4.
Instead of converting the height and width indexes into floating point numbers, can you use an integer scaling factor to avoid floating point math?
This sort of performance problem really should be profiled, but without the full context and realistic images it would amount to nothing more than guesses.