Ask Your Question

How to zoom in and out in open cv? I am new for open cv so ,I request you to guide me

asked 2013-07-09 08:04:59 -0500

heena gravatar image

I want to resize the image , after zooming in and out. how to do it?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-07-09 13:06:08 -0500

CodeFinder gravatar image

You are probably searching for the function resize(), see here.

edit flag offensive delete link more

answered 2013-07-10 03:06:25 -0500

updated 2013-07-10 03:21:44 -0500

I would suggest using the properties of the region of interest parameter, before the step of resizing.

Some sample code which will guide you:

Mat original; imread('location', original);
//use info to calculate your roi based on current location of mouse pointer
Rect roi(0,0,50,50); 
Mat temp = original(roi);
imshow('temp', temp);
edit flag offensive delete link more



ok. I'll Implement this , if I will Face any problem. I will get back to you.

heena gravatar imageheena ( 2013-07-10 03:42:40 -0500 )edit

If i am right mat is defined in c? Do we have to use some other function in c++

heena gravatar imageheena ( 2013-07-10 03:48:30 -0500 )edit

Mat is actually the C++ variant of the C-style IplImage.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-10 03:49:13 -0500 )edit

i want to learn open cv programming, so from where should i start? Because talking to you make me think; i have to learn it from please guide from where should i start?

heena gravatar imageheena ( 2013-07-10 03:56:55 -0500 )edit

Take a look at the tutorials of OpenCV or read the newly released book. Especially the last one is interesting if you have no OpenCV background.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-10 04:00:54 -0500 )edit

See I have few questions and confusions. I want you to clear it out. I want to do live zooming(in and out) not "video zooming". and how can we set zooming parameter. I ran this code "" but it is getting too much zoomed. i don't know which parameter is affecting, this zooming. is there any way to make me understand this code which is in link? so that my understanding get better. And what if we want to do live zooming with usb web cam(logitech). what i have to read and understand for that.

heena gravatar imageheena ( 2013-07-11 02:25:22 -0500 )edit

I will take a look at your comment in about an hour, be patient and please do not open new topics for the same problem.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-16 02:38:48 -0500 )edit

Basically you need to be sure that you actually want to perform software zooming? Probably your logitech USB webcam has an available API which can be accessed in C++ to call the zooming of the camera itself. Wouldn't that be more interesting?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-16 02:55:37 -0500 )edit

This">link probably tells you everything you should do :) Go give it a try! Or have a look at this link.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-16 02:57:00 -0500 )edit

first link is not working. second link is not helpful. and yes i am using logitech camera. but you are not getting my question .. i just want to know how to implement zoom in and out in open cv.. and i am using code blocks to program it to superimpose one image to whole to zoom in and out by camera in open cv. are there any predefined functions for this.

heena gravatar imageheena ( 2013-07-16 04:33:28 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2013-07-09 08:04:59 -0500

Seen: 10,176 times

Last updated: Jul 10 '13