ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I don't know if you need videoio
later but for now you don't, so comment it till you solve segmentation fault (core dumped)
problem.
Edit your CMakeLists
:
find_package(OpenCV REQUIRED)
add_executable(vpnode
src/vpnode.cpp
)
target_link_libraries(vpnode
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
)
Edit your sourcefile
as follow:
#include <iostream>
#include <opencv/cv.h>
#include <opencv2/highgui/highgui.hpp>
int main(int argc, char* argv[]) {
cv::Mat img = cv::imread("/home/andrija/Documents/image.jpg");
std::cout << img.rows << "; " << img.cols << std::endl;
cv::namedWindow("img");
cv::imshow("img", img);
cv::waitKey(2000);
return 0;
}
2 | No.2 Revision |
I don't know if you need videoio
later but for now you don't, so comment it till you solve segmentation fault (core dumped)
problem.
Edit your CMakeLists
:
find_package(OpenCV REQUIRED)
add_executable(vpnode
src/vpnode.cpp
)
target_link_libraries(vpnode
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
)
Edit your sourcefile
as follow:
#include <iostream>
#include <opencv/cv.h>
#include <opencv2/highgui/highgui.hpp>
int main(int argc, char* argv[]) {
cv::Mat img = cv::imread("/home/andrija/Documents/image.jpg");
cv::imread("/home/andrija/Documents/image.jpg"); //Make sure that the image is there
std::cout << img.rows << "; " << img.cols << std::endl;
cv::namedWindow("img");
cv::imshow("img", img);
cv::waitKey(2000);
return 0;
}
3 | No.3 Revision |
I don't know if you need videoio
later but for now you don't, so comment it till you solve segmentation fault (core dumped)
problem.
Edit your CMakeLists
:
find_package(OpenCV REQUIRED)
add_executable(vpnode
src/vpnode.cpp
)
target_link_libraries(vpnode
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
)
Edit your sourcefile
as follow:
#include <iostream>
#include <opencv/cv.h>
#include <opencv2/highgui/highgui.hpp>
int main(int argc, char* argv[]) {
cv::Mat img = cv::imread("/home/andrija/Documents/image.jpg"); //Make sure that the image is there
std::cout << img.rows << "; " << img.cols << std::endl;
cv::namedWindow("img");
cv::imshow("img", img);
cv::waitKey(2000);
return 0;
}
You don't have to edit package.xml
leave as it is, This file defines properties about the package such as the package name, version numbers, authors, maintainers, and dependencies on other catkin packages. here