Files
Aurora/src/Function2D.h

187 lines
6.2 KiB
C
Raw Normal View History

#ifndef AURORA_FUNCTION2D_H
#define AURORA_FUNCTION2D_H
2023-05-10 13:46:40 +08:00
#include <cstdio>
#include <initializer_list>
2023-04-20 15:34:38 +08:00
#include "Matrix.h"
#include "Function1D.h"
2023-05-05 13:22:15 +08:00
namespace Aurora
{
enum FunctionDirection
{
2023-04-23 16:02:08 +08:00
Column,
Row,
All
};
2023-10-08 15:58:43 +08:00
float immse(const Matrix &aImageA, const Matrix &aImageB);
2023-05-05 13:22:15 +08:00
Matrix inv(const Matrix &aMatrix);
Matrix inv(Matrix &&aMatrix);
Matrix interp2(const Matrix &aX, const Matrix &aY, const Matrix &aV, const Matrix &aX1, const Matrix &aY1, InterpnMethod aMethod);
Matrix interpn(const Matrix &aX, const Matrix &aY, const Matrix &aV, const Matrix &aX1, const Matrix &aY1, InterpnMethod aMethod);
Matrix std(const Matrix &aMatrix);
2023-04-23 16:02:08 +08:00
/**
* ,
* @param aMatrix
2023-04-23 16:02:08 +08:00
* @param direction Column, Row, All
* @return
*/
2023-05-05 13:22:15 +08:00
Matrix min(const Matrix &aMatrix, FunctionDirection direction = Column);
2023-04-23 16:02:08 +08:00
2023-05-05 13:22:15 +08:00
Matrix min(const Matrix &aMatrix, FunctionDirection direction, long &rowIdx, long &colIdx);
2023-04-24 16:02:15 +08:00
2023-04-23 16:02:08 +08:00
/**
* ,
* @param aMatrix
2023-04-23 16:02:08 +08:00
* @param direction Column, Row, All
* @return
2023-04-23 16:02:08 +08:00
*/
2023-05-05 13:22:15 +08:00
Matrix max(const Matrix &aMatrix, FunctionDirection direction = Column);
2023-04-23 17:32:04 +08:00
2023-05-05 13:22:15 +08:00
Matrix max(const Matrix &aMatrix, FunctionDirection direction, long &rowIdx, long &colIdx);
2023-04-24 16:02:15 +08:00
2023-04-23 16:02:08 +08:00
/**
*
* @attention A为[MxN],B应为标量或[1xN]
* @param aMatrix 1
* @param aOther 2
* @return
2023-04-23 16:02:08 +08:00
*/
2023-05-05 13:22:15 +08:00
Matrix min(const Matrix &aMatrix, const Matrix &aOther);
2023-04-23 16:02:08 +08:00
2023-05-19 13:44:00 +08:00
/**
*
* @attention A为[MxN],B应为标量或[1xN]
* @param aMatrix 1
* @param aOther 2
* @return
*/
Matrix max(const Matrix &aMatrix, const Matrix &aOther);
2023-05-19 13:44:00 +08:00
/**
*
* @attention A为[MxN],B应为标量或[1xN]
* @param aMatrix 1
* @param aOther 2
* @return
*/
2023-10-08 15:58:43 +08:00
Matrix max(const Matrix &aMatrix, const float aValue);
2023-05-19 13:44:00 +08:00
2023-04-23 17:32:04 +08:00
/**
2023-04-25 17:28:33 +08:00
* ,
* @param aMatrix
2023-04-23 17:32:04 +08:00
* @param direction Column, Row, All
* @return
2023-04-23 17:32:04 +08:00
*/
2023-05-05 13:22:15 +08:00
Matrix sum(const Matrix &aMatrix, FunctionDirection direction = Column);
2023-04-23 17:32:04 +08:00
2023-04-24 15:24:23 +08:00
/**
* ,
* @param aMatrix
2023-04-24 15:24:23 +08:00
* @param direction Column, Row, All
* @param aIncludeNan nan
* @return
2023-04-24 15:24:23 +08:00
*/
2023-05-05 13:22:15 +08:00
Matrix mean(const Matrix &aMatrix, FunctionDirection direction = Column, bool aIncludeNan = true);
2023-04-24 15:24:23 +08:00
/**
2023-05-24 11:04:36 +08:00
* @brief ,
*
* @param aMatrix
2023-05-24 11:04:36 +08:00
* @param direction ALL
* @return Matrix
*/
2023-05-24 11:04:36 +08:00
Matrix sort(const Matrix &aMatrix,FunctionDirection direction = Column);
/**
2023-05-24 11:04:36 +08:00
* @brief ,
*
* @param aMatrix
2023-05-24 11:04:36 +08:00
* @param direction ALL
* @return Matrix
*/
2023-05-24 11:04:36 +08:00
Matrix sort(Matrix &&aMatrix,FunctionDirection direction = Column);
/**
2023-05-24 11:04:36 +08:00
*
* sortrows
* @attention
* @param aMatrix
2023-05-24 11:04:36 +08:00
* @param indexMatrix
* @return
*/
2023-05-24 11:04:36 +08:00
Matrix sortrows(const Matrix &aMatrix, Matrix* indexMatrix=nullptr);
/**
* ,
* @param aMatrix
* @return
*/
2023-05-05 13:22:15 +08:00
Matrix median(const Matrix &aMatrix);
/**
* FFT,2
* @param aMatrix
* @param aFFTSize -1
* @return fft后的复数矩阵
*/
Matrix fft(const Matrix &aMatrix, long aFFTSize = -1);
/**
* fftshift,fft的数据的前半部分和后半部分交换2D数据
* @param aMatrix
*/
void fftshift(Matrix &aMatrix);
2023-06-08 15:24:49 +08:00
/**
* fftshift,fft的数据的前半部分和后半部分交换2D数据
* @param aMatrix
*/
void ifftshift(Matrix &aMatrix);
/**
* fft2
* @attention 使real去除虚部
* @param aMatrix
* @return ifft后的复数矩阵
*/
2023-06-09 14:31:47 +08:00
Matrix ifft(const Matrix &aMatrix, long aFFTSize = -1);
2023-05-05 13:22:15 +08:00
/**
* Symmetric逆fft2
* @param aMatrix
* @return ifft后的实数矩阵
*/
Matrix ifft_symmetric(const Matrix &aMatrix,long length);
/**
* hilbert2
* @param aMatrix
* @return
*/
2023-05-05 13:22:15 +08:00
Matrix hilbert(const Matrix &aMatrix);
2023-04-25 17:28:33 +08:00
/**
* prod2
* @param aMatrix
* @return
*/
2023-05-05 13:22:15 +08:00
Matrix prod(const Matrix &aMatrix);
2023-04-25 17:28:33 +08:00
2023-05-05 13:22:15 +08:00
Matrix dot(const Matrix &aMatrix, const Matrix &aOther, FunctionDirection direction = Column);
2023-05-10 13:46:40 +08:00
2023-05-11 16:21:01 +08:00
/**
*
* @attention 1matlab对应C++使-1
* @param aVMatrixSize
* @param aSliceIdxs
* @return
*/
2023-05-10 13:46:40 +08:00
Matrix sub2ind(const Matrix &aVMatrixSize, std::initializer_list<Matrix> aSliceIdxs);
};
2023-05-05 13:22:15 +08:00
#endif // AURORA_FUNCTION2D_H