Commit 1167aacc by 潘建波

增加算法折线区域

1 parent 06c3c266
...@@ -3,7 +3,7 @@ console.log(process.env.NODE_ENV); ...@@ -3,7 +3,7 @@ console.log(process.env.NODE_ENV);
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case "development": case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url // baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = "http://192.168.9.233:20080"; // 测试环境url baseUrl = "http://192.168.9.133:20080"; // 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url // baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086"; // baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510'; // baseUrl = 'http://vion-panda.51vip.biz:52510';
......
...@@ -143,6 +143,7 @@ export default { ...@@ -143,6 +143,7 @@ export default {
localStorage.removeItem("curmenu"); localStorage.removeItem("curmenu");
this.$store.commit(types.ATOKEN, ""); this.$store.commit(types.ATOKEN, "");
localStorage.removeItem("atoken"); localStorage.removeItem("atoken");
this.$logs.oplogs('','serv_login',`退出了平台`);
this.$router.push("/login").catch(err => { this.$router.push("/login").catch(err => {
err; err;
}); });
......
...@@ -109,7 +109,8 @@ export default { ...@@ -109,7 +109,8 @@ export default {
this.$api.login this.$api.login
.login({ .login({
username: this.ruleForm.username, username: this.ruleForm.username,
password: this.baseencode(this.ruleForm.password), // password: this.baseencode(this.ruleForm.password),
password: this.ruleForm.password,
user_type: "user" user_type: "user"
}) })
.then(res => { .then(res => {
...@@ -120,7 +121,7 @@ export default { ...@@ -120,7 +121,7 @@ export default {
//本系统可以直接用本地缓存做 //本系统可以直接用本地缓存做
localStorage.setItem("atoken", res.atoken); localStorage.setItem("atoken", res.atoken);
localStorage.setItem("uname", res.user_name); localStorage.setItem("uname", res.user_name);
this.$logs.oplogs(res,'serv_login',`登录了平台`); this.$logs.oplogs(res.user_name,'serv_login',`登录了平台`);
// 处理登录用户权限菜单显示问题; // 处理登录用户权限菜单显示问题;
if(res.firstLogin) { if(res.firstLogin) {
this.$router.push('resetpass') this.$router.push('resetpass')
......
...@@ -32,6 +32,7 @@ import FlowCanvas from "./areaconfig/FlowCanvas"; ...@@ -32,6 +32,7 @@ import FlowCanvas from "./areaconfig/FlowCanvas";
import SafeCanvas from "./areaconfig/SafeCanvas"; import SafeCanvas from "./areaconfig/SafeCanvas";
import FaceCanvas from "./areaconfig/FaceCanvas"; import FaceCanvas from "./areaconfig/FaceCanvas";
import ComplexCanvas from "./areaconfig/ComplexCanvas"; import ComplexCanvas from "./areaconfig/ComplexCanvas";
import {roi} from "./areaconfig/roi_1"
export default { export default {
data() { data() {
return { return {
...@@ -94,7 +95,8 @@ export default { ...@@ -94,7 +95,8 @@ export default {
setTimeout(() => { setTimeout(() => {
_this.$refs.canvas.stageInit(); _this.$refs.canvas.stageInit();
if (data.rois) { if (data.rois) {
_this.$refs.canvas.configInit(data.rois[0].roi); // _this.$refs.canvas.configInit(data.rois[0].roi);
_this.$refs.canvas.configInit(roi);
} }
}, 300); }, 300);
}, },
......
...@@ -530,6 +530,7 @@ export default { ...@@ -530,6 +530,7 @@ export default {
//TODO handle the exception //TODO handle the exception
console.log(e); console.log(e);
} }
debugger
//车道和行人 //车道和行人
if (obj.median_lines.lane_count > 0) { if (obj.median_lines.lane_count > 0) {
let ary = obj.median_lines.lane; let ary = obj.median_lines.lane;
...@@ -1193,6 +1194,8 @@ export default { ...@@ -1193,6 +1194,8 @@ export default {
if (!this.needRect) return; if (!this.needRect) return;
this.needRect = false; this.needRect = false;
if (this.drawState == 3) { if (this.drawState == 3) {
//车道属性
debugger
let layer = this.layers[this.drawState]; let layer = this.layers[this.drawState];
let rects = layer.get(".rect"); let rects = layer.get(".rect");
let rect = rects[rects.length - 1]; let rect = rects[rects.length - 1];
...@@ -1635,7 +1638,6 @@ export default { ...@@ -1635,7 +1638,6 @@ export default {
}, },
//生成车道 //生成车道
drawRoad: function() { drawRoad: function() {
debugger;
if (this.roadFlag === true) return; if (this.roadFlag === true) return;
if (this.roadFlag === false) { if (this.roadFlag === false) {
this.$alert("车道线有修改,请逐一检查车道属性是否正确", "提示", { this.$alert("车道线有修改,请逐一检查车道属性是否正确", "提示", {
...@@ -1671,7 +1673,16 @@ export default { ...@@ -1671,7 +1673,16 @@ export default {
var len = arr.length; var len = arr.length;
for (var i = 0; i < len; i++) { for (var i = 0; i < len; i++) {
for (var j = 0; j < len - 1 - i; j++) { for (var j = 0; j < len - 1 - i; j++) {
if (arr[j].attrs.points[0] > arr[j + 1].attrs.points[0]) { let startpointx = arr[j].attrs.points[0];
let endpointx = arr[j].attrs.points[arr[j].attrs.points.length -2];
let centerx = (endpointx - startpointx) /2 + startpointx;
let nextstartpointx = arr[j+1].attrs.points[0];
let nextendpointx = arr[j + 1].attrs.points[arr[j + 1].attrs.points.length -2];
let nextcenterx = (nextstartpointx - nextendpointx) /2 + nextstartpointx;
// let startpointy = arr[j].attrs.points[1];
// let endpointy = arr[j].attrs.points[arr[j].attrs.points.length -2];
// let centery = (endpointy -startpointy) /2 + startpointy;
if (centerx > nextcenterx) {
//相邻元素两两对比 //相邻元素两两对比
var temp = arr[j + 1]; //元素交换 var temp = arr[j + 1]; //元素交换
arr[j + 1] = arr[j]; arr[j + 1] = arr[j];
...@@ -1681,8 +1692,9 @@ export default { ...@@ -1681,8 +1692,9 @@ export default {
} }
return arr; return arr;
} }
console.log("排序后的蓝色车道线"); // this.blueLines = sortBlueLine(this.blueLines);
console.log(sortBlueLine(this.blueLines)); console.log("蓝色车道线",this.blueLines);
// console.log(sortBlueLine(this.blueLines));
this.blueLines.forEach((ele, index) => { this.blueLines.forEach((ele, index) => {
let points = this.sortLinePoints(ele.attrs.points); let points = this.sortLinePoints(ele.attrs.points);
if (index > 0) { if (index > 0) {
...@@ -1708,19 +1720,37 @@ export default { ...@@ -1708,19 +1720,37 @@ export default {
Math.pow(points[points.length - 1] - lastPoints[1], 2); Math.pow(points[points.length - 1] - lastPoints[1], 2);
let mPoints; let mPoints;
if (num1 < num2) { if (num1 < num2) {
mPoints = points.concat([ var arr = [];
lastPoints[lastPoints.length - 2], var len = lastPoints.length
lastPoints[lastPoints.length - 1], for(var i = len; 0 < i ; i--) {
lastPoints[0], if(i%2 == 0){
lastPoints[1] arr.push(lastPoints[i-2])
]); arr.push(lastPoints[i-1])
}
}
// mPoints = points.concat([
// lastPoints[lastPoints.length - 2],
// lastPoints[lastPoints.length - 1],
// lastPoints[0],
// lastPoints[1]
// ]);
mPoints = points.concat(arr)
} else { } else {
mPoints = points.concat([ let arr = [];
lastPoints[0], let len = lastPoints.length
lastPoints[1], for(let i = 0; i < len; i++) {
lastPoints[lastPoints.length - 2], if(i%2 == 0){
lastPoints[lastPoints.length - 1] a.push(lastPoints[i])
]); a.push(lastPoints[i+1])
}
}
mPoints = points.concat(arr)
// mPoints = points.concat([
// lastPoints[0],
// lastPoints[1],
// lastPoints[lastPoints.length - 2],
// lastPoints[lastPoints.length - 1]
// ]);
} }
let rect = this.drawRect( let rect = this.drawRect(
"morePoints", "morePoints",
...@@ -1730,17 +1760,18 @@ export default { ...@@ -1730,17 +1760,18 @@ export default {
); );
rect.roadIndex = index - 1; rect.roadIndex = index - 1;
this.roadLayer.add(rect); this.roadLayer.add(rect);
//绘制车道中线 //绘制车道
debugger
if (!this.roads[index - 1]) { if (!this.roads[index - 1]) {
this.roads[index - 1] = {}; this.roads[index - 1] = {};
} }
var newmPoints = mPoints.filter(item => item); var newmPoints = mPoints.filter(item => item);
let road = this.roads[index - 1]; let road = this.roads[index - 1];
let cPoints = [ let cPoints = [
(newmPoints[0] + newmPoints[6]) / 2, (newmPoints[0] + newmPoints[newmPoints.length -2]) / 2,
(newmPoints[1] + newmPoints[7]) / 2, (newmPoints[1] + newmPoints[newmPoints.length -1]) / 2,
(newmPoints[2] + newmPoints[4]) / 2, (newmPoints[2] + newmPoints[newmPoints.length - 4]) / 2,
(newmPoints[3] + newmPoints[5]) / 2 (newmPoints[3] + newmPoints[newmPoints.length -3]) / 2
]; ];
road.cPoints = cPoints; road.cPoints = cPoints;
let cLine = this.drawLine("morePoints", cPoints, this.color[2]); let cLine = this.drawLine("morePoints", cPoints, this.color[2]);
...@@ -1919,6 +1950,7 @@ export default { ...@@ -1919,6 +1950,7 @@ export default {
rectPoints2 = this.sortLinePoints( rectPoints2 = this.sortLinePoints(
this.blueLines[index + 1].attrs.points this.blueLines[index + 1].attrs.points
); );
debugger
let options = { let options = {
lane_seq: index + 1, lane_seq: index + 1,
lane_no: midLine.index, lane_no: midLine.index,
......
export let roi = '<?xml version="1.0" encoding="GBK"?><roi><flow_roi><flow_type/><flow_region><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>0.068000</x><y>0.496680</y></point><point><point_seq>2</point_seq><x>0.068000</x><y>0.707000</y></point><point><point_seq>3</point_seq><x>0.703313</x><y>0.696680</y></point><point><point_seq>4</point_seq><x>0.689125</x><y>0.504940</y></point></flow_region></flow_roi><plate_detect_region><detect_polygon><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>0.068000</x><y>0.496680</y></point><point><point_seq>2</point_seq><x>0.068000</x><y>0.707000</y></point><point><point_seq>3</point_seq><x>0.703313</x><y>0.696680</y></point><point><point_seq>4</point_seq><x>0.689125</x><y>0.504940</y></point></detect_polygon></plate_detect_region><lane_line><line_count>4</line_count><line><line_seq>1</line_seq><lane_no>1</lane_no><line_type>0</line_type><points><point_count>5</point_count><point><point_seq>1</point_seq><x>0.068000</x><y>0.490500</y></point><point><point_seq>2</point_seq><x>0.091200</x><y>0.643080</y></point><point><point_seq>3</point_seq><x>0.060262</x><y>0.964720</y></point><point><point_seq>4</point_seq><x>0.060262</x><y>0.964720</y></point><point><point_seq>5</point_seq><x>0.060262</x><y>0.964720</y></point></points></line><line><line_seq>2</line_seq><lane_no>1</lane_no><line_type>0</line_type><points><point_count>6</point_count><point><point_seq>1</point_seq><x>0.168500</x><y>0.484300</y></point><point><point_seq>2</point_seq><x>0.220062</x><y>0.643080</y></point><point><point_seq>3</point_seq><x>0.262587</x><y>0.968860</y></point><point><point_seq>4</point_seq><x>0.261300</x><y>0.960600</y></point><point><point_seq>5</point_seq><x>0.261300</x><y>0.960600</y></point><point><point_seq>6</point_seq><x>0.261300</x><y>0.960600</y></point></points></line><line><line_seq>3</line_seq><lane_no>1</lane_no><line_type>0</line_type><points><point_count>2</point_count><point><point_seq>1</point_seq><x>0.375987</x><y>0.461640</y></point><point><point_seq>2</point_seq><x>0.953312</x><y>0.772980</y></point></points></line><line><line_seq>4</line_seq><lane_no>1</lane_no><line_type>0</line_type><points><point_count>5</point_count><point><point_seq>1</point_seq><x>0.377275</x><y>0.467820</y></point><point><point_seq>2</point_seq><x>0.497125</x><y>0.659580</y></point><point><point_seq>3</point_seq><x>0.609237</x><y>0.964720</y></point><point><point_seq>4</point_seq><x>0.609237</x><y>0.964720</y></point><point><point_seq>5</point_seq><x>0.609237</x><y>0.964720</y></point></points></line></lane_line><lanes><lane_count>3</lane_count><lane><lane_seq>1</lane_seq><lane_no>3</lane_no><line><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.214900</x><y>0.722450</y></point><point><point_seq>2</point_seq><x>0.244544</x><y>0.805970</y></point></line><direction_polygon><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.214900</x><y>0.722450</y></point><point><point_seq>2</point_seq><x>0.244544</x><y>0.805970</y></point></direction_polygon><lane_polygon><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>0.091200</x><y>0.643080</y></point><point><point_seq>2</point_seq><x>0.068000</x><y>0.490500</y></point><point><point_seq>3</point_seq><x>0.168500</x><y>0.484300</y></point><point><point_seq>4</point_seq><x>0.220062</x><y>0.643080</y></point></lane_polygon><lane_type>9</lane_type><lane_use_type>2</lane_use_type><lane_guiding_type>0</lane_guiding_type><lane_user_id>3</lane_user_id><lane_middle_line><polygon_point_count>2</polygon_point_count><point1><x>0.214900</x><y>0.722450</y></point1><point2><x>0.244544</x><y>0.805970</y></point2></lane_middle_line><lane_directions><lane_direction_count>1</lane_direction_count><lane_direction><lane_direction_type>1</lane_direction_type><lane_direction_time>00:00:00-23:59:59</lane_direction_time></lane_direction></lane_directions></lane><lane><lane_seq>2</lane_seq><lane_no>2</lane_no><line><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.272244</x><y>0.472970</y></point><point><point_seq>2</point_seq><x>0.607306</x><y>0.866790</y></point></line><direction_polygon><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.272244</x><y>0.472970</y></point><point><point_seq>2</point_seq><x>0.607306</x><y>0.866790</y></point></direction_polygon><lane_polygon><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>0.220062</x><y>0.643080</y></point><point><point_seq>2</point_seq><x>0.168500</x><y>0.484300</y></point><point><point_seq>3</point_seq><x>0.375987</x><y>0.461640</y></point><point><point_seq>4</point_seq><x>0.953312</x><y>0.772980</y></point></lane_polygon><lane_type>2</lane_type><lane_use_type>0</lane_use_type><lane_guiding_type>0</lane_guiding_type><lane_user_id>2</lane_user_id><lane_middle_line><polygon_point_count>2</polygon_point_count><point1><x>0.272244</x><y>0.472970</y></point1><point2><x>0.607306</x><y>0.866790</y></point2></lane_middle_line><lane_directions><lane_direction_count>1</lane_direction_count><lane_direction><lane_direction_type>1</lane_direction_type><lane_direction_time>00:00:00-23:59:59</lane_direction_time></lane_direction></lane_directions></lane><lane><lane_seq>3</lane_seq><lane_no>1</lane_no><line><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.493256</x><y>0.716270</y></point><point><point_seq>2</point_seq><x>0.553181</x><y>0.812150</y></point></line><direction_polygon><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.493256</x><y>0.716270</y></point><point><point_seq>2</point_seq><x>0.553181</x><y>0.812150</y></point></direction_polygon><lane_polygon><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>0.953312</x><y>0.772980</y></point><point><point_seq>2</point_seq><x>0.375987</x><y>0.461640</y></point><point><point_seq>3</point_seq><x>0.377275</x><y>0.467820</y></point><point><point_seq>4</point_seq><x>0.497125</x><y>0.659580</y></point></lane_polygon><lane_type>14</lane_type><lane_use_type>5</lane_use_type><lane_guiding_type/><lane_user_id>1</lane_user_id><lane_middle_line><polygon_point_count>2</polygon_point_count><point1><x>0.493256</x><y>0.716270</y></point1><point2><x>0.553181</x><y>0.812150</y></point2></lane_middle_line><lane_directions><lane_direction_count>1</lane_direction_count><lane_direction><lane_direction_type>1</lane_direction_type><lane_direction_time>00:00:00-23:59:59</lane_direction_time></lane_direction></lane_directions></lane></lanes><lights><light_count>0</light_count></lights><no_stop_region><region_count>1</region_count><no_stop_polygon><polygon_seq>1</polygon_seq><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>0.056400</x><y>0.430700</y></point><point><point_seq>2</point_seq><x>0.056400</x><y>0.913180</y></point><point><point_seq>3</point_seq><x>0.718775</x><y>0.913180</y></point><point><point_seq>4</point_seq><x>0.636300</x><y>0.410080</y></point></no_stop_polygon></no_stop_region><pedestrian_detection_region><region_count>1</region_count><polygon><polygon_id/><polygon_name/><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>0.060262</x><y>0.424520</y></point><point><point_seq>2</point_seq><x>0.060262</x><y>0.942040</y></point><point><point_seq>3</point_seq><x>0.665937</x><y>0.942040</y></point><point><point_seq>4</point_seq><x>0.602787</x><y>0.443080</y></point></polygon></pedestrian_detection_region><median_lines><lane_count>4</lane_count><lane><lane_seq>1</lane_seq><lane_no>3</lane_no><line><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.214900</x><y>0.722450</y></point><point><point_seq>2</point_seq><x>0.244544</x><y>0.805970</y></point></line><direction_polygon><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.214900</x><y>0.722450</y></point><point><point_seq>2</point_seq><x>0.244544</x><y>0.805970</y></point></direction_polygon><lane_polygon><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>0.091200</x><y>0.643080</y></point><point><point_seq>2</point_seq><x>0.068000</x><y>0.490500</y></point><point><point_seq>3</point_seq><x>0.168500</x><y>0.484300</y></point><point><point_seq>4</point_seq><x>0.220062</x><y>0.643080</y></point></lane_polygon><lane_type>9</lane_type></lane><lane><lane_seq>2</lane_seq><lane_no>2</lane_no><line><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.272244</x><y>0.472970</y></point><point><point_seq>2</point_seq><x>0.607306</x><y>0.866790</y></point></line><direction_polygon><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.272244</x><y>0.472970</y></point><point><point_seq>2</point_seq><x>0.607306</x><y>0.866790</y></point></direction_polygon><lane_polygon><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>0.220062</x><y>0.643080</y></point><point><point_seq>2</point_seq><x>0.168500</x><y>0.484300</y></point><point><point_seq>3</point_seq><x>0.375987</x><y>0.461640</y></point><point><point_seq>4</point_seq><x>0.953312</x><y>0.772980</y></point></lane_polygon><lane_type>2</lane_type></lane><lane><lane_seq>3</lane_seq><lane_no>1</lane_no><line><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.493256</x><y>0.716270</y></point><point><point_seq>2</point_seq><x>0.553181</x><y>0.812150</y></point></line><direction_polygon><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.493256</x><y>0.716270</y></point><point><point_seq>2</point_seq><x>0.553181</x><y>0.812150</y></point></direction_polygon><lane_polygon><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>0.953312</x><y>0.772980</y></point><point><point_seq>2</point_seq><x>0.375987</x><y>0.461640</y></point><point><point_seq>3</point_seq><x>0.377275</x><y>0.467820</y></point><point><point_seq>4</point_seq><x>0.497125</x><y>0.659580</y></point></lane_polygon><lane_type>14</lane_type></lane><lane><lane_no>1</lane_no><lane_seq>4</lane_seq><lane_type>12</lane_type><lane_polygon><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>0.060262</x><y>0.424520</y></point><point><point_seq>2</point_seq><x>0.060262</x><y>0.942040</y></point><point><point_seq>3</point_seq><x>0.665937</x><y>0.942040</y></point><point><point_seq>4</point_seq><x>0.602787</x><y>0.443080</y></point></lane_polygon></lane></median_lines><pedestrian_density_region><region_count>0</region_count></pedestrian_density_region><foreign_detection_region><region_count>0</region_count></foreign_detection_region><test_result_region><region_count>0</region_count></test_result_region></roi>'
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!