Skip to content

Point could be made optional when the size of the src is the same as dest? #15928

Closed

Description

Rect roi_d(p.x - roi_s.width / 2, p.y - roi_s.height / 2, roi_s.width, roi_s.height);

When src is the same as desk, and a mask is provided, the expected behaviour could be to blend the dest inside the src where the mask are 255,255,255 instead of requiring the p (the centre) to be specified?

I had

src.shape   = 500,500
src_mask    = 500,500
dest.shape = 500,500

h, w = src_mask.shape[:2]

at this point I didn't see the use of the required argument p, as I expected the function to match the mask. But since it's a required argument, I provided (w//2, h//2) for p (the centre of everything). But instead of having the src aligned into dest, the resulting cloning was shifted up to the centre of the screen!

Activity

  1. alalek commented on Nov 17, 2019

    @alalek
    Member

    Documentation says that "p" is:

    Point in dst image where object is placed.


    I didn't see the use of the required argument p

    Are you expecting API of "normalClone()"? (it is not exposed in public API)

  2. alalek commented on Nov 19, 2019

    @alalek
    Member

    @sturkmen72 I believe request here is for avoiding mask ROI handling through boundingRect(). Or at least use the same ROI for destination, like this:

    Rect roi_s = boundingRect(mask);
    if (roi_s.empty()) return;
    
    Rect roi_d = roi_s;
    if (p.x == -1 && p.y == -1)
    {
        CV_Assert(src.size() == dest.size());
    }
    else
    {
        roi_d = Rect(p.x - roi_s.width / 2, p.y - roi_s.height / 2, roi_s.width, roi_s.height);
    }
    
  3. added this to the 4.11.0 milestone on Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions