Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
钟尚武
dlib
Commits
d6b1f69b
Commit
d6b1f69b
authored
Jun 01, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up numpy_image code a little.
parent
b6267d7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
24 deletions
+7
-24
numpy_image.h
dlib/python/numpy_image.h
+7
-24
No files found.
dlib/python/numpy_image.h
View file @
d6b1f69b
...
@@ -148,26 +148,17 @@ namespace dlib
...
@@ -148,26 +148,17 @@ namespace dlib
numpy_image
(
numpy_image
(
const
py
::
object
&
img
const
py
::
object
&
img
)
)
:
numpy_image
(
img
.
cast
<
py
::
array
>
())
{}
{
py
::
array_t
<
typename
pixel_traits
<
pixel_type
>::
basic_pixel_type
,
py
::
array
::
c_style
>
arr
=
img
.
cast
<
py
::
array
>
();
assert_is_image
<
pixel_type
>
(
arr
);
py
::
array_t
<
typename
pixel_traits
<
pixel_type
>::
basic_pixel_type
,
py
::
array
::
c_style
>::
operator
=
(
arr
);
}
numpy_image
(
numpy_image
(
const
numpy_image
&
img
const
numpy_image
&
img
)
:
py
::
array_t
<
typename
pixel_traits
<
pixel_type
>::
basic_pixel_type
,
py
::
array
::
c_style
>
(
img
)
)
=
default
;
{
}
numpy_image
&
operator
=
(
numpy_image
&
operator
=
(
const
py
::
object
&
rhs
const
py
::
object
&
rhs
)
)
{
{
py
::
array
arr
=
rhs
.
cast
<
py
::
array
>
();
*
this
=
numpy_image
(
rhs
);
assert_is_image
<
pixel_type
>
(
arr
);
py
::
array_t
<
typename
pixel_traits
<
pixel_type
>::
basic_pixel_type
,
py
::
array
::
c_style
>::
operator
=
(
arr
);
return
*
this
;
return
*
this
;
}
}
...
@@ -175,33 +166,25 @@ namespace dlib
...
@@ -175,33 +166,25 @@ namespace dlib
const
py
::
array_t
<
typename
pixel_traits
<
pixel_type
>::
basic_pixel_type
,
py
::
array
::
c_style
>&
rhs
const
py
::
array_t
<
typename
pixel_traits
<
pixel_type
>::
basic_pixel_type
,
py
::
array
::
c_style
>&
rhs
)
)
{
{
assert_is_image
<
pixel_type
>
(
rhs
);
*
this
=
numpy_image
(
rhs
);
py
::
array_t
<
typename
pixel_traits
<
pixel_type
>::
basic_pixel_type
,
py
::
array
::
c_style
>::
operator
=
(
rhs
);
return
*
this
;
return
*
this
;
}
}
numpy_image
&
operator
=
(
numpy_image
&
operator
=
(
const
numpy_image
&
rhs
const
numpy_image
&
rhs
)
)
=
default
;
{
py
::
array_t
<
typename
pixel_traits
<
pixel_type
>::
basic_pixel_type
,
py
::
array
::
c_style
>::
operator
=
(
rhs
);
return
*
this
;
}
template
<
long
NR
,
long
NC
>
template
<
long
NR
,
long
NC
>
numpy_image
(
numpy_image
(
matrix
<
pixel_type
,
NR
,
NC
>&&
rhs
matrix
<
pixel_type
,
NR
,
NC
>&&
rhs
)
)
:
numpy_image
(
convert_to_numpy
(
std
::
move
(
rhs
)))
{}
{
*
this
=
convert_to_numpy
(
std
::
move
(
rhs
));
}
template
<
long
NR
,
long
NC
>
template
<
long
NR
,
long
NC
>
numpy_image
&
operator
=
(
numpy_image
&
operator
=
(
matrix
<
pixel_type
,
NR
,
NC
>&&
rhs
matrix
<
pixel_type
,
NR
,
NC
>&&
rhs
)
)
{
{
*
this
=
convert_to_numpy
(
std
::
move
(
rhs
)
);
*
this
=
numpy_image
(
rhs
);
return
*
this
;
return
*
this
;
}
}
...
...
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