Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ esrocos_init()
esrocos_export_function("camera_capture" "tutorial/cam_capture")

#uncomment to export PKG-CONFIG-file
esrocos_export_pkg-config_info( VERSION 1.0
REQUIRES opencv
)
esrocos_export_pkgconfig( VERSION 1.0
REQUIRES opencv
)
33 changes: 19 additions & 14 deletions camera_capture/camera_capture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,24 @@ void camera_capture_startup()
void camera_capture_PI_capture()
{
VideoCapture cap(0); // open the default camera
if(!cap.isOpened()) // check if we succeeded

namedWindow("raw",1);
namedWindow("edges",2);

Mat frame;
Mat edges;
cap >> frame; // get a new frame from camera
cvtColor(frame, edges, COLOR_BGR2GRAY);
GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
Canny(edges, edges, 0, 30, 3);
imshow("raw", frame);
imshow("edges", edges);
if(waitKey(100) >= 0);
if(cap.isOpened()) // check if we succeeded
{
namedWindow("raw",1);
namedWindow("edges",2);

Mat frame;
Mat edges;
cap >> frame; // get a new frame from camera

if(frame.size().width > 0 && frame.size().height > 0)
{
cvtColor(frame, edges, COLOR_BGR2GRAY);
GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
Canny(edges, edges, 0, 30, 3);
imshow("raw", frame);
imshow("edges", edges);
if(waitKey(100) >= 0);
}
}
}