The deal is for $2.25 million, agent Drew Rosenhaus told ESPN's Adam Schefter.
Melvin, 30, signed a one-year contract with Detroit last March and won the starting job opposite Darius Slay by the start of the season. He defended 11 passes but had no interceptions in 12 starts for Detroit, making a career-high 68 tackles.
Melvin has bounced around the NFL since signing as an undrafted free agent with Tampa Bay in 2013. He spent two seasons with the Colts in 2016 and '17, starting 19 games and having a career-high three interceptions and 13 passes defended in 2017.
He signed with Oakland in 2018, starting seven games and intercepting one pass before signing with the Lions last offseason.
ESPN's Michael Rothstein and Michael DiRocco contributed to this report.