Patent ID: 8423170

Claim:
A sewing machine comprising: an image capturing device that captures an image; a sewing device that sews a buttonhole having a length in accordance with a shape of a button, based on an image of the button captured by the image capturing device, wherein: the sewing device sews the buttonhole having the length obtained by increasing or decreasing a diameter of the button, the sewing device comprises: a needle bar to which a sewing needle is capable of being attached; a moving device that causes a movement of a sewing target relative to the sewing needle; a moving member that moves with the sewing target relative to the needle bar; and a control device that controls the moving device, the image capturing device captures an image of the moving member, the control device controls the moving device to change at least one of a direction and a distance of the movement of the sewing target relative to the needle bar based on the captured image of the moving member after sewing of the buttonhole has started, the moving member has a mark provided thereon that changes a position in accordance with the movement of the sewing target relative to the needle bar, and the control device controls the moving device to change at least one of the direction and the distance of the movement of the sewing target relative to the needle bar, based on the captured image of the moving member with the mark after sewing of the buttonhole has started.