The heat equation in relation to smoothing algorithm Recently I learned about a technique in image processing, which has its roots in something called the 'heat equation' from physics. The original creators of this technique were inspired by the physics of how heat diffuses through an object. 
The objective of course is to 'smooth out' the image, for general noise removal. This was done by taking a Gaussian kernel, and convolving it with the image. However, the professor says that the heat-equation is actually a generalization of this process, and in fact, we can get much better techniques using the heat-equation framework. 
Essentially, if the original image we have is $I$, then the heat equation framework says that:
$$
I(t) = \nabla \cdot (\ D(x,y) \ \nabla I)
$$
where the $\nabla$ means spatial derivative, (I think). The $I(t)$ indicates the image new image at some point in time as it evolves - as heat flows - as this algorithm is run. Finally, the $D(x,y)$ is the "diffusion co-efficient", and if $D=1$, (or any constant), then the above simply collapses to a Gaussian kernel convolving the image $I$. 
Now, what I am hoping for is the following: I am hoping someone here can add some intuitive insight into how/why this is working, vis-a-vis a physical analogy to 'heat flow' in the image. 
The way I currently understand it, is that we have an image. The bigger the amplitude of certain pixels, the 'hotter' those pixels are. In fact every image pixel is as hot as its amplitude. Now, we also know from physics and entropy, that the heat will try to dissipate, so that eventually, the "temperature" across the image becomes equal. (This I take it, is what is happening when a gaussian convolves the image - this is the 'smearing' we are seeking for removal of noise...). 
Now, with the diffusion co-efficient being a constant or 1, this 'heat flow' occurs everywhere. However, if the diffusion co-efficient is, say, a binary function of the spatial image, the the co-ordinates of where $D(x,y)$ equal 0, are where no heat can flow through, and so those are pixels that are spared from the heat flow... 
Is my understanding of this physically inspired algorithmic technique correct? Are we really doing nothing but 'simulating' heat flow, except in the frame work of an image? Thank you so much.
 A: The heat equation comes from two very intuitive ideas: the rate of heat flow is proportional to the temperature difference, and the conservation of energy.
First, from Newton's law of cooling or Fourier's law we get that the flow of heat is proportional to the gradient of the temperature:
$$\mathbf{j}_{\text{heat}}=-k \nabla T$$ where $k$ is the thermal conductivity, and the minus sign represents that heat flows from the hot areas to the cold areas.
For energy to be conserved, the amount of heat leaving a given point has to be equal to the rate of change of heat contained at that point. This is represented by the continuity equation:
$$\nabla \cdot \mathbf{j}_{\text{heat}} = -\frac{\partial q}{\partial t} $$
This equation basically says "the rate of heat decrease at a point is equal to the rate at which it flows out". The operator $\nabla \cdot$ is called the "divergence" and represents the tendency of a vector quantity to flow away from where it's being calculated.
Putting these two together:
$$\frac{\partial q}{\partial t}=-\nabla \cdot \mathbf{j}_{\text{heat}}=-\nabla \cdot (-k) \nabla T$$
We then multiply both sides by the heat capacity $c_p$ and cancel out the minus signs:
$$\frac{\partial T}{\partial t}=c_p\nabla \cdot (k \nabla T)$$
and finally combine $c_p$ and $k$ into the diffusion coefficient $D$.
$$\frac{\partial T}{\partial t}=\nabla \cdot (D \nabla T)$$
A: Yes, you are literally simulating the flow of heat through a material. The diffusion coefficient is basically just a local measure of thermal conductivity and heat capacity. Rather than convolving your image with a Gaussian kernel, you could use something like the Crank-Nicholson method and make some number of timesteps. You could also adjust $D$ to make it greater in parts of the image with greater noise.
$\nabla$ is the gradient operator. It's a vector operator that looks like this in two dimensional cartesian coordinates: $$ \nabla= \hat{\mathbf{x}} \frac{\partial}{\partial x} + \hat{\mathbf{y}} \frac{\partial}{\partial y}$$ where $\hat{\mathbf{x}}$ and $\hat{\mathbf{y}}$ are the unit vectors pointing in the $x$ and $y$ directions.
In short, your intuitive understanding is correct.
