Click here to Skip to main content
15,880,405 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Comments
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?

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/[^]
 
Share this answer
 
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 .


CSS
#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 .
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900