Skip to content

Commit

Permalink
[image_view2] Visualize depth image
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Nov 9, 2015
1 parent f896aea commit bc089cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jsk_ros_patch/image_view2/image_view2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,11 @@ namespace image_view2{
if (msg->encoding.find("bayer") != std::string::npos) {
original_image_ = cv::Mat(msg->height, msg->width, CV_8UC1,
const_cast<uint8_t*>(&msg->data[0]), msg->step);
} else if (msg->encoding == sensor_msgs::image_encodings::TYPE_16UC1) {
cv::Mat input_image = cv_bridge::toCvCopy(msg)->image;
double min, max;
cv::minMaxIdx(input_image, &min, &max);
cv::convertScaleAbs(input_image, original_image_, 255 / max);
} else {
try {
original_image_ = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8)->image;
Expand Down

0 comments on commit bc089cc

Please sign in to comment.