I am currently working on implementing spectrogram and the input to it are output from FFT. The results which I am getting is very pixelated. To make the output more smooth, I need to implement bilinear interpolation.
Is there any library or API readily available for it?
I found a function samplingLinear() in CoreImage which samples an image using bilinear interpolation. However, I need to interpolate the FFT data instead of an image.
Any help will be greatly appreciated.Spectrogram_Sample
Thanks.
Assuming you're displaying the data via OpenGL/CoreAnimation/UIImageView, you should do the interpolation there.
E.g. if you're displaying the data via a CALayer, you can set the magnificationFilter to kCAFilterLinear. If you're using OpenGL, you can set GL_TEXTURE_MAG_FILTER to GL_LINEAR.
Related
I'm working with Intelrealsense D435 and what I plan to do is to overlay an image on top of the point cloud using the opencv_pointcloud_viewer.py example in the python wrapper.
First of all, I've done calibration using checkerboard and clearly there's a difference between the values of intrinsic parameters using the calibration process and the default found using depth_profile.get_intrinsics() function.
I was wondering if there's a way to change the values of intrinsic parameters corresponding to the depth_frame in my python code. I mean I want to replace the default intrinsic values with the values I found myself so that next time I use depth_profile.get_intrinsics(), I can get the same values as the ones found during the checkerboard calibration.
Thanks for your help in advance.
I have seen https://community.intel.com/t5/Items-with-no-label/How-to-save-load-intrinsics-to-from-file-python/td-p/435336 but that doesn't seem to solve my problem.
I found intel realsense dynamic calibrator tool that could be used for this purpose. It's possible to define the custom XML file including the intrinsic parameters for all sensors and write them to the device.
I'm trying to do OCR to some forms that, however, have some texture as follows:
This texture causes the OCR programs to ignore it tagging it as an image region.
I considered using morphology. A closing operation with a star ends up as follows:
This result is still not good enough for the OCR.
When I manually erase the 'pepper' and do adaptive thresholding an image as follows gives good results on the OCR:
Do you have any other ideas for the problem?
thanks
For the given image, a 5x5 median filter does a little better than the closing. From there, binarization with an adaptive threshold can remove more of the background.
Anyway, the resulting quality will depend a lot on the images and perfect results can't be achieved.
Maybe have a look at this: https://code.google.com/p/ocropus/source/browse/DIRS?repo=ocroold (see ocr-doc-clean).
Considering that you know the font size, you could also consider using connected component filtering, perhaps in combination with a morphological operation. To be able to retain the commas, just be careful if a smaller connected component is near one that has a size similar to the characters that you are trying to read.
The background pattern is very regular and directionnal, so filtering in the Fourier domain must do some pretty good job here. Try for example the Butterworth filter
A concrete example of such filtering using gimp can be found here
Using OpenCV 2.4.2 C/C++
I am trying to use the copyTo function to add a binary CV_8UC1 image to a RGB CV_8UC3 image. However, it seems to crash the program whenever I do this. I'm assuming that the difference in the number of channels doesn't allow me to add them. Is there some type of conversion that can allow me to use this copyTo function? I'm stitching a camera feed with its thresholded image side by side.
I'm using src.copyTo(dst(Rect(x,y,w,h))); as the copying code, and inRange(src,Scalar(#,#,#),Scalar(#,#,#),dst) as the thresholding operation.
I've tried to use the convertTo function but not having much luck with it. Can anyone give some advice?
Thanks
You should use cv::cvtColor function, which can convert from one color space to another. Look here for details.
I am doing a project on image binarisation where I am required to transform an image such that its divided into individual color layers using clustering. What I mean to say is that there will be no shades in the image, instead the shades of the input image will be converted into a layer dividing the two colors.
The input and output images are given:
I am trying to implement this using opencv, but not able to figure out how to do that.
Thanks in advance.
Try using k-means clustering.
http://aishack.in/tutorials/kmeans-clustering-opencv/
You get as many colours as you have means.
Here is an example being implemented using the Accord.NET C# library.
http://crsouza.blogspot.com.au/2010/10/k-means-clustering.html
I am trying to forward Fast Fourier Transfer an Image and then backward Fast Fourier Transfer it. I am using the library from http://www.fftw.org/. The thing is that I have stored the RGB values in a one dimensional array in the listed order. The way I think would work is to allocate arrays for each of the colors and do a separate FFT for each array. Like this:
fftw_plan_dft_2d(imageWidth, imageHeight, pixelColor, fft_result, FFTW_FORWARD,
FFTW_ESTIMATE)
I don't know much about FFT but to me it doesn't seem like an ideal way to do it. Can someone tell me if there is a better way to FFT all the pixelcolors from an Image with the library from fftw.org?
Thanks.
No sure what an fft of a colour image would mean.
Presumably you want to look at structure in each colour or more common - just make a greyscale (intensity) image and work on that