简体   繁体   English

Qt中的基本图像处理,如何将图像分解为数组,准备对其执行傅立叶变换?

[英]Basic image processing in Qt, how do I break up an image into an array, ready to perform a Fourier transform on it?

I am trying to do some very basic, but ridiculously cool, image processing with Qt (I have to use Qt, no Matlab allowed). 我正在尝试使用Qt进行一些非常基本的但非常酷的图像处理(我必须使用Qt,不允许使用Matlab)。 I need to load a black and white image (Already done) and then perform a Fourier transform on it which I then display. 我需要加载黑白图像(已完成),然后对其进行傅立叶变换,然后进行显示。 The next step I'm looking at is filtering out some high frequencies, reverse transform and see what the results look like. 我正在研究的下一步是过滤掉一些高频,进行逆变换并查看结果。

I assume that the starting point to this is breaking up the image into an array of discrete values in the spatial domain. 我假设这样做的出发点是将图像分解成空间域中离散值的数组。

Does anybody have any experience in doing what I am describing? 有人在做我所描述的内容方面有经验吗? Do you guys agree with the array approach? 你们同意数组方法吗? Do I need a fancy library, or is it going to boil down to a numerical approach with various loops transforming each pixel? 我是否需要精美的资料库,还是可以归结为具有各种循环来转换每个像素的数值方法?

I am a bit of a noob in Qt so it would be awesome of you could keep it simple. 我在Qt中有点菜鸟,所以您可以保持简单就好了。

Just load your picture into a QImage object. 只需将图片加载到QImage对象中即可。 With the pixel method you will get the pixel value in RGB at position x,y. 使用pixel方法,您将获得x,y位置的RGB像素值。 Using qGray(int r, int g, int b) will give you the grey value (0-255). 使用qGray(int r,int g,int b)将给您灰度值(0-255)。 For FFT, just take a look at numerical recipes . 对于FFT,只需看一下数字配方即可

Refer to this link 参考此链接

https://codereview.stackexchange.com/questions/20529/slicing-up-an-image-into-rows-and-columns-in-java https://codereview.stackexchange.com/questions/20529/slicing-up-an-image-into-rows-and-columns-in-java

you have to just change the image location as 您只需将图像位置更改为

GridImage image = new GridImage("img/card-grid-image-mass-effect.jpg",4, 15); GridImage图片=新的GridImage(“ img / card-grid-image-mass-effect.jpg”,4,15);

change File Name . 更改文件名。 then comile and execute code 然后编译并执行代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM