OpenCV in the cloud

2019-03-14 07:32发布

The question may seem dumb to those experienced with cloud development, but coming from the desktop world I can´t exactly figure out the solution by myself. I have a loads of code using opencv, some of it with an api.

Question is, would it be possible to get opencv running on a remote server (let s say heroku or S3)?
I think the only way would be to send any dependency (and there is a lot) within the code?

I m developing in Python.

Thanks !

EDIT :

My very first idea is this one : https://github.com/jlengrand/FaceMovie

I am developing a small application automatically able to detect faces in images, center them and create a movie out of it. But as a computer engineer, I have a whole bunch of ideas of simple stuff that can be done in the cloud.

I realize that the transfer of data may be huge with this kind of things, and you may be better placed than me to answer whether such stuff is possible or not.

I was thinking of ways to "reduce" this payload, by reducing the quality of images of taking images from somewhere on the cloud already ? (picasa albums, . . . )

Let me know, I am open to quite any possibility in fact.

2条回答
乱世女痞
2楼-- · 2019-03-14 07:48

You should try Windows Azure. It's the only PAAS (Cloud without "servers") that runs c/c++.

If some commands are required to install it, you can use startup tasks.

As for the video stream, you can open a socket (using a TCP endpoint) and stream the video up to an azure instance that way. That's probably the most efficient way of doing it if you want real time video processing. If you want to record the video and upload it, look at using blob storage. You can then use a message queue to signal to the worker, that there is a video waiting to be processed.

credit : How do I install OpenCV on Windows Azure?

查看更多
Bombasti
3楼-- · 2019-03-14 07:54

Its definitely possible. For webservices in Python, Piston is my go-to. From there, you need to deploy it on a webserver of some kind. If you're deploying on EC2, you can use the bitami AMI preconfigured with Django and Apache. Of course, you'll need to apt-get install the opencv ubuntu packages.

Now, given all that, it might or might not make sense to do this "in the cloud" with a webservice. You'll need to transfer the image you want to process, probably via an HTTP POST, so that will take some time and bandwidth. Depending on what you want to return, you might have a lot of data coming back too, which will have its own cost. Can you share with us what your application will do? I could provide better advice if I knew what you were trying to accomplish.

As you noted, the ubuntu OpenCV package is out of date. If you need something more recent, I've found its easy to install ROS which includes OpenCV 2.3 and its dependencies.

查看更多
登录 后发表回答