Real time detecting technique for workpiece based on computer vision