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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:07:26+00:00 2026-06-17T23:07:26+00:00

Given a Int array, an Argb32 image, how can i load this into Eigen

  • 0

Given a Int array, an Argb32 image, how can i load this into Eigen Matrixes the best way?

The goal is to create a small image processing library. And as the first part i want to convert from RGB to Gray scale.

Are there any way to load the int[] into 3 eigen matrixes wihthout any memory copying ?

(when refering to eigen, its the Linear Algebra Library).

  • 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-17T23:07:27+00:00Added an answer on June 17, 2026 at 11:07 pm

    Yes, using the Map<> class with an appropriate inner-stride, for example:

    unsigned char* data = ...;
    int w, h; // the width and height
    typedef Map<Matrix<unsigned char,Dynamic,Dynamic>, 0, InnerStride<4> > Slide;
    Slice red(data, w, h), green(data+1, w, h), blue(data+2, w, h);
    

    Then you can start playing with them, e.g., construct a gray level floating point version:

    MatrixXf gray = (red.cast<float>() * 11 + green.cast<float>() * 16 + blue.cast<float>() * 5)/(32.*255.);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given this piece of code: (void)someFunction(void) { int array[] = {1,2,3,4,5,6,7,8,9,10}; } Where are
Given this array int [] myArray = {5,-11,2,3,14,5,-14,2}; I must be able to return
I've noticed that the underlying int array is getting changed given the way the
I came across this problem during an interview forum., Given an int array which
I was given this problem Given an int array length 3, if there is
Given this array int [] myArray = {5,-11,2,3,14,5,-14,2}; You are to find the maximum
Given following data, what is the best way to organize an array of elements
Given a ParameterInfo p from this: void foo(int modopt(IsLong) n); p.GetOptionalCustomModifiers() returns a System.Runtime.CompilerServices.IsLong;
Given the following code: void foo( int* array ) { // ... } void
When an array is given: int[] a={1,3,4,5,67,8,899,56,12,33} and if i wish to return the

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.