Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
platform
/
fanxing_new
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1167aacc
authored
Oct 29, 2020
by
潘建波
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加算法折线区域
1 parent
06c3c266
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
25 deletions
src/api/baseUrl.js
src/views/Layout/index.vue
src/views/Login.vue
src/views/sceneManage/setting/area.vue
src/views/sceneManage/setting/areaconfig/TraficCanvas.vue
src/views/sceneManage/setting/areaconfig/roi_1.js
src/api/baseUrl.js
View file @
1167aac
...
...
@@ -3,7 +3,7 @@ console.log(process.env.NODE_ENV);
switch
(
process
.
env
.
NODE_ENV
)
{
case
"development"
:
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl
=
"http://192.168.9.
2
33:20080"
;
// 测试环境url
baseUrl
=
"http://192.168.9.
1
33:20080"
;
// 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510';
...
...
src/views/Layout/index.vue
View file @
1167aac
...
...
@@ -143,6 +143,7 @@ export default {
localStorage
.
removeItem
(
"curmenu"
);
this
.
$store
.
commit
(
types
.
ATOKEN
,
""
);
localStorage
.
removeItem
(
"atoken"
);
this
.
$logs
.
oplogs
(
''
,
'serv_login'
,
`退出了平台`
);
this
.
$router
.
push
(
"/login"
).
catch
(
err
=>
{
err
;
});
...
...
src/views/Login.vue
View file @
1167aac
...
...
@@ -109,7 +109,8 @@ export default {
this
.
$api
.
login
.
login
({
username
:
this
.
ruleForm
.
username
,
password
:
this
.
baseencode
(
this
.
ruleForm
.
password
),
// password: this.baseencode(this.ruleForm.password),
password
:
this
.
ruleForm
.
password
,
user_type
:
"user"
})
.
then
(
res
=>
{
...
...
@@ -120,7 +121,7 @@ export default {
//本系统可以直接用本地缓存做
localStorage
.
setItem
(
"atoken"
,
res
.
atoken
);
localStorage
.
setItem
(
"uname"
,
res
.
user_name
);
this
.
$logs
.
oplogs
(
res
,
'serv_login'
,
`登录了平台`
);
this
.
$logs
.
oplogs
(
res
.
user_name
,
'serv_login'
,
`登录了平台`
);
// 处理登录用户权限菜单显示问题;
if
(
res
.
firstLogin
)
{
this
.
$router
.
push
(
'resetpass'
)
...
...
src/views/sceneManage/setting/area.vue
View file @
1167aac
...
...
@@ -32,6 +32,7 @@ import FlowCanvas from "./areaconfig/FlowCanvas";
import
SafeCanvas
from
"./areaconfig/SafeCanvas"
;
import
FaceCanvas
from
"./areaconfig/FaceCanvas"
;
import
ComplexCanvas
from
"./areaconfig/ComplexCanvas"
;
import
{
roi
}
from
"./areaconfig/roi_1"
export
default
{
data
()
{
return
{
...
...
@@ -94,7 +95,8 @@ export default {
setTimeout
(()
=>
{
_this
.
$refs
.
canvas
.
stageInit
();
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
);
},
...
...
src/views/sceneManage/setting/areaconfig/TraficCanvas.vue
View file @
1167aac
...
...
@@ -530,6 +530,7 @@ export default {
//TODO handle the exception
console
.
log
(
e
);
}
debugger
//车道和行人
if
(
obj
.
median_lines
.
lane_count
>
0
)
{
let
ary
=
obj
.
median_lines
.
lane
;
...
...
@@ -1193,6 +1194,8 @@ export default {
if
(
!
this
.
needRect
)
return
;
this
.
needRect
=
false
;
if
(
this
.
drawState
==
3
)
{
//车道属性
debugger
let
layer
=
this
.
layers
[
this
.
drawState
];
let
rects
=
layer
.
get
(
".rect"
);
let
rect
=
rects
[
rects
.
length
-
1
];
...
...
@@ -1635,7 +1638,6 @@ export default {
},
//生成车道
drawRoad
:
function
()
{
debugger
;
if
(
this
.
roadFlag
===
true
)
return
;
if
(
this
.
roadFlag
===
false
)
{
this
.
$alert
(
"车道线有修改,请逐一检查车道属性是否正确"
,
"提示"
,
{
...
...
@@ -1671,7 +1673,16 @@ export default {
var
len
=
arr
.
length
;
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
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
];
//元素交换
arr
[
j
+
1
]
=
arr
[
j
];
...
...
@@ -1681,8 +1692,9 @@ export default {
}
return
arr
;
}
console
.
log
(
"排序后的蓝色车道线"
);
console
.
log
(
sortBlueLine
(
this
.
blueLines
));
// this.blueLines = sortBlueLine(this.blueLines);
console
.
log
(
"蓝色车道线"
,
this
.
blueLines
);
// console.log(sortBlueLine(this.blueLines));
this
.
blueLines
.
forEach
((
ele
,
index
)
=>
{
let
points
=
this
.
sortLinePoints
(
ele
.
attrs
.
points
);
if
(
index
>
0
)
{
...
...
@@ -1708,19 +1720,37 @@ export default {
Math
.
pow
(
points
[
points
.
length
-
1
]
-
lastPoints
[
1
],
2
);
let
mPoints
;
if
(
num1
<
num2
)
{
mPoints
=
points
.
concat
([
lastPoints
[
lastPoints
.
length
-
2
],
lastPoints
[
lastPoints
.
length
-
1
],
lastPoints
[
0
],
lastPoints
[
1
]
]);
var
arr
=
[];
var
len
=
lastPoints
.
length
for
(
var
i
=
len
;
0
<
i
;
i
--
)
{
if
(
i
%
2
==
0
){
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
{
mPoints
=
points
.
concat
([
lastPoints
[
0
],
lastPoints
[
1
],
lastPoints
[
lastPoints
.
length
-
2
],
lastPoints
[
lastPoints
.
length
-
1
]
]);
let
arr
=
[];
let
len
=
lastPoints
.
length
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
if
(
i
%
2
==
0
){
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
(
"morePoints"
,
...
...
@@ -1730,17 +1760,18 @@ export default {
);
rect
.
roadIndex
=
index
-
1
;
this
.
roadLayer
.
add
(
rect
);
//绘制车道中线
//绘制车道
debugger
if
(
!
this
.
roads
[
index
-
1
])
{
this
.
roads
[
index
-
1
]
=
{};
}
var
newmPoints
=
mPoints
.
filter
(
item
=>
item
);
let
road
=
this
.
roads
[
index
-
1
];
let
cPoints
=
[
(
newmPoints
[
0
]
+
newmPoints
[
6
])
/
2
,
(
newmPoints
[
1
]
+
newmPoints
[
7
])
/
2
,
(
newmPoints
[
2
]
+
newmPoints
[
4
])
/
2
,
(
newmPoints
[
3
]
+
newmPoints
[
5
])
/
2
(
newmPoints
[
0
]
+
newmPoints
[
newmPoints
.
length
-
2
])
/
2
,
(
newmPoints
[
1
]
+
newmPoints
[
newmPoints
.
length
-
1
])
/
2
,
(
newmPoints
[
2
]
+
newmPoints
[
newmPoints
.
length
-
4
])
/
2
,
(
newmPoints
[
3
]
+
newmPoints
[
newmPoints
.
length
-
3
])
/
2
];
road
.
cPoints
=
cPoints
;
let
cLine
=
this
.
drawLine
(
"morePoints"
,
cPoints
,
this
.
color
[
2
]);
...
...
@@ -1919,6 +1950,7 @@ export default {
rectPoints2
=
this
.
sortLinePoints
(
this
.
blueLines
[
index
+
1
].
attrs
.
points
);
debugger
let
options
=
{
lane_seq
:
index
+
1
,
lane_no
:
midLine
.
index
,
...
...
src/views/sceneManage/setting/areaconfig/roi_1.js
0 → 100644
View file @
1167aac
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>'
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment