1. A method of generating a model for image processing, said method comprising: selecting at least one reference image from a plurality of reference images; partitioning the at least one reference image into a plurality of patches; generating an individual patch model for each of the patches, wherein the individual patch model for each patch jointly models a patch density along with spatial structure and texture of the corresponding patch, wherein each individual patch model includes a mean of the corresponding patch and an inverse covariance of the corresponding patch; and generating a model of a probability distribution for the at least one reference image using the individual patch models for the patches; wherein generating the model comprises: calculating a density value for each of the patches; and merging the density values to generate a model of the reference image, the model including a texture and a density of the reference image.