[ros-users] cv::Canny() error

Top Page
Attachments:
Message as email
+ (text/plain)
+ CMakeLists.txt (text/plain)
+ manifest.xml (text/xml)
Delete this message
Reply to this message
Author: Jared Marshall Glover
Date:  
To: ros-users
Subject: [ros-users] cv::Canny() error
Hi,

I'm not sure if this should go to ros-users or the opencv mailing list, but I'm
getting a runtime error in cv::Canny():

OpenCV Error: Unsupported format or combination of formats () in cvCanny, file
/opt/ros/cturtle/stack/vision_opencv/opencv2/build/opencv-svn/modules/imgproc/src/canny.cpp,
line 66
terminate called after throwing an instance of 'cv::Exception'

Here's my code:

Mat1b I2, E;
I = 256*I; // I is a Mat1d
I.assignTo(I2, DataType<uchar>::type);
I = I/256;
E.create(I2.size());
Canny(I2,E,100,240);

I'm also getting some warnings during compilation about the opencv headers:

In file included from /u/jglov/lis/bookbot/src/bookFinder.cpp:2:
/opt/ros/cturtle/stacks/vision_opencv/opencv2/opencv/include/opencv/cv.h:47:2:
warning: #warning "This is a deprecated opencv header provided for
compatibility. Please include a header from a corresponding opencv module"
In file included from
/opt/ros/cturtle/stacks/vision_opencv/opencv2/opencv/include/opencv/cv.h:64,
                 from /u/jglov/lis/bookbot/src/bookFinder.cpp:2:
/opt/ros/cturtle/stacks/vision_opencv/opencv2/opencv/include/opencv2/core/internal.hpp:297:1:
warning: "CV_IMPL" redefined
In file included from /u/jglov/lis/bookbot/src/bookFinder.cpp:2:
/opt/ros/cturtle/stacks/vision_opencv/opencv2/opencv/include/opencv/cv.h:60:1:
warning: this is the location of the previous definition
/opt/ros/cturtle/stacks/vision_opencv/opencv2/opencv/include/opencv/cv.h:67:8:
warning: extra tokens at end of #endif directive


I've attached the manifest.xml and CMakeLists.txt of the project for reference.

Thanks,
Jared
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)


rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

#uncomment if you have defined messages
rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()

#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})



rosbuild_add_executable(transformer src/transformer.cpp)
rosbuild_add_executable(tableFilter src/tableFilter.cpp)
rosbuild_add_executable(driver src/driver.cpp)
rosbuild_add_executable(bookGrabber src/bookGrabber.cpp)
rosbuild_add_executable(bookPlacer src/bookPlacer.cpp)
#rosbuild_add_executable(testFunction src/testFunction.cpp src/lib/angle_diff.cpp src/lib/angle_mean.cpp src/lib/book_edge_dist.cpp src/lib/edge2polar.cpp src/lib/line_clip.cpp src/lib/line_point_dist.cpp)
#rosbuild_add_executable(tableFilter src/tableFilter.cpp)
rosbuild_add_executable(bookFinder src/bookFinder.cpp src/util.cpp)
#include_directories(bookFinder `pkg-config opencv --cflags`)
#include_directories(/usr/local/include/opencv)
target_link_libraries(bookFinder cv)


#rosbuild_add_executable(testing src/testroutine.cpp)
#rosbuild_add_executable(testFunction src/testFunction.cpp src/lib/angle_diff.cpp src/lib/angle_mean.cpp src/lib/book_edge_dist.cpp src/lib/edge2polar.cpp src/lib/line_clip.cpp src/lib/line_point_dist.cpp)
<package>
<description brief="bookbot">

     bookbot


</description>
<author>lis</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/bookbot</url>
<depend package="roscpp"/>
<depend package="rospy"/>
<depend package="std_msgs"/>
<depend package="sensor_msgs"/>
<depend package="tf"/>
<depend package="geometry_msgs"/>
<depend package="stereo_msgs" />
<depend package="pcl" />
<depend package="eigen" />
<depend package="actionlib_msgs" />
<depend package="actionlib" />
<depend package="image_geometry" />
<depend package="cv_bridge" />
</package>