1. A method for effectively performing local image similarity measurement and a system equipped with such a method for performing an image processing task with an electronic device, comprising: an image processor that performs an intermediate-results calculation procedure to calculate intermediate result values that are based upon corresponding pixels of a target patch and one or more similar patches, said image processor moving said target patch of said intermediate-results calculation procedure in a raster order, said image processor performing an intermediate-results combination procedure by calculating appropriate statistics of said intermediate result values to produce processed pixel values; and a processor device that controls said image processor to perform said image processing tasks including, but not limited to, demosaicing and denoising.