Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I don't think that ROI * scale is implemented in opencv, but here are some notes:

  • It is a good idea to write a modular function for this task but a better interface would be scaleROI(Rect& sampleRect, float scale) and do other computations like center in the function.
  • There is some thing that should get corrected in your implementation: (Remember top left image starts with (0, 0))
  • If you are familiar with operator overloading in CPP, It may be a better idea to implement '*' for cv::Rect class!
click to hide/show revision 2
completed second item!

I don't think that ROI * scale is implemented in opencv, but here are some notes:

  • It is a good idea to write a modular function for this task but a better interface would be scaleROI(Rect& sampleRect, float scale) and do other computations like center in the function.
  • There is some thing that should get corrected in your implementation: (Remember top left image starts with (0, 0))0)):
    tl.y = queryCenter.y - shiftY;
    br.y = queryCenter.y + shiftY;

  • If you are familiar with operator overloading in CPP, It may be a better idea to implement '*' for cv::Rect class!