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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:11:38+00:00 2026-05-23T11:11:38+00:00

I am trying to use opencv2, built on ubuntu 10.04 to get a simple

  • 0

I am trying to use opencv2, built on ubuntu 10.04 to get a simple program going which reads a exisitng image, creates another image from it and resize that original image by 2(both width and height). Below is the code. Upon execution, I don’t see the resized image window.

# include "stdio.h"
#include "opencv2/highgui/highgui_c.h"
#include <opencv2/imgproc/types_c.h>

int main( int argc, char** argv ) {
  IplImage* img = 0;
  IplImage* dst_img = 0;


  if( argc < 2 ) {
    printf( "Usage: Accepts one image as argument\n" );
    exit( EXIT_SUCCESS );
  }

  img = cvLoadImage( argv[1],1);
  if( !img ) {
    printf( "Error loading image file %s\n", argv[1]);
    exit( EXIT_SUCCESS );
  }

  dst_img = cvCreateImage(cvSize(img->width*2,img->height*2),img->depth,img->nChannels);
  if( !dst_img ) {
    printf( "Error loading output image file \n");
    exit( EXIT_SUCCESS );
  }


  cvResize(img,dst_img,CV_INTER_LINEAR); 

  cvNamedWindow( "Original Image", CV_WINDOW_AUTOSIZE );
  cvNamedWindow( "RescaledImage", CV_WINDOW_AUTOSIZE );

  cvMoveWindow( "Original Image", 720, 515 );
  cvMoveWindow( "RescaledImage", 1500,1200 );

  cvShowImage( "Original Image", img );
  cvShowImage( "RescaledImage", dst_img );

  cvWaitKey( 0 );

  cvReleaseImage( &img );
  cvReleaseImage( &dst_img );

  cvDestroyWindow( "Original Image" );
  cvDestroyWindow( "RescaledImage" );

  return EXIT_SUCCESS;
  }

I am using cvCreateImage(), & cvResize() correctly above?

How can I resize the input image by 2 in both directions?

Any pointers on web(blogs,tutorials) , books for OpenCV which has lot of sample code which one can use to study opencv hands-on?

  • 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-05-23T11:11:39+00:00Added an answer on May 23, 2026 at 11:11 am
    cvMoveWindow( "RescaledImage", 1500,1200 ); 
    

    My mistake. I thought this was the dimension of window/image. But this is the position of the window on screen. changed it to –

    cvMoveWindow( "RescaledImage", 100,100 );
    

    Both windows are fine now!

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

Sidebar

Related Questions

I am trying to use mexopencv on my system which has: Ubuntu 12.04.1 LTS
I'm trying to use OpenCV 2.0 to take three points, which essentially make up
I am trying to use OpenCV on my Ubuntu machine but I am having
Anyone know how to create a cvCreateStructuringElementEx using a image? I'm trying use opencv.cv.cvCreateStructuringElementEx()
I'm trying to use android-opencv 2.3.1 to recognize circles (coins) in an image. However
I am trying to use OpenCV's estimateAffine3D() function to get the affine transformation between
I'm trying to compile PCL for use with OpenCV on Ubuntu (64 bit). I'm
I'm trying to use OpenCV to extract SURF descriptors from an image. I'm using
I am trying to use OpenCV and Python to stitch together several hundred puzzle
I'm trying to use the new OpenCV 2.0 API in MS Visual C++ 2008

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.