Complex number matrix in OpenCV (Java)
Hello
I am working on image data and the end goal is to use fourier transform on a product of the data and some complex matrix.
The first matrix will multiply with the second complex matrix and after that I will use a fourier transform on it
Is there a way of doing this in OpenCV?
edit:
// image matrix
Bitmap bitmap_image = ...
Mat matrix = new Mat(1000, 1000, CvType.CV_64FC1);
Utils.bitmapToMat(bitmap_image, matrix);
Imgproc.cvtColor(matrix, matrix, Imgproc.COLOR_RGBA2GRAY);
matrix.convertTo(matrix, CvType.CV_64FC1, 1.0/255.0); // type when initialised is ignored
// secondary matrix
Mat secondary_matrix = new Mat(1000, 1000, CvType.CV_64FC1);
for (int i=0; i<1000; i++) {
for (int j=0; j<1000; j++) {
// ... do some stuff to get value
secondary matrix.put(i,j,value);
}
}
// now need to make secondary matrix complex by multiplying by some function of i
// complex numbers created in Java according to the Apache Commons complex class