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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:33:25+00:00 2026-06-10T23:33:25+00:00

I seem to miss something but I cannot understand how to resize an image.

  • 0

I seem to miss something but I cannot understand how to resize an image. Here is code:

#include <opencv2\core\core.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\highgui\highgui.hpp>

using namespace cv;

int main(int argc, char* argv[])
{
    IplImage* src = NULL;
    IplImage* dst = NULL;
    src = cvLoadImage("image.tif");
    dst = cvCreateImage(cvSize( src->width / 10, src->height / 10 ), src->depth, src->nChannels );

    resize(src, dst, dst->nSize, 0.1, 0.1, CV_INTER_AREA );

    return 0;
}

But this code only results into the compiler error:

error C2664: 'cv::resize' : cannot convert parameter 1 from 'IplImage *' to 'cv::InputArray'

Can someone tell me what’s wrong here? I mean how can I create an InputArray from an IplImage?

Thanks,
Christian

  • 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-06-10T23:33:26+00:00Added an answer on June 10, 2026 at 11:33 pm

    You are mixing up OpenCV C and C++ functions. If you are programming in C++ you should use the Mat class to store image data. If you are on the other hand using pure C you should use the function cvResize to resize your IplImage.

    As you can see in the OpenCV API documentation, there is a C and C++ programming interface for every function. They are essentially doing the same and you can of course use the C functions in C++, but you cannot use C OpenCV structs (like IplImage) with C++ OpenCV functions (like resize()).

    This introduction describes the basic concepts of the OpenCV C++ API.

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

Sidebar

Related Questions

I seem to miss something here: I want a TabControl with rounded Corners at
I seem to miss something here : I have an application that uses a
I run next code and I miss somthing, for me it seem OK :
This might be a way to simple question, but I seem to miss the
I can't seem to find the debugdraw for Box2djs. Did I miss something or
Just beginning with iPhone development i seem to miss something fundamental. In a View
I seem to remember there is a problem with WITH. I don’t miss it;
Seem to be having some issues storing the current date in a core data
I do like the SQL editor now bundled with Eclipse but I can't seem
I've been following two tutorials on some Visual C++ fundamentals but they all seem

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.