python code slow skin detection
<p>This code changes the color space to LAB and using a threshold finds the skin area of an image. but it's ridiculously slow. I don't know how to make it faster ?    </p>

<pre><code>from colormath.color_objects import *

def skinDetection(img, treshold=80, color=[255,20,147]):

    print img.shape
    res=img.copy()
    for x in range(img.shape[0]):
        for y in range(img.shape[1]):
            RGBimg=RGBColor(img[x,y,0],img[x,y,1],img[x,y,2])
            LABimg=RGBimg.convert_to('lab', debug=False)
            if (LABimg.lab_l &gt; treshold):
                res[x,y,:]=color
            else: 
                res[x,y,:]=img[x,y,:]

    return res
</code></pre>
