tu-darmstadt-ros-pkg / mapstitch

24 stars 16 forks source link

Command Line Mapstitch Issue #3

Open DevasenaInupakutika opened 11 years ago

DevasenaInupakutika commented 11 years ago

screenshot from 2013-09-08 11 28 54 screenshot from 2013-09-08 11 31 47

Hi,

I am attempting to merge already created and saved maps of two rooms of my lab and getting below error although the two rooms are connected through door passage as is evident from the pgm files of rooms attached herewith.

turtlebot@ubuntu:~/fuerte_workspace/sandbox/mapstitch$ bin/mapstitch -o testmerge.pgm -d 1.0 robo_lab2.pgm robo_lab2p2.pgm OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /tmp/buildd/ros-fuerte-opencv2-2.4.2-1precise-20130312-1306/modules/core/src/array.cpp, line 2482 terminate called after throwing an instance of 'cv::Exception' what(): /tmp/buildd/ros-fuerte-opencv2-2.4.2-1precise-20130312-1306/modules/core/src/array.cpp:2482: error: (-206) Unrecognized or unsupported array type in function cvGetMat

Aborted (core dumped)

I followed few ways as discussed in stackoverflow related to this OpenCV error which could be datatype mismatch error or differences in C/C++ opencv API's but didn't work.

Could you please let me know what could be the issue and reason for this error ?

Thanks, Devasena

pscholl commented 11 years ago

I never tested compiling against opencv2, so the problem may be a change there. The problem seems to be the conversion from the image to a Mat object, which happens in main.cpp line 80, where the image is actually loaded. The rest of the code assumes that the image is in grayscale format, which imread(filename, 0) should do. Maybe you can load it in RGB mode and convert it down to grayscale by hand.

DevasenaInupakutika commented 11 years ago

Thank you. Quite possible. However, I tried with OpenCV alone but still getting same error along with segmentation fault with some files as below:

turtlebot@ubuntu:~/OPCV_Progs$ ./mapstitch -o test.pgm robo_lab.png robolab.png Segmentation fault (core dumped) turtlebot@ubuntu:~/OPCV_Progs$ ./mapstitch -v -o test.pgm robo_lab.png robolab.png Segmentation fault (core dumped) turtlebot@ubuntu:~/OPCV_Progs$ ./mapstitch -o test.pgm /home/turtlebot/OPCV_Progs/robo_lab.png /home/turtlebot/OPCV_Progs/robo_lab2.png OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /home/turtlebot/opencv-2.4.6.1/modules/core/src/array.cpp, line 2482 terminate called after throwing an instance of 'cv::Exception' what(): /home/turtlebot/opencv-2.4.6.1/modules/core/src/array.cpp:2482: error: (-206) Unrecognized or unsupported array type in function cvGetMat

Also, Does it matter how the map is built ? As in I have generated map using map_server map_saver by capturing data from Kinect (converting kinect data to laser scan data). So, the reason for getting segmentation fault might be because of huge data from kinect ? The map (.pgm) created is 4000 * 4000 with 16 MB size. Does this effect ?

I would also like to know with what all sensors or lasers data this package has been tested and the size of the .pgm files used for testing.