Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9034637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:32:20+00:00 2026-06-16T08:32:20+00:00

UPDATE: My original question here is not valid, sorry. I left a line out

  • 0

UPDATE:

My original question here is not valid, sorry. I left a line out from it, where m.create gets called. If there was no answer on this I would delete the question right away.


I’ve just noticed that Mat::adjustROI seems to change the wholeSize of cv::Mat.

Mat m(11,11,CV_32FC1);
Size wholeSize, old_size;
Point ofs;
m.locateROI(old_size, ofs);
m.adjustROI(0,old_size.height/2,0,old_size.width/2);
m.locateROI(wholeSize, ofs);
assert(wholeSize==old_size); // fails, wholeSize is now smaller

Is this normal?
If so, I suspect reallocation otherwise this could be a source of a memory leak.
If Im right, when does the reallocation occur?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:32:21+00:00Added an answer on June 16, 2026 at 8:32 am

    I ran your code, and the assert doesn’t fail for me (MSVC 2010). I stepped through it with the debugger and I can also see in the watch window that both sizes are equal (x and y equal to 11). I’m a beginner in OpenCV, but from the documentation of the function it seems to me adjustROI should not modify “wholeSize”.

    The method is complimentary to the cv::Mat::locateROI. Indeed, the
    typical use of these functions is to determine the submatrix position
    within the parent matrix and then shift the positionsomehow. Typically
    it can be needed for filtering operations, when pixels outside of the
    ROI shouldbe taken into account. When all the method’s parameters are
    positive, it means that the ROI needsto grow in all directions by the
    specified amount.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE: This question is out of date, but left for informational purposes. Original Question
OK, here was my original question, where I've left out the most important thing:
UPDATE 1: The exception is being thrown on this line: client_group_details.Add(new ClientGroupDetails( ORIGINAL QUESTION:
Update 7/17 SOLVED I've updated my code to the Solved version. Original Question I'm
UPDATE : My original question wasn't quite clear. I'm looking for the name of
UPDATE I have combined various answers from here into a 'definitive' answer on a
Coming off the back of this question here , is there a way to
This question is related to my earlier question here: python update outer passed value
My original question I've managed to answer by cobbling other answers together from this
Update : I really botched the original question. My original title was Why do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.