VINS-Mono icon indicating copy to clipboard operation
VINS-Mono copied to clipboard

Changed with my own topic, but it reported an OpenCV error

Open kevinchow1993 opened this issue 8 years ago • 8 comments

I changed the topics in file euroc_config_no_extrinsic.yaml and set my camera parameter. But when iI launch euroc_no_extrinsic_param.launch It came with an opencv error:

[ INFO] [1497603966.780701533]: init begins
[ INFO] [1497603966.798758974]: Loaded config_file: /home/kevinchow/catkin_ws/src/VINS-Mono/feature_tracker/../config/euroc/euroc_config_no_extrinsic.yaml
[ INFO] [1497603966.810666136]: Loaded vins_folder: /home/kevinchow/catkin_ws/src/VINS-Mono/feature_tracker/../config/../
[ WARN] [1497603966.811355650]: have no prior about extrinsic param, calibrate extrinsic param
[ WARN] [1497603966.811599652]: waiting for image and imu...
[ WARN] [1497603966.854704240]: LOOP_CLOSURE true
voc file: /home/kevinchow/catkin_ws/src/VINS-Mono/feature_tracker/../config/..//support_files/brief_k10L6.bin
loop start load vocabulary
 loop closure init finish
OpenCV Error: Assertion failed (mask.empty() || (mask.type() == CV_8UC1 && mask.size() == image.size())) in goodFeaturesToTrack, file /home/kevinchow/opencv-2.4.10/modules/imgproc/src/featureselect.cpp, line 63
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/kevinchow/opencv-2.4.10/modules/imgproc/src/featureselect.cpp:63: error: (-215) mask.empty() || (mask.type() == CV_8UC1 && mask.size() == image.size()) in function goodFeaturesToTrack

[feature_tracker-1] process has died [pid 10576, exit code -6, cmd /home/kevinchow/catkin_ws/devel/lib/feature_tracker/feature_tracker __name:=feature_tracker __log:=/home/kevinchow/.ros/log/ea0908b8-5242-11e7-a34b-e8039a938798/feature_tracker-1.log].
log file: /home/kevinchow/.ros/log/ea0908b8-5242-11e7-a34b-e8039a938798/feature_tracker-1*.log
^C[vins_estimator-2] killing on exit
terminate called without an active exception
shutting down processing monitor...
... shutting down processing monitor complete
done
kevinchow@kevinchow-Q470-500P4A:~/catkin_ws$ vim /home/kevinchow/opencv-2.4.10/modules/imgproc/src/featureselect.cpp
kevinchow@kevinchow-Q470-500P4A:~/catkin_ws$ /home/kevinchow/catkin_ws/devel/lib/feature_tracker/feature_tracker __name:=feature_tracker __log:=/home/kevinchow/.ros/log/ea0908b8-5242-11e7-a34b-e8039a938798/feature_tracker-1.log
[ INFO] [1497605468.987013289]: Loaded config_file: /home/kevinchow/catkin_ws/src/VINS-Mono/feature_tracker/../config/euroc/euroc_config_no_extrinsic.yaml
[ INFO] [1497605468.988844032]: Loaded vins_folder: /home/kevinchow/catkin_ws/src/VINS-Mono/feature_tracker/../config/../
[ INFO] [1497605468.988985383]: reading paramerter of camera /home/kevinchow/catkin_ws/src/VINS-Mono/feature_tracker/../config/euroc/euroc_config_no_extrinsic.yaml
^Ckevinchow@kevinchow-Q470-500P4A:~/catkin_ws$ 

kevinchow1993 avatar Jun 16 '17 09:06 kevinchow1993

set the right image_width and image_height in config file.

qintonguav avatar Jun 16 '17 12:06 qintonguav

Thanks, My image is 640*480, and I set image_width=640, image_height=480. It turned to be wrong. but I set 752*480 just now, it worked!! Do you know why?

kevinchow1993 avatar Jun 16 '17 12:06 kevinchow1993

are you using fisheye? if you use fisheye, please draw a cirle mask in the same size.

qintonguav avatar Jul 02 '17 14:07 qintonguav

@kevinchow1993 i have the same issue but it didn't change when i modified image_width and image_height. Do you know why or you modified something else ?

trinamntn08 avatar Aug 31 '17 15:08 trinamntn08

@qintonguav When I use kitti dataset with vins, I encountered one problem which is [RUNNING] Bag Time: 1317357761.831904 Duration: 0.002078 / 537.850337
[RUNNING] Bag Time: 1317357761.891237 Duration: 0.061411 / 537.850337
[RUNNING] Bag Time: 1317357761.932425 Duration: 0.102599 / 537.850337
[RUNNING] Bag Time: 1317357761.933925 Duration: 0.104099 / 537.850337
[RUNNING] Bag Time: 1317357761.934457 Duration: 0.104631 / 537.850337
[RUNNING] Bag Time: 1317357761.935838 Duration: 0.106012 / 537.850337
OpenCV Error: Assertion failed (0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows) in Mat, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/core/src/matrix.cpp, line 492 terminate called after throwing an instance of 'cv::Exception' what(): /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/core/src/matrix.cpp:492: error: (-215) 0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows in function Mat

[RUNNING] Bag Time: 1317357761.992828 Duration: 0.163002 / 537.850337
[RUNNING] Bag Time: 1317357762.033182 Duration: 0.203356 / 537.850337
[RUNNING] Bag Time: 1317357762.037807 Duration: 0.207981 / 537.850337
[RUNNING] Bag Time: 1317357762.038259 Duration: 0.208433 / 537.850337
[RUNNING] Bag Time: 1317357762.043259 Duration: 0.213432 / 537.850337
[RUNNING] Bag Time: 1317357762.093648 Duration: 0.263822 / 537.850337
[feature_tracker-1] process has died [pid 3558, exit code -6, cmd /home/test/vins_ws/devel/lib/feature_tracker/feature_tracker __name:=feature_tracker __log:=/home/test/.ros/log/d8cecac6-9f65-11e8-bc7e-1002b5c94820/feature_tracker-1.log]. log file: /home/test/.ros/log/d8cecac6-9f65-11e8-bc7e-1002b5c94820/feature_tracker-1*.log [RUNNING] Bag Time: 1317357762.134015 Duration: 0.304189 / 537.850337

Could you tell how to solve it.Thanks!

yueshukun avatar Aug 14 '18 05:08 yueshukun

@yueshukun I also go the same error what(): /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/core/src/matrix.cpp:492: error: (-215) 0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows in function Mat if you have solved it please could you tell me

chrismath avatar Oct 01 '18 11:10 chrismath

If you're using any of the kitti raw sync sequences, you need to adjust the image size accordingly in the config file. The images are cropped to account for the undistortion effects making the size smaller than the original size of 1392 x 512.

karnikram avatar May 30 '19 11:05 karnikram

@chrismath

Change image_width & image_height depend on your dataset or camera.

vi ./catkin_ws/src/VINS-Mono/config/euroc/euroc_config.yaml
camera_name: camera
#image_width: 752
image_height: 480
image_width: 640

nopnop2002 avatar Feb 17 '23 05:02 nopnop2002