Ugandan opposition leader Kizza Besigye has vowed to defeat the government in elections, after his release on bail on Monday after two months in detention.
Dr Besigye was once President Museveni's personal physician
Dr Besigye said he had been held illegally and that President Yoweri Museveni should be the one in court.
This was proved by a world court ruling that Uganda was wrong to invade the Democratic Republic of Congo, he said.
Dr Besigye was arrested in November after returning home from four years' exile to contest February's polls.
The International Court of Justice ruled last month that Uganda must pay compensation to DR Congo for looting during the 1998-2003 war and the two countries are negotiating on the level of compensation.
Dr Besigye faces treason, rape, firearms and terrorism charges, which he says are politically motivated.
"Taking our troops to Congo without the authority of parliament as required by the constitution where thousands of our soldiers died. What more treason can there be?", Dr Besigye asked a news conference at his Kampala home before heading east of the capital to attend a campaign rally.
"It should be Museveni in the docks and not Kizza Besigye."
Dr Besigye, a former close ally of Mr Museveni, added that he did not advocate violence.
President Museveni has been in power since 1986
"I have been warning about the possibility of violence in Uganda occasioned by the actions of government. The person who points a finger at the danger is not the cause of the danger."
The Forum for Democratic Change candidate said he was not bitter about the obstacles he faced and that should he get into power he would treat his opposition with respect.
"Certainly as a person I forgive Museveni for all the torture I have gone through," Dr Besigye said.
President Museveni is campaigning in the west of the country.
In court on Monday, the judge said the extension of a military warrant keeping Dr Besigye in prison over additional terrorism charges was illegal.
Presidential candidate Ssebana Kizito is a former mayor of Kampala
Dr Besigye returned briefly to the High Court after his release for the start of his rape trial - before it was adjourned until Wednesday.
At that trial, a 28-year-old woman told the court that Dr Besigye raped her twice in 1997.
Dr Besigye's supporters say the multiple charges against him in civilian and military courts are intended to stop him campaigning ahead of the poll.
He returned from four years abroad to contest February's polls and is viewed as the first credible challenger to Mr Museveni, who has been in power for 19 years.
Three other presidential candidates are contesting next month's polls.
Democratic Party candidate Ssebana Kizito turned up in the middle of Dr Besigye's press conference on Tuesday, prompting speculation that the two may join forces.
These will be the first multi-party elections since Mr Museveni took power.
Ugandan presidential spokesman John Nagenda told the BBC he viewed Dr Besigye's release as a very good thing, as it meant he would not now get any sympathy votes in the presidential election.
"It actually says a lot for the governemnt that they haven't tried to in any way control the judgements of the High Court," he said.