Automatic measurement of leaf area