What are the criteria to consider when ordering dc motors for a line following robot?
Is there a way to calculate the torque required?
It's a question of balance as always. You need to select motors that require voltage and current that your robot's power source can provide, physical size so that it fits on your robot and also torque and RPM to give your robot enough oomph. Also note that gearbox and wheel size affect the final top speed an acceleration.
What I did was to go through several suppliers and preselect motors with acceptable physical dimensions and voltage. Then I made a spreadsheet where I calculated robot acceleration at motor stall from torque and robot speed from motor's free running RPM with estimated robot mass and with all wheel sizes in a certain range. From this spreadsheet I selected set of parameters (2G acceleration and 3m/s top speed for my tabletop line follower) that seemed the best and bought the motors.
When doing this you must realize that the top speed and acceleration are only theoretical maximum, your robot will be slower (because the motor is loaded when dragging your robot around) and there will probably also be less available acceleration as well.