Automatic detection algorithm for space debris