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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:20:02+00:00 2026-06-09T11:20:02+00:00

As stated in documentation: IplImage.imageData (from OpenCV library): A pointer to the aligned image

  • 0

As stated in documentation:

IplImage.imageData (from OpenCV library):

A pointer to the aligned image data

Image.tostring() (from Python PIL):

Returns a string containing pixel data, using the standard “raw”
encoder.

What is the difference between the results of Image.tostring() and IplImage.imageData ? What should I do if I want to get exactly the same data as returned by IplImage.imageData in Python ?

EDIT:
Just to clarify, I need to use PIL to load images as I have a python service to receive data from internet and there’s no straightforward way in OpenCV to load an image from memory instead of disk.

  • 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-09T11:20:03+00:00Added an answer on June 9, 2026 at 11:20 am

    While Opencv image, pixel data is ordered as BGR, in PIL it is RGB.
    You can convert a PIL image data to opencv as below.

    import Image, cv
    pi = Image.open('building.jpg')       # PIL image
    cv_im = cv.CreateImageHeader(pi.size, cv.IPL_DEPTH_8U, 3)
    cv.SetData(cv_im, pi.tostring())
    

    For more information here.

    http://opencv.willowgarage.com/documentation/python/cookbook.html

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

Sidebar

Related Questions

From HopStop's documentation: http://www.hopstop.com/developer/?action=documentation#6.1.3 for the GetRoute function, it is stated that instead of
In the documentation for DatabaseUtils.concatenateWhere(...) it is stated that it is supported from API
As stated in the documentation for the IDirectDraw7::SetCooperativeLevel method , it states You must
In Google App Engine documentation for Channel API, it is stated that Only one
The documentation states: Precision can range from 1 to 38. Scale can range from
It's not stated in documentation for CGImageSourceCopyPropertiesAtIndex function. But am i right that i
It is stated in documentation that Android test case classes for activities extend JUnit
As it is stated in documentation : Hibernate persists JavaBeans style properties and recognizes
As stated in the Lucene documentation there is a parameter that enables for specifying
As stated in the Facebook Oauth Documentation , in order to use the Client

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.