Conversation
ipa-rmb
left a comment
There was a problem hiding this comment.
Very good, please change the commented smaller items.
Did you test whether the functions with 90/180/270 deg rotations still work and whether they work with e.g. a gray scale single channel image and a color image?
| return true; | ||
| } | ||
|
|
||
| template <typename T> void ImageFlip::setMatValuePtr(cv::Mat& color_image, int u, int v, double value) |
There was a problem hiding this comment.
Instead of double value a T value would be more explicit about the usage of the type. If it does not cause problems, please change the function head accordingly, remove type conversion (T) inside the function and add the respective type in the function calls of the other setMatValuePtr function.
| void disparityDisconnectCB(const ros::SingleSubscriberPublisher& pub); | ||
|
|
||
|
|
||
| template <typename T>void setMatValuePtr(cv::Mat& image, int row, int index, double value); |
There was a problem hiding this comment.
Brief comments on usage and meaning of the functions, please. It should be noted, e.g., how the row and index coordinates work. Maybe add an example how to compute the index for a multi-channel image (index = number_channels*u+channel_k).
| color_image.ptr<T>(u)[v] = T(value); | ||
| } | ||
|
|
||
| void ImageFlip::setMatValuePtr(cv::Mat& color_image, int u, int v, double value) |
There was a problem hiding this comment.
- The naming
int u, int vis misleading for multi-channel images. Please useint row, int indexinstead as done in the header file. - Indentation down to line 242 is still spaces and should be changed to tabs as the remainder of the file.
template void setMatValuePtr(cv::Mat& image, int row, int index, double value);
void setMatValuePtr(cv::Mat &image, int row, int index, double value);
template T getMatValuePtr(cv::Mat& image, int row, int index);
double getMatValuePtr(cv::Mat& image, int row, int index);