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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:28:05+00:00 2026-05-25T18:28:05+00:00

I´m a begginer on C Language and I need to copy pixels to Android

  • 0

I´m a begginer on C Language and I need to copy pixels to Android Bitmap, I´m using a piece of code of android opencv, used for a jni:

AndroidBitmapInfo  info;
void*              pixels;
int                ret;
cv::Mat* mat;


if ((ret = AndroidBitmap_getInfo(env, bitmap, &info)) < 0 ){
    LOGE("AndroidBitmap_getInfo() failed ! error=%d", ret);

    return false; // can't get info
}

if (info.format != ANDROID_BITMAP_FORMAT_RGBA_8888){
    LOGE("Bitmap format is not RGB_8888 !");
    return false; // incompatible format
}

if ( (ret = AndroidBitmap_lockPixels(env, bitmap, &pixels)) < 0 ){
    LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret);
    return false; // can't get pixels
}

memcpy(pixels, mat->data, info.height * info.width * 4);

AndroidBitmap_unlockPixels(env, bitmap);

So, I have an IplImage* called pImage, but I don´t know how to convert an IplImage* to a cv::Mat*. I see a way to convert to a cv:Mat, like this:

cv::Mat mat(pImage);

But I need an cv:Mat* not an cv:Mat. Any help?

  • 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-25T18:28:06+00:00Added an answer on May 25, 2026 at 6:28 pm

    Answering to your question title:

    cv::Mat* mat = new cv::Mat(pImage);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Begginer's question. I'm trying to write small piece of code in Visual Studio (VB.net)
I am a begginer C++ programmer. In C#, I used the System.Net.Sockets.Socket class, which
I am a begginer in android,here I have activity that use web service: SoapObject
I'm begginer in asp.net mvc and i have some doubts. P.S: I'm using DDD
i'm just a begginer in perl, and very urgently need to prepare a small
I'm making a Grade log application and I have this piece of code here
Im new at tkinter so im a begginer.. I need help because i was
I'm a begginer in cookies and stuff like that. I need to set a
so i am a begginer and i really need help so i wrote this
I'm a begginer jQuery dev, and I'm using the jQuery UI dialog to show

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.