Though the Shogun's rule is extremely strict, Edo's justice system is actually rather simple and not particularly brutal (at least compared to Europe in the 1600s and 1700s). The punishments shown in the picture are not sentences imposed on the guilty. Torture is used only to extract information from people who refuse to cooperate. Criminals who confess their crimes immediately and completely can escape serious torture. Thus, it is not surprising that most petty criminals do confess, if and when they are caught.
Officially, the justice system in Edo has only three punishments: death, banishment or a monetary fine. Death is usually reserved for serious crimes like treason or murder, though it is also imposed on habitual thieves and on people who are a danger to the state (such as those who refuse to renounce Christianity).
Banishment is actually a rather severe punishment. People who are banished will find it very difficult to gain acceptance anywhere else in the country. Any homeless person searching for a new place to live might as well wear a huge sign on their back saying "former convicted criminal". As a result, banished individuals usually end up living a meager existence in the wilds of the remote mountains or in the far north of Japan.
Monetary fines can either be paid in cash or by working off the penalty. In practice "working off" the penalty often means a public whipping. Poor people who are convicted of minor crimes are either whipped, or forced to perform back-breaking labor, such as digging moats and canals or building walls and earthworks. However, there are no jails in Edo, only a Ro-yashiki (prisoner's quarters), where people are held while awaiting trial.
The Ro-yashiki includes torture facilities such as the ones shown here, for people who have not yet confessed, or who are still being interrogated. Homeless people are also sent to the Ro-yashiki to live. They are forced to do heavy manual labor, but at least they are provided with food and shelter until they find a job.