The increasing of robotics equipped with machine vision sensors applied to Precision Agriculture is demanding solutions for several problems. The robot navigates and acts over a rough surface, considering specific restrictions. The information to navigate between the crops is supplied by physical sensors and mainly by some imaging detection system to the robot. The vision system for this kind of robots has many challenges, as changes in luminosity, uncontinuous crop row, processing capacity and time, as well as terrain conditions, among others. The aim of this research is to propose a method to develop a vision system for a tractor robot based on: PCA dimensionality reduction algorithm, the second derivative method and a genetic algorithm for crop row detection.