diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left01.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left01.jpg" new file mode 100644 index 0000000..870bc98 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left01.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left02.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left02.jpg" new file mode 100644 index 0000000..2b72d7c Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left02.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left03.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left03.jpg" new file mode 100644 index 0000000..b36dac0 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left03.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left04.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left04.jpg" new file mode 100644 index 0000000..7ac17d6 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left04.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left05.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left05.jpg" new file mode 100644 index 0000000..f83bb76 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left05.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left06.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left06.jpg" new file mode 100644 index 0000000..d3f0caf Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left06.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left07.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left07.jpg" new file mode 100644 index 0000000..7cfb0b8 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left07.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left08.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left08.jpg" new file mode 100644 index 0000000..7d5966b Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left08.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left09.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left09.jpg" new file mode 100644 index 0000000..c62fdaa Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left09.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left10.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left10.jpg" new file mode 100644 index 0000000..b41b9a7 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left10.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left11.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left11.jpg" new file mode 100644 index 0000000..dae9414 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left11.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left12.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left12.jpg" new file mode 100644 index 0000000..8680ef2 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left12.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left13.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left13.jpg" new file mode 100644 index 0000000..95dd5aa Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left13.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left14.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left14.jpg" new file mode 100644 index 0000000..ec8bb72 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left14.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left15.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left15.jpg" new file mode 100644 index 0000000..f991f7d Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left15.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left16.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left16.jpg" new file mode 100644 index 0000000..61e5fd0 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left16.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left17.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left17.jpg" new file mode 100644 index 0000000..dea39fc Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left17.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left18.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left18.jpg" new file mode 100644 index 0000000..98426bd Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left18.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left19.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left19.jpg" new file mode 100644 index 0000000..db186ce Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left19.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left20.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left20.jpg" new file mode 100644 index 0000000..d6cb295 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left20.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left21.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left21.jpg" new file mode 100644 index 0000000..96958e7 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left21.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left22.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left22.jpg" new file mode 100644 index 0000000..7e1e575 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left22.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left23.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left23.jpg" new file mode 100644 index 0000000..cd039b9 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left23.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left24.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left24.jpg" new file mode 100644 index 0000000..751af8e Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left24.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left25.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left25.jpg" new file mode 100644 index 0000000..f84077d Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left25.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left26.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left26.jpg" new file mode 100644 index 0000000..30f42b5 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left26.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left27.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left27.jpg" new file mode 100644 index 0000000..20c4e03 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left27.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left28.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left28.jpg" new file mode 100644 index 0000000..61a9251 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left28.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left29.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left29.jpg" new file mode 100644 index 0000000..4de576c Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left29.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left30.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left30.jpg" new file mode 100644 index 0000000..287873b Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Left30.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right01.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right01.jpg" new file mode 100644 index 0000000..ec79451 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right01.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right02.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right02.jpg" new file mode 100644 index 0000000..f7d647a Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right02.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right03.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right03.jpg" new file mode 100644 index 0000000..08319c9 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right03.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right04.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right04.jpg" new file mode 100644 index 0000000..1d64816 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right04.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right05.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right05.jpg" new file mode 100644 index 0000000..7ec4dd1 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right05.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right06.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right06.jpg" new file mode 100644 index 0000000..3018a57 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right06.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right07.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right07.jpg" new file mode 100644 index 0000000..137a7ec Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right07.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right08.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right08.jpg" new file mode 100644 index 0000000..db2198b Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right08.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right09.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right09.jpg" new file mode 100644 index 0000000..027e847 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right09.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right10.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right10.jpg" new file mode 100644 index 0000000..bd60ce2 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right10.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right11.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right11.jpg" new file mode 100644 index 0000000..af11a3a Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right11.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right12.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right12.jpg" new file mode 100644 index 0000000..ee296bd Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right12.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right13.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right13.jpg" new file mode 100644 index 0000000..d093f83 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right13.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right14.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right14.jpg" new file mode 100644 index 0000000..a317f08 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right14.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right15.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right15.jpg" new file mode 100644 index 0000000..6244e70 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right15.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right16.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right16.jpg" new file mode 100644 index 0000000..4fa0172 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right16.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right17.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right17.jpg" new file mode 100644 index 0000000..0a8f471 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right17.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right18.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right18.jpg" new file mode 100644 index 0000000..bb78198 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right18.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right19.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right19.jpg" new file mode 100644 index 0000000..9e46fd0 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right19.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right20.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right20.jpg" new file mode 100644 index 0000000..61645d2 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right20.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right21.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right21.jpg" new file mode 100644 index 0000000..d1d5e8f Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right21.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right22.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right22.jpg" new file mode 100644 index 0000000..9f521f3 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right22.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right23.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right23.jpg" new file mode 100644 index 0000000..6fcd9aa Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right23.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right24.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right24.jpg" new file mode 100644 index 0000000..aab8a42 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right24.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right25.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right25.jpg" new file mode 100644 index 0000000..d1f399f Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right25.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right26.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right26.jpg" new file mode 100644 index 0000000..d4101f4 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right26.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right27.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right27.jpg" new file mode 100644 index 0000000..63b9f75 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right27.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right28.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right28.jpg" new file mode 100644 index 0000000..7e878e1 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right28.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right29.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right29.jpg" new file mode 100644 index 0000000..3fa0961 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right29.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right30.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right30.jpg" new file mode 100644 index 0000000..41d11c3 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/Right30.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/StereoCalibration.py" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/StereoCalibration.py" new file mode 100644 index 0000000..69e8607 --- /dev/null +++ "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/StereoCalibration.py" @@ -0,0 +1,165 @@ +import numpy as np +import cv2 + +print 'Program Start...' + +criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) +flags = (cv2.CALIB_FIX_ASPECT_RATIO + cv2.CALIB_ZERO_TANGENT_DIST + cv2.CALIB_SAME_FOCAL_LENGTH) + +number = ["01","02","03","04","05","06","07","08","09","10" +,"11","12","13","14","15","16","17","18","19","20" +,"21","22","23","24","25","26","27","28","29","30" ] + +nBoardW=8 +nBoardH=6 + +objp = np.zeros((nBoardW*nBoardH,3), np.float32) +objp[:,:2] = np.mgrid[0:nBoardW,0:nBoardH].T.reshape(-1,2) + +R = np.asarray([(0., 0., 0.), (0., 0., 0.), (0., 0., 0.)]) +T = np.asarray([(0., 0., 0.), (0., 0., 0.), (0., 0., 0.)]) +E = np.asarray([(0., 0., 0.), (0., 0., 0.), (0., 0., 0.)]) +F = np.asarray([(0., 0., 0.), (0., 0., 0.), (0., 0., 0.)]) + +objpoints = [] # 3d point in real world space +Right_imgpoints = [] # 2d points in image plane. +Left_imgpoints = [] # 2d points in image plane. + +samples_to_use = 30 + +height = 0 +width = 0 + +for i in range(0, samples_to_use): + + print 'Reading frame %s of %s' % (i+1, samples_to_use) + + strImg_R ="Right" + strImg_L = "Left" + strImg_N = number[i] + strFormat = ".jpg" + + strImg_R = strImg_R + strImg_N + strFormat + strImg_L = strImg_L + strImg_N + strFormat + + Right_im = cv2.imread(strImg_R) + Left_im = cv2.imread(strImg_L) + + height, width, depth = Right_im.shape + + print 'finding chessboard' + + R_ret , R_corners = cv2.findChessboardCorners(Right_im, (nBoardW,nBoardH), None) + L_ret , L_corners = cv2.findChessboardCorners(Left_im, (nBoardW,nBoardH), None) + + if R_ret == True and L_ret == True: + print 'Right_found chessboard' + objpoints.append(objp) + Right_imgpoints.append(R_corners) + Left_imgpoints.append(L_corners) + + print 'samples: %i' % len(Right_imgpoints) + print 'samples: %i' % len(Left_imgpoints) + + cv2.drawChessboardCorners(Right_im, (nBoardW,nBoardH), R_corners, R_ret) + cv2.drawChessboardCorners(Left_im, (nBoardW,nBoardH), L_corners, L_ret) + + cv2.imshow("Right_im",Right_im) + cv2.imshow("Left_im",Left_im) + + cv2.waitKey(500); # delay time + else : + print 'not found' + + print 'find corners...' + +############################################################################ + +print 'calibrating...' + +objpoints = objpoints[:samples_to_use] +Right_imgpoints = Right_imgpoints[:samples_to_use] +Left_imgpoints = Left_imgpoints[:samples_to_use] + +R_ret, R_intrinsic, R_distort, R_rvecs, R_tvecs = cv2.calibrateCamera(objpoints, Right_imgpoints, (width,height), None, None) +print 'Right calibration complete' +print 'R_ret: %s' % R_ret +print 'R_intrinsic: %s' % R_intrinsic +print 'R_distort: %s' % R_distort +print 'R_rvecs: %s' % R_rvecs +print 'R_tvecs: %s' % R_tvecs + +L_ret, L_intrinsic, L_distort, L_rvecs, L_tvecs = cv2.calibrateCamera(objpoints, Left_imgpoints, (width,height), None, None) +print 'Left calibration complete' +print 'L_ret: %s' % L_ret +print 'L_intrinsic: %s' % L_intrinsic +print 'L_distort: %s' % L_distort +print 'L_rvecs: %s' % L_rvecs +print 'L_tvecs: %s' % L_tvecs + +############################################################################ + +print "Starting Calibration\n" + +intrinsic_R2 = cv2.cv.CreateMat(3, 3, cv2.CV_64FC1) +intrinsic_L2 = cv2.cv.CreateMat(3, 3, cv2.CV_64FC1) + +ret, intrinsic_R2, distort_R2, intrinsic_L2, distort_L2, R, T, E, F = cv2.stereoCalibrate(objpoints, Right_imgpoints, Left_imgpoints, (width, height),criteria=criteria, flags=flags) + +print 'intrinsic_R2: %s' % intrinsic_R2 +print 'distort_R2: %s' % distort_R2 +print 'intrinsic_L2: %s' % intrinsic_L2 +print 'distort_L2: %s' % distort_L2 +print 'R: %s' % R +print 'T: %s' % T + +print "Done Calibration\n" + +############################################################################ + +print "Starting Rectification\n" + + +Rr, Rl, Pr, Pl, Q, roi1, roi2 = cv2.stereoRectify(intrinsic_R2, distort_R2, intrinsic_L2, distort_L2,(width, height), R, T, alpha=-1) + +print 'Rr: %s' % Rr +print 'Rl: %s' % Rl +print 'Pr: %s' % Pr +print 'Pl: %s' % Pl + +print "Done Rectification\n" + +########################################################################### + +print "Applying Undistort\n" + +map1x, map1y = cv2.initUndistortRectifyMap(intrinsic_R2, distort_R2, Rr, Pr, (width, height), cv2.CV_32FC1) +map2x, map2y = cv2.initUndistortRectifyMap(intrinsic_L2, distort_L2, Rl, Pl, (width, height), cv2.CV_32FC1) + +print 'map1x: %s' % map1x +print 'map1y: %s' % map1y +print 'map2x: %s' % map2x +print 'map2y: %s' % map2y + +print "Undistort complete\n" + +########################################################################### + +input_r = "r1.jpg" # choice that you want to retify image each one~ +input_l = "l1.jpg" + +input_Rightimg = cv2.imread(input_r) +input_leftimg = cv2.imread(input_l) + +right_remap = cv2.remap(input_Rightimg, map1x, map1y, cv2.INTER_NEAREST) +left_remap = cv2.remap(input_leftimg,map2x,map2y,cv2.INTER_NEAREST) + +cv2.imshow("input_Rightimg",input_Rightimg); +cv2.imshow("input_leftimg",input_leftimg); + +cv2.waitKey(100); + +cv2.imshow("image2R", right_remap); +cv2.imshow("image1L", left_remap); + +cv2.waitKey(100); \ No newline at end of file diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/l1.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/l1.jpg" new file mode 100644 index 0000000..e98389a Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/l1.jpg" differ diff --git "a/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/r1.jpg" "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/r1.jpg" new file mode 100644 index 0000000..5ccd181 Binary files /dev/null and "b/Python code (StereoCalibration)_\352\265\254\352\267\274(2015108632)/r1.jpg" differ