A system controller serving as a controller for controlling a forming machine acquires, from a sensor which outputs image data for determining a distance in a height direction by sensing a predetermined area including a machining area of the forming machine, background image data not including an image of a workpiece and an operator of the forming machine, and current state image data representing a current state of the predetermined area during operation of the forming machine. The system controller calculates difference data indicating a difference between the background image data and the current state image data, and determines an area of the operator in the predetermined area based on the difference data. The system controller controls operation speed of the forming machine based on a result of the determination.