Object tracking is one of the main issues in image processing. A real-time CNC is designed and implemented in which the target image is taken using the digital camera every ten milliseconds. After extracting the new position, the target's exact location is sent to the CNC; then, the CNC pen will move to that location and copy the target path. In this project, a Raspberry Pi 3 Model B+ board is used as the processor and the controlling board, a Raspberry Pi digital camera is the input unit, and the CNC motors and its pen are the output unit. The target is a small dark dot moving on a white surface with the dimensions of 4.5 cm × 4.5 cm. The camera is placed under the surface, so a tiny magnet is used on the surface, which the user can easily displace to move the target. Kinematic analysis of the proposed structure is done using Denavit-Hartenberg parameters. The CNC is programmed in Python and implemented using stepper motors and an output plane. Template Matching TM_CCOEFF_NORMED function of the OpenCV image processing library of Python is used to read and detect the target. Various test results show that the machine is successful both in repeating the patterns created by the user and reproducing the same line without deviation.