Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-skynet-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-skynet-admin
Commits
746c2092
Commit
746c2092
authored
Sep 29, 2021
by
朱松文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dog name
parent
590e7e9a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
22 deletions
+51
-22
myVideo.scss
src/assets/scss/myVideo.scss
+20
-0
index.vue
src/components/DogInfo/index.vue
+10
-0
index.ts
src/components/MyVideo/track/index.ts
+20
-21
CameraService.ts
src/service/CameraService.ts
+1
-1
No files found.
src/assets/scss/myVideo.scss
View file @
746c2092
...
...
@@ -12,8 +12,28 @@
border
:
2px
solid
#0079fe
;
}
.najiu-dog-track-dog-name
{
position
:
absolute
;
font-size
:
10px
;
border-top
:
2px
solid
#0079fe
;
border-left
:
2px
solid
#0079fe
;
border-right
:
2px
solid
#0079fe
;
border-bottom
:
3px
solid
#0079fe
;
top
:
-22px
;
left
:
-10px
;
min-width
:
50px
;
padding
:
2px
5px
;
}
.najiu-dog-track-current
{
position
:
absolute
;
border
:
2px
solid
#f95e5a
;
z-index
:
100
;
}
.najiu-dog-track-dog-name-current
{
border-top
:
2px
solid
#f95e5a
;
border-left
:
2px
solid
#f95e5a
;
border-right
:
2px
solid
#f95e5a
;
border-bottom
:
3px
solid
#f95e5a
;
}
\ No newline at end of file
src/components/DogInfo/index.vue
View file @
746c2092
...
...
@@ -3,6 +3,11 @@
<div
:class=
"
{'table-container':true,active:isActive}">
<table>
<tbody>
<tr>
<td
colspan=
"3"
>
<div
class=
"dog-id"
>
狗-
{{
dog
.
id
}}
</div>
</td>
</tr>
<tr>
<td
class=
"td-img"
rowspan=
"6"
>
<div
class=
"dog-img"
>
...
...
@@ -99,6 +104,11 @@ export default class DogInfo extends BaseVue {
.
#{
$prefixCls
}
-dog
{
font-size
:
12px
;
font-weight
:
700
;
.dog-id
{
text-align
:
left
;
padding-top
:
5px
;
padding-bottom
:
5px
;
}
.table-container
{
margin-bottom
:
10px
;
}
...
...
src/components/MyVideo/track/index.ts
View file @
746c2092
...
...
@@ -13,30 +13,22 @@ class DogTrack extends Component {
constructor
(
player
,
options
)
{
super
(
player
,
options
);
const
this_
=
this
player
.
on
(
"
loadedmetadata
"
,
()
=>
{
console
.
log
(
"
视频时长单位秒
"
,
player
.
duration
())
})
player
.
on
(
"
timeupdate
"
,
()
=>
this
.
update
())
player
.
on
(
"
fullscreenchange
"
,
(
e
)
=>
this
.
fullScreenChange
.
call
(
this_
,
e
,
player
))
//
player.on("fullscreenchange", (e) => this.fullScreenChange.call(this_, e, player))
player
.
on
(
"
ended
"
,
()
=>
{
this
.
arrayIndex
=
0
;
})
player
.
on
(
"
playerresize
"
,
(
e
)
=>
{
// this.defaultHeight = player.currentHeight()
// this.defaultWidth = player.currentWidth()
// console.log("aaa", player.currentHeight(), player.currentWidth())
})
}
fullScreenChange
(
e
,
player
)
{
if
(
player
.
isFullscreen
())
{
// this.fullWidth = e.currentTarget.offsetWidth
// this.fullHeight = e.currentTarget.offsetHeight
console
.
log
(
"
full
"
,
e
.
currentTarget
.
offsetWidth
,
e
.
currentTarget
.
offsetHeight
)
}
}
// fullScreenChange(e, player) {
// if (player.isFullscreen()) {
// console.log("full", e.currentTarget.offsetWidth, e.currentTarget.offsetHeight)
// }
// }
update
()
{
if
(
this
.
processing
||
this
.
trackData
.
length
===
0
)
return
...
...
@@ -80,14 +72,14 @@ class DogTrack extends Component {
//跟踪框位置
myel
.
style
.
top
=
`
${
value
.
y1
*
this
.
player_
.
currentHeight
()}
px`
myel
.
style
.
left
=
`
${
value
.
x1
*
this
.
player_
.
currentWidth
()}
px`
console
.
log
(
`top:
${
myel
.
style
.
top
}
,left:
${
myel
.
style
.
left
}
,screen-width:
${
this
.
player_
.
currentWidth
()}
,screen-height:
${
this
.
player_
.
currentHeight
()}
,dogs:
${
JSON
.
stringify
(
value
)}
`
)
//
console.log(`top:${myel.style.top},left:${myel.style.left},screen-width:${this.player_.currentWidth()},screen-height:${this.player_.currentHeight()},dogs:${JSON.stringify(value)}`)
}
else
{
myel
.
style
.
width
=
`
${(
value
.
x2
-
value
.
x1
)
*
this
.
player_
.
currentWidth
()}
px`
myel
.
style
.
height
=
`
${(
value
.
y2
-
value
.
y1
)
*
(
this
.
player_
.
currentHeight
()
+
30
)}
px`
//跟踪框位置
myel
.
style
.
top
=
`
${
value
.
y1
*
this
.
player_
.
currentHeight
()}
px`
myel
.
style
.
left
=
`
${
value
.
x1
*
this
.
player_
.
currentWidth
()}
px`
console
.
log
(
`top:
${
myel
.
style
.
top
}
,left:
${
myel
.
style
.
left
}
,screen-width:
${
this
.
player_
.
currentWidth
()}
,screen-height:
${
this
.
player_
.
currentHeight
()}
,dogs:
${
JSON
.
stringify
(
value
)}
`
)
//
console.log(`top:${myel.style.top},left:${myel.style.left},screen-width:${this.player_.currentWidth()},screen-height:${this.player_.currentHeight()},dogs:${JSON.stringify(value)}`)
}
myel
.
className
=
myel
.
className
.
replace
(
/display-none/ig
,
""
)
...
...
@@ -116,7 +108,7 @@ class DogTrack extends Component {
setTimeout
(()
=>
{
const
numberDogId
=
Number
(
currentDogId
)
if
(
dogIds
&&
dogIds
.
has
(
numberDogId
))
{
this
.
player_
.
currentTime
((
dogIds
.
get
(
numberDogId
)
*
40
-
30
)
/
1000
)
this
.
player_
.
currentTime
((
dogIds
.
get
(
numberDogId
)
.
FrameIndex
*
40
-
30
)
/
1000
)
}
},
100
);
}
...
...
@@ -125,18 +117,25 @@ class DogTrack extends Component {
if
(
!
dogIds
||
dogIds
.
size
===
0
)
return
;
//@ts-ignore
const
myContainer
=
this
.
player_
.
el_
;
console
.
log
(
"
key currentDogId
"
,
dogIds
,
currentDogId
,
myContainer
)
for
(
const
key
of
dogIds
.
keys
())
{
// console.log("key currentDogId", dogIds, currentDogId, myContainer)
for
(
const
[
key
,
value
]
of
dogIds
)
{
//定位框元素
const
el
=
document
.
createElement
(
"
div
"
)
el
.
id
=
`dog_
${
key
}
`
el
.
classList
.
add
(
"
display-none
"
)
// console.log("dogId", `当前狗id:${currentDogId},遍历狗id:${key}`)
//dog name
const
dogNameEl
=
document
.
createElement
(
"
div
"
)
dogNameEl
.
classList
.
add
(
"
najiu-dog-track-dog-name
"
)
//@ts-ignore
const
dogName
=
document
.
createTextNode
(
`狗
${
value
.
obj_id
}
`
)
if
(
key
==
currentDogId
)
{
// console.log("currentDogId", currentDogId)
el
.
classList
.
add
(
"
najiu-dog-track-current
"
)
dogNameEl
.
classList
.
add
(
"
najiu-dog-track-dog-name-current
"
)
}
else
{
el
.
classList
.
add
(
"
najiu-dog-track
"
)
}
dogNameEl
.
appendChild
(
dogName
)
el
.
appendChild
(
dogNameEl
)
//@ts-ignore
myContainer
.
appendChild
(
el
)
this
.
dogDiv
.
set
(
key
,
el
)
...
...
src/service/CameraService.ts
View file @
746c2092
...
...
@@ -75,7 +75,7 @@ export function convertLabelInfo(data: TrackData[]) {
const
m
=
f
?
f
:
new
Map
();
m
.
set
(
frame
.
DogId
,
frame
)
trackData
.
set
(
frame
.
FrameIndex
,
m
)
dogIds
.
set
(
frame
.
DogId
,
frame
.
FrameIndex
)
dogIds
.
set
(
frame
.
DogId
,
frame
)
});
console
.
log
(
`标识文件大小:
${
data
.
length
}
行,处理耗时:
${
new
Date
().
getTime
()
-
now
}
毫秒`
)
return
[
dogIds
,
trackData
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment