|
|
|
@ -107,9 +107,21 @@ export class ImageLabelAnxinComponent implements OnInit {
|
|
|
|
|
// 图片加载完后,将其显示在canvas中
|
|
|
|
|
var img = new Image(); |
|
|
|
|
img.src = this.imgItem ? this.imgItem : '../../../assets/images/bgImg.png'; |
|
|
|
|
|
|
|
|
|
console.log('img', img); |
|
|
|
|
|
|
|
|
|
img.onload = () => { |
|
|
|
|
console.log('原始宽度', img.width); |
|
|
|
|
console.log('原始高度', img.height); |
|
|
|
|
if (img.width > 1920) { |
|
|
|
|
img.height = img.height * (1920 / img.width); |
|
|
|
|
img.width = 1920; |
|
|
|
|
} |
|
|
|
|
this.canvasWidth = img.width; |
|
|
|
|
this.canvasHeight = img.height; |
|
|
|
|
console.log('显示宽度', this.canvasWidth); |
|
|
|
|
console.log('显示高度', this.canvasHeight); |
|
|
|
|
// return;
|
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
// 加载图片
|
|
|
|
|
this.ctx.drawImage(img, 0, 0, this.canvasWidth, this.canvasHeight); |
|
|
|
@ -499,7 +511,7 @@ export class ImageLabelAnxinComponent implements OnInit {
|
|
|
|
|
save() { |
|
|
|
|
console.log(this.camerasData.dimensionedPointsAnxin); |
|
|
|
|
console.log('标点数据', this.PolygonData); |
|
|
|
|
// return;
|
|
|
|
|
|
|
|
|
|
for (const key in this.PolygonData) { |
|
|
|
|
const element = this.PolygonData[key]; |
|
|
|
|
if (element.Points.length !== 0 && element.Points.length <= 2) { |
|
|
|
@ -544,6 +556,7 @@ export class ImageLabelAnxinComponent implements OnInit {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
console.log('标点结果', this.camerasData.dimensionedPointsAnxin); |
|
|
|
|
// return;
|
|
|
|
|
this.http |
|
|
|
|
.put(`/api/Cameras/${this.camerasData.id}/DimensionedPoints`, body) |
|
|
|
|
.subscribe((data) => { |
|
|
|
|