An algorithm of small and dim target detection in deep space background