An acclaimed chronicler of samurai history and folklore once wrote,
Under Tokugawa law, it was an inalienable right of the men of the warrior class to inflict capital and swift retribution for an insult perpetrated by a commoner. The samurai held strength and courage as the ultimate forms of male virtue while cowardice and meanness represented the basest immortality. In the face of disrespect or contempt the only way for a man to preserve his dignity as a samurai was to strike down the perpetrator immediately.
The following picture depicts a higher ranked samurai
While this one depicts the lower ranked samurai during the last years of the Tokugawa.
Both photos come from the fantastic Taiga drama, Ryomaden.