|
|
|
@ -13,7 +13,7 @@ export class ImageLabel2Component implements OnInit {
|
|
|
|
|
private http: HttpClient, |
|
|
|
|
private message: NzMessageService, |
|
|
|
|
private modal: NzModalService |
|
|
|
|
) { } |
|
|
|
|
) {} |
|
|
|
|
|
|
|
|
|
@Input() data: any; //传递id
|
|
|
|
|
camerasData: any; //摄像头Data
|
|
|
|
@ -27,7 +27,7 @@ export class ImageLabel2Component implements OnInit {
|
|
|
|
|
history.go(-1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { } |
|
|
|
|
ngOnInit(): void {} |
|
|
|
|
|
|
|
|
|
//获取 摄像头图片/标注点位
|
|
|
|
|
getImgMarkData() { |
|
|
|
@ -68,15 +68,17 @@ export class ImageLabel2Component implements OnInit {
|
|
|
|
|
'向边缘设备发送请求成功,请过一段时间手动刷新页面!' |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
error: (error: HttpErrorResponse) => { }, |
|
|
|
|
complete: () => { }, |
|
|
|
|
error: (error: HttpErrorResponse) => {}, |
|
|
|
|
complete: () => {}, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngAfterContentInit(): void { |
|
|
|
|
this.getImgMarkData() |
|
|
|
|
.then((res: any) => { |
|
|
|
|
console.log(111, res); |
|
|
|
|
this.imgItem = window.URL.createObjectURL(res); |
|
|
|
|
console.log(222, this.imgItem); |
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
this.initBackgroundImg(); |
|
|
|
|
}, 0); |
|
|
|
@ -356,7 +358,6 @@ export class ImageLabel2Component implements OnInit {
|
|
|
|
|
var upX = e.pageX - canvas.offsetLeft; |
|
|
|
|
var upY = e.pageY - canvas.offsetTop; |
|
|
|
|
if (this.isDrawArrow && !this.arrowDirection && !this.isAllMonitoring) { |
|
|
|
|
console.log('八嘎'); |
|
|
|
|
//绘制 箭头
|
|
|
|
|
if (this.arrowPoints.length === 2) { |
|
|
|
|
//限制数量
|
|
|
|
@ -386,10 +387,6 @@ export class ImageLabel2Component implements OnInit {
|
|
|
|
|
context, |
|
|
|
|
'black' |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if ( |
|
|
|
|
this.isDrawArrow && |
|
|
|
@ -424,8 +421,6 @@ export class ImageLabel2Component implements OnInit {
|
|
|
|
|
context, |
|
|
|
|
'black' |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if ( |
|
|
|
|
this.isDrawArrow && |
|
|
|
@ -453,7 +448,6 @@ export class ImageLabel2Component implements OnInit {
|
|
|
|
|
]; |
|
|
|
|
this.drawLine(arr, context); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.redrawPolygon( |
|
|
|
|
this.pointsOfmonitor, |
|
|
|
|
this.allpointsOfmonitor, |
|
|
|
@ -461,8 +455,6 @@ export class ImageLabel2Component implements OnInit {
|
|
|
|
|
context, |
|
|
|
|
'black' |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if ( |
|
|
|
|
this.isDrawArrow && |
|
|
|
@ -795,9 +787,9 @@ export class ImageLabel2Component implements OnInit {
|
|
|
|
|
((poly[i].y <= pt.y && pt.y < poly[j].y) || |
|
|
|
|
(poly[j].y <= pt.y && pt.y < poly[i].y)) && |
|
|
|
|
pt.x < |
|
|
|
|
((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) / |
|
|
|
|
(poly[j].y - poly[i].y) + |
|
|
|
|
poly[i].x && |
|
|
|
|
((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) / |
|
|
|
|
(poly[j].y - poly[i].y) + |
|
|
|
|
poly[i].x && |
|
|
|
|
(c = !c); |
|
|
|
|
return c; |
|
|
|
|
} |
|
|
|
@ -935,9 +927,9 @@ export class ImageLabel2Component implements OnInit {
|
|
|
|
|
((poly[i].y <= pt.y && pt.y < poly[j].y) || |
|
|
|
|
(poly[j].y <= pt.y && pt.y < poly[i].y)) && |
|
|
|
|
pt.x < |
|
|
|
|
((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) / |
|
|
|
|
(poly[j].y - poly[i].y) + |
|
|
|
|
poly[i].x && |
|
|
|
|
((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) / |
|
|
|
|
(poly[j].y - poly[i].y) + |
|
|
|
|
poly[i].x && |
|
|
|
|
(c = !c); |
|
|
|
|
return c; |
|
|
|
|
} |
|
|
|
|