5

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.

jlengrand
  • 12,152
  • 14
  • 57
  • 87
  • 1
    Are you building a webapp or do you just want processing done in the cloud? – Sharun May 04 '12 at 16:57
  • Well the basic idea is that I would like to transfer what I can do on my computer in the cloud. So this would be for a webapp – jlengrand May 04 '12 at 16:58
  • I was going to suggest App Engine as its Python based and easy to use, but I just took a look at the opencv install page and I think there is a dependency on Numpy which needs C libraries that appengine may not allow you to upload. If your code isn't using any numpy calls appengine maybe an option. – Sharun May 04 '12 at 17:08
  • 1
    I think you had your tagging wrong. Amazon S3 isn't a cloud platform solution, it's a storage solution. It's just for data storage. The actual process platform is called [EC2](http://aws.amazon.com/ec2/). – voithos May 04 '12 at 17:37
  • indeed. Another proof of my lack of knowledge in the domain. Thanks for editing voithos – jlengrand May 04 '12 at 18:21

2 Answers2

3

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.

nont
  • 9,322
  • 7
  • 62
  • 82
  • Hey Nont, thqnks for your comment. Thing is, the opencv package available in ubuntu is waaay outdated, and I really need some newer version. I can still compile it on host though, and try to send it one way or another. – jlengrand May 04 '12 at 18:23
  • you're absolutely right. If you need a more up-to-date version of OpenCV, you could compile it yourself. A easier way, that I've used in the past is to install ROS. (I've updated my answer to include this.) – nont May 04 '12 at 18:28
  • So your pick would pick EC2 ? What's your idea about heroku? – jlengrand May 06 '12 at 10:28
  • The same strategy would also work on a rackspace cloud server though, so it really just depends on if you like EC2 or Rackspace. However, I haven't worked with heroku, so I can't intelligently comment on that. – nont May 06 '12 at 12:19
1

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?

Community
  • 1
  • 1
themihai
  • 7,903
  • 11
  • 39
  • 61