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

  • SEARCH
  • Home
  • 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 8080695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:29:37+00:00 2026-06-05T16:29:37+00:00

Is there an OpenCV function to draw an image over another image? I have

  • 0

Is there an OpenCV function to draw an image over another image?
I have one big image of Mat type.
And I have a small image of Mat type (5x7).
I want to draw this small image over the big image at specified coordinates.

  • 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-05T16:29:39+00:00Added an answer on June 5, 2026 at 4:29 pm

    Use Mat::rowRange() and Mat::colRange() to specify the area to which you want to draw in the destination Mat. Code:

    Mat src( 5,  7, CV_8UC1, Scalar(1)); // 5x7
    Mat dst(10, 10, CV_8UC1, Scalar(0)); // 10x10
    
    src.copyTo(dst.rowRange(1, 6).colRange(3, 10));
    

    Results in the following:

    before copyTo():

    dst:
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
    

    after copyTo():

    dst:
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 1 1 1 1 1 1 1 )
        ( 0 0 0 1 1 1 1 1 1 1 )
        ( 0 0 0 1 1 1 1 1 1 1 )
        ( 0 0 0 1 1 1 1 1 1 1 )
        ( 0 0 0 1 1 1 1 1 1 1 )
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
        ( 0 0 0 0 0 0 0 0 0 0 )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a function that receives OpenCV image and turns it into gray-scale.
How would I draw a CvBox2D in OpenCV? Is there any similar function to
Is there some openCV function that I can pass in a cv::Mat and get
Is there a way to stream video with opencv faster? i'm using Mat img;
There exists an RSS feed with over 1000 items. I want to create a
Is there any function in OpenCV or Emgu CV desktop capture options? (addons, libs,
I am using cvFindContour function of opencv and in it there is a parameter
I have a large C++ function which uses OpenCV library and running on Windows
I am writing a function that takes a OpenCV Mat structure and does some
I'm working on a project using OpenCV, and there is a function which takes

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.