Giter Site home page Giter Site logo

Comments (3)

furushchev avatar furushchev commented on July 21, 2024

@k-sekiya Welcome to open source programming.
The code you posted looks not related to this repository, so it's better to post to a forum for general ROS community like https://answers.ros.org/ .
Seemingly, you specified the desired encoding of converted images to the same as original images here [1]:

    cv::Mat in_img = cv_bridge::toCvCopy(msg, msg->encoding)->image;

So the encoding of in_img can be any encoding depending on the encoding of input images.
However, in cvtColor function, you assume BGR as the encoding of the input image.
Here if the encoding of the input image is not BGR, it can occur such an error.

    cv::cvtColor(face_img, gray, CV_BGR2GRAY);

But I did not execute your code, so it might not be true.
Hope it helps you.

[1] http://docs.ros.org/diamondback/api/cv_bridge/html/c++/namespacecv__bridge.html#a49fedf7e642d505557b866f6e307a034

from opencv_apps.

k-sekiya avatar k-sekiya commented on July 21, 2024

@furushchev Thank you.

from opencv_apps.

furushchev avatar furushchev commented on July 21, 2024

@k-sekiya Is your problem solved?
Please could you refer the link if you post a question to other sites like answers.ros.org just for helping those who may suffer the same problem that you met?

from opencv_apps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.