0
有问题。我有一个tiff图像(有4层)。 我的任务是对像素的颜色进行细微更改以使图像更好。 在这种情况下,我使用GDAL库。我的来源是:GDAL获取像素颜色
GDALDataset *poDataset;
GDALAllRegister();
poDataset = (GDALDataset *) GDALOpen(fileName.toStdString().c_str(), GA_ReadOnly);
if (poDataset == NULL) {
QMessageBox::information(0, "error", "We have problems");
} else {
QMessageBox::information(0, "Message", "All is ok");
}
int rasterCount = poDataset->GetRasterCount(); // Here is 4 raster images
GDALRasterBand *band = poDataset->GetRasterBand(1);
int width = band->GetXSize();
int height = band->GetYSize();
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
// cross all pixels
// How to get pixel color here?
}
}
所以我不知道如何获得像素颜色的循环。你能给我建议吗?
这个问题可能更适合于http://gis.stackexchange.com – cartant
补充说,感谢意见。 – lazexe