Skip to content

Commit 2b3e13d

Browse files
committed
imshow for double data type
1 parent 7db9d2f commit 2b3e13d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

matplotlibcpp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ namespace detail {
940940
inline void imshow(void* ptr, const NPY_TYPES type, const int rows, const int columns,
941941
const int colors, const std::map<std::string, std::string>& keywords,
942942
PyObject** out) {
943-
assert(type == NPY_UINT8 || type == NPY_FLOAT);
943+
assert(type == NPY_UINT8 || type == NPY_FLOAT || type == NPY_DOUBLE);
944944
assert(colors == 1 || colors == 3 || colors == 4);
945945

946946
detail::_interpreter::get();
@@ -982,6 +982,7 @@ inline void imshow(const float* ptr, const int rows, const int columns, const in
982982
detail::imshow((void*)ptr, NPY_FLOAT, rows, columns, colors, keywords, out);
983983
}
984984

985+
inline void imshow(const double* ptr, const int rows, const int columns, const int colors,
985986
#ifdef WITH_OPENCV
986987
void imshow(const cv::Mat& image, const std::map<std::string, std::string>& keywords = {}) {
987988
// Convert underlying type of matrix, if needed

0 commit comments

Comments
 (0)