From The CATO Institute:
To execute any search or seizure, a police officer must reasonably suspect that a crime has been or is being committed based on the facts available to him at the time he executes the search or seizure. Under this standard, searches can be lawful even if the officer is mistaken in his understanding of the facts before him, as long as his understanding led him to reasonably suspect criminal activity. But what if the officer is mistaken about whether a particular activity is actually criminal?