Ardupilot does not support this. It focus on flight control. A good way to go is adding a companion computer, with a attached camera and dedicated software. I suggest a Raspberry Pi (my preference) or a NVidia TX1. Then, you will need specialized software to do image recognition. I think there is no “install-and-go” solution. You will need to do some research, test some software, and most probably do some code programing. Your software can get flight information (location coordinates, altitude, heading…) from Ardupilot via a Mavlink link (see this example). Your software can also send commands to Ardupilot. As an example: if you detect something, send a RTL command.
I’m not sure if you need to take immediate action on detection. I so, this would make your project more difficult, because companion computers normally don’t have processing power to do elaborate image recognition. If an offline strategy is enough (i.e.: fly a mission, return, copy recorded images to laptop, analyze), then have look at Randy Mackay’s work on TAP-J Search and Rescue Challenge. It’s somewhat similar to what you want.