Diseases in plants cause major production and economic losses in agricultural industry. Excessive use of pesticide for plant diseases treatment increases the cost and environmental pollution. In order to prevent this, an early disease detection system can aid in decreasing such losses caused by plant diseases and can further prevent the spread of diseases. One of the common dangerous diseases which can cause major production and economic losses to cucumber and melon plants specially in humid weather is downey mildew ( Pseudoperonospora cubensis ). It can destroy all plants in green houses in less than 24 hrs. The visible symptoms often appear as chlorotic and angular spots on the leaves. In practice, the disease diagnosis of cucumber is normally assessed either subjectively by experienced personnel or by some pathological analysis techniques. These methods are time-consuming and destructive which make it unsuitable for early disease detection and prevention. This project was carried out to develop an image processing system to rapid and nondestructive detection of cucumber downy mildew in greenhouse. To get to this result, at first photos was taken from the cucumber in natural light using Canon A70. These images were processed in Matlab software. This was done by encoding images to HSV color space. In preprocessing stage, the leaves were separated from the background by encoding the images to HSV color space and studying the histograms of images in hue component and exercising morphological filters in order to filter out the noises. Then, considering colorful characteristics of spots in hue component, they were separated from the leave images and were converted into binary images. Due to similarity between color spectrum of downey mildew and other cucumber diseases and some nutritional deficiencies; the angularity of the spots were used to separate them from other disease symptoms. Therefore the algorithm was completed using morphological image processing based on geometric features of downey mildew symptoms. When the program is performed, you can face to three cases: 1) if the symptom is not recognized at the color processing stage, the sample is reported as a healthy leaf, 2) if the symptom is only detected at the stage of color processing, the probability of the disease existence is reported and 3) if the symptom is recognized at the stage of morphological image processing, the disease existence in the greenhouse is reported. The results showed that the leaves infected by downey mildew was detected with 90% accuracy. Therefore, by installing the computer-controlled camera, on a vehicle which can move between the cucumber rows in a greenhouse the developed algorithm has the capability of online detecting of downey mildew. Keywords: Color image processing; Morphological image processing; Early disease detection system; Plant disease