Click here to Skip to main content
11,933,253 members (63,380 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# OpenCV

need to put a smaller image within a larger image. the smaller picture should be centered in the larger picture. I'm working with C # and OpenCV, does anyone know how to do this?
Posted 8-Oct-12 9:06am
Nelek 8-Oct-12 14:31pm
Should the first image still be visible or can the section be overwriten by the second image? Is the first image static or dynamic? and the second? What happen if the second image is bigger than the first one?
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Refer to this tutorial that explains the task with a transparent overlay. I would also suggest to not use the old openCV versions (with IplImage) but rather the new ones (with Mat as image container).[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

HI arthur ,

it can be acheieved by CSS .

just take your Large image in a parent DIV , gve its a iD. then assign its css
position:relative .

now your smaller image will be in a div with style position:absolute .and give this
div top:200px nd left:200px; like this to make this in center .

#div-1 {
#div-1a {

your div-1a will be in div-1 as a child and you can locate this to center .
you can do this dynamically too from code behind .
Legor 9-Oct-12 10:34am
He asked to do it with openCV.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 9 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100