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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:09:46+00:00 2026-06-10T16:09:46+00:00

i am running a basic application using openCV for C++. I am attempting to

  • 0

i am running a basic application using openCV for C++. I am attempting to split the image into rgb components using cvSplit() as below:

CvMat* mat;

//initialize mat

CvMat* b = cvCreateMat(mat->rows, mat->cols, CV_8UC1);
CvMat* g = cvCreateMat(mat->rows, mat->cols, CV_8UC1);
CvMat* r = cvCreateMat(mat->rows, mat->cols, CV_8UC1);
cvSplit(mat, b, g, r, NULL );

It builds just fine, but when I attempt to run it, I get the following error:

OpenCV Error: Assertion failed (i < src.channels()) in cvSplit, file /home/username/Downloads/OpenCV-2.4.0/modules/core/src/convert.cpp, line 1196
terminate called after throwing an instance of 'cv::Exception'

What does this error mean, and how can I solve the problem?

  • 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-10T16:09:47+00:00Added an answer on June 10, 2026 at 4:09 pm

    The IplImage you are using to create the Mat should be in color. You need three channels to be able to use cvSplit. You can check this with IplImage->nChannels in your debugger.

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

Sidebar

Related Questions

I'm trying to compile the basic tutorial program at http://doc.trolltech.com/4.4/mainwindows-application.html and running into a
I created a pretty basic Django project using django-admin and I'm now running into
We're using CRM On-Demand for our Service Group and I'm running into an application
I have a basic web application written in Java, running on a tomcat on
I'm running a very basic fetch request that returns about 2000 objects. I'm using
I am attempting to get the basic form of crawler4j running as seen here
So i am running into a very odd error. I am making a basic
I am running a Perl application named bitlfu.For login it is using something like
ONe of my system components is using the Basic HTTP Authrozation ( http://en.wikipedia.org/wiki/Basic_access_authentication )
I have just create a very basic Dynamic Data web application using Entity Framework,

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.