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

The Archive Base Latest Questions

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

Objective: I am trying to use openCV function cvResize() to resample a 2D array.[I

  • 0

Objective:

I am trying to use openCV function cvResize() to resample a 2D array.[I have a working code in opencv using cvResize, I know its usage] But the input 2D array which I want to resample is not any image read by openCV using cvLoadImage() instead –

1.I would want to read the 2D array from a text file I have. That file has floating point values, in it. I would open that file in this test code using opencv library, read the values in a 2D array of float.

2.Then use cvResize() to resize it. First I want to downsample it – width/2, height/2.

3.Then I want to upsample it by 4 – width*4, height*4. This is my final 2D array.

4.Store this final 2D array to a text file as floating point values.

5.Basically I want to use the Bilinear interpolation logic used by OpenCV, but on my own data. What path/which file can I see the code for cvResize()?

Any pointers appreciated.

  • 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:05:53+00:00Added an answer on May 23, 2026 at 11:05 am

    The difficulty here seems to be that you are using a data type (2D array) to store the data read from the file, that is not compatible with what cvResize() works with (it’s IplImage* remember?).

    If you are using the C interface of OpenCV (and by watching your other questions I know you are), after successfully reading the data from the file to your custom data type (2D array?) you need to create a IplImage* that is big enough to store this information.

    IplImage* cv_data_img = cvCreateImage(cvSize(custom_data_height, custom_data_width), IPL_DEPTH_32F, 1);

    and after that, you’ll have to iterate on cv_data_img copying the original data.

    Once cv_data_img it’s filled with the data, you can create the others IplImage* you’ll need to store the result of cvResize().

    At the end, you can iterate on the resulting IplImage* and copy it back to your original data type (2D array) or do whatever you want with it.

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

Sidebar

Related Questions

I'm trying to convert a piece of Objective-C code into C# for use with
I'm trying to fix something in some Objective C++ (?!) code. I don't know
I'm trying to sort a multidimensional array in objective-c i know that i can
I have been trying to use some objective C, i have got as far
I'm trying to use Objective-C 2.0 feature Property in GNUstep(using Windows). But i can't
I am trying to use some C++ classes in my Objective-C code for an
I am trying to use Objective-C blocks in an iPhone 3.1.3 app but am
Im trying to create a iPhone Objective C login page using PHP/MySQL to authenticate.
I'm trying to use an Objective-C class made in Python to do this but
I am trying to use the UINavigationController class in Objective-C, but I am having

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.