Aflatoxins are toxic metabolites produced by some fungus (Aspergillus flavus and Aspergillus parasiticus) that can grow on a wide variety of foodstuffs. The most important factors that play a role in the growth of fungi in foodstuffs and in the formation of aflatoxin are relative to the humidity of the air and the storage temperature. It is also pointed out that aflatoxin, which is passed to humans through food, causes mostly liver cancer, increases the effect of hepatitis (B) and (C) viruses, and breaks the immune system. Traditionally, dried figs have been examined for the evidence of bright greenish-yellow fluorescence (BGYF), which can indicate the possible presence of Aspergillus flavus, when illuminated with ultra-violet (UV) light. The BGYF test is typically the first step that leads to a chemical analysis for possible aflatoxin contamination. Naturally, the chemical methods that detect aflatoxins are quite accurate but expensive and destructive. Nowadays, hyperspectral and multispectral imaging are becoming increasingly important for rapid and nondestructive testing for the presence of such contaminants. In this study, a compact machine vision system is being proposed for the detection of aflatoxin contaminated dried figs. An image-processing method is defined for a pixel-based prediction of an aflatoxin contaminated surface area on selected dried figs that is scanned by a Charge Coupled Device (CCD) color camera and under UV lighting in this system. Additionally, naturally contaminated fig test samples are sent to an authorized laboratory in order to determine the amount of aflatoxin B-1 and the total aflatoxins for comparing the actual aflatoxin amounts of dried figs and the pixel values of contaminated samples. The results of this study have shown that there is not a linear correlation between total surface area of aflatoxin contamination on dried figs in pixels and the actual aflatoxin amounts analyzed under laboratory conditions.