Thresholding surely must be applied after sobel filter.
Instructions for using filters.