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

  • Home
  • SEARCH
  • 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 8444329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:22:49+00:00 2026-06-10T09:22:49+00:00

In my application, I want to create a OpenCV Mat A (2-Dimensions) having some

  • 0

In my application, I want to create a OpenCV Mat A (2-Dimensions) having some values and then pass it to another OpenCV function using A as input.

Currently, I’m trying:

// float data[2][5] = {{1,2,3,4,5},{7,8,9,10,11}}; 
// OR
float data[10] = {1,2,3,4,5,7,8,9,10,11};

// and then
//  A = Mat(1, 5, CV_32FC1, &data, 2);   // init from float 1D - array
// OR 
    A = Mat(2, 5, CV_32FC1, &data, 2);  

in case of 1D array, the value passing is OK. But this does not work for 2D array, which is even more a common case. How can I solve this in OpenCV??

  • 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-10T09:22:50+00:00Added an answer on June 10, 2026 at 9:22 am

    Originally, I used the mnemonic from OpenCV online guides:

    Mat::Mat(Size size, int type, void* data, size_t step=AUTO_STEP)
    

    But I didn’t understand what the document meant by size_t step=AUTO_STEP. And this means that I can omit the step argument with which OpenCV will automatically choose AUTO_STEP

    I’ve tried and this works:

    A = Mat(2, 5, CV_32FC1, &data);
    

    for the 2D Mat initialized from array

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

Sidebar

Related Questions

I want to create a Java Desktop Application and want to employ some mechanism
I'm using Netbeans to develop a Java application and I want to create a
In my MFC Application Now I want to create .chm file using HTML Help
I want to create an application which creates a VPN between some endpoints, something
For my newest windows-application I want to create an interface that is web-based using
in my application i want to create a shortcut (a button), to another application
In my application I want to create a dialog which has a button to
in my silverlight application i want to create a style from code behind and
For an MVC3 application I want to create a reusable DAL that is accessed
I want create an application with animate button? how can i do? after click

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.