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 7761451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:08:21+00:00 2026-06-01T14:08:21+00:00

Is it possible to place an image inside an image with OpenCv (JavaCv). For

  • 0

Is it possible to place an image inside an image with OpenCv (JavaCv).
For example i have a 1000×1000 image and a 100×100 image. And at position 600×600 i would like to place the smaller image inside the larger image.

lets say the blue box is the 1000×1000 IplImage and the red one is the 100×100 IplImage.
Is it possible to put the red box in the blue box. Preferably computational rather efficient because it has to work in real time.

enter image description here

Thx in advance

  • 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-01T14:08:23+00:00Added an answer on June 1, 2026 at 2:08 pm

    This is in Python, but conversion to Java is going to be real easy. Use GetSubRect(), and Copy(). GetSubRect() returns a rectangular subarray of interest (specify top left point of interest, and the width and height). Then just copy over the image using Copy().

    import cv
    blue = cv.LoadImage("blue.jpg")
    red = cv.LoadImage("red.jpg")
    
    sub = cv.GetSubRect(blue, (100, 100, 50, 50))
    cv.Copy(red,sub)
    
    cv.ShowImage('blue_red', blue)
    cv.WaitKey(0)
    

    Alternatively, as karlphillip suggests you could specify the ‘region of interest’ using SetImageROI(), and do much the same thing:

    cv.SetImageROI(blue,(100,100,50,50))
    cv.Copy(red, blue)
    cv.ResetImageROI(blue)
    

    Its very important to reset the ROI, ResetImageROI, otherwise you will only display/save the ROI, and not the whole image.

    Demo output:

    blue: enter image description here red: enter image description here combined: enter image description here

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

Sidebar

Related Questions

I would like to place an image in my application. when I click on
Is it possible to place Facebook's request form inside a popup? Google is failing
I know it's possible to place a PyCairo surface inside a Gtk Drawing Area.
In Word you can place an image on a page and have the text
is it possible to give a button a background image really i have an
Is it possible to place a child component inside a JButton and make it
how can i mark place in the text where i have to put image.
Possible Duplicate: Place watermark image on other images (C#, ASP.Net) how to add water
Is it possible to dynamically place text on an image in php? And then
Is is possible to place a button inside of a ListCtrl item with wxPython?

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.