Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
d0b2e60e
Commit
d0b2e60e
authored
Jan 05, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10514 from alalek:build_warnings
parents
8e1f31f5
59c6661d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
19 deletions
+25
-19
grfmt_pam.cpp
modules/imgcodecs/src/grfmt_pam.cpp
+2
-4
thresh.cpp
modules/imgproc/src/thresh.cpp
+4
-4
CMakeLists.txt
modules/python/bindings/CMakeLists.txt
+19
-11
No files found.
modules/imgcodecs/src/grfmt_pam.cpp
View file @
d0b2e60e
...
...
@@ -487,7 +487,7 @@ bool PAMDecoder::readData( Mat& img )
bool
res
=
false
,
funcout
;
PaletteEntry
palette
[
256
];
const
struct
pam_format
*
fmt
=
NULL
;
struct
channel_layout
layout
;
struct
channel_layout
layout
=
{
0
,
0
,
0
,
0
};
// normalized to 1-channel grey format
/* setting buffer to max data size so scaling up is possible */
AutoBuffer
<
uchar
>
_src
(
src_elems_per_row
*
2
);
...
...
@@ -506,9 +506,7 @@ bool PAMDecoder::readData( Mat& img )
layout
.
bchan
=
0
;
layout
.
gchan
=
1
;
layout
.
rchan
=
2
;
}
else
layout
.
bchan
=
layout
.
gchan
=
layout
.
rchan
=
0
;
layout
.
graychan
=
0
;
}
}
CV_TRY
...
...
modules/imgproc/src/thresh.cpp
View file @
d0b2e60e
...
...
@@ -1483,14 +1483,14 @@ double cv::threshold( InputArray _src, OutputArray _dst, double thresh, double m
imaxval
=
saturate_cast
<
ushort
>
(
imaxval
);
int
ushrt_min
=
0
;
if
(
ithresh
<
ushrt_min
||
ithresh
>=
USHRT_MAX
)
if
(
ithresh
<
ushrt_min
||
ithresh
>=
(
int
)
USHRT_MAX
)
{
if
(
type
==
THRESH_BINARY
||
type
==
THRESH_BINARY_INV
||
((
type
==
THRESH_TRUNC
||
type
==
THRESH_TOZERO_INV
)
&&
ithresh
<
ushrt_min
)
||
(
type
==
THRESH_TOZERO
&&
ithresh
>=
USHRT_MAX
))
(
type
==
THRESH_TOZERO
&&
ithresh
>=
(
int
)
USHRT_MAX
))
{
int
v
=
type
==
THRESH_BINARY
?
(
ithresh
>=
USHRT_MAX
?
0
:
imaxval
)
:
type
==
THRESH_BINARY_INV
?
(
ithresh
>=
USHRT_MAX
?
imaxval
:
0
)
:
int
v
=
type
==
THRESH_BINARY
?
(
ithresh
>=
(
int
)
USHRT_MAX
?
0
:
imaxval
)
:
type
==
THRESH_BINARY_INV
?
(
ithresh
>=
(
int
)
USHRT_MAX
?
imaxval
:
0
)
:
/*type == THRESH_TRUNC ? imaxval :*/
0
;
dst
.
setTo
(
v
);
}
...
...
modules/python/bindings/CMakeLists.txt
View file @
d0b2e60e
...
...
@@ -38,15 +38,12 @@ ocv_list_filterout(opencv_hdrs "modules/.*_inl\\\\.h*")
ocv_list_filterout
(
opencv_hdrs
"modules/.*
\\\\
.details
\\\\
.h*"
)
ocv_list_filterout
(
opencv_hdrs
"modules/.*/detection_based_tracker
\\\\
.hpp"
)
# Conditional compilation
set
(
cv2_generated_
hdr
s
set
(
cv2_generated_
file
s
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_include.h"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_funcs.h"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_types.h"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_type_reg.h"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_ns_reg.h"
)
set
(
cv2_generated_files
${
cv2_generated_hdrs
}
"
${
OPENCV_PYTHON_SIGNATURES_FILE
}
"
)
...
...
@@ -54,18 +51,29 @@ string(REPLACE ";" "\n" opencv_hdrs_ "${opencv_hdrs}")
file
(
WRITE
"
${
CMAKE_CURRENT_BINARY_DIR
}
/headers.txt"
"
${
opencv_hdrs_
}
"
)
add_custom_command
(
OUTPUT
${
cv2_generated_files
}
COMMAND
${
PYTHON_DEFAULT_EXECUTABLE
}
"
${
PYTHON_SOURCE_DIR
}
/src2/gen2.py"
${
CMAKE_CURRENT_BINARY_DIR
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/headers.txt"
DEPENDS
${
PYTHON_SOURCE_DIR
}
/src2/gen2.py
DEPENDS
${
PYTHON_SOURCE_DIR
}
/src2/hdr_parser.py
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/headers.txt
DEPENDS
${
opencv_hdrs
}
COMMAND
"
${
PYTHON_DEFAULT_EXECUTABLE
}
"
"
${
PYTHON_SOURCE_DIR
}
/src2/gen2.py"
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/headers.txt"
DEPENDS
"
${
PYTHON_SOURCE_DIR
}
/src2/gen2.py"
"
${
PYTHON_SOURCE_DIR
}
/src2/hdr_parser.py"
# not a real build dependency (file(WRITE) result):
${CMAKE_CURRENT_BINARY_DIR}/headers.txt
${
opencv_hdrs
}
COMMENT
"Generate files for Python bindings and documentation"
)
add_custom_target
(
gen_opencv_python_source DEPENDS
${
cv2_generated_files
}
)
set
(
cv2_custom_hdr
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_custom_headers.h"
)
file
(
WRITE
${
cv2_custom_hdr
}
"//user-defined headers
\n
"
)
set
(
cv2_custom_hdr_str
"//user-defined headers
\n
"
)
foreach
(
uh
${
opencv_userdef_hdrs
}
)
file
(
APPEND
${
cv2_custom_hdr
}
"
#include
\"
${
uh
}
\"\n
"
)
set
(
cv2_custom_hdr_str
"
${
cv2_custom_hdr_str
}
#include
\"
${
uh
}
\"\n
"
)
endforeach
(
uh
)
if
(
EXISTS
"
${
cv2_custom_hdr
}
"
)
file
(
READ
"
${
cv2_custom_hdr
}
"
__content
)
else
()
set
(
__content
""
)
endif
()
if
(
"
${
__content
}
"
STREQUAL
"
${
cv2_custom_hdr_str
}
"
)
# Up-to-date
else
()
file
(
WRITE
"
${
cv2_custom_hdr
}
"
"
${
cv2_custom_hdr_str
}
"
)
endif
()
unset
(
__content
)
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