File tree 3 files changed +36
-12
lines changed
source/plugins/org.custusx.vslam
3 files changed +36
-12
lines changed Original file line number Diff line number Diff line change @@ -293,3 +293,12 @@ macro(cx_initialize_deformableslam)
293
293
find_package (DeformableSLAM REQUIRED)
294
294
include (${DeformableSLAM_USE_FILE} )
295
295
endmacro ()
296
+
297
+ ###############################################################################
298
+ # Initialize Pangolin library
299
+ # Find the package.
300
+ ###############################################################################
301
+ macro (cx_initialize_Pangolin)
302
+ find_package (Pangolin REQUIRED )
303
+ include_directories (${Pangolin_INCLUDE_DIRS} )
304
+ endmacro ()
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ project(org_custusx_vslam)
2
2
3
3
cx_initialize_deformableslam()
4
4
cx_initialize_opencv()
5
+ cx_initialize_Pangolin()
5
6
6
7
set (PLUGIN_export_directive "${PROJECT_NAME} _EXPORT" )
7
8
@@ -40,9 +41,11 @@ set(PLUGIN_target_libraries
40
41
cxResourceVisualization
41
42
cxLogicManager
42
43
#cxLogicManager
43
- #cxGrabber
44
- Qt5::Widgets
44
+ #cxGrabber
45
+ Qt5::Widgets
45
46
DeformableSLAM
47
+ ${Pangolin_LIBRARIES}
48
+ ${OpenCV_LIBS}
46
49
)
47
50
48
51
set (PLUGIN_OUTPUT_DIR "" )
Original file line number Diff line number Diff line change @@ -12,11 +12,9 @@ See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt
12
12
#include " cxVslamWidget.h"
13
13
#include < QVBoxLayout>
14
14
#include " opencv2/core/core.hpp"
15
+ #include " opencv2/opencv.hpp"
15
16
#include " Modules/Common/System.h"
16
- namespace cv
17
- {
18
- class VideoCapture ;
19
- }
17
+
20
18
namespace cx
21
19
{
22
20
@@ -38,14 +36,28 @@ VslamWidget::~VslamWidget()
38
36
void VslamWidget::startVslam ()
39
37
{
40
38
qDebug ()<<" 开始规划了" ;
41
- /*
42
- cv::VideoCapture cap;
39
+ cv::VideoCapture cap; // Open input
43
40
cap.open (" /home/shu/HamlynDatasetShort/f7phantom/f7_dynamic_deint_L.avi" );
44
- std::cout<<"cap status"<<cap.isOpened()<<std::endl;
45
- cap.set(cv::CAP_PROP_FRAME_WIDTH, 640);
46
- cap.set(cv::CAP_PROP_FRAME_HEIGHT, 480);
41
+ if (!cap.isOpened ()){
42
+ std::cout << " Error opening video stream or file" << std::endl;
43
+ }
44
+ while (1 ){
45
+ cv::Mat frame;
46
+ // Capture frame-by-frame
47
+ cap >> frame;
48
+ // If the frame is empty, break immediately
49
+ if (frame.empty ())
50
+ break ;
51
+ // Display the resulting frame
52
+ cv::imshow ( " Frame" , frame );
53
+ // Press ESC on keyboard to exit
54
+ char c=(char )cv::waitKey (25 );
55
+ if (c==27 )
56
+ break ;
57
+ }
58
+ // When everything done, release the video capture object
59
+ cap.release ();
47
60
48
- */
49
61
}
50
62
51
63
QString VslamWidget::defaultWhatsThis () const
You can’t perform that action at this time.
0 commit comments