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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:16:13+00:00 2026-05-23T17:16:13+00:00

I load a binary image in OpenCV using cvLoadImage as follows: IplImage* myImg=cvLoadImage(<ImagePath> ,-1);

  • 0

I load a binary image in OpenCV using cvLoadImage as follows:

IplImage* myImg=cvLoadImage(<ImagePath> ,-1); //-1 so that it is read as it is.

When I check myImg->width and myImg->widthStep, I was surprised to find that both of them have slightly different values. Then I went back to look at other images in the dataset, and found that for most cases, the two values were equal, however for some sizeable number of images, the two differed by a value of 1 or 2 mostly.

I though that only for colored images when the number of channels are more than 1, the two values are different, otherwise they are same. Am I wrong? Has anyone noticed this strange behavior before?

Thanks!

  • 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-23T17:16:13+00:00Added an answer on May 23, 2026 at 5:16 pm

    Apparently if the width is not a multiple of 4 it gets padded up to a multiple of 4, for performance and alignment reasons. So if width is e.g. 255 then widthStep would be 256.

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

Sidebar

Related Questions

is there a way to load the full binary of an image in javascript?
I'm trying to load an image file that's right next to the .SWF file.
I load data into my grid using a WCF service. When a user clicks
How do I load a Python module given its full path? Note that the
How can I load an external JavaScript file using a bookmarklet? This would overcome
I'm trying to load a page that is basically an edit form inside a
I want to load one or more DLLs dynamically so that they run with
LINQ to SQL by default maps a binary column (varbinary, image, ...) to a
Is there an easy (or generally accepted) way to load up a binary column
Is there such a thing?! So for eample, on my image load I have

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.