(Canto 10, lines 119-120)
Holy Roman Emperor Frederick II was the grandson of Frederick I Barbarossa and the son of Henry VI. In 1197 he became king of Sicily and sat on the imperial throne from 1214 to 1250. A thorough opponent of the papacy, he was supported by the Ghibellines. In cultural circles, he is noted for his learning and especially his promoting of the Sicilian school of poetry. He is considered a key figure in the Italian transition from the Middle Ages to the Renaissance. For this reason, even though he was a political opponent of Dante, Dante admired and respected him personally, like Farinata (as is seen for example in Canto 13 of Inferno). Like many other opponents of the papacy, Frederick was often considered a heretic and epicurean, and has been accused of trying to prove from the Bible that there was no life after death.
The "Cardinal" mentioned here is Ottaviano degli Ubaldini, who was bishop of Bologna from 1240 to 1244. In 1245 he was named Cardinal and died in 1273. He was the son of a prominent Ghibelline family, and was widely known as simply "the Cardinal" during his lifetime, like here. His Ghibelline, by some termed "heretical" stance made him notorious in his time. His nephew was the famous archbishop Ruggieri, who Dante placed in the ninth circle of Hell (Canto 33). While he supported the Pope and opposed Frederick II, he remained a political Ghibelline all his life, and it does look as if his "heresy" might mostly have consisted of an all to intense interest in secular politics: one quote attributed to him says "If I have a soul, I have lost it a thousand times over on behalf of the Ghibellines."