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
3b6190df
Commit
3b6190df
authored
9 years ago
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6150 from lvv:fix-6149-applColorMap
parents
4e479d58
bebab8d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
imgproc.hpp
modules/imgproc/include/opencv2/imgproc.hpp
+1
-1
colormap.cpp
modules/imgproc/src/colormap.cpp
+3
-10
No files found.
modules/imgproc/include/opencv2/imgproc.hpp
View file @
3b6190df
...
...
@@ -3975,7 +3975,7 @@ enum ColormapTypes
/** @brief Applies a GNU Octave/MATLAB equivalent colormap on a given image.
@param src The source image, grayscale or colored
does not matter
.
@param src The source image, grayscale or colored
of type CV_8UC1 or CV_8UC3
.
@param dst The result is the colormapped source image. Note: Mat::create is called on dst.
@param colormap The colormap to apply, see cv::ColormapTypes
*/
...
...
This diff is collapsed.
Click to expand it.
modules/imgproc/src/colormap.cpp
View file @
3b6190df
...
...
@@ -144,10 +144,7 @@ namespace colormap
// Applies the colormap on a given image.
//
// This function expects BGR-aligned data of type CV_8UC1 or
// CV_8UC3. If the wrong image type is given, the original image
// will be returned.
//
// This function expects BGR-aligned data of type CV_8UC1 or CV_8UC3.
// Throws an error for wrong-aligned lookup table, which must be
// of size 256 in the latest OpenCV release (2.3.1).
void
operator
()(
InputArray
src
,
OutputArray
dst
)
const
;
...
...
@@ -498,12 +495,8 @@ namespace colormap
if
(
_lut
.
total
()
!=
256
)
CV_Error
(
Error
::
StsAssert
,
"cv::LUT only supports tables of size 256."
);
Mat
src
=
_src
.
getMat
();
// Return original matrix if wrong type is given (is fail loud better here?)
if
(
src
.
type
()
!=
CV_8UC1
&&
src
.
type
()
!=
CV_8UC3
)
{
src
.
copyTo
(
_dst
);
return
;
}
if
(
src
.
type
()
!=
CV_8UC1
&&
src
.
type
()
!=
CV_8UC3
)
CV_Error
(
Error
::
StsBadArg
,
"cv::ColorMap only supports source images of type CV_8UC1 or CV_8UC3"
);
// Turn into a BGR matrix into its grayscale representation.
if
(
src
.
type
()
==
CV_8UC3
)
cvtColor
(
src
.
clone
(),
src
,
COLOR_BGR2GRAY
);
...
...
This diff is collapsed.
Click to expand it.
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