0
문제가 있습니다. 티파니 이미지 (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