At first I did this where `image` is a grayscale image and `example` is a colored image

```
    BasicColorizer[image_, example_] := 
     Module[{grayed, pairs, clustered, rules, default}, 
      grayed = ColorConvert[example, "Grayscale"];
      default = RandomChoice[Commonest[Flatten[ImageData[example], 1]]];
      pairs = 
       Flatten[MapThread[List, {ImageData[grayed], ImageData[example]}, 
         2], 1];
      clustered = GatherBy[pairs, Round[100 #[[1]]] &];
      rules = 
       Append[Round[100 #[[1, 1]]] -> 
           RandomChoice[Commonest[#[[All, 2]]]] & /@ clustered, _ -> 
         default];
      Image[Replace[
        Round[100 ImageData[ColorConvert[image, "Grayscale"]]], 
        rules, {2}]]]

```

And then

```
    limg = First@ColorSeparate[img, "LAB"]
    {lref, aref, bref} = ColorSeparate[ref, "RGB"]

    l2 = HistogramTransform[limg, lref]
    ImageHistogram /@ {l2, lref}

    radius = 2
    {neighimg, neighref} = ColorCombine[{
         MeanFilter[#, radius],
         StandardDeviationFilter[#, radius]}] & /@ {l2, lref}
    nfun = Nearest[
      Flatten[ImageData@neighref, 1] -> 
       Transpose[Flatten@ImageData@# & /@ {aref, bref}]]

    col = Map[First@nfun[#, 1] &, ImageData@neighimg, {2}];
    ColorConvert[
     Image[Join[{ImageData@limg}, Transpose[col, {2, 3, 1}]], 
      Interleaving -> False, ColorSpace -> "RGB"], "LAB"]

 Import["http://fc06.deviantart.net/fs71/f/2012/047/6/b/saint_basil__s_cathedral_by_tomdal-d4pwlwo.jpg"]

```

This is a grayscale image
and after that

```
Import["http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2012/3/14/1331719456752/St.-Basils-Cathedral-001.jpg"]

```

This is colored image.

After that I find Corresponding Points between this to images.

Every object from grayscale image and colored images after colorization should have the same color.

And to do this I choose the same images from net one grayscale and other colored.
Now how can I transfer the colors from colored image into grayscale?

I tried doing it with several methods but I encountered some colorization errors. What can I do?