File tree Expand file tree Collapse file tree
demos/video/chapel-webcam Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,8 +32,12 @@ libsmol: smol.chpl
3232 $(LIB_GEN_CMD )
3333
3434
35+ OPENCV_CFLAGS = ` pkg-config --cflags opencv4 `
36+ OPENCV_LDFLAGS = ` pkg-config --cflags --libs opencv4 `
37+
3538main : main.cpp smol_wrapper.h lib/libsmol.so
36- $(CHPL_COMPILER ) $(CHPL_CFLAGS ) -fPIC main.cpp -o main $(CHPL_LDFLAGS )
39+ @echo $(OPENCV_CFLAGS )
40+ $(CHPL_COMPILER ) $(CHPL_CFLAGS ) $(OPENCV_CFLAGS ) -std=c++20 -fPIC main.cpp -o main $(CHPL_LDFLAGS ) $(OPENCV_LDFLAGS )
3741
3842clean :
3943 rm -f maincpp maincpp.o main.o main
Original file line number Diff line number Diff line change 11#include " smol_wrapper.h"
22
3+
4+ // #include <opencv2/opencv.hpp>
5+ // #include <iostream>
6+
7+
8+ // int mirror() {
9+ // cv::VideoCapture cap(0);
10+ // if (!cap.isOpened()) {
11+ // std::cerr << "Error: Cannot open the webcam.\n";
12+ // return -1;
13+ // }
14+
15+ // cv::Mat frame;
16+ // const std::string windowName = "Webcam Feed";
17+ // cv::namedWindow(windowName, cv::WINDOW_AUTOSIZE);
18+
19+ // while (true) {
20+ // // Capture a new frame from webcam
21+ // cap >> frame;
22+ // if (frame.empty()) {
23+ // std::cerr << "Error: Empty frame captured.\n";
24+ // break;
25+ // }
26+
27+ // // Display the captured frame
28+ // cv::imshow(windowName, frame);
29+
30+ // // Wait for 30ms or until 'q' key is pressed
31+ // char key = static_cast<char>(cv::waitKey(30));
32+ // if (key == 'q' || key == 27) { // 'q' or ESC to quit
33+ // break;
34+ // }
35+ // }
36+
37+ // // Release the camera and destroy all windows
38+ // cap.release();
39+ // cv::destroyAllWindows();
40+ // return 0;
41+ // }
42+
43+ int mirror () { return 0 ; }
44+
345int main (int argc, char * argv[]) {
446 chpl_library_init (argc, argv);
547
@@ -17,9 +59,11 @@ int main(int argc, char* argv[]) {
1759 printArray (&matrix_ptr);
1860 chpl_free_external_array (matrix_ptr);
1961
62+ int code = mirror ();
63+
2064
2165 chpl_library_finalize ();
22- return 0 ;
66+ return code ;
2367}
2468
2569
You can’t perform that action at this time.
0 commit comments