OpenCV Error:assertion failed (SCN ==3 | | scn==4) in Cv::cvtcolor

Source: Internet
Author: User

In the traversal of the file picture in turn, the face detection, but every time there is an exception, very puzzled, the program is written without problems, the Internet to check a bit.

my problem is because it is empty when I pass in the mat image, so there is no way to do it when cvtcolor.

Why?? Why is it empty??

Look up the face library look at the naming order only to find that there are some missing data in the middle. Such as:

Less image_0010.png this image.

So it would be nice to add an if (!img.empty ()) condition.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

OpenCV Error:assertion failed (SCN ==3 | | scn==4) in Cv::cvtcolor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.