I am not sure how easy it would be to get it to work. Unless there is some sort of interface to gphoto2 for opencv, you will need to jump through a few hoops.
I found this question on superuser.com -
Can I use my DSLR as webcam through gphoto2 + v4l2loopback?. That talks about using gphoto2 and a number of other programs to make a DSLR have a webcam interface. If you can get that working, you could then use OpenCV (with Python).