def threshImg(diff, threshL, threshH):
    """Takes in difference image, low and high thresold values, and outputs a map of all defects.
    """
    assert isinstance(threshL, float), ('Wrong data type',
        'threshL must be a float')
    assert isinstance(threshH, float), ('Wrong data type',
        'threshH must be a float')
    threshIL = diff < threshL
    threshIH = diff > threshH
    threshI = threshIL + threshIH
    return threshI
