Traffic congestion will become one of the major problems as the city population and vehicles increase. traffic jams cause additional delays and stress for drivers and increase fuel consumption and air pollution. It seems to be everywhere, but megacity is the hardest hit. And due to its ever-increasing nature, there is a need to calculate real-time road traffic density for better signal control and effective traffic management. The traffic controller is one of the key factors affecting traffic flow. Therefore, traffic control needs to be optimized to better meet this growing demand. Our proposed system aims to use live images from cameras at intersections to calculate traffic density using image processing and AI. It also focuses on algorithms for switching traffic lights based on vehicle density to alleviate congestion. This allows people to move more quickly and reduce pollution.