Help a newbie to assemble a drone for specific needs

I want to buy/assemble a programmable drone (c++, Python preferable). Fly zone is in the woods, so max flight time is important as well sensors for obstacle avoidance. I must be able to code & process the camera input and do pretrained object recognition (like with openCV lib.). Budget is 500EUR max