Development of an optical sensor for real-time weed detection using laser based spectroscopy