Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Dark Kai

Image Processing

This topic is 5233 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there. I would like to know if OpenGL is capable of doing image processing like sharpening etc etc.. I''ve written some codes for this but it''s simply too slow. Thought maybe OpenGL can help speed things up. Can I send something to my GPU to process? will it be faster? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
I don''t think it''ll be faster. I don''t know how good you are at image processing - you''re probably using simple spatial domain convolution to apply the filter to the image. Here''s an article by me on that (folks at GD managed to mix up some of the images in the online version of the article, but the content is still there) and I''m too lazy to write to them: link (just casually mentioning ).

If you want speed, you''ll need to do the whole thing in the frequency domain via FFT convolution (convolution in the time domain = multiplication in the frequency domain). That is, you run 2D FFT''s on the filter and the image and multiply the spectra, then run an IFFT on the result. If this doesn''t make sense to you, don''t despair.

In any case, loading an image into video memory, rendering it (unless you can modulate images directly in VRAM), running a shader or what not on it and capturing the whole thing will eventually be slower than doing an FFT convolution. Additionally, you''ll be posing severe hardware limitations although writing an appropriate shader is probably simpler than writing an FFT implementation.

Your pick.




TCP - Transmission by Carrier Pigeons

Share this post


Link to post
Share on other sites
Thanks Crispy.
You''ve certainly light up a lot of things. You are right I''m using the spatial domain convolution. Actually I''ve been looking in to FFTs but have no idea how the thing works. I know Microsoft even gave out codes in C for this but I don''t know what am I processing, what are the inputs and what will I be geting out of FFT. Is there any good site to learn FFT? (prefered with lots of samples of implementation )

Thanks again Crispy.

Share this post


Link to post
Share on other sites
(I)FFT is a single algorithm (stands for (Inverse) Fast Fourier Transform) used for taking fast (I)DFT (Discrete Fourier Transform). There is not single place to "learn FFT" from. It''s a complex algorithm and will require you to do quite a bit of research to even begin understand. I, for one, do not have the mathematical background to understand the algorithm - all I can do, is follow a description of the algorithm and see what happens.

You could try www.fftw.org for starters.

Anyway, since (I think) you know what "spatial domain" and "comvolution" are, you''re already half way there. If you''re not sure, I suggest Googling for The Scientist and Engineer''s Guide to Signal Processing, which is a free online book (totalling ~600 pages if I remember correctly) - it should give the necessary background and get you up to speed with most of the terminology - well, it worked for me anyway...

If you just want to use the FFT, I suggest you snatch the algorithm from some place (hint: Google), although you should look out for copyrights on implementation. If you want to process the frequency domain of an audio signal, BASS, FMOD and probably other third party libraries provide you with primitive tools.

As for your claims about Microsoft doing what you say it did - sounds a bit vague and weird since FFT is not patented.

My suggestion is to go with the book first, then read the second volume again and then start doing things yourself.




TCP - Transmission by Carrier Pigeons

Share this post


Link to post
Share on other sites
Well you could use GLSLang shaders, you should be able to do something like that.

Go to nvidias site and look up a pdf from GDC 2004(it''s on their developer site) that describes ways of using the gpu for other things than just graphics.

---------------------------------
For an overdose of l33tness, flashbang.nu

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!