计算权重,保存到txt中。
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <fstream>
#include <iostream>
double getWeight(int form, int i, int j, int width, int height){
double a;
//====== format0: Equirectangular =======
if (form == 0) {
a = cos((j - (height / 2 - 0.5))*3.1415926 / height);
return a;
}
else if (form == 5) {
int ci, cj, r2;
double d2