Hi everyone, I have one question about how to extract 3D coordinates (latitude, longitude and height) for all pixels in the camera view in the fastest way.
I understand I posted a similar question before but this one is about how to improve efficiency (last one on how to obtain 3D coordinates). The problem is that a large number of images + coordinates per pixel are needed (e.g. 10,000 images at 600*400 + all coordinates). In the hardware accessible to me, the speed was like 20s per image + coor. while it took only 3-5s for one RGB image without the coordinates. Since the processing speed is really a limit, I was wondering if there is any way to extract coordinates more efficiently.
Our code is like this:
for(var ii=0;ii<viewer.canvas.width;ii++){
for(var jj=0;jj<viewer.canvas.height;jj++){
var cur_pos = new Cesium.Cartesian2(ii, jj);
// use scene.pickPosition
var ppCartesian = viewer.scene.pickPosition(cur_pos);
if (Cesium.defined(ppCartesian)){
var ppCartographic = Cesium.Cartographic.fromCartesian(ppCartesian);
var s = Cesium.Math.toDegrees(ppCartographic.latitude).toFixed(7);
stringCart += “[(” + s.toString() + “,”;
s = Cesium.Math.toDegrees(ppCartographic.longitude).toFixed(7);
stringCart += s.toString() + “,”;
s = ppCartographic.height.toFixed(0);
stringCart += s.toString() + “), “;
stringCart += “(”+ii.toString()+”,”+jj.toString()+“)], "
}
else{
stringCart += “[(-1,-1,-1), “;
stringCart += “(”+ii.toString()+”,”+jj.toString()+”)], "
}
Cesium 1.63 and firefox were used. Looking forward to your opinions.