Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# OpenCV
hi
 
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 8:06am
Comments
Nelek at 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
good
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 {
 position:relative;
}
#div-1a {
 position:absolute;
 top:0;
 right:0;
 width:200px;
}
 
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 .
  Permalink  
Comments
Legor at 9-Oct-12 10:34am
   
He asked to do it with openCV.
Rate this: bad
good
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).
 
http://www.aishack.in/2010/07/transparent-image-overlays-in-opencv/[^]
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 625
1 OriginalGriff 285
2 George Jonsson 225
3 CPallini 210
4 Fredrik Bornander 150
0 OriginalGriff 5,835
1 Sergey Alexandrovich Kryukov 5,263
2 CPallini 4,750
3 George Jonsson 3,227
4 Gihan Liyanage 2,487


Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 9 Oct 2012
Copyright © CodeProject, 1999-2014
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