Nowadays, CNC machines have high importance in manufacturing factories and workshops due to its high accuracy and flexibility. Unfortunately it still cannot ensure the quality of machined products. The trend towards automation in machining has been driven by the need to maintain high product quality with improving production rate. These improvements can be possible by monitoring and control of machining process, in this research a new algorithm is introduced for the direct measurement of cutting tool wear by vision system on the basis of edge detection and morphological operations for the captured images. The results showed the efficiency of the proposed method for online monitoring of the tool condition.