The 25-year-old has signed a three-and-a-half year deal with the Welsh giants after making just 72 appearances in all competitions over four years with the Black Cats
Campbell has signed a three-and-a-half year deal with the Welsh giants, but the fee remains undisclosed.
The former Manchester United striker arrived at the Stadium of Light in the summer of 2009, but struggled badly with injuries and made just 72 appearances in all competitions in four years.
The 25-year-old made 15 appearances for Martin O'Neill's men this season, scoring once. His departure may free up funds for an increased bid for Swansea striker Danny Graham.
Cardiff currently lead the Championship by 10 points from Leicester and Hull as they look to secure a first ever promotion to the Premier League.