Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
罗鑫霖
/
vion-tools
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 0c999ad4
authored
Nov 27, 2023
by
李乾广
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改bug,数据聚类--单张特征对比功能优化
1 parent
57a5e9d7
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
164 additions
and
80 deletions
src/views/FeatureComparisonVerification/api.js
src/views/SnapshotCluster/ClusterResult/ClusterResult.vue
src/views/SnapshotCluster/SnapshotRecord/SnapshotRecord.vue
src/views/SnapshotCluster/imgDialog.vue
src/views/SnapshotCluster/singleImgComparisonDialog.vue
src/views/FeatureComparisonVerification/api.js
View file @
0c999ad
...
...
@@ -17,7 +17,8 @@ class FeatureResultApi {
return
axiosInstance
.
request
(
{
method
:
'GET'
,
url
:
`/feature/allPersonContrast`
,
// url: `/feature/allPersonContrast`,
url
:
`/feature/allPersonContrastGroup`
,
params
:
filterEmptyValueInObject
(
data
)
...
...
src/views/SnapshotCluster/ClusterResult/ClusterResult.vue
View file @
0c999ad
...
...
@@ -630,6 +630,8 @@ export default {
let
parmas
=
{
person_unid
:
currobj
.
value
.
person_unid
,
pic_type
:
rawData
.
picType
,
endTime
:
rawData
.
endTime
,
startTime
:
rawData
.
startTime
,
countdate
:
formatDate
(
rawData
.
date
),
pic_id
:
currobj
.
value
.
id
,
ip
:
window
.
_baseImgUrl
,
...
...
src/views/SnapshotCluster/SnapshotRecord/SnapshotRecord.vue
View file @
0c999ad
...
...
@@ -105,6 +105,9 @@
<a-form-item
style=
"padding: 5px 0"
>
<a-button
type=
"primary"
@
click=
"comparativeFun"
>
特征对比验证
</a-button>
</a-form-item>
<a-form-item
style=
"padding: 5px 0"
>
<a-button
type=
"primary"
@
click=
"singleComparativeFun"
>
单张特征对比
</a-button>
</a-form-item>
</a-form>
<div
v-loading=
"isLoading"
>
...
...
@@ -150,6 +153,7 @@
</div>
<!--
<imgDialog
ref=
'imgModelRef'
></imgDialog>
-->
<DetailDialog
ref=
"DetailDialogRef"
/>
<singleImgComparisonDialog
ref=
"singleImgComparisonRef"
></singleImgComparisonDialog>
</
template
>
<
script
>
...
...
@@ -161,10 +165,12 @@ import {filterEmptyValueInObject, formatDate, formatTime, getPagedList} from '@/
// import imgDialog from '../imgDialog.vue'
import
{
ElMessage
}
from
'element-plus'
import
DetailDialog
from
"../../ComparisonCapturedPictures/DetailDialog.vue"
;
import
singleImgComparisonDialog
from
"../singleImgComparisonDialog.vue"
;
export
default
{
components
:{
// imgDialog ,
DetailDialog
DetailDialog
,
singleImgComparisonDialog
},
setup
()
{
// scalar
...
...
@@ -512,6 +518,40 @@ export default {
}
DetailDialogRef
.
value
.
initDialog
(
currobj
.
value
,
parmas
);
}
//单张特征对比
const
singleImgComparisonRef
=
ref
()
const
singleComparativeFun
=
function
(){
if
(
!
currobj
.
value
.
id
){
ElMessage
(
{
message
:
`请选择图片`
,
type
:
'warning'
}
)
return
}
if
(
!
currobj
.
value
.
picture_url
){
ElMessage
(
{
message
:
`该图片没有特征,请选择有效的图片`
,
type
:
'warning'
}
)
return
}
const
rawData
=
toRaw
(
queryForm
)
let
parmas
=
{
person_unid
:
currobj
.
value
.
person_unid
,
pic_type
:
rawData
.
picType
,
endTime
:
rawData
.
endTime
,
startTime
:
rawData
.
startTime
,
countdate
:
formatDate
(
rawData
.
date
),
pic_id
:
currobj
.
value
.
id
,
ip
:
window
.
_baseImgUrl
,
plaza_id
:
currobj
.
value
.
mall_id
}
singleImgComparisonRef
.
value
.
initDialog
(
parmas
);
}
const
clickSearch
=
function
()
{
pageNum
.
value
=
1
confirmSearch
()
...
...
@@ -557,7 +597,9 @@ export default {
clickSearch
,
// ref
DetailDialogRef
,
imgModelRef
imgModelRef
,
singleComparativeFun
,
singleImgComparisonRef
}
}
}
...
...
src/views/SnapshotCluster/imgDialog.vue
View file @
0c999ad
<
template
>
<a-modal
title=
"图片
"
:title=
"'图片' + ' ' + unidStr
"
v-if=
'isVisible'
v-model:visible=
"isVisible"
width=
"1200px"
...
...
@@ -25,8 +25,11 @@ export default {
const
imgUrl
=
ref
()
const
canvas
=
ref
()
const
ctx
=
ref
()
const
initDialog
=
(
url
,
data
)
=>
{
const
unidStr
=
ref
(
''
)
const
initDialog
=
(
unid
,
url
,
data
)
=>
{
console
.
log
(
unid
,
url
,
data
,)
imgUrl
.
value
=
url
unidStr
.
value
=
unid
isVisible
.
value
=
true
;
setTimeout
(()
=>
{
var
imgscream
=
document
.
getElementById
(
"img"
);
...
...
@@ -56,6 +59,7 @@ export default {
initDialog
,
isLoading
,
imgUrl
,
unidStr
,
detailData
};
},
...
...
src/views/SnapshotCluster/singleImgComparisonDialog.vue
View file @
0c999ad
<
template
>
<a-modal
title=
"单张图片特征对比"
v-if=
'isVisible'
v-model:visible=
"isVisible"
width=
"1600px"
height=
'90%'
class=
"detail-modal"
>
<a-modal
title=
"单张图片特征对比"
v-if=
'isVisible'
v-model:visible=
"isVisible"
width=
"1066px"
height=
'90%'
class=
"detail-modal"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8
"
class=
'imgBox1'
v-loading=
'isLoading'
>
<el-col
:span=
"12
"
class=
'imgBox1'
v-loading=
'isLoading'
>
<p
class=
"title"
>
<span
class=
"name"
>
现在聚类
</span>
<span
class=
"id"
>
{{
detailData
.
person_unid
}}
</span>
...
...
@@ -29,15 +23,19 @@
<a-empty
v-if=
'featureList.length==0'
style=
'margin: 0 auto;'
></a-empty>
</el-row>
</el-col>
<el-col
:span=
"8
"
class=
'imgBox1'
v-loading=
'isLoading1'
>
<el-col
:span=
"12
"
class=
'imgBox1'
v-loading=
'isLoading1'
>
<p
class=
"title"
>
<span
class=
"name"
>
特征比对
</span>
<span
class=
"num"
>
{{
comparisonList
.
length
}}
张
</span>
<span
class=
"num"
>
{{
comparisonList
&&
comparisonList
.
length
>
0
?
comparisonList
[
0
].
numLength
:
0
}}
张
</span>
</p>
<el-row
:gutter=
"10"
class=
"imgBox1_top"
>
<el-col
:span=
"8"
class=
"itemBox"
v-for=
"item in comparisonList"
>
<el-image
:src=
"item.picture_url"
:fit=
"'fill'"
class=
"single-image"
@
click=
'clickItem(item)'
>
</el-image>
<el-row
class=
"imgBox1_top"
>
<el-row
:gutter=
"10"
v-for=
"(one,ind) in comparisonList"
style=
"width: 100%;"
>
<div
style=
"height: 30px;line-height: 30px;width: 100%;padding-left: 5px;margin-bottom: 5px;"
>
{{
one
.
person_unid
}}
<span
style=
"float: right;padding-right: 11px;"
v-if=
"one.personList"
>
{{
one
.
personList
.
length
}}
张
</span>
</div>
<el-col
:span=
"8"
class=
"itemBox"
v-for=
"(item,index) in one.personList"
>
<el-image
:src=
"item.picture_url"
:fit=
"'fill'"
class=
"single-image"
@
click=
'clickItem(item)'
></el-image>
<span
class=
"el-icon-picture-outline openImage"
@
click=
"openImage(item,$event)"
></span>
<span
class=
"el-icon-document downloadFile"
@
click=
"downloadFile(item,$event)"
></span>
<p
class=
"featureNum"
>
{{
item
.
featureNum
?(
item
.
featureNum
).
toFixed
(
2
):
0
}}
</p>
...
...
@@ -46,10 +44,11 @@
<div
class=
"direction"
:class=
"'direction'+item.direction"
>
方向:
{{
formatDirection
(
item
.
direction
)
}}
</div>
<div>
地点:
{{
item
.
gate_name
}}
</div>
</el-col>
</el-row>
<a-empty
v-if=
'comparisonList.length==0'
style=
'margin: 0 auto;'
></a-empty>
</el-row>
</el-col>
<el-col
:span=
"8"
class=
'imgBox1'
v-loading=
'isLoading2'
>
<!--
<el-col
:span=
"8"
class=
'imgBox1'
v-loading=
'isLoading2'
>
<p
class=
"title"
>
<span
class=
"name"
>
重提特征后比对
</span>
<a-button
class=
"id"
type=
"primary"
@
click=
"reComparisonFeature"
>
重提特征比对
</a-button>
...
...
@@ -69,25 +68,31 @@
</el-col>
<a-empty
v-if=
'reComparisonList.length==0'
style=
'margin: 0 auto;'
></a-empty>
</el-row>
</el-col>
</el-col>
-->
</el-row>
<template
#
footer
>
<a-button
@
click=
"onCancel"
>
返回
</a-button>
</
template
>
</a-modal>
<imgDialog
ref=
'imgModelRef'
></imgDialog>
<imgOtherDialog
ref=
"imgOtherDialogRef"
></imgOtherDialog>
<imgOtherDialog
ref=
"imgOtherDialogRef"
></imgOtherDialog>
</template>
<
script
>
import
{
reactive
,
ref
,
watch
}
from
"vue"
;
import
featureApi
from
'@/views/FeatureComparisonVerification/api.js'
import
clusterResultApi
from
'@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import
{
isArray
}
from
'@/PublicUtil/Judgment'
import
imgDialog
from
'./imgDialog.vue'
import
imgOtherDialog
from
"../ComparisonCapturedPictures/imgOtherDialog.vue"
;
export
default
{
components
:{
import
{
reactive
,
ref
,
watch
}
from
"vue"
;
import
featureApi
from
'@/views/FeatureComparisonVerification/api.js'
import
clusterResultApi
from
'@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import
{
isArray
}
from
'@/PublicUtil/Judgment'
import
imgDialog
from
'./imgDialog.vue'
import
imgOtherDialog
from
"../ComparisonCapturedPictures/imgOtherDialog.vue"
;
export
default
{
components
:
{
imgDialog
,
imgOtherDialog
},
...
...
@@ -95,7 +100,7 @@ export default {
const
isVisible
=
ref
(
false
);
const
isLoading
=
ref
(
false
);
const
isLoading1
=
ref
(
false
);
const
isLoading2
=
ref
(
false
);
const
isLoading2
=
ref
(
false
);
const
detailData
=
ref
({});
const
featureList
=
ref
([])
const
imgModelRef
=
ref
();
...
...
@@ -119,9 +124,11 @@ export default {
}
}
}
watch
([
featureList
],(
newVal
,
oldVal
)
=>
{
watch
([
featureList
],
(
newVal
,
oldVal
)
=>
{
},{
deep
:
true
})
},
{
deep
:
true
})
const
initDialog
=
(
data
)
=>
{
isLoading
.
value
=
true
;
isLoading1
.
value
=
true
;
...
...
@@ -129,10 +136,10 @@ export default {
detailData
.
value
=
data
;
featureList
.
value
=
[]
reComparisonList
.
value
=
[]
featureApi
.
getPersonContrastList
(
data
).
then
((
r
)
=>
{
featureApi
.
getPersonContrastList
(
data
).
then
((
r1
)
=>
{
isLoading
.
value
=
false
if
(
r
.
data
&&
isArray
(
r
.
data
.
personList
))
{
r
.
data
.
personList
.
forEach
((
item
)
=>
{
if
(
r1
.
data
&&
isArray
(
r1
.
data
.
personList
))
{
r1
.
data
.
personList
.
forEach
((
item
)
=>
{
if
(
item
.
features_url
)
{
item
.
features_url
=
window
.
_baseImgUrl
+
item
.
features_url
}
...
...
@@ -140,15 +147,33 @@ export default {
item
.
picture_url
=
window
.
_baseImgUrl
+
item
.
picture_url
}
})
featureList
.
value
=
r
.
data
.
personList
featureList
.
value
=
r1
.
data
.
personList
}
}
)
})
comparisonList
.
value
=
[]
featureApi
.
getAllPersonContrastList
(
data
).
then
((
r
)
=>
{
isLoading1
.
value
=
false
if
(
isArray
(
r
.
data
))
{
if
(
r
.
data
.
length
>
0
){
if
(
r
.
data
.
length
>
0
)
{
let
numLength
=
0
r
.
data
.
forEach
((
item
)
=>
{
if
(
item
.
personList
&&
item
.
personList
.
length
>
0
)
{
numLength
+=
item
.
personList
.
length
item
.
personList
.
forEach
((
one
)
=>
{
if
(
one
.
picture_url
)
{
one
.
picture_url
=
window
.
_baseImgUrl
+
one
.
picture_url
}
})
}
})
r
.
data
[
0
].
numLength
=
numLength
comparisonList
.
value
=
r
.
data
}
}
/* isLoading1.value = false
console.log(r)
if (isArray(r.data)) {
if (r.data.length > 0) {
r.data.forEach((item) => {
if (item.features_url) {
item.features_url = window._baseImgUrl + item.features_url
...
...
@@ -159,23 +184,25 @@ export default {
})
comparisonList.value = r.data
}
}
}
)
} */
})
isVisible
.
value
=
true
;
};
const
clickItem
=
function
(
data
){
clusterResultApi
.
getBodyPoint
({
'feature_url'
:
data
.
features_url
}).
then
((
r
)
=>
{
imgModelRef
.
value
.
initDialog
(
data
.
picture_url
,
r
.
data
);
const
clickItem
=
function
(
data
)
{
console
.
log
(
data
)
clusterResultApi
.
getBodyPoint
({
'feature_url'
:
data
.
features_url
}).
then
((
r
)
=>
{
imgModelRef
.
value
.
initDialog
(
data
.
unid
,
data
.
picture_url
,
r
.
data
);
})
}
const
reComparisonFeature
=
function
()
{
const
reComparisonFeature
=
function
()
{
isLoading2
.
value
=
true
reComparisonList
.
value
=
[]
featureApi
.
getNewPersonContrastList
(
detailData
.
value
).
then
((
r
)
=>
{
isLoading2
.
value
=
false
if
(
isArray
(
r
.
data
))
{
if
(
r
.
data
.
length
>
0
)
{
if
(
r
.
data
.
length
>
0
)
{
r
.
data
.
forEach
((
item
)
=>
{
if
(
item
.
features_url
)
{
item
.
features_url
=
window
.
_baseImgUrl
+
item
.
features_url
...
...
@@ -187,36 +214,31 @@ export default {
reComparisonList
.
value
=
r
.
data
}
}
})
}
)
}
const
downloadFile
=
function
(
item
,
event
){
const
downloadFile
=
function
(
item
,
event
)
{
event
.
stopPropagation
()
if
(
item
.
features_url
)
{
if
(
item
.
features_url
)
{
window
.
open
(
item
.
features_url
)
}
else
{
ElMessage
(
{
}
else
{
ElMessage
({
message
:
`该图片没有特征`
,
type
:
'warning'
}
)
})
return
}
}
const
openImage
=
function
(
item
,
event
)
{
const
openImage
=
function
(
item
,
event
)
{
event
.
stopPropagation
()
if
(
item
.
features_url
)
{
if
(
item
.
features_url
)
{
let
url
=
item
.
picture_url
imgOtherDialogRef
.
value
.
initDialog
(
url
.
split
(
'0.jpg'
)[
0
]
+
'1.jpg'
)
}
else
{
ElMessage
(
{
imgOtherDialogRef
.
value
.
initDialog
(
url
.
split
(
'0.jpg'
)[
0
]
+
'1.jpg'
)
}
else
{
ElMessage
({
message
:
`该图片没有特征`
,
type
:
'warning'
}
)
})
return
}
}
...
...
@@ -244,7 +266,7 @@ export default {
imgOtherDialogRef
};
},
};
};
</
script
>
<
style
lang=
"less"
scoped
>
.single-image
{
...
...
@@ -252,41 +274,51 @@ export default {
width
:
150px
;
cursor
:
pointer
;
}
.direction
{
.direction
{
font-weight
:
900
;
background-color
:
red
;
color
:
white
;
}
.direction1
{
.direction1
{
background-color
:
green
;
}
.direction0
{
.direction0
{
background-color
:
orange
;
}
.title
{
.title
{
height
:
32px
;
line-height
:
32px
;
padding
:
0
;
.name{
.name
{
font-weight
:
900
;
font-size
:
18px
;
}
.id
{
.id
{
margin-left
:
20px
;
}
.num
{
.num
{
float
:
right
;
margin-right
:
15px
;
}
}
.imgBox1
{
.imgBox1
{
//
border-left
:
10px
solid
#efefef
;
box-sizing
:
border-box
;
min-height
:
100%
;
.itemBox{
.itemBox
{
position
:
relative
;
}
.downloadFile
{
.downloadFile
{
position
:
absolute
;
color
:
#1890ff
;
font-size
:
32px
;
...
...
@@ -294,7 +326,8 @@ export default {
right
:
10px
;
cursor
:
pointer
;
}
.openImage
{
.openImage
{
position
:
absolute
;
color
:
#1890ff
;
font-size
:
32px
;
...
...
@@ -302,7 +335,8 @@ export default {
left
:
90px
;
cursor
:
pointer
;
}
.featureNum
{
.featureNum
{
position
:
absolute
;
top
:
0
;
left
:
15px
;
...
...
@@ -311,7 +345,8 @@ export default {
font-size
:
16px
;
}
}
.imgBox1_top
{
.imgBox1_top
{
min-height
:
400px
;
max-height
:
600px
;
overflow-y
:
auto
;
...
...
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