One of the fundamental functions of traffic monitoring systems is vehicle detection. However, vehicle detection is typically hampered by the shadow problem. Objects are sometimes lost or their shapes are distorted because shadows are misunderstood to be elements of a vehicle. Shadows are a major problem for the current vehicle detecting technology. For video target segmentation, a moving shadow can be easily mistaken for a portion of the object due to their similarity, and the processing speed of classic shadow eradication methods is insufficient for a real-time intelligent transport system. For the purpose of removing shadows, a novel technique is suggested in this research. There are a number of issues that arise as a result of this, including the destruction of objects and the warping of their original shapes. Many algorithms, including deep learning ones, ignore the shadow problem, which contributes to the poor accuracy of vehicle recognition. The shadow problem can reduce the accuracy of vehicle detection, hence traditionally, vehicle detection has been a part of traffic monitoring structures. Vehicle components cast in a shadow may be misidentified, and users may have to deal with the loss of items or the distorting of their shapes. Since the problem could be caused by inaccurate data, the shadow reduction technique is the primary method for improving precision during the vehicle detection procedure. This research presents a method for removing shadows from an image by first identifying the foreground regions using edge data, and then detecting and removing the shadows using prior knowledge based on the image's grayscale data. According to the results of the performance analysis, the suggested method outperforms similar methods in detecting vehicles, hence it will be used in future Intelligent Transportation System deployments.