-
Notifications
You must be signed in to change notification settings - Fork 59
make .at type-independent #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: indigo_dev
Are you sure you want to change the base?
Conversation
ipa-rmb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
fmessmer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rebase and finalize
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);