Shift Vector Coefficients: | -13.1183 | 0.080631 | -0.00011 |
Pixel to Wavelength Coefficients: | 1819.63 | -0.92552 | -0.00023 |
请问,上面参数的具体含义是什么,是DLP NANO光谱模块保存的文件里面的信息。
Jeremy Wu:
在DLPspec_types.h和DLP Spectrum Library中有定义.存储calibration系数的.
#define NUM_PIXEL_NM_COEFFS PX_TO_LAMBDA_NUM_POL_COEFF#define NUM_SHIFT_VECTOR_COEFFS PX_TO_LAMBDA_NUM_POL_COEFF
/** * @brief Contains calibration coefficients generated by calibrating a spectrometer. * * Stores the polynomial coefficients used when relating pixels to wavelengths * and for bending patterns to correct for mechanical tolerances which cause * slit image rotation on the DMD array and optical distortions which cause * curvature due to the out of plane angles on the grating. These coefficients * are generated during calibration and should be stored in non-volitile * protected memory in each spectrometer. */
typedef struct{ double ShiftVectorCoeffs[NUM_SHIFT_VECTOR_COEFFS]; double PixelToWavelengthCoeffs[NUM_PIXEL_NM_COEFFS];}calibCoeffs;
zyslqr:
回复 Jeremy Wu:
您好,谢谢。
请问有具体的多项式公式,或者在程序哪里看到,请指教,谢谢。
Jeremy Wu:
回复 zyslqr:
参考dlpspec_calib.c
DLPSPEC_ERR_CODE dlpspec_calib_genPxToPyCoeffs(const int num_peaks, const double *px_measured, const double *py_measured, double*px_to_py_coeffs, double *rsquared)/** * Finds a second order polynomial that fits the given x and y input values and returs the three co-efficients for that polynomial * * @param[in] num_peaks Number of points in @p *px_measured and @p *py_measured * @param[in] px_measured Pointer to the pixel peak locations. This should be * @param[in] py_measured Pointer to the 6 nanometer values * @param[out] px_to_py_coeffs Pointer to the computed polynomial coefficients in the following order c, b, a which should be used to compute any given y value as * y = ax2 + bx + c * @param[out] rsquared Pointer to r squared coefficient of determination for the derrived 2nd order equation. * * @return number of peaks found in the input data set * <0 Error codes as DLPSPEC_ERR_CODE * */
DLPSPEC_ERR_CODE dlpspec_calib_genPxyToCurveCoeffs(const double *peaks, const double *y_values, const int num_peaks, const int num_measurements, double *pxy_to_curve_coeffs)/** * This function computes the polynomial coefficients using DMD row used for measurement and corresponding peak location * These coefficients can then be used to compute the shift during pattern generation * * @param[in] peaks Pointer to the pixel peak locations on top, middle & bottom of DMD (ordered with peaks closest to the centre column of DMD first and the farthest from centre as the last) * @param[in] num_measurements Number of measurements taken; typically 3, one on top, middle and bottom of DMD * @param[in] num_peaks number of peaks measured * @param[in] y_values y values correspoding to each set of measurements * @param[out] pxy_to_curve_coeffs Pointer to the computed polynomial coefficients in the following order c, b, a which * should be used to compute any given y value as y = ax2 + bx + c * * @return Error codes */