开发者

How powerful is OpenGL?

I want to create an application which will capture one by camera and will manipulate the live images taken by it in milliseconds of the time.

The goal is that the application should change my clothes with 开发者_StackOverflow社区some other clothes which I will supply.

I have few questions:

Does OpenGL have such power of modifying live images in a way it will change my clothes in the computer image? I will be moving my hands and the like, can it be that accurate so it'll just look like I am in changed clothes and not the original I am wearing?


Is not a matter of power. OpenGL is for rendering 3D graphics. What you want is in the area of Computer Vision and Augmented Reality. Use the right tool for the task. You might want to take a look at OpenCV.


OpenGL can add the clothing very quickly indeed. This will not even begin to strain its capability in compositing images.

However, you may have a misunderstanding about what exactly it can do for you. It can blend images, but you will have to tell it exactly where to draw your clothes, how to deform them, etc., and you will have to figure these things out by yourself. OpenGL will not help you find out where the person's hand is.


OpenGL is a rendering library; it's purpose is to draw things on your screen. It could probably be used as a part of a solution to your problem, but only the rendering part. Your problem also requires some rather serious image-processing, to take the source image from the camera, recognize the human body and all its various parts and poses, and then narrow that down to the clothes.

What if you're wearing e.g. a trenchcoat, and the replacement outfit (to be rendered) is something form-fitting like a professional ice skating suit? Clearly the replacement process needs information that is not available from the source image, in that case. This calls for either a pre-generated database that describes your body, or limiting the range of possible replacement outfits (to, perhaps, just changing the pattern and/or color of the trenchcoat).

Look into OpenCV, and what people are doing with the Kinect controller. This will not be easy.


I think the question is more about the power of today's graphics cards (GPUs) than about OpenGL. OpenGL is just an API for accessing the GPU power.

The GPUs are very powerful today (see my favorite and already a bit outdated chart) and I think that they can handle the task you want from them quick enough.

Your objective is very (very) ambitious - you will need to modify the computer vision algorithms to work well on GPUs (parallelize them) and use them to detect segments with clothing and then replace those segments. Any of these tasks would suffice for a master thesis.

OpenGL can help you do the job but you have to code all the algorithms yourself using shaders (in GLSL) and rendering to texture.

Unlike others, I wouldn't recommend using OpenCV as it has some serious disadvantages for your use:

  • It is slow and you won't achieve interactive framerates for your task unless you have a very powerful CPU
  • It doesn't use the GPU power (at least the stable version)
  • The API is unintuitive - OpenCV is more a list of implemented CV algorithms than a framework. You still need to know how the algorithms work under the hood to use it properly.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜