Giter Site home page Giter Site logo

opencv_apps's People

Contributors

130s avatar aginika avatar fmauch avatar fujimo-t avatar furushchev avatar garaemon avatar gcrowards avatar iory avatar ivan1993br avatar jspricke avatar k-okada avatar knorth55 avatar lucasw avatar mintar avatar nakane11 avatar talregev avatar tkmtnt7000 avatar tongtybj avatar trainman419 avatar vrabaud avatar wangl5 avatar wkentaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opencv_apps's Issues

Should we still mantain EOL distribution?

Hi all,

My question here is if we should keep testing against EOL ROS releases, such as Indigo, that still uses OpenCV 2. I think that this raises extra work on maintainability and development, for example I will not be able to implement TApi codes implemented here that uses Opencv3, so this implementation will not work with OpenCV2.

My proposal is that we only run tests for non EOL distribution. Or, If you think that there is a need to keep the old distribution maintenance, I see that disable some features only available to newer versions would be a valid possibility, something more or less like here .

What do you think @k-okada ?

Regression in Kinetic re OpenCV 3.3

http://build.ros.org/view/Kbin_uX64/job/Kbin_uX64__opencv_apps__ubuntu_xenial_amd64__binary/45/console

00:10:57.242 /usr/lib/ccache/x86_64-linux-gnu-g++   -DROSCONSOLE_BACKEND_LOG4CXX -DROS_PACKAGE_NAME=\"opencv_apps\" -Dopencv_apps_EXPORTS -I/tmp/binarydeb/ros-kinetic-opencv-apps-1.12.0/obj-x86_64-linux-gnu/devel/include -I/tmp/binarydeb/ros-kinetic-opencv-apps-1.12.0/include -I/opt/ros/kinetic/include -isystem /opt/ros/kinetic/include/opencv-3.3.1 -isystem /opt/ros/kinetic/include/opencv-3.3.1/opencv -I/opt/ros/kinetic/share/xmlrpcpp/cmake/../../../include/xmlrpcpp  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2  -fPIC   -o CMakeFiles/opencv_apps.dir/src/nodelet/face_recognition_nodelet.cpp.o -c /tmp/binarydeb/ros-kinetic-opencv-apps-1.12.0/src/nodelet/face_recognition_nodelet.cpp
00:11:06.299 /tmp/binarydeb/ros-kinetic-opencv-apps-1.12.0/src/nodelet/face_recognition_nodelet.cpp: In member function ‘void face_recognition::FaceRecognitionNodelet::configCallback(face_recognition::FaceRecognitionNodelet::Config&, uint32_t)’:
00:11:06.299 /tmp/binarydeb/ros-kinetic-opencv-apps-1.12.0/src/nodelet/face_recognition_nodelet.cpp:466:22: error: ‘createEigenFaceRecognizer’ is not a member of ‘face’
00:11:06.299              model_ = face::createEigenFaceRecognizer(config.model_num_components,
00:11:06.299                       ^
00:11:06.299 /tmp/binarydeb/ros-kinetic-opencv-apps-1.12.0/src/nodelet/face_recognition_nodelet.cpp:469:22: error: ‘createFisherFaceRecognizer’ is not a member of ‘face’
00:11:06.299              model_ = face::createFisherFaceRecognizer(config.model_num_components,
00:11:06.299                       ^
00:11:06.299 /tmp/binarydeb/ros-kinetic-opencv-apps-1.12.0/src/nodelet/face_recognition_nodelet.cpp:472:22: error: ‘createLBPHFaceRecognizer’ is not a member of ‘face’
00:11:06.299              model_ = face::createLBPHFaceRecognizer(config.lbph_radius,
00:11:06.299                       ^
00:11:06.302 CMakeFiles/opencv_apps.dir/build.make:473: recipe for target 'CMakeFiles/opencv_apps.dir/src/nodelet/face_recognition_nodelet.cpp.o' failed

Re: ros-infrastructure/rep#140 @vrabaud @mikaelarguedas FYI

Error about face_recognition.launch

Any suggestion about the following error?
The face detection part works well.

nishio@nishio-desktop:~$ roslaunch opencv_apps face_recognition.launch  image:=/zed/left/image_raw_color use_opencv3:=true  use_opencv3_3:=true
... logging to /home/nishio/.ros/log/8f8e5f22-624f-11e9-989d-88d7f6d5c690/roslaunch-nishio-desktop-16328.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://nishio-desktop:41435/

SUMMARY
========

PARAMETERS
 * /face_detection/debug_view: True
 * /face_detection/eyes_cascade_name: /opt/ros/kinetic/...
 * /face_detection/face_cascade_name: /opt/ros/kinetic/...
 * /face_detection/use_camera_info: False
 * /face_recognition/data_dir: ~/.ros/opencv_app...
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES
  /
    debug_image_viewer_nishio_desktop_16328_8344988699730467132 (image_view/image_view)
    face_detection (opencv_apps/face_detection)
    face_recognition (opencv_apps/face_recognition)
    face_recognition_trainer (opencv_apps/face_recognition_trainer.py)

ROS_MASTER_URI=http://localhost:11311

process[face_detection-1]: started with pid [16345]
process[face_recognition-2]: started with pid [16346]
process[face_recognition_trainer-3]: started with pid [16347]
process[debug_image_viewer_nishio_desktop_16328_8344988699730467132-4]: started with pid [16350]
[ INFO] [1555644640.109175425]: Initializing nodelet with 1 worker threads.
[ERROR] [1555644640.252733270]: --Error loading /opt/ros/kinetic/share/opencv3/../OpenCV-3.3.1/haarcascades/haarcascade_frontalface_alt.xml
[ERROR] [1555644640.252811938]: --Error loading /opt/ros/kinetic/share/opencv3/../OpenCV-3.3.1/haarcascades/haarcascade_eye_tree_eyeglasses.xml
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.504969826]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.534175926]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.564517071]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.598023871]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.631610306]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.664901007]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.699107667]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.732061251]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.767059899]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.798270680]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.831769118]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.865115907]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698
[ERROR] [1555644640.897904403]: Image processing error: !empty() detectMultiScale /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp 1698
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/objdetect/src/cascadedetect.cpp, line 1698

Screenshot from 2019-04-19 12-37-00

how to use opencv_apps to extract particular contour points?

Hello,

I am using opencv_apps, find contours_nodelet.cpp to detect circular contour. so far I can detect circular contour by modifying that source code llike this,

/// Draw contours my trial work
      cv::Mat drawing = cv::Mat::zeros(canny_output.size(), CV_8UC3);
      cv::Point2f rect_points[4];
      cv::Rect bounding_rect;

      std::vector<cv::Point> approx;
      for (size_t i = 0; i < contours.size(); i++)
      {
        cv::approxPolyDP(cv::Mat(contours[i]), approx, cv::arcLength(cv::Mat(contours[i]), true)*0.02, true);
        cv::Scalar color = cv::Scalar(rng.uniform(0, 255), rng.uniform(0, 255), rng.uniform(0, 255));
        if(fabs(cv::contourArea(contours[i])) < 100 || !(cv::isContourConvex(approx)))
                continue;
        if(approx.size() >=6 && approx.size() <=8)

        {
        cv::drawContours(drawing, contours, (int)i, color, 2, 8, hierarchy, 0, cv::Point());
        bounding_rect = cv::boundingRect(contours[i]);
        cv::rectangle(drawing, bounding_rect, color, 1, 8, 0);
        cv::RotatedRect bounding_rect = cv::minAreaRect(cv::Mat(contours[i]));
        bounding_rect.points(rect_points);
        }

But how can I extract this 4 rect points (rect_points[4]) for further work? or how to use this points with message?

thanks.

indigo branch is not only tested on indigo

Just noticed that indigo branch is main branch of this repository, and pull request to the branch is also tested on hydro, jade and kinetic.
In kinetic it seems to be use opencv3 (not opencv2) by default and it has not compatibility among them.
How should I put application for kinetic?

My proposal is:

  • split branches according with ros distro:
    • indigo(-devel)
    • jade(-devel)
    • kinetic(-devel)
  • split with opencv version:
    • opencv2
    • opencv3
      (this may break on incompatibility between opencv minor versions 2.x, 3.x)

Also I should use on PR2 which means creating backport branch to hydro (I understand hydro is already EOL.)

improvement proposal

copied from ros-perception/vision_opencv#121

Hi

I tried to use opencv_apps by reading http://wiki.ros.org/opencv_apps, but there is no example launch file for this, so I'd like to propose installing test directory for example launch file

I tried to run camsift, but at first it did not show anything, and it takes few minutes to understand

  1. we need gui param to show display
  2. we need histogram param to start program
    I think it is better to display these information or change code to run by rosrun opencv_apps camshift image:=image_raw

Cc: @k-okada

Debug view: Publish image instead opening OpenCV window

Why does opencv_apps use OpenCV's window and not use ROS topic to output debug view?

I think using ROS topic better than OpenCV's window:

  • The topic can be seen from other machines by ROS's network system
  • Can be seen with output of other node by existing tools like rqt or RViz

Threshold being reset to 50 for hough_lines

Hi,

The threshold for some reason when using roslaunch params keeps on being reset to 50 whenever a threshold below 50 is used. The bug can be seen by setting the threshold to 25 in the .launch file provided and adding a NODELET_DEBUG(%d, threshold_); on line 217 of hough_lines_nodelet.cpp

Launch file crashes on giving a real image topic.

Whenever I run the following command
roslaunch opencv_apps lk_flow.launch image:=one_image_raw

It crashes with the following error

[lk_flow-1] process has died [pid 6645, exit code -11, cmd /home/frcvision/catkin_ws/devel/lib/opencv_apps/lk_flow image:=one_image_raw __name:=lk_flow __log:=/home/frcvision/.ros/log/c914a1be-ffac-11e6-88c1-d8cb8ac73819/lk_flow-1.log]. log file: /home/frcvision/.ros/log/c914a1be-ffac-11e6-88c1-d8cb8ac73819/lk_flow-1*.log

The file lk_flow-1.log* is always empty.

Thanks,
Tanvir

face detect freezes after face is detected.

I am running opencv_apps face_detect on an AMD 64 running Ubuntu 16.04 and Kinetic. Immediately after detecting a face, the terminal comes back with "init_done" the image of the face circle changes from purple to grey and then the whole image grays out. The face detection topics are still running, but no data is being echoed. As far as I can tell the process is still running, but kill -HUP or control-c terminates. camera data is still being transmitted.

I am not seeing any error messages. Any place in logs where I can look to trouble-shoot?


SUMMARY

PARAMETERS

  • /face_detection/debug_view: True
  • /face_detection/eyes_cascade_name: /usr/share/opencv...
  • /face_detection/face_cascade_name: /usr/share/opencv...
  • /face_detection/use_camera_info: False
  • /rosdistro: kinetic
  • /rosversion: 1.12.7

NODES
/
face_detection (opencv_apps/face_detection)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[face_detection-1]: started with pid [3563]
init done


optical flow in opencv_apps

Hi! First of all I'm quite new to ROS so I'm not sure whether this is a silly question.
copied from ros-perception/vision_opencv#67

What role do the opencv_apps play in this repository? Are those meant just as code examples and not meant to be used within 'proper' applications?

In short: is it advisable to use opencv_apps/Flow.msg and fback_flow_nodelet in my application or should I roll my own? The fact that fback_flow_nodelet unconditionally draws the flow visualization suggests that it's really meant more as an example application, rather than a general nodelet for optical flow.


If opencv_apps are meant to be useful apart from serving as a code example I would suggest a few changes (and gladly provide pull requests) to the optical flow part.

In particular I think that the definition of the flow messages should be different. In Flow.msg the flow vector is called velocity, but what fback_flow_nodelet and lk_flow_nodelet really compute are the motions between two frames in pixels irrespective of the time passed between the two frames. So either the nodelets need to scale the movement by the time between the frames, so that the velocity field in Flow.msg get a proper unit (px/s e.g.), or velocity needs to be renamed to displacement and a time field needs to be added to Flow.msg.

PS: great repo! 👍 😄

Histogram equalization

Hi all,

I was just wondering if a Histogram equalization would be in the scope of this package, I didn't find any ROS Node that does that, so I was thinking about adding it here.

What do you think @k-okada ?

Thanks!

Issue finding opencv_apps executables

I was able to successfully build opencv_apps with ROS on Mac OSX but I'm having issues being able to find the corresponding executables using rosrun. I can see the launch file but there are no executables created from catkin build. Can anyone advise?

screen shot 2019-02-05 at 2 48 18 pm

Assertion failedのエラーが出る

ロボットシステムを受講している者です。
10/23の資料のp9の画像処理プログラムの開発でopencvを用いて顔検出のプログラムを書いてみたのですが以下のようなエラーが出てしまいます。

OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /tmp/binarydeb/ros-kinetic-opencv3-3.2.0/modules/imgproc/src/color.cpp, line 9748
terminate called after throwing an instance of 'cv::Exception'
  what():  /tmp/binarydeb/ros-kinetic-opencv3-3.2.0/modules/imgproc/src/color.cpp:9748: error: (-215) scn == 3 || scn == 4 in function cvtColor

プログラムは以下です。

#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/features2d/features2d.hpp"
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/objdetect/objdetect.hpp>

class MyCvPkg
{
  image_transport::Subscriber img_sub_;
  image_transport::ImageTransport it_;

  void imageCallback(const sensor_msgs::ImageConstPtr &msg) {
    ROS_INFO("Received image");
    cv::Mat in_img = cv_bridge::toCvCopy(msg, msg->encoding)->image;
    
    //write opencv code
    cv::Mat face_img =in_img.clone();
    double scale = 4.0;
    cv::Mat gray, smallImg(cv::saturate_cast<int>(face_img.rows/scale), cv::saturate_cast<int>(face_img.cols/scale), CV_8UC1);
    // グレースケール画像に変換
    cv::cvtColor(face_img, gray, CV_BGR2GRAY);
    // 処理時間短縮のために画像を縮小
    cv::resize(gray, smallImg, smallImg.size(), 0, 0, cv::INTER_LINEAR);
    cv::equalizeHist( smallImg, smallImg);
    
  // 分類器の読み込み
    std::string cascadeName = "./haarcascade_frontalface_alt.xml"; // Haar-like
    //std::string cascadeName = "./lbpcascade_frontalface.xml"; // LBP
    cv::CascadeClassifier cascade;
    //if(!cascade.load(cascadeName))
    //return -1;
    
    std::vector<cv::Rect> faces;
    // マルチスケール(顔)探索
    // 画像,出力矩形,縮小スケール,最低矩形数,(フラグ),最小矩形
    cascade.detectMultiScale(smallImg, faces,
			     1.1, 2,
			     CV_HAAR_SCALE_IMAGE
			     ,
			     cv::Size(30, 30));
    
    // 結果の描画
  std::vector<cv::Rect>::const_iterator r = faces.begin();
  for(; r != faces.end(); ++r) {
    cv::Point center;
    int radius;
    center.x = cv::saturate_cast<int>((r->x + r->width*0.5)*scale);
    center.y = cv::saturate_cast<int>((r->y + r->height*0.5)*scale);
    radius = cv::saturate_cast<int>((r->width + r->height)*0.25*scale);
    cv::circle( face_img, center, radius, cv::Scalar(80,80,255), 3, 8, 0 );
  }
	

  cv::imshow("window", face_img);//画像を表示.
  cv::waitKey(1);
    
    //write opencv code
  }
public:
  MyCvPkg(ros::NodeHandle nh = ros::NodeHandle()) : it_(nh)
  {
    img_sub_ = it_.subscribe("image", 3, &MyCvPkg::imageCallback, this);
    cv::namedWindow("Fast", 1);
  }
};

int main (int argc, char **argv)
{
  ros::init(argc, argv, "my_cv_pkg_node");
  MyCvPkg mcp;
  ros::spin();
}

opencvのコード自体はうまく行ったのですが、rosで画像処理をするとエラーが出てしまいます。
エラーの原因を教えていただきたいです。

Image histogram

I was looking for a node to compute the histogram of intensities from an image and found this nice repo I didn't know yet.

Apparently, there is no such feature in opencv_apps and I'm willing to implement it here. Is someone aware of intensity histogram already existing in ROS?

c&p mistake in fback_flow documentation on ROS wiki?

I think there's a copy&paste mistake in the documentation of the fback_flow node in the ROS wiki... I understand that fback_flow is not used for face recognition, so the framed part doesn't make much sense:
grafik

OpenCV apps does not support hydro

I met these error. (hydro)
How to solve it?

[opencv_apps] /workspace/ros/ws_jsk_recognition/src/ros-perception/opencv_apps/src/nodelet/simple_compressed_example_nodelet.cpp:79:22: error: 'CompressedImageConstPtr' in namespace 'sensor_msgs' does not name a type
[opencv_apps] /workspace/ros/ws_jsk_recognition/src/ros-perception/opencv_apps/src/nodelet/simple_compressed_example_nodelet.cpp:79:60: error: ISO C++ forbids declaration of 'msg' with no type [-fpermissive]
[opencv_apps] /workspace/ros/ws_jsk_recognition/src/ros-perception/opencv_apps/src/nodelet/simple_compressed_example_nodelet.cpp: In constructor 'simple_compressed_example::ImageConverter::ImageConverter()':
[opencv_apps] /workspace/ros/ws_jsk_recognition/src/ros-perception/opencv_apps/src/nodelet/simple_compressed_example_nodelet.cpp:69:32: error: 'CompressedImage' is not a member of 'sensor_msgs'
[opencv_apps] /workspace/ros/ws_jsk_recognition/src/ros-perception/opencv_apps/src/nodelet/simple_compressed_example_nodelet.cpp:69:32: error: 'CompressedImage' is not a member of 'sensor_msgs'
[opencv_apps] /workspace/ros/ws_jsk_recognition/src/ros-perception/opencv_apps/src/nodelet/simple_compressed_example_nodelet.cpp:69:107: error: no matching function for call to 'ros::NodeHandle::advertise(const char [41], int)'

Depth map as input

Hi,

When i try to launch any of the apps (i tried edge_detection and find_contours) when specifying the image:="/camera/depth/image_rect_raw" the node crashes with console output below

SUMMARY

PARAMETERS

  • /edge_detection/L2gradient: False
  • /edge_detection/apertureSize: 3
  • /edge_detection/apply_blur_post: False
  • /edge_detection/apply_blur_pre: True
  • /edge_detection/canny_threshold1: 100
  • /edge_detection/canny_threshold2: 200
  • /edge_detection/debug_view: True
  • /edge_detection/edge_type: 2
  • /edge_detection/postBlurSigma: 3.2
  • /edge_detection/postBlurSize: 13
  • /edge_detection/queue_size: 3
  • /edge_detection/use_camera_info: False
  • /rosdistro: melodic
  • /rosversion: 1.14.6

NODES
/
edge_detection (opencv_apps/edge_detection)

ROS_MASTER_URI=http://localhost:11311

process[edge_detection-1]: started with pid [16725]
terminate called after throwing an instance of 'cv_bridge::Exception'
what(): [16UC1] is not a color format. but [bgr8] is. The conversion does not make sense
[edge_detection-1] process has died [pid 16725, exit code -6, cmd /opt/ros/melodic/lib/opencv_apps/edge_detection image:=/camera/depth/image_rect_raw __name:=edge_detection __log:=/home/ahmad/.ros/log/1790e8f4-cf2d-11ea-8e04-54271e90ab2d/edge_detection-1.log].
log file: /home/ahmad/.ros/log/1790e8f4-cf2d-11ea-8e04-54271e90ab2d/edge_detection-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete

I understand the error is about the encoding used (bgr8). Is there a way to specify the depth map info (16uc1) as input?

Can this be edited to handle the depth map input? or is there a better/standard way?

cv::Mat frame = cv_bridge::toCvShare(msg, sensor_msgs::image_encodings::BGR8)->image;

Image processing error in testpyramids_test

Just a quick note: The test testpyramids_test actually detected a bug, but the test doesn't fail. If you go to any recent Travis log, you'll find those lines:

https://travis-ci.org/ros-perception/opencv_apps/jobs/522957213#L6335

OpenCV Error: Sizes of input arguments do not match (The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array') in arithm_op, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/arithm.cpp, line 659

[ERROR] [1572161328.939722859]: Image processing error: The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' arithm_op /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/arithm.cpp 659

-1 for subscribing camera_info which is unnecessary in actual

I'm not sure why some nodes in opencv_apps does subscribe camera_info even though it is unnecessary.

IMO, camera_info should not be subscribed as much as possible, because in most case it has higher frame rate compared to the images,
and it causes the difficulty of synchronization.

For example:

AddingImages

It subscribes camera_info by default with use_camera_info:=true:
https://github.com/ros-perception/opencv_apps/blob/indigo/src/nodelet/adding_images_nodelet.cpp#L116

And frame_id is passed to the do_work function:
https://github.com/ros-perception/opencv_apps/blob/indigo/src/nodelet/adding_images_nodelet.cpp#L103

But the input_frame_from_msg is not used in actual:
https://github.com/ros-perception/opencv_apps/blob/indigo/src/nodelet/adding_images_nodelet.cpp#L164

Even if we set the input_frame_from_msg to output msg,
I wonder there are any cases where the output frame_id is different from both two image inputs.
Cases like below are assumed by default?

  • camera/rgb/camera_info, fraem_id=camera_rgb_optical_frame
  • image_publisher/output1, frame_id=dummy_camera_1
  • image_publisher/output2, frame_id=dummy_camera_2
  • adding_images/image camera_info:=camera/rgb/camera_info image1:=image_publisher/output1 image2:=image_publisher/output2, fraem_id=camera_rgb_optical_frame

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.