How to Divide geo spatial Raster images in to tiles and combine back in to a complete

المشرف العام

Administrator
طاقم الإدارة
hi any one please help

I am reading a 2048 x 2048 image in the form of (204 x204) tiles and bilinear interpolating them to get (819x819) tiles. Then combining several 819x819 tiles to form a 8190x8190 image.Now as you can see in the attached image, after interpolation the image has tiled edges, Is there anything wrong with interpolation or with the way the tile is being written.

for (j = 0; j < nYsize_R; j = j + nYsize_R_1) {

if (j == nYsize_R - (nYsize_R_1 + nYsize_R_2)) { nYsize_R_1 = nYsize_R_1 + nYsize_R_2; } i2 = 0; ii = nXsize_P_1; nXsize_R_1 = temp_nXsize_R_1; for (i = 0; i < nXsize_R; i = i + nXsize_R_1) { if (i == nXsize_R - (nXsize_R_1 + nXsize_R_2)) { nXsize_R_1 = nXsize_R_1 + nXsize_R_2; } if (i2 == nXsize_P - (nXsize_P_1 + nXsize_P_2)) { ii = ii + nXsize_P_2; } poBand_MS[0]->RasterIO(GF_Read, i, j, nXsize_R_1, nYsize_R_1, poBandBlock[0], nXsize_R_1, nYsize_R_1, GDT_Float32, 0, 0) poBandBlockB2 = resizeBilinear(poBandBlock_padded[0], nXsize_R_1 + 1, nYsize_R_1 + 1, nXsize_P_1, nYsize_P_1); poBand_MS_interpolated[0]->RasterIO(GF_Write, i2, j2, ii, jj, poBandBlockB2, ii, jj, GDT_Float32, 0, 0); i2 = i2 + ii; } j2 = j2 + jj; if (j2 == nYsize_P - (nYsize_P_1 + nYsize_P_2)) { jj = jj + nYsize_P_2; }}float* resizeBilinear(float * pixels, int w, int h, int w2, int h2) {

double a, b, c, d;int x, y;unsigned int index;float x_ratio = ((float)h-1) / h2;float y_ratio = ((float)w-1) / w2;float x_diff, y_diff, blue, red, green;int offset = 0;int xx = 0;for (int i = 0; i
 
أعلى