I have in general followed these practices:
http://www.cplusplus.com/articles/z6vU7k9E/ (see the 6 listed at the end).


On Sat, Oct 5, 2013 at 3:40 PM, Laura Lindzey <notifications@github.com>wrote:

> In grabcut3d_segmentation/src/grabcut3d_segmentation_node.cpp:
>
> > +  actionlib::SimpleActionServer<shared_autonomy_msgs::SegmentAction> segment_server_;
> > +  actionlib::SimpleActionClient<shared_autonomy_msgs::BoundingBoxAction> bb_client_;
> > +  actionlib::SimpleActionClient<shared_autonomy_msgs::EditPixelAction> label_client_;
> > +
> > +  bool getPixelLabels(const sensor_msgs::Image& image, const sensor_msgs::Image& mask,
> > +		      std::vector<shared_autonomy_msgs::Pixel> &foreground_pixels,
> > +		      std::vector<shared_autonomy_msgs::Pixel> &background_pixels);
> > +  bool getBoundingBox(const sensor_msgs::Image& image,
> > +		      int *min_col, int *max_col, int *min_row, int *max_row);
> > +  void maskFromBB(cv::Mat &mask, int min_col, int max_col, int min_row, int max_row);
> > +  void grabcutMaskFromBB(const sensor_msgs::Image& image, const sensor_msgs::Image& depth,
> > +			 cv::Mat &mask, int min_col, int max_col, int min_row, int max_row);
> > +  void grabcutMaskFromPixels(const sensor_msgs::Image& image, const sensor_msgs::Image& depth,
> > +			     cv_bridge::CvImage &mask_bridge,
> > +			     std::vector<shared_autonomy_msgs::Pixel> foreground_pixels,
> > +			     std::vector<shared_autonomy_msgs::Pixel> background_pixels);
>
> I think you're right - for efficiency, they should be constant references.
> On Monday, I'd like to chat more about passing by reference/pointer/value.
> It bugs me that I'm doing everything (input and output) by reference, but
> that seems to match all the OpenCV example code. Is there some technical
> reason that I'm missing for why this is a good idea? The google style
> guide, referenced by the roscpp style guide, suggests reference for input,
> and pointer for output.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/SharedAutonomyToolkit/shared_autonomy_perception/pull/2/files#r6785211>
> .
>



-- 
Dejan Pangercic
Autonomous Technologies Group
Robert Bosch LLC
Office: +16505657403
Cell: +16508610951
E-Mail: dejan.pangercic@gmail.com
WWW: http://ias.cs.tum.edu/people/pangercic