show center of target
Change-Id: I6d6a3f656cdda982c33d0d51514c0ae8d27e4877
diff --git a/y2020/www/image_handler.ts b/y2020/www/image_handler.ts
index 1ab2ba3..5ef8d88 100644
--- a/y2020/www/image_handler.ts
+++ b/y2020/www/image_handler.ts
@@ -178,9 +178,9 @@
if (!this.imageTimestamp || !this.resultTimestamp ||
this.imageTimestamp.low !== this.resultTimestamp.low ||
this.imageTimestamp.high !== this.resultTimestamp.high) {
- console.log('image and result do not match');
- console.log(this.imageTimestamp.low, this.resultTimestamp.low);
- console.log(this.imageTimestamp.high, this.resultTimestamp.high);
+ // console.log('image and result do not match');
+ // console.log(this.imageTimestamp.low, this.resultTimestamp.low);
+ // console.log(this.imageTimestamp.high, this.resultTimestamp.high);
return;
}
this.convertImage();
@@ -198,22 +198,23 @@
this.drawFeature(feature);
}
} else {
+ console.log(this.result.imageMatchesLength(), this.result.cameraPosesLength());
const imageMatch = this.result.imageMatches(this.selectedIndex - 1);
for (const i = 0; i < imageMatch.matchesLength(); i++) {
const featureIndex = imageMatch.matches(i).queryFeature();
this.drawFeature(this.result.features(featureIndex));
}
+ // Draw center of target.
+ const cameraPose = this.result.cameraPoses(this.selctedIndex - 1);
+ ctx.strokeStyle = 'red';
+ ctx.beginPath();
+ ctx.arc(
+ cameraPose.queryTargetPointX(), cameraPose.queryTargetPointY(),
+ cameraPose.queryTargetPointRadius(), 0, 2 * Math.PI);
+ console.log(cameraPose.queryTargetPointX(), cameraPose.queryTargetPointY(), cameraPose.queryTargetPointRadius());
+ ctx.stroke();
}
- // Draw 'center' of target.
- // TODO(alex) adjust to new location in flatbuffer for these fields
- //ctx.strokeStyle = 'red';
- //ctx.beginPath();
- //ctx.arc(
- // this.result.targetPointX(), this.result.targetPointY(), 20, 0,
- // 2 * Math.PI);
- //ctx.stroke();
-
while (this.select.lastChild) {
this.select.removeChild(this.select.lastChild);
}