Closed k-sekiya closed 7 years ago
@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.
@furushchev Thank you.
@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?
ロボットシステムを受講している者です。 10/23の資料のp9の画像処理プログラムの開発でopencvを用いて顔検出のプログラムを書いてみたのですが以下のようなエラーが出てしまいます。
プログラムは以下です。
opencvのコード自体はうまく行ったのですが、rosで画像処理をするとエラーが出てしまいます。 エラーの原因を教えていただきたいです。