├── AI引论 ├── HW 01.pdf ├── HW 02.pdf ├── HW 03.pdf ├── HW 04.pdf ├── HW 05.pdf ├── HW 06.pdf ├── HW 07.pdf └── HW 08.pdf ├── README.md ├── 代数结构与组合数学 ├── ASCM 23_02_28.pdf ├── ASCM 23_03_07.pdf ├── ASCM 23_03_14.pdf ├── ASCM 23_03_21.pdf ├── ASCM 23_03_28.pdf ├── ASCM 23_04_04.pdf ├── ASCM 23_04_11.pdf ├── ASCM 23_04_18.pdf ├── ASCM 23_04_25.pdf ├── ASCM 23_05_09.pdf ├── ASCM 23_05_16.pdf ├── ASCM 23_05_23.pdf ├── ASCM 23_05_30.pdf └── ASCM 23_06_06.pdf ├── 信息论 ├── HW1.pdf ├── HW2.pdf └── HW3.pdf ├── 数据库概论 ├── HW1.pdf ├── HW2.pdf ├── HW3.pdf ├── HW4.pdf ├── HW5.pdf ├── HW6.pdf └── HW7.pdf ├── 数据结构与算法(A) ├── Ch1.pdf ├── Ch10.pdf ├── Ch2.pdf ├── Ch3.pdf ├── Ch4.pdf ├── Ch5.pdf ├── Ch6.pdf ├── Ch7.pdf ├── Ch8.pdf └── Ch9.pdf ├── 数理逻辑 ├── HW 6 22.10.21.pdf ├── HW1 22.9.16.pdf ├── HW10.pdf ├── HW11.pdf ├── HW12.pdf ├── HW2 22.9.23.pdf ├── HW3 22.9.30.pdf ├── HW4 22.10.7.pdf ├── HW5 22.10.14.pdf ├── HW7 22.10.28.pdf ├── HW8 22.11.11.pdf └── HW9 22.11.18.pdf ├── 概率统计(A) └── PTS HW.pdf ├── 算法设计与分析 ├── HW01.pdf ├── HW02.pdf ├── HW03.pdf ├── HW04.pdf ├── HW05.pdf ├── HW06.pdf ├── HW07.pdf ├── HW08.pdf ├── HW09.pdf └── HW10.pdf ├── 编译原理 ├── HW01.pdf ├── HW02.pdf ├── HW03.pdf ├── HW04.pdf ├── HW05.pdf ├── HW06.pdf ├── HW07.pdf ├── HW08.pdf ├── HW09.pdf ├── HW10.pdf ├── HW11.pdf ├── HW12.pdf ├── HW13.pdf ├── HW14.pdf ├── HW15.pdf └── HW16.pdf ├── 计算机网络(实验班) ├── Ch2.pdf ├── Ch3.pdf ├── Ch4.pdf ├── Ch5.pdf └── Ch6.pdf ├── 计算机视觉导论 ├── HW1 │ ├── HM1_Canny.py │ ├── HM1_Convolve.py │ ├── HM1_HarrisCorner.py │ ├── HM1_RANSAC.py │ ├── HM1_ransac_points.txt │ ├── Lenna.png │ ├── hand_writting.png │ ├── pack.py │ ├── result │ │ ├── HM1_Canny_result.png │ │ ├── HM1_Convolve_img_blur.png │ │ ├── HM1_Convolve_img_gadient_x.png │ │ ├── HM1_Convolve_img_gadient_y.png │ │ ├── HM1_Convolve_replicate_pad.txt │ │ ├── HM1_Convolve_result_1.txt │ │ ├── HM1_Convolve_result_2.txt │ │ ├── HM1_Convolve_zero_pad.txt │ │ ├── HM1_HarrisCorner.png │ │ ├── HM1_RANSAC_fig.png │ │ ├── HM1_RANSAC_plane.txt │ │ └── HM1_RANSAC_sample_time.txt │ └── utils.py ├── HW2 │ ├── BP.py │ ├── README.md │ ├── batch_normalization │ │ └── bn.py │ ├── cifar-10 │ │ ├── Lenna.png │ │ ├── dataset.py │ │ ├── network.py │ │ ├── train.py │ │ └── util.py │ ├── mnist_subset │ │ ├── 0.png │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 5.png │ │ ├── 6.png │ │ ├── 7.png │ │ ├── 8.png │ │ └── 9.png │ ├── pack.py │ └── results │ │ ├── BP.txt │ │ ├── Lenna.png │ │ ├── Lenna_aug1.png │ │ ├── Lenna_aug2.png │ │ ├── bn_loss.txt │ │ ├── learning_rate.png │ │ ├── my_best.png │ │ └── network_structure.png └── HW3 │ ├── README.md │ ├── camera_calibr │ ├── back_image.npy │ ├── calibr.ipynb │ ├── front.png │ └── front_image.npy │ ├── depth_pc │ ├── aligned_full_pc.txt │ ├── depth.png │ ├── depth_pc.ipynb │ ├── intrinsic.npy │ ├── raw_full_pc.txt │ ├── render.py │ ├── seg.png │ └── spot.obj │ ├── marching_cube │ ├── data │ │ ├── bob_cell.npy │ │ └── spot_cell.npy │ ├── lookup_table.py │ └── marching_cube.ipynb │ ├── mesh_pc │ ├── earthmover.py │ ├── fps_vis.txt │ ├── mesh_pc.ipynb │ ├── spot.obj │ └── uniform_sampling_vis.txt │ ├── pack.py │ └── results │ ├── bob.obj │ ├── calibr.npy │ ├── fps_results.npy │ ├── metrics.npy │ ├── one_way_CD.txt │ ├── pc_from_depth.txt │ ├── spot.obj │ └── uniform_sampling_results.npy ├── 计算理论导论 ├── HW1.pdf ├── HW2.pdf ├── HW3.pdf ├── HW4.pdf ├── HW5.pdf └── HW6.pdf ├── 随机过程引论 ├── HW1.pdf ├── HW2.pdf ├── HW3.pdf └── HW4.pdf └── 集合论与图论 ├── SG HW1.pdf ├── SG HW2.pdf ├── SG HW3.pdf ├── SG HW4.pdf └── SG HW5.pdf /AI引论/HW 01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/AI引论/HW 01.pdf -------------------------------------------------------------------------------- /AI引论/HW 02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/AI引论/HW 02.pdf -------------------------------------------------------------------------------- /AI引论/HW 03.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/AI引论/HW 03.pdf -------------------------------------------------------------------------------- /AI引论/HW 04.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/AI引论/HW 04.pdf -------------------------------------------------------------------------------- /AI引论/HW 05.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/AI引论/HW 05.pdf -------------------------------------------------------------------------------- /AI引论/HW 06.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/AI引论/HW 06.pdf -------------------------------------------------------------------------------- /AI引论/HW 07.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/AI引论/HW 07.pdf -------------------------------------------------------------------------------- /AI引论/HW 08.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/AI引论/HW 08.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PKU CS 作业合集 2 | 3 | ## 关于本仓库 4 | 5 | CS 专业课的教学质量想必大家有目共睹,无需多言。本仓库存放了我所上部分课程的作业解答,希望能给大家一些帮助。 6 | 7 | 由于能力有限,我写的答案可能有不少疏漏,或者做法不够简洁,请大家谨慎参考。如发现错误,欢迎开 issue 指正。 8 | 9 | 为了防止可能的版权纠纷,不提供作业题面。对于那些有“祖传作业”的课程,这应该不成问题。 10 | 11 | 我现在大三,这个仓库会在每学期结束后更新,直到我毕业。 12 | 13 | 如果我的作业帮到了你,不妨给我点个 star,让我知道有人在看~ 14 | 15 | ## 友情链接 16 | 17 | [计算机系统导论的 lab](https://github.com/CS-icez/introduction-to-computer-systems) 18 | 19 | [程序设计实习的 OJ 作业和补充练习](https://github.com/CS-icez/practice-of-programming-in-c-and-cpp) 20 | 21 | [数据结构与算法(A)的 OJ 作业](https://github.com/CS-icez/data-structure-and-algorithm) 22 | 23 | [数学分析(Ⅲ)的全书习题](https://www.zhihu.com/column/c_1593381605103681536) 24 | 25 | [编译原理的 lab](https://github.com/CS-icez/SysY-Compiler) 26 | 27 | 操作系统(实验班)的 lab(待开源) 28 | 29 | [毕业论文的 LaTeX 模板](https://github.com/CS-icez/pkuthss-undergraduate-eecs-2025) -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_02_28.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_02_28.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_03_07.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_03_07.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_03_14.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_03_14.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_03_21.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_03_21.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_03_28.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_03_28.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_04_04.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_04_04.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_04_11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_04_11.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_04_18.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_04_18.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_04_25.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_04_25.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_05_09.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_05_09.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_05_16.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_05_16.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_05_23.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_05_23.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_05_30.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_05_30.pdf -------------------------------------------------------------------------------- /代数结构与组合数学/ASCM 23_06_06.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/代数结构与组合数学/ASCM 23_06_06.pdf -------------------------------------------------------------------------------- /信息论/HW1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/信息论/HW1.pdf -------------------------------------------------------------------------------- /信息论/HW2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/信息论/HW2.pdf -------------------------------------------------------------------------------- /信息论/HW3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/信息论/HW3.pdf -------------------------------------------------------------------------------- /数据库概论/HW1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据库概论/HW1.pdf -------------------------------------------------------------------------------- /数据库概论/HW2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据库概论/HW2.pdf -------------------------------------------------------------------------------- /数据库概论/HW3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据库概论/HW3.pdf -------------------------------------------------------------------------------- /数据库概论/HW4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据库概论/HW4.pdf -------------------------------------------------------------------------------- /数据库概论/HW5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据库概论/HW5.pdf -------------------------------------------------------------------------------- /数据库概论/HW6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据库概论/HW6.pdf -------------------------------------------------------------------------------- /数据库概论/HW7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据库概论/HW7.pdf -------------------------------------------------------------------------------- /数据结构与算法(A)/Ch1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据结构与算法(A)/Ch1.pdf -------------------------------------------------------------------------------- /数据结构与算法(A)/Ch10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据结构与算法(A)/Ch10.pdf -------------------------------------------------------------------------------- /数据结构与算法(A)/Ch2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据结构与算法(A)/Ch2.pdf -------------------------------------------------------------------------------- /数据结构与算法(A)/Ch3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据结构与算法(A)/Ch3.pdf -------------------------------------------------------------------------------- /数据结构与算法(A)/Ch4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据结构与算法(A)/Ch4.pdf -------------------------------------------------------------------------------- /数据结构与算法(A)/Ch5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据结构与算法(A)/Ch5.pdf -------------------------------------------------------------------------------- /数据结构与算法(A)/Ch6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据结构与算法(A)/Ch6.pdf -------------------------------------------------------------------------------- /数据结构与算法(A)/Ch7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据结构与算法(A)/Ch7.pdf -------------------------------------------------------------------------------- /数据结构与算法(A)/Ch8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据结构与算法(A)/Ch8.pdf -------------------------------------------------------------------------------- /数据结构与算法(A)/Ch9.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数据结构与算法(A)/Ch9.pdf -------------------------------------------------------------------------------- /数理逻辑/HW 6 22.10.21.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW 6 22.10.21.pdf -------------------------------------------------------------------------------- /数理逻辑/HW1 22.9.16.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW1 22.9.16.pdf -------------------------------------------------------------------------------- /数理逻辑/HW10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW10.pdf -------------------------------------------------------------------------------- /数理逻辑/HW11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW11.pdf -------------------------------------------------------------------------------- /数理逻辑/HW12.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW12.pdf -------------------------------------------------------------------------------- /数理逻辑/HW2 22.9.23.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW2 22.9.23.pdf -------------------------------------------------------------------------------- /数理逻辑/HW3 22.9.30.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW3 22.9.30.pdf -------------------------------------------------------------------------------- /数理逻辑/HW4 22.10.7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW4 22.10.7.pdf -------------------------------------------------------------------------------- /数理逻辑/HW5 22.10.14.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW5 22.10.14.pdf -------------------------------------------------------------------------------- /数理逻辑/HW7 22.10.28.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW7 22.10.28.pdf -------------------------------------------------------------------------------- /数理逻辑/HW8 22.11.11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW8 22.11.11.pdf -------------------------------------------------------------------------------- /数理逻辑/HW9 22.11.18.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/数理逻辑/HW9 22.11.18.pdf -------------------------------------------------------------------------------- /概率统计(A)/PTS HW.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/概率统计(A)/PTS HW.pdf -------------------------------------------------------------------------------- /算法设计与分析/HW01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/算法设计与分析/HW01.pdf -------------------------------------------------------------------------------- /算法设计与分析/HW02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/算法设计与分析/HW02.pdf -------------------------------------------------------------------------------- /算法设计与分析/HW03.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/算法设计与分析/HW03.pdf -------------------------------------------------------------------------------- /算法设计与分析/HW04.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/算法设计与分析/HW04.pdf -------------------------------------------------------------------------------- /算法设计与分析/HW05.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/算法设计与分析/HW05.pdf -------------------------------------------------------------------------------- /算法设计与分析/HW06.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/算法设计与分析/HW06.pdf -------------------------------------------------------------------------------- /算法设计与分析/HW07.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/算法设计与分析/HW07.pdf -------------------------------------------------------------------------------- /算法设计与分析/HW08.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/算法设计与分析/HW08.pdf -------------------------------------------------------------------------------- /算法设计与分析/HW09.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/算法设计与分析/HW09.pdf -------------------------------------------------------------------------------- /算法设计与分析/HW10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/算法设计与分析/HW10.pdf -------------------------------------------------------------------------------- /编译原理/HW01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW01.pdf -------------------------------------------------------------------------------- /编译原理/HW02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW02.pdf -------------------------------------------------------------------------------- /编译原理/HW03.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW03.pdf -------------------------------------------------------------------------------- /编译原理/HW04.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW04.pdf -------------------------------------------------------------------------------- /编译原理/HW05.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW05.pdf -------------------------------------------------------------------------------- /编译原理/HW06.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW06.pdf -------------------------------------------------------------------------------- /编译原理/HW07.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW07.pdf -------------------------------------------------------------------------------- /编译原理/HW08.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW08.pdf -------------------------------------------------------------------------------- /编译原理/HW09.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW09.pdf -------------------------------------------------------------------------------- /编译原理/HW10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW10.pdf -------------------------------------------------------------------------------- /编译原理/HW11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW11.pdf -------------------------------------------------------------------------------- /编译原理/HW12.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW12.pdf -------------------------------------------------------------------------------- /编译原理/HW13.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW13.pdf -------------------------------------------------------------------------------- /编译原理/HW14.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW14.pdf -------------------------------------------------------------------------------- /编译原理/HW15.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW15.pdf -------------------------------------------------------------------------------- /编译原理/HW16.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/编译原理/HW16.pdf -------------------------------------------------------------------------------- /计算机网络(实验班)/Ch2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机网络(实验班)/Ch2.pdf -------------------------------------------------------------------------------- /计算机网络(实验班)/Ch3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机网络(实验班)/Ch3.pdf -------------------------------------------------------------------------------- /计算机网络(实验班)/Ch4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机网络(实验班)/Ch4.pdf -------------------------------------------------------------------------------- /计算机网络(实验班)/Ch5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机网络(实验班)/Ch5.pdf -------------------------------------------------------------------------------- /计算机网络(实验班)/Ch6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机网络(实验班)/Ch6.pdf -------------------------------------------------------------------------------- /计算机视觉导论/HW1/HM1_Canny.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from HM1_Convolve import Gaussian_filter, Sobel_filter_x, Sobel_filter_y 3 | from utils import read_img, write_img 4 | 5 | def compute_gradient_magnitude_direction(x_grad, y_grad): 6 | """ 7 | The function you need to implement for Q2 a). 8 | Inputs: 9 | x_grad: array(float) 10 | y_grad: array(float) 11 | Outputs: 12 | magnitude_grad: array(float) 13 | direction_grad: array(float) you may keep the angle of the gradient at each pixel 14 | """ 15 | magnitude_grad = np.sqrt(x_grad**2 + y_grad**2) 16 | direction_grad = np.arctan2(y_grad, x_grad) 17 | 18 | return magnitude_grad, direction_grad 19 | 20 | 21 | 22 | def non_maximal_suppressor(grad_mag, grad_dir): 23 | """ 24 | The function you need to implement for Q2 b). 25 | Inputs: 26 | grad_mag: array(float) 27 | grad_dir: array(float) 28 | Outputs: 29 | output: array(float) 30 | """ 31 | 32 | grad_dir = (np.rad2deg(grad_dir) % 180 // 22.5 + 1) // 2 % 4 33 | 34 | # Get all neighbors in a tensor style. 35 | pad = np.pad(grad_mag, 1, mode='constant') 36 | t = pad[:-2, 1:-1] 37 | b = pad[2:, 1:-1] 38 | l = pad[1:-1, :-2] 39 | r = pad[1:-1, 2:] 40 | tl = pad[:-2, :-2] 41 | tr = pad[:-2, 2:] 42 | bl = pad[2:, :-2] 43 | br = pad[2:, 2:] 44 | 45 | NMS_output = np.select( 46 | # Note that x-axis points rightwards and y-axis points downwards. 47 | # This can be inferred from the Sobel filter. 48 | condlist=[ 49 | (grad_dir == 0) & (grad_mag > l) & (grad_mag > r), 50 | (grad_dir == 1) & (grad_mag > tl) & (grad_mag > br), 51 | (grad_dir == 2) & (grad_mag > t) & (grad_mag > b), 52 | (grad_dir == 3) & (grad_mag > tr) & (grad_mag > bl) 53 | ], 54 | choicelist=[grad_mag, grad_mag, grad_mag, grad_mag] 55 | ) 56 | 57 | return NMS_output 58 | 59 | 60 | 61 | def hysteresis_thresholding(img) : 62 | """ 63 | The function you need to implement for Q2 c). 64 | Inputs: 65 | img: array(float) 66 | Outputs: 67 | output: array(float) 68 | """ 69 | 70 | 71 | #you can adjust the parameters to fit your own implementation 72 | low_ratio = 0.06 73 | high_ratio = 0.18 74 | 75 | low = low_ratio * np.max(img) 76 | high = high_ratio * np.max(img) 77 | 78 | output = np.where(img > high, 1, 0) 79 | output = np.pad(output, 1, mode='constant') 80 | 81 | curr_num = np.count_nonzero(output) 82 | prev_num = 0 83 | 84 | while curr_num > prev_num: 85 | t = output[:-2, 1:-1] 86 | b = output[2:, 1:-1] 87 | l = output[1:-1, :-2] 88 | r = output[1:-1, 2:] 89 | tl = output[:-2, :-2] 90 | tr = output[:-2, 2:] 91 | bl = output[2:, :-2] 92 | br = output[2:, 2:] 93 | 94 | cond = (img > low) & (t | b | l | r | tl | tr | bl | br) 95 | output[1:-1, 1:-1] = np.where(cond, 1, output[1:-1, 1:-1]) 96 | 97 | prev_num = curr_num 98 | curr_num = np.count_nonzero(output) 99 | 100 | output = output[1:-1, 1:-1] 101 | 102 | return output 103 | 104 | 105 | 106 | if __name__=="__main__": 107 | 108 | #Load the input images 109 | input_img = read_img("Lenna.png")/255 110 | 111 | #Apply gaussian blurring 112 | blur_img = Gaussian_filter(input_img) 113 | 114 | x_grad = Sobel_filter_x(blur_img) 115 | y_grad = Sobel_filter_y(blur_img) 116 | 117 | #Compute the magnitude and the direction of gradient 118 | magnitude_grad, direction_grad = compute_gradient_magnitude_direction(x_grad, y_grad) 119 | 120 | #NMS 121 | NMS_output = non_maximal_suppressor(magnitude_grad, direction_grad) 122 | 123 | #Edge linking with hysteresis 124 | output_img = hysteresis_thresholding(NMS_output) 125 | 126 | write_img("result/HM1_Canny_result.png", output_img*255) 127 | -------------------------------------------------------------------------------- /计算机视觉导论/HW1/HM1_Convolve.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from utils import read_img, write_img 3 | 4 | def padding(img, padding_size, type): 5 | """ 6 | The function you need to implement for Q1 a). 7 | Inputs: 8 | img: array(float) 9 | padding_size: int 10 | type: str, zeroPadding/replicatePadding 11 | Outputs: 12 | padding_img: array(float) 13 | """ 14 | 15 | h, w = img.shape 16 | p = padding_size 17 | 18 | if type=="zeroPadding": 19 | padding_img = np.zeros((h+2*p, w+2*p)) 20 | padding_img[p:p+h, p:p+w] = img # Center. 21 | return padding_img 22 | elif type=="replicatePadding": 23 | padding_img = np.zeros((h+2*p, w+2*p)) 24 | padding_img[p:p+h, p:p+w] = img # Center. 25 | padding_img[:p, p:p+w] = img[:1, :] # Top. 26 | padding_img[p+h:, p:p+w] = img[-1:, :] # Bottom. 27 | padding_img[p:p+h, :p] = img[:, :1] # Left. 28 | padding_img[p:p+h, p+w:] = img[:, -1:] # Right. 29 | padding_img[:p, :p] = img[0, 0] # Top left. 30 | padding_img[:p, p+w:] = img[0, -1] # Top right. 31 | padding_img[p+h:, :p] = img[-1, 0] # Bottom left. 32 | padding_img[p+h:, p+w:] = img[-1, -1] # Bottom right. 33 | return padding_img 34 | 35 | 36 | def convol_with_Toeplitz_matrix(img, kernel): 37 | """ 38 | The function you need to implement for Q1 b). 39 | Inputs: 40 | img: array(float) 6*6 41 | kernel: array(float) 3*3 42 | Outputs: 43 | output: array(float) 44 | """ 45 | 46 | #zero padding 47 | K = kernel.shape[0] 48 | H, W = img.shape 49 | img_pad = padding(img, (K - 1) // 2, "zeroPadding") 50 | HP, WP = img_pad.shape 51 | 52 | #build the Toeplitz matrix and compute convolution 53 | k_pad = np.zeros((K, WP)) # (K, WP) 54 | k_pad[:K, :K] = kernel 55 | 56 | # Construct circulant matrix. (n,) -> (n_rows, n). 57 | to_toeplitz = lambda v, n_row: v[np.arange(len(v)) - np.arange(n_row)[:, None]] 58 | t = np.apply_along_axis(lambda v: to_toeplitz(v, W), 1, k_pad) # (K, W, WP) 59 | t = np.concatenate((t, np.zeros((HP - K, W, WP))), axis=0) # (HP, W, WP) 60 | t = to_toeplitz(t, H) # (H, HP, W, WP) 61 | t = t.transpose(0, 2, 1, 3) # (H, W, HP, WP) 62 | t = t.reshape(img.size, img_pad.size) # (H*W, HP*WP) 63 | 64 | output = t @ img_pad.flatten() # (H*W, HP*WP) @ (HP*WP, 1) = (H*W, 1) 65 | output = output.reshape(img.shape) # (H, W) 66 | 67 | return output 68 | 69 | 70 | def convolve(img, kernel): 71 | """ 72 | The function you need to implement for Q1 c). 73 | Inputs: 74 | img: array(float) 75 | kernel: array(float) 76 | Outputs: 77 | output: array(float) 78 | """ 79 | 80 | #build the sliding-window convolution here 81 | H, W = img.shape 82 | K = kernel.shape[0] 83 | 84 | # Idea: convert each iteration dimension to a tensor dimension. 85 | x = np.arange(H-K+1).reshape(-1, 1, 1, 1) # (H-K+1, 1, 1, 1) 86 | y = np.arange(W-K+1).reshape(1, -1, 1, 1) # (1, W-K+1, 1, 1) 87 | dx = np.arange(K).reshape(1, 1, -1, 1) # (1, 1, K, 1) 88 | dy = np.arange(K).reshape(1, 1, 1, -1) # (1, 1, 1, K) 89 | kk = kernel.reshape(1, 1, K, K) # (1, 1, K, K) 90 | 91 | r = x + dx # (H-K+1, 1, K, 1) 92 | c = y + dy # (1, W-K+1, 1, K) 93 | 94 | windows = img[r, c] # (H-K+1, W-K+1, K, K) 95 | output = np.sum(windows * kk, axis=(2, 3)) # (H-K+1, W-K+1) 96 | 97 | return output 98 | 99 | 100 | def Gaussian_filter(img): 101 | padding_img = padding(img, 1, "replicatePadding") 102 | gaussian_kernel = np.array([[1/16,1/8,1/16],[1/8,1/4,1/8],[1/16,1/8,1/16]]) 103 | output = convolve(padding_img, gaussian_kernel) 104 | return output 105 | 106 | def Sobel_filter_x(img): 107 | padding_img = padding(img, 1, "replicatePadding") 108 | sobel_kernel_x = np.array([[-1,0,1],[-2,0,2],[-1,0,1]]) 109 | output = convolve(padding_img, sobel_kernel_x) 110 | return output 111 | 112 | def Sobel_filter_y(img): 113 | padding_img = padding(img, 1, "replicatePadding") 114 | sobel_kernel_y = np.array([[-1,-2,-1],[0,0,0],[1,2,1]]) 115 | output = convolve(padding_img, sobel_kernel_y) 116 | return output 117 | 118 | 119 | 120 | if __name__=="__main__": 121 | 122 | np.random.seed(111) 123 | input_array=np.random.rand(6,6) 124 | input_kernel=np.random.rand(3,3) 125 | 126 | 127 | # task1: padding 128 | zero_pad = padding(input_array,1,"zeroPadding") 129 | np.savetxt("result/HM1_Convolve_zero_pad.txt",zero_pad) 130 | 131 | replicate_pad = padding(input_array,1,"replicatePadding") 132 | np.savetxt("result/HM1_Convolve_replicate_pad.txt",replicate_pad) 133 | 134 | 135 | #task 2: convolution with Toeplitz matrix 136 | result_1 = convol_with_Toeplitz_matrix(input_array, input_kernel) 137 | np.savetxt("result/HM1_Convolve_result_1.txt", result_1) 138 | 139 | #task 3: convolution with sliding-window 140 | result_2 = convolve(input_array, input_kernel) 141 | np.savetxt("result/HM1_Convolve_result_2.txt", result_2) 142 | 143 | #task 4/5: Gaussian filter and Sobel filter 144 | input_img = read_img("Lenna.png")/255 145 | 146 | img_gadient_x = Sobel_filter_x(input_img) 147 | img_gadient_y = Sobel_filter_y(input_img) 148 | img_blur = Gaussian_filter(input_img) 149 | 150 | write_img("result/HM1_Convolve_img_gadient_x.png", img_gadient_x*255) 151 | write_img("result/HM1_Convolve_img_gadient_y.png", img_gadient_y*255) 152 | write_img("result/HM1_Convolve_img_blur.png", img_blur*255) 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /计算机视觉导论/HW1/HM1_HarrisCorner.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from utils import read_img, draw_corner 3 | from HM1_Convolve import convolve, Sobel_filter_x,Sobel_filter_y,padding 4 | 5 | 6 | 7 | def corner_response_function(input_img, window_size, alpha, threshold): 8 | """ 9 | The function you need to implement for Q3. 10 | Inputs: 11 | input_img: array(float) 12 | window_size: int 13 | alpha: float 14 | threshold: float 15 | Outputs: 16 | corner_list: array 17 | """ 18 | 19 | # please solve the corner_response_function of each window, 20 | # and keep windows with theta > threshold. 21 | # you can use several functions from HM1_Convolve to get 22 | # I_xx, I_yy, I_xy as well as the convolution result. 23 | # for detials of corner_response_function, please refer to the slides. 24 | 25 | Ix = Sobel_filter_x(input_img) 26 | Iy = Sobel_filter_y(input_img) 27 | 28 | window = np.ones((window_size, window_size)) 29 | a11 = convolve(Ix**2, window) 30 | a22 = convolve(Iy**2, window) 31 | a12 = convolve(Ix*Iy, window) 32 | a21 = a12 33 | 34 | tr = a11 + a22 35 | det = a11 * a22 - a12 * a21 36 | theta = det - alpha * (tr**2) 37 | theta[theta < threshold] = 0 38 | 39 | rows, cols = np.nonzero(theta) 40 | vals = theta[rows, cols] 41 | corner_list = np.column_stack((rows, cols, vals)) 42 | 43 | return corner_list # array, each row contains information about one corner, namely (index of row, index of col, theta) 44 | 45 | 46 | 47 | if __name__=="__main__": 48 | 49 | #Load the input images 50 | input_img = read_img("hand_writting.png")/255. 51 | 52 | #you can adjust the parameters to fit your own implementation 53 | window_size = 5 54 | alpha = 0.04 55 | threshold = 10 56 | 57 | corner_list = corner_response_function(input_img,window_size,alpha,threshold) 58 | 59 | # NMS 60 | corner_list_sorted = sorted(corner_list, key = lambda x: x[2], reverse = True) 61 | NML_selected = [] 62 | NML_selected.append(corner_list_sorted[0][:-1]) 63 | dis = 10 64 | for i in corner_list_sorted : 65 | for j in NML_selected : 66 | if(abs(i[0] - j[0]) <= dis and abs(i[1] - j[1]) <= dis) : 67 | break 68 | else : 69 | NML_selected.append(i[:-1]) 70 | 71 | 72 | #save results 73 | draw_corner("hand_writting.png", "result/HM1_HarrisCorner.png", NML_selected) 74 | -------------------------------------------------------------------------------- /计算机视觉导论/HW1/HM1_RANSAC.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from utils import draw_save_plane_with_points, normalize 3 | 4 | 5 | if __name__ == "__main__": 6 | 7 | 8 | np.random.seed(0) 9 | # load data, total 130 points inlcuding 100 inliers and 30 outliers 10 | # to simplify this problem, we provide the number of inliers and outliers here 11 | 12 | noise_points = np.loadtxt("HM1_ransac_points.txt") 13 | 14 | 15 | #RANSAC 16 | # Please formulate the palnace function as: A*x+B*y+C*z+D=0 17 | 18 | INLIER = 100 19 | OUTLIER = 30 20 | TOTAL = INLIER + OUTLIER 21 | PROB = 0.001 22 | SAMPLE_SIZE = 3 23 | fail_p = 1 - ((INLIER - SAMPLE_SIZE) / TOTAL) ** SAMPLE_SIZE 24 | t = np.log(PROB) / np.log(fail_p) 25 | t = int(t) + 1 26 | 27 | sample_time = t # the minimal time that can guarantee the probability of at least one hypothesis does not contain any outliers is larger than 99.9% 28 | distance_threshold = 0.05 29 | 30 | # sample points group 31 | indices = np.random.choice(TOTAL, (sample_time, SAMPLE_SIZE), replace=False) # (N, 3) (denote N as `sample_time`) 32 | samples = noise_points[indices] # (N, 3, 3) 33 | 34 | # estimate the plane with sampled points group 35 | p0 = samples[:, 0] # (N, 3) 36 | p1 = samples[:, 1] # (N, 3) 37 | p2 = samples[:, 2] # (N, 3) 38 | 39 | v1 = p1 - p0 # (N, 3) 40 | v2 = p2 - p0 # (N, 3) 41 | normal = np.cross(v1, v2) # (N, 3) 42 | D = -np.sum(normal * p0, axis=1, keepdims=True) # (N, 1) 43 | plane = np.hstack((normal, D)) # (N, 4) 44 | 45 | norm = np.linalg.norm(normal, axis=1, keepdims=True) # (N, 1) 46 | plane = plane / norm # (N, 4) 47 | 48 | #evaluate inliers (with point-to-plance distance < distance_threshold) 49 | point = np.vstack((noise_points.T, np.ones((1, TOTAL)))) # (4, TOTAL) 50 | distance = np.abs(plane @ point) # (N, TOTAL) 51 | inlier_cnt = np.sum(distance < distance_threshold, axis=1) # (N,) 52 | 53 | best_sample = np.argmax(inlier_cnt) # int 54 | best_plane = plane[best_sample] # (4,) 55 | inlier_idx = distance[best_sample] < distance_threshold # (TOTAL,) 56 | inlier = noise_points[inlier_idx] # (M, 3) (denote M as inlier number) 57 | 58 | # minimize the sum of squared perpendicular distances of all inliers with least-squared method 59 | A = np.hstack((inlier, np.ones((inlier.shape[0], 1)))) # (M, 4) 60 | U, S, Vt = np.linalg.svd(A) 61 | pf = Vt[-1] 62 | 63 | # draw the estimated plane with points and save the results 64 | # check the utils.py for more details 65 | # pf: [A,B,C,D] contains the parameters of palnace function A*x+B*y+C*z+D=0 66 | pf = normalize(pf) 67 | draw_save_plane_with_points(pf, noise_points,"result/HM1_RANSAC_fig.png") 68 | np.savetxt("result/HM1_RANSAC_plane.txt", pf) 69 | np.savetxt('result/HM1_RANSAC_sample_time.txt', np.array([sample_time])) 70 | -------------------------------------------------------------------------------- /计算机视觉导论/HW1/HM1_ransac_points.txt: -------------------------------------------------------------------------------- 1 | -4.093493911942476249e-01 -7.016740857210204130e-01 7.124552243345759095e+00 2 | -1.595510154708845718e-01 -5.226357175071079109e-01 6.636144289736422230e+00 3 | 9.814249292617573950e-01 -5.245470921999544345e-01 8.647624290948501269e+00 4 | 3.392004764932596839e-01 2.424858388013939603e-01 3.551161541559510137e+00 5 | -6.755718021005385765e-02 -7.632644977534328579e-01 8.042915113873814192e+00 6 | 8.015483583213673935e-01 5.879251209592568639e-01 2.574406684379292098e+00 7 | 6.304149149058813073e-01 9.819097026608203382e-01 2.351012602605501989e-01 8 | 6.275338340729754716e-01 -1.573642452015624471e-01 6.126425296677871835e+00 9 | -9.172671368306017925e-02 -7.893478293698137360e-01 8.135510855553143017e+00 10 | 3.954554691912652853e-01 1.305708026794529797e-01 4.229071113484499378e+00 11 | 9.969474873792987246e-01 -7.239158938881280481e-01 9.706699924799973900e+00 12 | -2.992739832313495718e-02 -1.899459282133864058e-01 5.141684729400392229e+00 13 | -3.543721490312203848e-01 -1.989089001664299250e-01 4.618907226988190118e+00 14 | 8.944436587850830289e-01 8.374167245288686168e-01 1.446112517142235543e+00 15 | -9.318458169587964246e-01 8.867457382899297524e-01 -2.013009812378455887e+00 16 | 6.131821012463527509e-01 -3.744391559397897140e-02 5.480593779527975329e+00 17 | -1.660418312060243373e-01 -3.623197481576514445e-01 5.795033025393438564e+00 18 | -9.236361486330524340e-01 -8.938206991100199339e-01 7.216816860070910167e+00 19 | -9.332336810854904297e-01 -5.471578152009299867e-01 5.405806314202616036e+00 20 | -6.427483800255968660e-01 -6.413104322679330505e-01 6.402690242199017057e+00 21 | 3.660262511361862536e-01 -6.198289875945173222e-02 5.174016945830143932e+00 22 | 3.376281171341732890e-01 -1.174636454868274171e-01 5.411342575123315513e+00 23 | -7.668676246574279709e-02 9.265337459489062510e-01 -7.187493027501985488e-01 24 | 8.136262539331868826e-01 -4.150327800234387965e-03 5.659915405632943042e+00 25 | 3.693159758129740400e-01 -6.450986719763567301e-01 8.197737463859862572e+00 26 | -3.582244637263665155e-02 -8.613164117679148468e-01 8.606059975045667443e+00 27 | -2.769916133554026771e-01 -5.587300094517066995e-02 4.014363527307842183e+00 28 | -6.494403192244611045e-01 8.982592049585138572e-01 -1.577181027001511637e+00 29 | -7.300089369518836246e-01 8.555716523643084326e-01 -1.497588780892987748e+00 30 | -8.944479285025028759e-01 -5.926329653171780176e-01 5.709206529323609836e+00 31 | 3.476961279213168776e-01 -4.054549797557263080e-01 6.919520469576315058e+00 32 | 2.366805416348829461e-01 -5.790015083726365308e-01 7.622968510179772395e+00 33 | -8.817858375440874585e-01 -3.835533901720917793e-01 4.649315900010595470e+00 34 | 9.443816575995147566e-01 8.188371623879049377e-01 1.629877186449934401e+00 35 | -7.696277921969223446e-01 9.159613590201922673e-01 -1.879641639153612376e+00 36 | 2.595929333205231337e-01 8.058010882453343626e-01 4.960372057055386086e-01 37 | 3.056085837507123149e-01 8.503170304767160292e-01 3.463665560824649159e-01 38 | 5.427283520890555657e-01 7.923294515041858777e-01 1.062458323223074208e+00 39 | -6.978798518301478904e-01 -2.501605077597046645e-01 4.281555312053511031e+00 40 | -8.185853724024338973e-02 6.447633802524177504e-02 3.733805976942609295e+00 41 | 3.197239231462671860e-01 -4.695313833226588685e-02 5.015002453521211656e+00 42 | -7.504049406846975412e-01 -1.750555269853173446e-01 3.800701595449464953e+00 43 | -3.065182419257108659e-01 9.487485873355130384e-01 -1.236911520546803533e+00 44 | 3.656858195469141481e-01 -9.363800125330685731e-01 9.698912600291896169e+00 45 | 4.033046878742911900e-01 9.318875542112343702e-01 9.557959374285235343e-02 46 | -5.653091576142714736e-01 4.384524706735408728e-01 9.501646770198479697e-01 47 | -1.625840949674037805e-01 -4.375497616863985861e-01 6.190456140430478094e+00 48 | -1.473075645931936073e-01 6.811550107066177695e-01 4.273341109619922529e-01 49 | 9.733048976012295128e-01 -5.334133505142995002e-01 8.679267341222693943e+00 50 | 3.217840548880419593e-01 -8.444865850614264868e-01 9.146297003355162047e+00 51 | -4.693875129285549619e-01 8.036767229376042820e-01 -7.718014659439682568e-01 52 | -2.015336094471198436e-01 6.405708479993270643e-01 5.422523040804370087e-01 53 | 4.505014021523301437e-02 -1.750503358654220687e-01 5.196123081707690439e+00 54 | 6.507609050243590154e-01 2.059343346310971157e-03 5.342065998457545817e+00 55 | -9.768153596569824071e-01 8.263008768417237082e-01 -1.779062957034878600e+00 56 | 6.861642201781477102e-01 -8.103066104417031568e-01 9.608620218358755238e+00 57 | -8.755436953770123765e-01 2.709889546510497738e-01 1.272644559392374974e+00 58 | -2.051355402658692206e-01 3.191735542279339199e-01 2.199343814499649330e+00 59 | 7.797312415900752303e-01 9.732632380525423343e-01 5.417936983612113844e-01 60 | 2.829733123085871327e-01 -4.956872264413560991e-01 7.272980953691627448e+00 61 | -4.638866464031097259e-01 7.365211016996009441e-01 -4.145836195339991925e-01 62 | 9.460313979507162241e-01 -5.728881014251976378e-01 8.835725932758158763e+00 63 | 4.735384452557347412e-01 -9.742173610337760969e-01 1.008394534077708293e+01 64 | 4.676466841161115440e-01 -3.486228189673479250e-03 5.049534404748601268e+00 65 | -9.821400734862915094e-01 7.014060560829165070e-01 -1.142003605915757225e+00 66 | 4.470140932602686412e-01 3.231002061563634786e-01 3.323072139084044085e+00 67 | -2.236093041243465418e-01 -1.476376669662644581e-01 4.582944210815231401e+00 68 | -6.198232526207214654e-02 6.400652331279581553e-01 7.896807162301925365e-01 69 | -2.064719871316940125e-01 -7.433083117621519520e-01 7.695935702508587717e+00 70 | -5.880323984525659409e-01 4.952565885157493852e-01 6.163088246823343885e-01 71 | -2.386931081660759180e-01 -7.881479892010090360e-02 4.200286307591500012e+00 72 | 6.290422132022748247e-01 -9.500547205878282497e-01 1.023168684127371364e+01 73 | 2.091029683694811681e-01 3.287655648329512736e-02 4.407779479173815851e+00 74 | 5.996221059777138152e-01 -6.534380791441025682e-01 8.644919237549062885e+00 75 | -4.836570655071685820e-01 -8.978672765090882635e-01 8.009605231104842460e+00 76 | -2.963036333300754777e-01 8.339750903747600308e-01 -6.249753944651211812e-01 77 | -7.909241537897169216e-01 -6.949493074203605403e-01 6.420360030092592929e+00 78 | 5.631028779323972167e-01 -2.137800575429986694e-01 6.305378870096840949e+00 79 | -1.338641060742147282e-01 -8.368930210054166263e-01 8.307663098681338454e+00 80 | -1.382308746844451708e-01 3.256736616288096187e-01 2.283071431691384934e+00 81 | 1.602518160775032730e-01 -1.379427831009638616e-02 4.563628644972565596e+00 82 | 5.788332041251282867e-01 5.621414811712441839e-01 2.317147387630724698e+00 83 | 8.802806367579714131e-01 7.554335504077556163e-01 1.845575319122639169e+00 84 | 8.737902858634709613e-01 3.475740977997416881e-01 3.945089648182517283e+00 85 | -3.099827991713846043e-01 -8.328681399978512534e-01 7.977871165754517158e+00 86 | -9.647698889793576704e-01 1.048215607712910113e-01 1.976126086074278643e+00 87 | 3.568893330009750287e-01 -6.589534458371342218e-01 8.247643877231860543e+00 88 | -5.880519107800727951e-01 -4.970465237296901595e-01 5.751996778922261022e+00 89 | 7.931700776478105563e-01 -7.543172955922807787e-01 9.506562166879472642e+00 90 | 8.959621692281130034e-01 -8.017084576393007644e-02 6.197803977633662420e+00 91 | 1.542831906982473633e-01 -2.330378749279251593e-01 5.687865946667712613e+00 92 | 2.974339400007723899e-01 -5.019048172906548366e-01 7.330528397892867254e+00 93 | 8.008389422991397666e-01 8.151201040589923785e-01 1.397301389023562379e+00 94 | -6.500101187289402116e-01 -1.650941657352076319e-01 3.925266295677646955e+00 95 | 4.743006370550115758e-01 -2.568500101821757919e-01 6.372506196117471156e+00 96 | 8.739610530445438563e-01 6.261070358635809630e-01 2.503825880794252168e+00 97 | -4.871824076846382745e-01 1.585735719176739611e-01 2.535750055625699773e+00 98 | 5.558438723140184390e-01 5.926552566449649895e-02 4.879481347661756452e+00 99 | 5.288422037012436849e-01 -6.153688763251490279e-01 8.323722338356814632e+00 100 | -9.999180118553239183e-01 8.938417218915548634e-01 -2.169152954921437004e+00 101 | -7.223436012489656832e-01 1.435125180955743041e-02 1.932463641769612828e-01 102 | 2.719848266550106697e-01 -7.317894477938731157e-01 9.437863321307597975e-01 103 | 7.483763092415236517e-01 -1.518094543556636200e-01 1.356778120577999402e-01 104 | -1.035623936824066060e-01 4.179363232567026021e-01 -5.357628711024875479e-02 105 | 2.518675860285004564e-01 -7.208603324530384882e-01 3.673466699852490081e-01 106 | 8.881398787008709661e-01 -3.425340688266236278e-01 -6.318940117588740524e-01 107 | 4.587188387776621745e-01 -7.964228364880931998e-02 1.453515108243530474e-01 108 | -5.410563877195340154e-02 -6.721704535740018471e-01 5.226060856176302227e-01 109 | -3.191292856089216201e-01 7.652519759020741663e-01 -5.745503603341730603e-01 110 | 8.928846989295806669e-01 -4.066759547938572084e-01 -8.042964851486704703e-01 111 | -4.541043998186251596e-01 5.868272095072561978e-01 1.887659275150450622e-01 112 | 5.658858742677685960e-01 7.124763561350113683e-01 3.128043082991776025e-01 113 | -8.819446044519885231e-01 -3.982128287215602747e-01 -9.902839266516390015e-01 114 | 3.657252131852484212e-01 9.203789192124167684e-01 7.051991674226099072e-01 115 | -6.229975983929292305e-01 -3.373400105921451342e-01 7.141359059571352752e-01 116 | 6.936429067630272005e-01 5.275739302957438426e-01 -8.646954531197412752e-01 117 | -8.716422949955813237e-01 4.033892337623803392e-01 -2.264269547452966158e-01 118 | -7.686822979282332824e-01 8.354270499048666032e-01 1.375767800318050682e-02 119 | 3.666227053908954758e-04 6.949347826944829443e-02 7.769568397052233344e-01 120 | -6.814654934627735194e-01 -2.446708303843749821e-01 -8.353434944166291398e-01 121 | 6.718383172823199079e-01 5.199432557456500348e-01 -9.850631643565821438e-01 122 | -2.139928384656539784e-01 8.803255482665193199e-01 -6.269300381664659749e-01 123 | 1.128219908534240368e-01 1.240070835008697525e-01 -7.851731169034164015e-01 124 | 7.090792952321638420e-01 7.561292790256772811e-01 2.904853008974372930e-01 125 | 9.237846872526218611e-01 -7.680949437337749597e-01 9.450959204369175914e-01 126 | 2.429661005824994557e-01 6.689887944807553222e-01 -5.278742136392562401e-01 127 | -1.252741900752125659e-01 -6.461507993342003875e-01 -6.697778980912483249e-01 128 | -6.489328073689237808e-01 8.021713835391861558e-01 -4.375658201273211478e-01 129 | 8.961653112442458102e-01 -7.452500947817106702e-01 4.851259464572572622e-01 130 | 4.019621263319785864e-01 2.782440241978336726e-01 -8.396330160188971714e-01 131 | -------------------------------------------------------------------------------- /计算机视觉导论/HW1/Lenna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW1/Lenna.png -------------------------------------------------------------------------------- /计算机视觉导论/HW1/hand_writting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW1/hand_writting.png -------------------------------------------------------------------------------- /计算机视觉导论/HW1/pack.py: -------------------------------------------------------------------------------- 1 | import os 2 | import zipfile 3 | 4 | def zipDir(dirpath, outFullName): 5 | zip = zipfile.ZipFile(outFullName, "w", zipfile.ZIP_DEFLATED) 6 | for path, dirnames, filenames in os.walk(dirpath): 7 | # 去掉目标跟路径,只对目标文件夹下边的文件及文件夹进行压缩 8 | fpath = path.replace(dirpath, '') 9 | 10 | for filename in filenames: 11 | print(filename) 12 | if filename.endswith('.zip'): 13 | continue 14 | zip.write(os.path.join(path, filename), os.path.join(fpath, filename)) 15 | zip.close() 16 | 17 | 18 | if __name__ == "__main__": 19 | 20 | # --------------------------------------------------------- 21 | # 请用你的学号和姓名替换下面的内容,注意参照例子的格式,使用拼音而非中文 22 | id = 2000010000 23 | name = 'ZhangSan' 24 | # --------------------------------------------------------- 25 | 26 | zip_name = f'{id}_{name}.zip' 27 | current_file_directory_path = os.path.dirname(os.path.abspath(__file__)) 28 | input_path = current_file_directory_path 29 | output_path = os.path.join(current_file_directory_path, zip_name) 30 | 31 | zipDir(input_path, output_path) -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_Canny_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW1/result/HM1_Canny_result.png -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_Convolve_img_blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW1/result/HM1_Convolve_img_blur.png -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_Convolve_img_gadient_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW1/result/HM1_Convolve_img_gadient_x.png -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_Convolve_img_gadient_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW1/result/HM1_Convolve_img_gadient_y.png -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_Convolve_replicate_pad.txt: -------------------------------------------------------------------------------- 1 | 6.121701756176186615e-01 6.121701756176186615e-01 1.690697543456364249e-01 4.360590193711701978e-01 7.692624725231228533e-01 2.953253044028761876e-01 1.491629571394897935e-01 1.491629571394897935e-01 2 | 6.121701756176186615e-01 6.121701756176186615e-01 1.690697543456364249e-01 4.360590193711701978e-01 7.692624725231228533e-01 2.953253044028761876e-01 1.491629571394897935e-01 1.491629571394897935e-01 3 | 2.247832454416176517e-02 2.247832454416176517e-02 4.202244922645577141e-01 2.386821412464460446e-01 3.376561918887923675e-01 9.907124646308786975e-01 2.377264539000227828e-01 2.377264539000227828e-01 4 | 8.119265945121156847e-02 8.119265945121156847e-02 6.696002382466298419e-01 6.212429194006969801e-01 2.742535302065184366e-01 4.662214098949730712e-01 1.183677511232835711e-01 1.183677511232835711e-01 5 | 7.395756414320420191e-02 7.395756414320420191e-02 9.007741791606836967e-01 7.939625604796284319e-01 8.405696487242811932e-01 8.152074574529406537e-01 9.909548513304101691e-01 9.909548513304101691e-01 6 | 5.772738296076793674e-01 5.772738296076793674e-01 8.137669170364877358e-01 4.213178773992187764e-01 2.744795981315373279e-02 4.541366431584699104e-01 1.053260853150931320e-01 1.053260853150931320e-01 7 | 8.172200615549912728e-01 8.172200615549912728e-01 6.977277345956326426e-01 5.652854013397264898e-01 2.742272954485119874e-01 9.984737436896493623e-01 1.380420530559359760e-01 1.380420530559359760e-01 8 | 8.172200615549912728e-01 8.172200615549912728e-01 6.977277345956326426e-01 5.652854013397264898e-01 2.742272954485119874e-01 9.984737436896493623e-01 1.380420530559359760e-01 1.380420530559359760e-01 9 | -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_Convolve_result_1.txt: -------------------------------------------------------------------------------- 1 | 6.726929099524359135e-01 1.299302001764504944e+00 1.242277848380564098e+00 1.990147764064087443e+00 1.979515410581911272e+00 8.042878141780547274e-01 2 | 1.233052743124086525e+00 2.113876763734376940e+00 2.199275198995008118e+00 2.326898746813730767e+00 1.975711725876759361e+00 1.312757340422121555e+00 3 | 1.373123590780443104e+00 2.444661726762888065e+00 3.120520693998054096e+00 3.237767655645754861e+00 3.132839976693769124e+00 2.301233400731500289e+00 4 | 1.989684052026016836e+00 2.631015404889353260e+00 2.756966696140569884e+00 2.457542757960983870e+00 2.250434181206241391e+00 1.502196161584189449e+00 5 | 2.328109733508479273e+00 3.096520763029277923e+00 3.029142896424832365e+00 3.081291009456641028e+00 2.682901772749619607e+00 1.796120230915411842e+00 6 | 1.152878120400029349e+00 1.967086661250722068e+00 1.516439580734680881e+00 1.356437579617560063e+00 8.570340226429324915e-01 1.101869898510777102e+00 7 | -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_Convolve_result_2.txt: -------------------------------------------------------------------------------- 1 | 2.113876763734377384e+00 2.199275198995008562e+00 2.326898746813730767e+00 1.975711725876758917e+00 2 | 2.444661726762888510e+00 3.120520693998053652e+00 3.237767655645754861e+00 3.132839976693769124e+00 3 | 2.631015404889353260e+00 2.756966696140569439e+00 2.457542757960983870e+00 2.250434181206241391e+00 4 | 3.096520763029277923e+00 3.029142896424831921e+00 3.081291009456641028e+00 2.682901772749619607e+00 5 | -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_Convolve_zero_pad.txt: -------------------------------------------------------------------------------- 1 | 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 2 | 0.000000000000000000e+00 6.121701756176186615e-01 1.690697543456364249e-01 4.360590193711701978e-01 7.692624725231228533e-01 2.953253044028761876e-01 1.491629571394897935e-01 0.000000000000000000e+00 3 | 0.000000000000000000e+00 2.247832454416176517e-02 4.202244922645577141e-01 2.386821412464460446e-01 3.376561918887923675e-01 9.907124646308786975e-01 2.377264539000227828e-01 0.000000000000000000e+00 4 | 0.000000000000000000e+00 8.119265945121156847e-02 6.696002382466298419e-01 6.212429194006969801e-01 2.742535302065184366e-01 4.662214098949730712e-01 1.183677511232835711e-01 0.000000000000000000e+00 5 | 0.000000000000000000e+00 7.395756414320420191e-02 9.007741791606836967e-01 7.939625604796284319e-01 8.405696487242811932e-01 8.152074574529406537e-01 9.909548513304101691e-01 0.000000000000000000e+00 6 | 0.000000000000000000e+00 5.772738296076793674e-01 8.137669170364877358e-01 4.213178773992187764e-01 2.744795981315373279e-02 4.541366431584699104e-01 1.053260853150931320e-01 0.000000000000000000e+00 7 | 0.000000000000000000e+00 8.172200615549912728e-01 6.977277345956326426e-01 5.652854013397264898e-01 2.742272954485119874e-01 9.984737436896493623e-01 1.380420530559359760e-01 0.000000000000000000e+00 8 | 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 9 | -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_HarrisCorner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW1/result/HM1_HarrisCorner.png -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_RANSAC_fig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW1/result/HM1_RANSAC_fig.png -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_RANSAC_plane.txt: -------------------------------------------------------------------------------- 1 | 2.521511431554123162e-01 2 | -7.429045891115706457e-01 3 | -1.433801776492190649e-01 4 | 6.032865796117676815e-01 5 | -------------------------------------------------------------------------------- /计算机视觉导论/HW1/result/HM1_RANSAC_sample_time.txt: -------------------------------------------------------------------------------- 1 | 1.300000000000000000e+01 2 | -------------------------------------------------------------------------------- /计算机视觉导论/HW1/utils.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import matplotlib.pyplot as plt 3 | from mpl_toolkits.mplot3d import Axes3D 4 | import numpy as np 5 | 6 | def read_img(path): 7 | return cv2.imread(path, cv2.IMREAD_GRAYSCALE) 8 | 9 | def write_img(path, img): 10 | cv2.imwrite(path, img) 11 | 12 | def draw_corner(img_path, save_path, coner_list): 13 | vis_img = cv2.imread(img_path) 14 | for point in coner_list: 15 | cv2.circle(vis_img, (int(point[1]), int(point[0])), 2, (0,0,255), -1) 16 | 17 | write_img(save_path, vis_img) 18 | 19 | 20 | def plane_func(pf, p_xy): 21 | return (pf[0]*p_xy[:,0] + pf[1]*p_xy[:,1] + pf[3])/-pf[2] 22 | 23 | def draw_save_plane_with_points(estimated_pf, p, path): # plane function: pf[0]*x+pf[1]*y+pf[2]*z+pf[3]=0 24 | fig = plt.figure() 25 | ax = fig.add_subplot(111, projection='3d') 26 | ax.scatter(p[:,0], p[:,1], p[:,2], c="g", s=10) 27 | x = np.linspace(-1, 1, 100) 28 | y = np.linspace(-1, 1, 100) 29 | x, y = np.meshgrid(x, y) 30 | estimated_plane_z = plane_func(estimated_pf, np.concatenate((x.reshape(-1,1), y.reshape(-1,1)),axis=1)) 31 | ax.plot_surface(x, y, estimated_plane_z.reshape(100, 100), alpha=0.5) 32 | ax.view_init(elev=45, azim=315) 33 | plt.savefig(path) 34 | # plt.show() 35 | plt.clf() 36 | 37 | def normalize(pf): 38 | return pf / np.linalg.norm(pf) * np.sign(pf[0]) 39 | 40 | -------------------------------------------------------------------------------- /计算机视觉导论/HW2/BP.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import cv2 3 | import os 4 | 5 | 6 | def read_img(path): 7 | return cv2.imread(path, cv2.IMREAD_GRAYSCALE) 8 | 9 | 10 | if __name__ == "__main__": 11 | 12 | #input 13 | input_vector = np.zeros((10,784)) 14 | for i in range(10): 15 | input_vector[i,:] = read_img("mnist_subset/"+str(i)+".png").reshape(-1)/255. 16 | gt_y = np.zeros((10,1)) 17 | gt_y[0] =1 18 | 19 | np.random.seed(14) 20 | 21 | #Intialization MLP (784 -> 16 -> 1) 22 | MLP_layer_1 = np.random.randn(784,16) 23 | MLP_layer_2 = np.random.randn(16,1) 24 | lr=1e-1 25 | loss_list=[] 26 | 27 | for i in range(50): 28 | #Forward 29 | output_layer_1 = input_vector.dot(MLP_layer_1) 30 | output_layer_1_act = 1 / (1 + np.exp(-output_layer_1)) #sigmoid activation function 31 | output_layer_2 = output_layer_1_act.dot(MLP_layer_2) 32 | pred_y = 1 / (1 + np.exp(-output_layer_2)) #sigmoid activation function 33 | loss = -(gt_y * np.log(pred_y) + (1 - gt_y) * np.log(1 - pred_y)).sum() #cross-entroy loss 34 | print("iteration: %d, loss: %f" % (i + 1 ,loss)) 35 | loss_list.append(loss) 36 | 37 | 38 | # Backward : compute the gradient of paratmerters of layer1 (grad_layer_1) and layer2 (grad_layer_2) 39 | 40 | grad_output_layer_2 = pred_y - gt_y 41 | grad_layer_2 = output_layer_1_act.T.dot(grad_output_layer_2) 42 | grad_output_layer_1_act = grad_output_layer_2.dot(MLP_layer_2.T) 43 | grad_output_layer_1 = grad_output_layer_1_act * (output_layer_1_act * (1 - output_layer_1_act)) 44 | grad_layer_1 = input_vector.T.dot(grad_output_layer_1) 45 | 46 | MLP_layer_1 -= lr * grad_layer_1 47 | MLP_layer_2 -= lr * grad_layer_2 48 | 49 | os.makedirs("results", exist_ok=True) 50 | np.savetxt("results/BP.txt", loss_list) -------------------------------------------------------------------------------- /计算机视觉导论/HW2/README.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | - We recommand using [Anaconda](https://www.anaconda.com/) to manage your python environments. Use the following command to create a new environment. Please change the 3.x bellow to your python version. Note that, we only test the code on python version higher than 3.7. 4 | ```bash 5 | conda create -n hw2 python=3.x 6 | conda activate hw2 7 | ``` 8 | 9 | - We recommand using [Tsinghua Mirror](https://mirrors.tuna.tsinghua.edu.cn/) to install dependent packages. 10 | 11 | ```bash 12 | # pip 13 | python -m pip install --upgrade pip 14 | pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple 15 | 16 | # conda 17 | conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch 18 | conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main 19 | conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 20 | conda config --set show_channel_urls yes 21 | ``` 22 | 23 | - Now you can install [pytorch](https://pytorch.org/get-started/previous-versions/) and other dependencies as below. 24 | ```bash 25 | conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cpuonly # remember to remove "-c pytorh"! 26 | 27 | # tips: try "pip install xxx" first before "conda install xxx" 28 | pip install opencv-python 29 | pip install pillow 30 | pip install tensorboardx 31 | pip install tensorflow # for tensorboardx 32 | ``` 33 | The specific version of pytorch should make no difference for this assignment, since we only use some basic functions. You can also install the GPU version if you can access a GPU. 34 | 35 | # CIFAR-10 36 | 37 | ## Dataset 38 | - Download cifar-10 dataset from [here](https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz) and save to `datasets`. Then unzip it. 39 | 40 | ```bash 41 | cd datasets 42 | wget https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz 43 | tar -zxvf cifar-10-python.tar.gz 44 | ``` 45 | 46 | ## Visualization 47 | - Visualize the structure of your network 48 | ```bash 49 | cd cifar-10 50 | python network.py 51 | cd ../experiments 52 | tensorboard --logdir . 53 | ``` 54 | 55 | - Visualize and check the input data 56 | ```bash 57 | cd cifar-10 58 | python dataset.py 59 | ``` 60 | 61 | - Train network and visualize the curves 62 | ```bash 63 | cd cifar-10 64 | python train.py 65 | cd ../experiments 66 | tensorboard --logdir . 67 | ``` 68 | 69 | # Submission 70 | - Compress the entire folder **except** `datasets` and `experiments`. 71 | 72 | - Rename the compressed folder to **Name_ID.zip** and submit to [course.pku.edu.cn](https://course.pku.edu.cn/). 73 | 74 | - The folder named `results` should be structed as follows. 75 | ```bash 76 | results 77 | ├── bn_loss.txt 78 | ├── Lenna.png 79 | ├── Lenna_aug1.png 80 | ├── Lenna_aug2.png 81 | ├── Screenshot_LearningRate.png 82 | └── Screenshot_YourBest.png 83 | 84 | ``` 85 | 86 | # Appendix 87 | We list some libraries that may help you solve this assignment. 88 | 89 | - [TensorboardX](https://pytorch.org/docs/stable/tensorboard.html) 90 | - [OpenCV-Python](https://docs.opencv.org/4.x/d6/d00/tutorial_py_root.html) 91 | - [Pillow (PIL)](https://pillow.readthedocs.io/en/stable/) 92 | - [Torchvision.transforms](https://pytorch.org/vision/0.9/transforms.html) 93 | -------------------------------------------------------------------------------- /计算机视觉导论/HW2/batch_normalization/bn.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import cv2 3 | import os 4 | 5 | 6 | # eps may help you to deal with numerical problem 7 | eps = 1e-5 8 | def bn_forward_test(x, gamma, beta, mean, var): 9 | 10 | #----------------TODO------------------ 11 | # Implement forward 12 | x_hat = (x - mean) / np.sqrt(var + eps) 13 | out = gamma * x_hat + beta 14 | #----------------TODO------------------ 15 | 16 | return out 17 | 18 | def bn_forward_train(x, gamma, beta): 19 | 20 | #----------------TODO------------------ 21 | # Implement forward 22 | sample_mean = np.mean(x, axis=0) 23 | sample_var = np.var(x, axis=0) 24 | x_hat = (x - sample_mean) / np.sqrt(sample_var + eps) 25 | out = gamma * x_hat + beta 26 | #----------------TODO------------------ 27 | 28 | # save intermidiate variables for computing the gradient when backward 29 | cache = (gamma, x, sample_mean, sample_var, x_hat) 30 | return out, cache 31 | 32 | def bn_backward(dout, cache): 33 | 34 | #----------------TODO------------------ 35 | # Implement backward 36 | #----------------TODO------------------ 37 | gamma, x, mean, var, x_hat = cache 38 | B = x.shape[0] 39 | 40 | dgamma = np.sum(dout * x_hat, axis=0) 41 | dbeta = np.sum(dout, axis=0) 42 | 43 | dx_hat = dout * gamma 44 | t = np.einsum('kj,ij->kij', x_hat, x_hat) 45 | t = (1 + t) / B 46 | t = np.einsum('kj,kij->ij', dx_hat, t) 47 | dx = (dx_hat - t) / np.sqrt(var + eps) 48 | 49 | return dx, dgamma, dbeta 50 | 51 | # This function may help you to check your code 52 | def print_info(x): 53 | print('mean:', np.mean(x,axis=0)) 54 | print('var:',np.var(x,axis=0)) 55 | print('------------------') 56 | return 57 | 58 | if __name__ == "__main__": 59 | HW_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 60 | 61 | # input data 62 | train_data = np.zeros((9,784)) 63 | for i in range(9): 64 | train_data[i,:] = cv2.imread(os.path.join(HW_dir, "mnist_subset", f"{i}.png"), cv2.IMREAD_GRAYSCALE).reshape(-1)/255. 65 | gt_y = np.zeros((9,1)) 66 | gt_y[0] =1 67 | 68 | val_data = np.zeros((1,784)) 69 | val_data[0,:] = cv2.imread(os.path.join(HW_dir, "mnist_subset", "9.png"), cv2.IMREAD_GRAYSCALE).reshape(-1)/255. 70 | val_gt = np.zeros((1,1)) 71 | 72 | np.random.seed(14) 73 | 74 | # Intialize MLP (784 -> 16 -> 1) 75 | MLP_layer_1 = np.random.randn(784,16) 76 | MLP_layer_2 = np.random.randn(16,1) 77 | 78 | # Initialize gamma and beta 79 | gamma = np.random.randn(16) 80 | beta = np.random.randn(16) 81 | 82 | lr=1e-1 83 | loss_list=[] 84 | 85 | # ---------------- TODO ------------------- 86 | # compute mean and var for testing 87 | # add codes anywhere as you need 88 | # ---------------- TODO ------------------- 89 | mean = np.zeros(16) 90 | var = np.ones(16) 91 | 92 | # training 93 | for i in range(50): 94 | # Forward 95 | output_layer_1 = train_data.dot(MLP_layer_1) 96 | output_layer_1_bn, cache = bn_forward_train(output_layer_1, gamma, beta) 97 | output_layer_1_act = 1 / (1+np.exp(-output_layer_1_bn)) #sigmoid activation function 98 | output_layer_2 = output_layer_1_act.dot(MLP_layer_2) 99 | pred_y = 1 / (1+np.exp(-output_layer_2)) #sigmoid activation function 100 | 101 | r = 0.9 102 | mean = r * cache[2] + (1-r) * mean 103 | var = r * cache[3] + (1-r) * var 104 | 105 | # compute loss 106 | loss = -( gt_y * np.log(pred_y) + (1-gt_y) * np.log(1-pred_y)).sum() 107 | print("iteration: %d, loss: %f" % (i+1 ,loss)) 108 | loss_list.append(loss) 109 | 110 | # Backward : compute the gradient of paratmerters of layer1 (grad_layer_1) and layer2 (grad_layer_2) 111 | grad_pred_y = -(gt_y/pred_y) + (1-gt_y)/(1-pred_y) 112 | grad_activation_func = grad_pred_y * pred_y * (1-pred_y) 113 | grad_layer_2 = output_layer_1_act.T.dot(grad_activation_func) 114 | grad_output_layer_1_act = grad_activation_func.dot(MLP_layer_2.T) 115 | grad_output_layer_1_bn = grad_output_layer_1_act * (1-output_layer_1_act) * output_layer_1_act 116 | grad_output_layer_1, grad_gamma, grad_beta = bn_backward(grad_output_layer_1_bn, cache) 117 | grad_layer_1 = train_data.T.dot(grad_output_layer_1) 118 | 119 | # update parameters 120 | gamma -= lr * grad_gamma 121 | beta -= lr * grad_beta 122 | MLP_layer_1 -= lr * grad_layer_1 123 | MLP_layer_2 -= lr * grad_layer_2 124 | 125 | # validate 126 | output_layer_1 = val_data.dot(MLP_layer_1) 127 | output_layer_1_bn = bn_forward_test(output_layer_1, gamma, beta, mean, var) 128 | output_layer_1_act = 1 / (1+np.exp(-output_layer_1_bn)) #sigmoid activation function 129 | output_layer_2 = output_layer_1_act.dot(MLP_layer_2) 130 | pred_y = 1 / (1+np.exp(-output_layer_2)) #sigmoid activation function 131 | loss = -( val_gt * np.log(pred_y) + (1-val_gt) * np.log(1-pred_y)).sum() 132 | print("validation loss: %f" % (loss)) 133 | loss_list.append(loss) 134 | 135 | os.makedirs(os.path.join(os.path.join(HW_dir), "results"), exist_ok=True) 136 | np.savetxt(os.path.join(os.path.join(HW_dir), "results", "bn_loss.txt"), loss_list) -------------------------------------------------------------------------------- /计算机视觉导论/HW2/cifar-10/Lenna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/cifar-10/Lenna.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/cifar-10/dataset.py: -------------------------------------------------------------------------------- 1 | import os 2 | import os.path 3 | import numpy as np 4 | import pickle 5 | import torch 6 | import torchvision.transforms as tfs 7 | from PIL import Image 8 | 9 | class CIFAR10(torch.utils.data.Dataset): 10 | """ 11 | modified from `CIFAR10 `_ Dataset. 12 | """ 13 | def __init__(self, train=True): 14 | super(CIFAR10, self).__init__() 15 | 16 | self.base_folder = '../datasets/cifar-10-batches-py' 17 | self.train_list = ['data_batch_1', 'data_batch_2', 'data_batch_3', 'data_batch_4','data_batch_5'] 18 | self.test_list = ['test_batch'] 19 | 20 | self.meta = { 21 | 'filename': 'batches.meta', 22 | 'key': 'label_names' 23 | } 24 | 25 | self.train = train # training set or test set 26 | if self.train: 27 | file_list = self.train_list 28 | else: 29 | file_list = self.test_list 30 | 31 | self.data = [] 32 | self.targets = [] 33 | 34 | # now load the picked numpy arrays 35 | for file_name in file_list: 36 | file_path = os.path.join(self.base_folder, file_name) 37 | with open(file_path, 'rb') as f: 38 | entry = pickle.load(f, encoding='latin1') 39 | self.data.append(entry['data']) 40 | if 'labels' in entry: 41 | self.targets.extend(entry['labels']) 42 | else: 43 | self.targets.extend(entry['fine_labels']) 44 | 45 | self.data = np.vstack(self.data).reshape(-1, 3, 32, 32) 46 | self.data = self.data.transpose((0, 2, 3, 1)) # convert to HWC 47 | 48 | self._load_meta() 49 | 50 | def _load_meta(self): 51 | path = os.path.join(self.base_folder, self.meta['filename']) 52 | with open(path, 'rb') as infile: 53 | data = pickle.load(infile, encoding='latin1') 54 | self.classes = data[self.meta['key']] 55 | self.class_to_idx = {_class: i for i, _class in enumerate(self.classes)} 56 | 57 | def __getitem__(self, index): 58 | """ 59 | Args: 60 | index (int): Index 61 | 62 | Returns: 63 | tuple: (image, target) where target is index of the target class. 64 | """ 65 | img, target = self.data[index], self.targets[index] 66 | # img = img.astype(np.float32) 67 | # img = img.transpose(2, 0, 1) 68 | 69 | # ------------TODO-------------- 70 | # data augmentation 71 | transform = tfs.Compose([ 72 | tfs.ToPILImage(), 73 | tfs.RandomHorizontalFlip(), 74 | tfs.RandomRotation(10), 75 | tfs.ToTensor() 76 | ]) 77 | img = transform(img) 78 | # ------------TODO-------------- 79 | 80 | return img, target 81 | 82 | def __len__(self): 83 | return len(self.data) 84 | 85 | 86 | if __name__ == '__main__': 87 | # -------------------------------- 88 | # The resolution of CIFAR-10 is tooooo low 89 | # You can use Lenna.png as an example to visualize and check your code. 90 | # Submit the origin image "Lenna.png" as well as at least two augmented images of Lenna named "Lenna_aug1.png", "Lenna_aug2.png" ... 91 | # -------------------------------- 92 | 93 | # # Visualize CIFAR-10. For someone who are intersted. 94 | # train_dataset = CIFAR10() 95 | # i = 0 96 | # for imgs, labels in train_dataset: 97 | # imgs = imgs.transpose(1,2,0) 98 | # cv2.imwrite(f'aug1_{i}.png', imgs) 99 | # i += 1 100 | # if i == 10: 101 | # break 102 | 103 | # Visualize and save for submission 104 | img = Image.open('Lenna.png') 105 | img.save('../results/Lenna.png') 106 | 107 | # --------------TODO------------------ 108 | # Copy the first kind of your augmentation code here 109 | transform = tfs.RandomHorizontalFlip() 110 | # --------------TODO------------------ 111 | aug1 = transform(img) 112 | aug1.save(f'../results/Lenna_aug1.png') 113 | 114 | # --------------TODO------------------ 115 | # Copy the second kind of your augmentation code here 116 | transform = tfs.RandomRotation(10) 117 | # --------------TODO------------------ 118 | aug2 = transform(img) 119 | aug2.save(f'../results/Lenna_aug2.png') 120 | 121 | -------------------------------------------------------------------------------- /计算机视觉导论/HW2/cifar-10/network.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | 3 | 4 | class ConvNet(nn.Module): 5 | def __init__(self, num_class=10): 6 | super(ConvNet, self).__init__() 7 | pass 8 | # ----------TODO------------ 9 | # define a network 10 | wraped_conv_tuple = lambda in_channels, out_channels: ( 11 | nn.Conv2d(in_channels, out_channels, kernel_size=3, padding=1), 12 | nn.BatchNorm2d(out_channels), 13 | nn.ReLU(inplace=True) 14 | ) 15 | # Simplified vgg11_bn. 16 | self.features = nn.Sequential( 17 | *wraped_conv_tuple(3, 64), 18 | nn.MaxPool2d(kernel_size=2), 19 | *wraped_conv_tuple(64, 128), 20 | nn.MaxPool2d(kernel_size=2), 21 | *wraped_conv_tuple(128, 256), 22 | nn.MaxPool2d(kernel_size=2), 23 | *wraped_conv_tuple(256, 512), 24 | nn.MaxPool2d(kernel_size=2), 25 | *wraped_conv_tuple(512, 512) 26 | ) 27 | self.avgpool = nn.AdaptiveAvgPool2d((1, 1)) 28 | self.classifier = nn.Sequential( 29 | nn.Flatten(), 30 | nn.Linear(512, 128), 31 | nn.ReLU(inplace=True), 32 | nn.Dropout(), 33 | nn.Linear(128, 128), 34 | nn.ReLU(inplace=True), 35 | nn.Dropout(), 36 | nn.Linear(128, num_class), 37 | nn.Softmax() 38 | ) 39 | # ----------TODO------------ 40 | 41 | def forward(self, x): 42 | 43 | # ----------TODO------------ 44 | # network forwarding 45 | # ----------TODO------------ 46 | x = self.features(x) 47 | x = self.avgpool(x) 48 | x = self.classifier(x) 49 | return x 50 | 51 | 52 | if __name__ == '__main__': 53 | import torch 54 | from torch.utils.tensorboard import SummaryWriter 55 | from dataset import CIFAR10 56 | writer = SummaryWriter(log_dir='../experiments/network_structure') 57 | net = ConvNet() 58 | train_dataset = CIFAR10() 59 | train_loader = torch.utils.data.DataLoader( 60 | train_dataset, batch_size=2, shuffle=False, num_workers=2) 61 | # Write a CNN graph. 62 | # Please save a figure/screenshot to '../results' for submission. 63 | for imgs, labels in train_loader: 64 | writer.add_graph(net, imgs) 65 | writer.close() 66 | break 67 | -------------------------------------------------------------------------------- /计算机视觉导论/HW2/cifar-10/train.py: -------------------------------------------------------------------------------- 1 | import os 2 | import torch 3 | from dataset import CIFAR10 4 | from network import ConvNet 5 | import tqdm 6 | import torch.optim as optim 7 | from util import evaluate, AverageMeter 8 | import argparse 9 | from torch.utils.tensorboard import SummaryWriter 10 | 11 | 12 | def MyCELoss(pred, gt): 13 | # ----------TODO------------ 14 | # Implement CE loss here 15 | t = torch.zeros_like(pred) 16 | t[torch.arange(t.shape[0]), gt] = 1 17 | loss = -torch.sum(t * torch.log(pred + 1e-10), dim=1) 18 | loss = torch.mean(loss) 19 | # ----------TODO------------ 20 | return loss 21 | 22 | 23 | def validate(epoch, model, val_loader, writer): 24 | model.eval() 25 | top1 = AverageMeter() 26 | top5 = AverageMeter() 27 | for imgs, labels in tqdm.tqdm(val_loader): 28 | if torch.cuda.is_available(): 29 | imgs = imgs.cuda() 30 | bsz = labels.shape[0] 31 | output = model(imgs) 32 | if torch.cuda.is_available(): 33 | output = output.cpu() 34 | # update metric 35 | acc1, acc5 = evaluate(output, labels, topk=(1, 5)) 36 | top1.update(acc1.item(), bsz) 37 | top5.update(acc5.item(), bsz) 38 | 39 | # ----------TODO------------ 40 | # draw accuracy curve! 41 | writer.add_scalar('val/top1', top1.avg, epoch) 42 | writer.add_scalar('val/top5', top5.avg, epoch) 43 | # ----------TODO------------ 44 | 45 | print(' Val Acc@1 {top1.avg:.3f}'.format(top1=top1)) 46 | print(' Val Acc@5 {top5.avg:.3f}'.format(top5=top5)) 47 | return 48 | 49 | def train(epoch, model, optimizer, criterion, train_loader, writer): 50 | model.train() 51 | 52 | losses = AverageMeter() 53 | top1 = AverageMeter() 54 | top5 = AverageMeter() 55 | iteration = len(train_loader) * epoch 56 | for imgs, labels in tqdm.tqdm(train_loader): 57 | bsz = labels.shape[0] 58 | 59 | if torch.cuda.is_available(): 60 | imgs = imgs.cuda() 61 | labels = labels.cuda() 62 | 63 | optimizer.zero_grad() 64 | 65 | output = model(imgs) 66 | loss = criterion(output, labels) 67 | 68 | # update metric 69 | losses.update(loss.item(), bsz) 70 | acc1, acc5 = evaluate(output, labels, topk=(1, 5)) 71 | top1.update(acc1.item(), bsz) 72 | top5.update(acc5.item(), bsz) 73 | 74 | loss.backward() 75 | optimizer.step() 76 | 77 | iteration += 1 78 | if iteration % 50 == 0: 79 | pass 80 | # ----------TODO------------ 81 | # draw loss curve and accuracy curve! 82 | writer.add_scalar('train/loss', losses.val, iteration) 83 | writer.add_scalar('train/top1', top1.avg, iteration) 84 | writer.add_scalar('train/top5', top5.avg, iteration) 85 | # ----------TODO------------ 86 | 87 | print(' Epoch: %d'%(epoch)) 88 | print(' Train Acc@1 {top1.avg:.3f}'.format(top1=top1)) 89 | print(' Train Acc@5 {top5.avg:.3f}'.format(top5=top5)) 90 | return 91 | 92 | def run(args): 93 | save_folder = os.path.join('../experiments', args.exp_name) 94 | ckpt_folder = os.path.join(save_folder, 'ckpt') 95 | log_folder = os.path.join(save_folder, 'log') 96 | os.makedirs(ckpt_folder, exist_ok=True) 97 | os.makedirs(log_folder, exist_ok=True) 98 | writer = SummaryWriter(log_dir=log_folder) 99 | 100 | # define dataset and dataloader 101 | train_dataset = CIFAR10() 102 | val_dataset = CIFAR10(train=False) 103 | train_loader = torch.utils.data.DataLoader( 104 | train_dataset, batch_size=args.batchsize, shuffle=True, num_workers=2) 105 | val_loader = torch.utils.data.DataLoader( 106 | val_dataset, batch_size=args.batchsize, shuffle=False, num_workers=2) 107 | 108 | # define network 109 | model = ConvNet() 110 | if torch.cuda.is_available(): 111 | model = model.cuda() 112 | 113 | # define optimizer 114 | optimizer = optim.Adam(model.parameters(), lr=args.lr) 115 | 116 | # define loss 117 | criterion = MyCELoss 118 | 119 | if args.cont: 120 | # load latest checkpoint 121 | ckpt_lst = os.listdir(ckpt_folder) 122 | ckpt_lst.sort(key=lambda x: int(x.split('_')[-1])) 123 | read_path = os.path.join(ckpt_folder, ckpt_lst[-1]) 124 | print('load checkpoint from %s'%(read_path)) 125 | checkpoint = torch.load(read_path) 126 | model.load_state_dict(checkpoint['model']) 127 | optimizer.load_state_dict(checkpoint['optimizer']) 128 | start_epoch = checkpoint['epoch'] + 1 129 | else: 130 | start_epoch = 0 131 | 132 | for epoch in range(start_epoch, args.total_epoch): 133 | train(epoch, model, optimizer, criterion, train_loader, writer) 134 | 135 | if epoch % args.save_freq == 0: 136 | state = { 137 | 'model': model.state_dict(), 138 | 'optimizer': optimizer.state_dict(), 139 | 'epoch': epoch, 140 | } 141 | save_file = os.path.join(ckpt_folder, 'ckpt_epoch_%s'%(str(epoch))) 142 | torch.save(state, save_file) 143 | 144 | with torch.no_grad(): 145 | validate(epoch, model, val_loader, writer) 146 | return 147 | 148 | if __name__ == '__main__': 149 | arg_parser = argparse.ArgumentParser() 150 | arg_parser.add_argument('--exp_name', '-e', type=str, required=True, help="The checkpoints and logs will be save in ./checkpoint/$EXP_NAME") 151 | arg_parser.add_argument('--lr', '-l', type=float, default=1e-4, help="Learning rate") 152 | arg_parser.add_argument('--save_freq', '-s', type=int, default=1, help="frequency of saving model") 153 | arg_parser.add_argument('--total_epoch', '-t', type=int, default=10, help="total epoch number for training") 154 | arg_parser.add_argument('--cont', '-c', action='store_true', help="whether to load saved checkpoints from $EXP_NAME and continue training") 155 | arg_parser.add_argument('--batchsize', '-b', type=int, default=20, help="batch size") 156 | args = arg_parser.parse_args() 157 | 158 | run(args) -------------------------------------------------------------------------------- /计算机视觉导论/HW2/cifar-10/util.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | class AverageMeter(object): 4 | """Computes and stores the average and current value 5 | Imported from https://github.com/pytorch/examples/blob/master/imagenet/main.py#L247-L262 6 | """ 7 | 8 | def __init__(self): 9 | self.reset() 10 | 11 | def reset(self): 12 | self.val = 0 13 | self.avg = 0 14 | self.sum = 0 15 | self.count = 0 16 | 17 | def update(self, val, n=1): 18 | self.val = val 19 | self.sum += val * n 20 | self.count += n 21 | self.avg = self.sum / self.count 22 | 23 | def evaluate(output, target, topk=(1,)): 24 | """Computes the accuracy over the k top predictions for the specified values of k""" 25 | with torch.no_grad(): 26 | maxk = max(topk) 27 | batch_size = target.size(0) 28 | 29 | _, pred = output.topk(maxk, 1, True, True) 30 | pred = pred.t() 31 | correct = pred.eq(target.view(1, -1).expand_as(pred)) 32 | 33 | res = [] 34 | for k in topk: 35 | correct_k = correct[:k].reshape(-1).float().sum(0) 36 | res.append(correct_k.mul_(100.0 / batch_size)) 37 | return res 38 | -------------------------------------------------------------------------------- /计算机视觉导论/HW2/mnist_subset/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/mnist_subset/0.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/mnist_subset/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/mnist_subset/1.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/mnist_subset/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/mnist_subset/2.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/mnist_subset/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/mnist_subset/3.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/mnist_subset/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/mnist_subset/4.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/mnist_subset/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/mnist_subset/5.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/mnist_subset/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/mnist_subset/6.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/mnist_subset/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/mnist_subset/7.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/mnist_subset/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/mnist_subset/8.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/mnist_subset/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/mnist_subset/9.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/pack.py: -------------------------------------------------------------------------------- 1 | import os 2 | import zipfile 3 | 4 | 5 | def zipHW2(input_path: str, output_path: str, zip_name: str): 6 | zip = zipfile.ZipFile(output_path, "w", zipfile.ZIP_DEFLATED) 7 | for path, dirnames, filenames in os.walk(os.path.join(input_path, "batch_normalization")): 8 | fpath = path.replace(input_path, f'HW2_{zip_name}') 9 | for filename in filenames: 10 | if filename in ["bn.py"]: 11 | zip.write(os.path.join(path, filename), os.path.join(fpath, filename)) 12 | for path, dirnames, filenames in os.walk(os.path.join(input_path, "cifar-10")): 13 | fpath = path.replace(input_path, f'HW2_{zip_name}') 14 | for filename in filenames: 15 | if filename in ["dataset.py", "network.py", "train.py"]: 16 | zip.write(os.path.join(path, filename), os.path.join(fpath, filename)) 17 | for path, dirnames, filenames in os.walk(os.path.join(input_path, "results")): 18 | fpath = path.replace(input_path, f'HW2_{zip_name}') 19 | for filename in filenames: 20 | zip.write(os.path.join(path, filename), os.path.join(fpath, filename)) 21 | zip.write(os.path.join(input_path, "BP.py"), os.path.join(f'HW2_{zip_name}', "BP.py")) 22 | zip.close() 23 | 24 | 25 | if __name__ == "__main__": 26 | 27 | # --------------------------------------------------------- 28 | # 请用你的学号和姓名替换下面的内容,注意参照例子的格式,使用拼音而非中文 29 | id = 1900012950 30 | name = 'ZhangSan' 31 | # --------------------------------------------------------- 32 | 33 | zip_name = f'{id}_{name}.zip' 34 | input_path = os.path.dirname(os.path.abspath(__file__)) 35 | output_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), zip_name) 36 | 37 | zipHW2(input_path, output_path, zip_name.split(".")[0]) 38 | -------------------------------------------------------------------------------- /计算机视觉导论/HW2/results/BP.txt: -------------------------------------------------------------------------------- 1 | 9.779284769618634243e+00 2 | 4.179958911953551848e+00 3 | 3.212628089564451006e+00 4 | 2.781939232574513809e+00 5 | 2.521983696361397964e+00 6 | 2.317483164400497397e+00 7 | 2.140868130341873510e+00 8 | 1.984310588985534807e+00 9 | 1.844338086451177361e+00 10 | 1.718717435254833115e+00 11 | 1.605697625090467540e+00 12 | 1.503788222428893429e+00 13 | 1.411693541447843314e+00 14 | 1.328286516684636265e+00 15 | 1.252585864633001700e+00 16 | 1.183731285334008287e+00 17 | 1.120961515703425393e+00 18 | 1.063599520962808187e+00 19 | 1.011044783556032556e+00 20 | 9.627693681274921422e-01 21 | 9.183140418425473905e-01 22 | 8.772823295082272654e-01 23 | 8.393323255945468464e-01 24 | 8.041673595907683492e-01 25 | 7.715269910867809111e-01 26 | 7.411794933070361413e-01 27 | 7.129163281032779853e-01 28 | 6.865484872314185916e-01 29 | 6.619042068756149089e-01 30 | 6.388274911054411254e-01 31 | 6.171770013305257763e-01 32 | 5.968250494395517247e-01 33 | 5.776565842351083502e-01 34 | 5.595681544049057043e-01 35 | 5.424668735082949222e-01 36 | 5.262694221302972597e-01 37 | 5.109011162768259950e-01 38 | 4.962950599135954044e-01 39 | 4.823913885516625810e-01 40 | 4.691366018603405075e-01 41 | 4.564829767179177655e-01 42 | 4.443880476090866782e-01 43 | 4.328141385444577161e-01 44 | 4.217279295930687066e-01 45 | 4.111000417449204303e-01 46 | 4.009046262801188587e-01 47 | 3.911189491179150046e-01 48 | 3.817229664558677293e-01 49 | 3.726988946794456137e-01 50 | 3.640307839412161850e-01 51 | -------------------------------------------------------------------------------- /计算机视觉导论/HW2/results/Lenna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/results/Lenna.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/results/Lenna_aug1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/results/Lenna_aug1.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/results/Lenna_aug2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/results/Lenna_aug2.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/results/bn_loss.txt: -------------------------------------------------------------------------------- 1 | 1.390185479780854827e+01 2 | 3.033448550031816016e+00 3 | 2.752286567016787977e+00 4 | 2.656001582022865293e+00 5 | 2.593305208061170930e+00 6 | 2.539740282361730994e+00 7 | 2.489078261615607968e+00 8 | 2.439408137224944095e+00 9 | 2.390089215026077962e+00 10 | 2.340904016676573107e+00 11 | 2.291789582483165777e+00 12 | 2.242744965600917517e+00 13 | 2.193797333728853438e+00 14 | 2.144988604485112749e+00 15 | 2.096369477225719091e+00 16 | 2.047996165041164218e+00 17 | 1.999928135915148175e+00 18 | 1.952226276004763506e+00 19 | 1.904951297351569206e+00 20 | 1.858162358771123790e+00 21 | 1.811915912627082070e+00 22 | 1.766264793810403466e+00 23 | 1.721257555994122113e+00 24 | 1.676938045352085016e+00 25 | 1.633345188631723177e+00 26 | 1.590512963047900685e+00 27 | 1.548470510562641511e+00 28 | 1.507242358394743409e+00 29 | 1.466848710181750670e+00 30 | 1.427305777002585430e+00 31 | 1.388626123398267742e+00 32 | 1.350819009712002305e+00 33 | 1.313890717861643243e+00 34 | 1.277844852656450536e+00 35 | 1.242682614788496176e+00 36 | 1.208403044640072199e+00 37 | 1.175003238132246830e+00 38 | 1.142478537135842132e+00 39 | 1.110822697637114720e+00 40 | 1.080028039056951883e+00 41 | 1.050085578008018050e+00 42 | 1.020985149458546459e+00 43 | 9.927155178477751196e-01 44 | 9.652644802354032327e-01 45 | 9.386189631135049005e-01 46 | 9.127651140943587871e-01 47 | 8.876883893285624216e-01 48 | 8.633736372114767521e-01 49 | 8.398051787026913351e-01 50 | 8.169668844084373438e-01 51 | 2.756584251033496191e-02 52 | -------------------------------------------------------------------------------- /计算机视觉导论/HW2/results/learning_rate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/results/learning_rate.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/results/my_best.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/results/my_best.png -------------------------------------------------------------------------------- /计算机视觉导论/HW2/results/network_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW2/results/network_structure.png -------------------------------------------------------------------------------- /计算机视觉导论/HW3/README.md: -------------------------------------------------------------------------------- 1 | # Calibration 2 | 3 | - We provide a reference answer in code because the data is fake and the result is strange. 4 | 5 | 6 | 7 | # Depth_pc 8 | 9 | - The `depth.png` and `seg.png` are generated by `render.py`, which uses `pyrender` to render `spot.obj` to 2D image plane. 10 | - If you implement the backprojection correctly, the result should be overlapped with `aligned_full_pc.txt`. 11 | - For interest readers, `aligned_full_pc.txt` is different from `raw_full_pc.txt`, which is sampled from `spot.obj`, because the default camera in `pyrender` looks at -z axis. 12 | 13 | 14 | 15 | # Mesh_pc 16 | 17 | - Note that we use the mean distance in this assignment, which is different from the slides. 18 | - We recommend using [this repo](https://github.com/j2kun/earthmover/) to compute earth move distance between two point clouds. 19 | ```bash 20 | cd mesh_pc 21 | git clone git@github.com:j2kun/earthmover.git 22 | ``` 23 | 24 | 25 | 26 | 27 | # Submission 28 | - Compress the entire folder using our provided `pack.py` and submit to [course.pku.edu.cn](https://course.pku.edu.cn/). 29 | - The folder named `results` in the main directoy should be structed as follows. 30 | ```bash 31 | results 32 | ├── bob.obj 33 | ├── spot.obj 34 | ├── calibr.npy 35 | ├── uniform_sampling_results.npy 36 | ├── fps_results.npy 37 | ├── metrics.npy 38 | ├── pc_from_depth.txt 39 | └── one_way_CD.txt 40 | ``` 41 | 42 | 43 | 44 | # Appendix 45 | 46 | - We recommand to use some softwares to visualize the results to help debug. 47 | - CloudCompare: https://www.danielgm.net/cc/ 48 | - Meshlab: https://www.meshlab.net/ 49 | - ... 50 | -------------------------------------------------------------------------------- /计算机视觉导论/HW3/camera_calibr/back_image.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/camera_calibr/back_image.npy -------------------------------------------------------------------------------- /计算机视觉导论/HW3/camera_calibr/calibr.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import numpy as np\n", 10 | "import cv2\n", 11 | "from matplotlib import pyplot as plt" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": null, 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "front_2Dcoord = np.load('front_image.npy', allow_pickle=True)\n", 21 | "back_2Dcoord = np.load('back_image.npy', allow_pickle=True)\n", 22 | "front_img = cv2.imread('front.png')" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": null, 28 | "metadata": {}, 29 | "outputs": [], 30 | "source": [ 31 | "#visualization\n", 32 | "print(front_2Dcoord.shape, back_2Dcoord.shape)\n", 33 | "from copy import deepcopy\n", 34 | "vis_img = deepcopy(front_img)\n", 35 | "for i in range(front_2Dcoord.shape[0]):\n", 36 | " cv2.circle(vis_img, (int(front_2Dcoord[i,0]), int(front_2Dcoord[i,1])), 2, (255,0,0), 2)\n", 37 | "plt.imshow(vis_img[:,:,::-1])\n", 38 | "plt.show()" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": null, 44 | "metadata": {}, 45 | "outputs": [], 46 | "source": [ 47 | "# ------------TODO----------------\n", 48 | "# Compute corresponding 3D coordinate\n", 49 | "t = np.array([[0, 0, 0], [50, 0, 0], [50, 50, 0], [0, 50, 0]])\n", 50 | "u = t + np.array([160, 240, 0])\n", 51 | "v = t + np.array([400, 400, 0])\n", 52 | "front_3Dcoord = np.vstack((t, u, v)).astype(np.float64)\n", 53 | "back_3Dcoord = front_3Dcoord + np.array([0, 0, 150])\n", 54 | "# ------------TODO----------------\n", 55 | "\n", 56 | "all_2Dcoord = np.concatenate((front_2Dcoord, back_2Dcoord), axis=0)\n", 57 | "all_3Dcoord = np.concatenate((front_3Dcoord, back_3Dcoord), axis=0)\n", 58 | "print(all_2Dcoord.shape, all_3Dcoord.shape)" 59 | ] 60 | }, 61 | { 62 | "cell_type": "code", 63 | "execution_count": null, 64 | "metadata": {}, 65 | "outputs": [], 66 | "source": [ 67 | "# ------------TODO----------------\n", 68 | "# Construct the Equation Pm=0 and solve m\n", 69 | "def f(p, u, v):\n", 70 | " p = np.hstack((p, 1))\n", 71 | " z = np.zeros((4,))\n", 72 | " l0 = np.hstack((p.T, z, -u * p.T))\n", 73 | " l1 = np.hstack((z, p.T, -v * p.T))\n", 74 | " return np.vstack((l0, l1))\n", 75 | "g = lambda x: f(x[:3], x[3], x[4])\n", 76 | "n = all_2Dcoord.shape[0]\n", 77 | "P = np.hstack((all_3Dcoord, all_2Dcoord))\n", 78 | "P = np.apply_along_axis(g, 1, P).reshape(2 * n, -1)\n", 79 | "U, S, Vt = np.linalg.svd(P)\n", 80 | "m = Vt[-1]\n", 81 | "# ------------TODO----------------" 82 | ] 83 | }, 84 | { 85 | "cell_type": "code", 86 | "execution_count": null, 87 | "metadata": {}, 88 | "outputs": [], 89 | "source": [ 90 | "# ------------TODO----------------\n", 91 | "# Solve K, and [R T] from m\n", 92 | "M = m.reshape(3, 4)\n", 93 | "A = M[:, :3]\n", 94 | "b = M[:, 3]\n", 95 | "a1, a2, a3 = map(lambda x: x.reshape(-1), np.vsplit(A, 3))\n", 96 | "\n", 97 | "rho_sq = 1 / np.dot(a3, a3) # How to decide the sign?\n", 98 | "cx = rho_sq * np.dot(a1, a3)\n", 99 | "cy = rho_sq * np.dot(a2, a3)\n", 100 | "t1 = np.cross(a2, a3)\n", 101 | "t2 = np.cross(a3, a1)\n", 102 | "t1_norm = np.linalg.norm(t1)\n", 103 | "t2_norm = np.linalg.norm(t2)\n", 104 | "cos_theta = np.dot(t1, t2) / (t1_norm * t2_norm)\n", 105 | "sin_theta = np.sqrt(1 - cos_theta ** 2)\n", 106 | "cot_theta = cos_theta / sin_theta\n", 107 | "\n", 108 | "alpha = rho_sq * t2_norm * sin_theta\n", 109 | "beta = rho_sq * t1_norm * sin_theta\n", 110 | "\n", 111 | "r1 = t1 / t1_norm\n", 112 | "r3 = a3 / np.linalg.norm(a3)\n", 113 | "r2 = np.cross(r3, r1)\n", 114 | "\n", 115 | "K = np.array([\n", 116 | " [alpha, -alpha * cot_theta, cx],\n", 117 | " [0, beta / sin_theta, cy],\n", 118 | " [0, 0, 1]\n", 119 | "])\n", 120 | "R = np.vstack((r1, r2, r3))\n", 121 | "T = np.sqrt(rho_sq) * np.linalg.inv(K) @ b\n", 122 | "# ------------TODO----------------" 123 | ] 124 | }, 125 | { 126 | "cell_type": "code", 127 | "execution_count": null, 128 | "metadata": {}, 129 | "outputs": [], 130 | "source": [ 131 | "# save results\n", 132 | "save_dict = {'3Dcoord': all_3Dcoord, 'P':P, 'm':m, 'K':K, 'R':R, 'T':T}\n", 133 | "np.save('../results/calibr', save_dict)\n", 134 | "\n", 135 | "# The reference answer of T should be [383001.8386981 -67357.81794783 67071.11338303]\n", 136 | "# The results are very strange because the data is fake." 137 | ] 138 | } 139 | ], 140 | "metadata": { 141 | "kernelspec": { 142 | "display_name": "Python 3", 143 | "language": "python", 144 | "name": "python3" 145 | }, 146 | "language_info": { 147 | "codemirror_mode": { 148 | "name": "ipython", 149 | "version": 3 150 | }, 151 | "file_extension": ".py", 152 | "mimetype": "text/x-python", 153 | "name": "python", 154 | "nbconvert_exporter": "python", 155 | "pygments_lexer": "ipython3", 156 | "version": "3.10.12" 157 | }, 158 | "orig_nbformat": 4 159 | }, 160 | "nbformat": 4, 161 | "nbformat_minor": 2 162 | } 163 | -------------------------------------------------------------------------------- /计算机视觉导论/HW3/camera_calibr/front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/camera_calibr/front.png -------------------------------------------------------------------------------- /计算机视觉导论/HW3/camera_calibr/front_image.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/camera_calibr/front_image.npy -------------------------------------------------------------------------------- /计算机视觉导论/HW3/depth_pc/depth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/depth_pc/depth.png -------------------------------------------------------------------------------- /计算机视觉导论/HW3/depth_pc/depth_pc.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import numpy as np\n", 10 | "import cv2" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": null, 16 | "metadata": {}, 17 | "outputs": [], 18 | "source": [ 19 | "# read depth image\n", 20 | "depth_scale = 0.00012498664727900177\n", 21 | "depth_img = cv2.imread('depth.png')\n", 22 | "dpt = depth_img[:, :, 2] + depth_img[:, :, 1] * 256\n", 23 | "dpt = dpt * depth_scale\n", 24 | "\n", 25 | "# read seg image\n", 26 | "seg = cv2.imread('seg.png')[...,0] # 255: fore ground, 0: background\n", 27 | "\n", 28 | "# read intrinsics and extrinsics\n", 29 | "K = np.load('intrinsic.npy')\n", 30 | "print(K)" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": null, 36 | "metadata": {}, 37 | "outputs": [], 38 | "source": [ 39 | "# task1: convert depth image to point cloud\n", 40 | "def depth2pc(depth, seg, K):\n", 41 | " # ------------TODO---------------\n", 42 | " # compute point cloud from depth image\n", 43 | " # for-loop is not allowed!!\n", 44 | " cx = K[0, 2]\n", 45 | " cy = K[1, 2]\n", 46 | " alpha = K[0, 0]\n", 47 | " beta = K[1, 1]\n", 48 | "\n", 49 | " u, v = np.meshgrid(np.arange(depth.shape[1]), np.arange(depth.shape[0]))\n", 50 | " pc = np.zeros((depth.shape[0], depth.shape[1], 3))\n", 51 | " pc[:, :, 0] = depth * (u - cx) / alpha\n", 52 | " pc[:, :, 1] = depth * (v - cy) / beta\n", 53 | " pc[:, :, 2] = depth\n", 54 | " pc = pc[seg > 0]\n", 55 | " # ------------TODO --------------\n", 56 | " return pc\n", 57 | "\n", 58 | "partial_pc = depth2pc(dpt, seg, K)\n", 59 | "\n", 60 | "# For debug and submission\n", 61 | "np.savetxt('../results/pc_from_depth.txt', partial_pc)" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": null, 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [ 70 | "# task2: compute one-way chamfer distance to the complete shape\n", 71 | "full_pc = np.loadtxt('aligned_full_pc.txt')\n", 72 | "\n", 73 | "def random_sample(pc, num):\n", 74 | " permu = np.random.permutation(pc.shape[0])\n", 75 | " return pc[permu][:num]\n", 76 | "\n", 77 | "partial_pc_sampled = random_sample(partial_pc, 2048)\n", 78 | "full_pc_sampled = random_sample(full_pc, 2048)\n", 79 | "\n", 80 | "# -----------TODO---------------\n", 81 | "# implement one way chamfer distance\n", 82 | "t = partial_pc_sampled[:, None, :] - full_pc_sampled[None, :, :]\n", 83 | "t = np.linalg.norm(t, axis=2)\n", 84 | "t = np.min(t, axis=1)\n", 85 | "one_way_CD = np.mean(t)[None]\n", 86 | "# -----------TODO---------------\n", 87 | "print('one way chamfer distance: ', one_way_CD)\n", 88 | "\n", 89 | "# For submission\n", 90 | "np.savetxt('../results/one_way_CD.txt', one_way_CD)" 91 | ] 92 | } 93 | ], 94 | "metadata": { 95 | "kernelspec": { 96 | "display_name": "Python 3", 97 | "language": "python", 98 | "name": "python3" 99 | }, 100 | "language_info": { 101 | "codemirror_mode": { 102 | "name": "ipython", 103 | "version": 3 104 | }, 105 | "file_extension": ".py", 106 | "mimetype": "text/x-python", 107 | "name": "python", 108 | "nbconvert_exporter": "python", 109 | "pygments_lexer": "ipython3", 110 | "version": "3.10.12" 111 | }, 112 | "orig_nbformat": 4 113 | }, 114 | "nbformat": 4, 115 | "nbformat_minor": 2 116 | } 117 | -------------------------------------------------------------------------------- /计算机视觉导论/HW3/depth_pc/intrinsic.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/depth_pc/intrinsic.npy -------------------------------------------------------------------------------- /计算机视觉导论/HW3/depth_pc/render.py: -------------------------------------------------------------------------------- 1 | # This code is used to render a depth image from a mesh. 2 | # This code is only provided for interested readers and you don't have to run this. 3 | 4 | import pyrender 5 | import trimesh 6 | import numpy as np 7 | import cv2 8 | 9 | # # if you are using a headless server, you may need below lines 10 | # import os 11 | # os.environ['PYOPENGL_PLATFORM'] = 'egl' 12 | 13 | # load object and preprocess 14 | mesh = trimesh.load('spot.obj', force='mesh') 15 | base_scale = np.sqrt(((mesh.vertices.max(axis=0)-mesh.vertices.min(axis=0))**2).sum()) 16 | obj_center = np.array(mesh.vertices.max(axis=0) + mesh.vertices.min(axis=0)) 17 | mesh.vertices = (mesh.vertices - obj_center) / base_scale 18 | mesh.vertices = mesh.vertices + [0.5,0.5,-1] 19 | np.savetxt('raw_full_pc.txt', np.array(mesh.vertices)) 20 | 21 | # pyrender load object 22 | scene = pyrender.Scene() 23 | obj_mesh = pyrender.Mesh.from_trimesh(mesh) 24 | obj_node = pyrender.Node(mesh=obj_mesh, matrix=np.eye(4)) 25 | scene.add_node(obj_node) 26 | 27 | # initialize camera 28 | pw = 640 29 | ph = 480 30 | camera_pose = np.eye(4) 31 | camera = pyrender.PerspectiveCamera(yfov=np.deg2rad(60), aspectRatio=pw / ph, znear=0.1, zfar=10) 32 | scene.add(camera, camera_pose) 33 | 34 | # render 35 | r = pyrender.OffscreenRenderer(pw, ph) 36 | seg_img, depth = r.render(scene, flags=pyrender.constants.RenderFlags.SEG, seg_node_map={obj_node:[255,0,0]}) 37 | 38 | depth_scale = 0.00012498664727900177 39 | print(depth.mean(), depth.max(), depth.min()) 40 | 41 | depth = (depth / depth_scale).astype(np.int32) 42 | depth_img = np.zeros_like(seg_img) 43 | depth_img[..., 1] = depth // 256 44 | depth_img[..., 2] = depth % 256 45 | 46 | cv2.imwrite('seg.png', seg_img) 47 | cv2.imwrite('depth.png', depth_img) 48 | 49 | 50 | # intrinsic 51 | projection = camera.get_projection_matrix() 52 | K = np.eye(3) 53 | K[0,0] = projection[0,0] * pw / 2 54 | K[1,1] = projection[1,1] * ph / 2 55 | K[0,2] = pw / 2 56 | K[1,2] = ph / 2 57 | np.save('intrinsic', K) -------------------------------------------------------------------------------- /计算机视觉导论/HW3/depth_pc/seg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/depth_pc/seg.png -------------------------------------------------------------------------------- /计算机视觉导论/HW3/marching_cube/data/bob_cell.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/marching_cube/data/bob_cell.npy -------------------------------------------------------------------------------- /计算机视觉导论/HW3/marching_cube/data/spot_cell.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/marching_cube/data/spot_cell.npy -------------------------------------------------------------------------------- /计算机视觉导论/HW3/marching_cube/lookup_table.py: -------------------------------------------------------------------------------- 1 | # -----------------------Hint--------------------- 2 | # Assuming that we have the signed distance field "cells" of a 3D shape and we want to extract the iso-surface of "thre", 3 | # how to compute the triangles of a cell "(x,y,z)" ~ "(x+1,y+1,z+1)"? 4 | # 1. Use "getCaseNum(x,y,z,thre,cells)" to get a list of case values for this cell. 5 | # 2. For each case value "case_num", use "CaseNum2EdgeOffset[case_num]" to get an edge of this cell which interacts with the iso-surface. 6 | # To be more specific, one corner of this edge is "(x+CaseNum2EdgeOffset[case_num][0],y+CaseNum2EdgeOffset[case_num][1],z+CaseNum2EdgeOffset[case_num][2])" 7 | # and the other is "(x+CaseNum2EdgeOffset[case_num][3],y+CaseNum2EdgeOffset[case_num][4],z+CaseNum2EdgeOffset[case_num][5])" 8 | # 3. Use linear interpolation to find the interaction point "(xp,yp,zp)", which should satisfy "cells[xp,yp,zp]=thre", on the edge found in Step 2. 9 | # 4. Back to Step 2 and find the next interaction point. Use every three consecutive interaction points to form a face. 10 | # -----------------------Hint--------------------- 11 | 12 | # Build Marching Cubes Lookup table 13 | # This table is straight from Paul Bourke's site (Source: http://paulbourke.net/geometry/polygonise/) 14 | triTable =[ 15 | [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 16 | [0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 17 | [0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 18 | [1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 19 | [1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 20 | [0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 21 | [9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 22 | [2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1], 23 | [3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 24 | [0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 25 | [1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 26 | [1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1], 27 | [3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 28 | [0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1], 29 | [3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1], 30 | [9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 31 | [4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 32 | [4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 33 | [0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 34 | [4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1], 35 | [1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 36 | [3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1], 37 | [9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1], 38 | [2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1], 39 | [8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 40 | [11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1], 41 | [9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1], 42 | [4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1], 43 | [3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1], 44 | [1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1], 45 | [4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1], 46 | [4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1], 47 | [9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 48 | [9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 49 | [0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 50 | [8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1], 51 | [1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 52 | [3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1], 53 | [5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1], 54 | [2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1], 55 | [9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 56 | [0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1], 57 | [0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1], 58 | [2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1], 59 | [10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1], 60 | [4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1], 61 | [5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1], 62 | [5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1], 63 | [9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 64 | [9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1], 65 | [0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1], 66 | [1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 67 | [9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1], 68 | [10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1], 69 | [8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1], 70 | [2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1], 71 | [7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1], 72 | [9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1], 73 | [2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1], 74 | [11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1], 75 | [9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1], 76 | [5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1], 77 | [11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1], 78 | [11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 79 | [10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 80 | [0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 81 | [9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 82 | [1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1], 83 | [1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 84 | [1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1], 85 | [9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1], 86 | [5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1], 87 | [2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 88 | [11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1], 89 | [0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1], 90 | [5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1], 91 | [6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1], 92 | [0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1], 93 | [3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1], 94 | [6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1], 95 | [5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 96 | [4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1], 97 | [1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1], 98 | [10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1], 99 | [6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1], 100 | [1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1], 101 | [8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1], 102 | [7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1], 103 | [3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1], 104 | [5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1], 105 | [0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1], 106 | [9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1], 107 | [8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1], 108 | [5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1], 109 | [0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1], 110 | [6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1], 111 | [10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 112 | [4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1], 113 | [10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1], 114 | [8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1], 115 | [1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1], 116 | [3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1], 117 | [0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 118 | [8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1], 119 | [10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1], 120 | [0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1], 121 | [3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1], 122 | [6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1], 123 | [9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1], 124 | [8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1], 125 | [3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1], 126 | [6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 127 | [7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1], 128 | [0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1], 129 | [10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1], 130 | [10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1], 131 | [1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1], 132 | [2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1], 133 | [7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1], 134 | [7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 135 | [2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1], 136 | [2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1], 137 | [1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1], 138 | [11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1], 139 | [8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1], 140 | [0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 141 | [7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1], 142 | [7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 143 | [7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 144 | [3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 145 | [0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 146 | [8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1], 147 | [10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 148 | [1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1], 149 | [2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1], 150 | [6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1], 151 | [7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 152 | [7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1], 153 | [2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1], 154 | [1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1], 155 | [10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1], 156 | [10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1], 157 | [0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1], 158 | [7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1], 159 | [6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 160 | [3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1], 161 | [8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1], 162 | [9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1], 163 | [6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1], 164 | [1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1], 165 | [4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1], 166 | [10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1], 167 | [8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1], 168 | [0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 169 | [1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1], 170 | [1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1], 171 | [8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1], 172 | [10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1], 173 | [4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1], 174 | [10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 175 | [4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 176 | [0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1], 177 | [5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1], 178 | [11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1], 179 | [9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1], 180 | [6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1], 181 | [7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1], 182 | [3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1], 183 | [7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1], 184 | [9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1], 185 | [3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1], 186 | [6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1], 187 | [9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1], 188 | [1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1], 189 | [4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1], 190 | [7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1], 191 | [6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1], 192 | [3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1], 193 | [0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1], 194 | [6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1], 195 | [1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1], 196 | [0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1], 197 | [11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1], 198 | [6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1], 199 | [5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1], 200 | [9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1], 201 | [1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1], 202 | [1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 203 | [1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1], 204 | [10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1], 205 | [0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 206 | [10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 207 | [11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 208 | [11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1], 209 | [5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1], 210 | [10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1], 211 | [11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1], 212 | [0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1], 213 | [9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1], 214 | [7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1], 215 | [2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1], 216 | [8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1], 217 | [9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1], 218 | [9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1], 219 | [1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 220 | [0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1], 221 | [9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1], 222 | [9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 223 | [5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1], 224 | [5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1], 225 | [0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1], 226 | [10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1], 227 | [2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1], 228 | [0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1], 229 | [0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1], 230 | [9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 231 | [2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1], 232 | [5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1], 233 | [3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1], 234 | [5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1], 235 | [8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1], 236 | [0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 237 | [8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1], 238 | [9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 239 | [4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1], 240 | [0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1], 241 | [1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1], 242 | [3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1], 243 | [4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1], 244 | [9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1], 245 | [11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1], 246 | [11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1], 247 | [2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1], 248 | [9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1], 249 | [3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1], 250 | [1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 251 | [4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1], 252 | [4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1], 253 | [4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 254 | [4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 255 | [9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 256 | [3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1], 257 | [0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1], 258 | [3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 259 | [1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1], 260 | [3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1], 261 | [0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 262 | [3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 263 | [2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1], 264 | [9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 265 | [2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1], 266 | [1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 267 | [1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 268 | [0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 269 | [0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], 270 | [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]] 271 | 272 | 273 | # look up Lookup table 274 | def getCaseNum(x,y,z, thres,cells): 275 | case = 0 276 | if (thres < cells[x,y+1,z+1]): 277 | case = 128 278 | if (thres < cells[x+1,y+1,z+1]): 279 | case = case + 64 280 | if (thres < cells[x+1,y,z+1]): 281 | case = case + 32 282 | if (thres < cells[x,y,z+1]): 283 | case = case + 16 284 | if (thres < cells[x,y+1,z]): 285 | case = case + 8 286 | if (thres < cells[x+1,y+1,z]): 287 | case = case + 4 288 | if (thres < cells[x+1,y,z]): 289 | case = case + 2 290 | if (thres < cells[x,y,z]): 291 | case = case + 1 292 | case_nums = triTable[case] 293 | return case_nums 294 | 295 | 296 | # Change the value of Lookup table to an edge 297 | CaseNum2EdgeOffset = [ 298 | [0,0,0, 1,0,0], 299 | [1,0,0, 1,1,0], 300 | [0,1,0, 1,1,0], 301 | [0,0,0, 0,1,0], 302 | [0,0,1, 1,0,1], 303 | [1,0,1, 1,1,1], 304 | [0,1,1, 1,1,1], 305 | [0,0,1, 0,1,1], 306 | [0,0,0, 0,0,1], 307 | [1,0,0, 1,0,1], 308 | [1,1,0, 1,1,1], 309 | [0,1,0, 0,1,1] 310 | ] 311 | -------------------------------------------------------------------------------- /计算机视觉导论/HW3/marching_cube/marching_cube.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import numpy as np\n", 10 | "from lookup_table import CaseNum2EdgeOffset, getCaseNum\n", 11 | "import trimesh\n", 12 | "import os\n", 13 | "import time" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": null, 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "def marching_cube(thres,cells):\n", 23 | " # vertices use dictionary to avoid duplicate axes\n", 24 | " vertex_array = {}\n", 25 | " face_array = []\n", 26 | " t1 = time.time()\n", 27 | " # -------------------TODO------------------ \n", 28 | " # compute vertices and faces\n", 29 | " # vertices: [N, 3]\n", 30 | " # faces: [M, 3], e.g. np.array([[0,1,2]]) means a triangle composed of vertices[0], vertices[1] and vertices[2]\n", 31 | " # for-loop is allowed to reduce difficulty\n", 32 | " for i in range(cells.shape[0] - 1):\n", 33 | " for j in range(cells.shape[1] - 1):\n", 34 | " for k in range(cells.shape[2] - 1):\n", 35 | " case_nums = getCaseNum(i, j, k, thres, cells)\n", 36 | " for l in range(0, len(case_nums) - 1, 3):\n", 37 | " if case_nums[l] == -1:\n", 38 | " break\n", 39 | " triangle = case_nums[l:l+3]\n", 40 | " \n", 41 | " def f(edge):\n", 42 | " edge = CaseNum2EdgeOffset[edge]\n", 43 | " p0 = np.array(edge[:3])\n", 44 | " p1 = np.array(edge[3:])\n", 45 | " v0 = cells[i + p0[0], j + p0[1], k + p0[2]]\n", 46 | " v1 = cells[i + p1[0], j + p1[1], k + p1[2]]\n", 47 | " p = np.array([i, j, k]) + p0 + (thres - v0) / (v1 - v0) * (p1 - p0)\n", 48 | " return tuple(np.round(p, 6))\n", 49 | " \n", 50 | " vertices = list(map(f, triangle))\n", 51 | " for v in vertices:\n", 52 | " vertex_array.setdefault(v, len(vertex_array))\n", 53 | " face_array.append([vertex_array[v] for v in vertices])\n", 54 | " # -------------------TODO------------------ \n", 55 | " t2 = time.time()\n", 56 | " print(\"\\nTime taken by algorithm\\n\"+'-'*40+\"\\n{} s\".format(t2-t1))\n", 57 | " vertex_array = list(vertex_array.keys())\n", 58 | " return np.array(vertex_array), np.array(face_array)" 59 | ] 60 | }, 61 | { 62 | "cell_type": "code", 63 | "execution_count": null, 64 | "metadata": {}, 65 | "outputs": [], 66 | "source": [ 67 | "# reconstruct these two animals\n", 68 | "shape_name_lst = ['spot', 'bob']\n", 69 | "for shape_name in shape_name_lst:\n", 70 | " data = np.load(os.path.join('data', shape_name + '_cell.npy'))\n", 71 | " verts, faces = marching_cube(0, data)\n", 72 | " print(verts.shape, faces.shape)\n", 73 | " mesh = trimesh.Trimesh(vertices=verts, faces=faces)\n", 74 | " mesh_txt = trimesh.exchange.obj.export_obj(mesh)\n", 75 | " with open(os.path.join('../results', shape_name + '.obj'),\"w\") as fp:\n", 76 | " fp.write(mesh_txt)" 77 | ] 78 | } 79 | ], 80 | "metadata": { 81 | "kernelspec": { 82 | "display_name": "Python 3", 83 | "language": "python", 84 | "name": "python3" 85 | }, 86 | "language_info": { 87 | "codemirror_mode": { 88 | "name": "ipython", 89 | "version": 3 90 | }, 91 | "file_extension": ".py", 92 | "mimetype": "text/x-python", 93 | "name": "python", 94 | "nbconvert_exporter": "python", 95 | "pygments_lexer": "ipython3", 96 | "version": "3.10.12" 97 | }, 98 | "orig_nbformat": 4 99 | }, 100 | "nbformat": 4, 101 | "nbformat_minor": 2 102 | } 103 | -------------------------------------------------------------------------------- /计算机视觉导论/HW3/mesh_pc/earthmover.py: -------------------------------------------------------------------------------- 1 | # https://github.com/j2kun/earthmover/blob/main/earthmover.py 2 | 3 | ''' 4 | A python implementation of the Earthmover distance metric. 5 | ''' 6 | 7 | import math 8 | 9 | from collections import Counter 10 | from collections import defaultdict 11 | from ortools.linear_solver import pywraplp 12 | 13 | 14 | def euclidean_distance(x, y): 15 | return math.sqrt(sum((a - b)**2 for (a, b) in zip(x, y))) 16 | 17 | 18 | def earthmover_distance(p1, p2): 19 | ''' 20 | Output the Earthmover distance between the two given points. 21 | 22 | Arguments: 23 | 24 | - p1: an iterable of hashable iterables of numbers (i.e., list of tuples) 25 | - p2: an iterable of hashable iterables of numbers (i.e., list of tuples) 26 | ''' 27 | dist1 = {x: float(count) / len(p1) for (x, count) in Counter(p1).items()} 28 | dist2 = {x: float(count) / len(p2) for (x, count) in Counter(p2).items()} 29 | solver = pywraplp.Solver('earthmover_distance', pywraplp.Solver.GLOP_LINEAR_PROGRAMMING) 30 | 31 | variables = dict() 32 | 33 | # for each pile in dist1, the constraint that says all the dirt must leave this pile 34 | dirt_leaving_constraints = defaultdict(lambda: 0) 35 | 36 | # for each hole in dist2, the constraint that says this hole must be filled 37 | dirt_filling_constraints = defaultdict(lambda: 0) 38 | 39 | # the objective 40 | objective = solver.Objective() 41 | objective.SetMinimization() 42 | 43 | for (x, dirt_at_x) in dist1.items(): 44 | for (y, capacity_of_y) in dist2.items(): 45 | amount_to_move_x_y = solver.NumVar(0, solver.infinity(), 'z_{%s, %s}' % (x, y)) 46 | variables[(x, y)] = amount_to_move_x_y 47 | dirt_leaving_constraints[x] += amount_to_move_x_y 48 | dirt_filling_constraints[y] += amount_to_move_x_y 49 | objective.SetCoefficient(amount_to_move_x_y, euclidean_distance(x, y)) 50 | 51 | for x, linear_combination in dirt_leaving_constraints.items(): 52 | solver.Add(linear_combination == dist1[x]) 53 | 54 | for y, linear_combination in dirt_filling_constraints.items(): 55 | solver.Add(linear_combination == dist2[y]) 56 | 57 | status = solver.Solve() 58 | if status not in [solver.OPTIMAL, solver.FEASIBLE]: 59 | raise Exception('Unable to find feasible solution') 60 | 61 | for ((x, y), variable) in variables.items(): 62 | if variable.solution_value() != 0: 63 | cost = euclidean_distance(x, y) * variable.solution_value() 64 | print("move {} dirt from {} to {} for a cost of {}".format( 65 | variable.solution_value(), x, y, cost)) 66 | 67 | return objective.Value() 68 | 69 | 70 | if __name__ == "__main__": 71 | p1 = [ 72 | (0, 0), 73 | (0, 1), 74 | (0, -1), 75 | (1, 0), 76 | (-1, 0), 77 | ] 78 | 79 | p2 = [ 80 | (0, 0), 81 | (0, 2), 82 | (0, -2), 83 | (2, 0), 84 | (-2, 0), 85 | ] 86 | 87 | print(earthmover_distance(p1, p2)) -------------------------------------------------------------------------------- /计算机视觉导论/HW3/mesh_pc/fps_vis.txt: -------------------------------------------------------------------------------- 1 | 4.011833494028976332e+01 3.290412941850384954e+01 2.534337591013203905e+01 2 | 7.109170477117532805e+00 3.636440134198253560e+01 3.824841383912857395e+01 3 | 2.486235063378076049e+01 8.204212594109620227e+00 4.028084273003798899e+01 4 | 5.215221653972227500e+01 1.005386626135586603e+01 3.601361454539500784e+01 5 | 1.989741921651644319e+01 4.929038686532997104e+01 1.886370891940553207e+01 6 | 2.350852729303023381e+01 1.861257917553535179e+01 2.132502578154735318e+01 7 | 2.812937812538977767e+01 2.884225124309305599e+01 4.138327704224578696e+01 8 | 1.815929067114952744e+01 5.375231399385046416e+01 3.807642346993973348e+01 9 | 4.608712860309903192e+01 2.669111647633819473e+01 4.126355530246952696e+01 10 | 4.513589492597331798e+01 1.667957489884884481e+01 2.178497752312249958e+01 11 | 1.556381995908371252e+01 3.350661041070883073e+01 2.358818703451268561e+01 12 | 2.749375984929144323e+01 4.126444922669232795e+01 3.126663793365019828e+01 13 | 5.412852505049659868e+01 2.570554377310060801e+01 2.925510617314055750e+01 14 | 3.810030093269799778e+01 1.279967192253480590e+01 3.426525606819208036e+01 15 | 2.808077672792347812e+01 7.677586833631472096e+00 2.699058685663384693e+01 16 | 1.915869855596923799e+01 2.486179563516663293e+01 3.247603110264380888e+01 17 | 1.059195745026367064e+01 4.477054984547297067e+01 2.652012097622541376e+01 18 | 2.803980263719321897e+01 3.119056675531310319e+01 2.260150860097406067e+01 19 | 2.007368575178706394e+01 3.879227629250535614e+01 4.002622610006856263e+01 20 | 3.745668287136004437e+01 3.413497005930207706e+01 3.698557946118288697e+01 21 | 3.111413978204723918e+01 1.753287201313009547e+01 4.212077352389094642e+01 22 | 3.546983123668935178e+01 2.197825075635863357e+01 2.043311347659138377e+01 23 | 4.977243093380950256e+01 7.480712406636273570e+00 2.506496677611673718e+01 24 | 4.737674007307561652e+01 3.394967971694121900e+01 3.323336193162826646e+01 25 | 1.768951612437345844e+01 5.439548508210174305e+01 2.771740807110093030e+01 26 | 4.561111229106690956e+01 1.593806112676274722e+01 4.126708187179118426e+01 27 | 1.171766521685863083e+01 4.583447242629151219e+01 3.807350422866919359e+01 28 | 2.504900495274677752e+01 1.662873409172924610e+01 3.177261778816833271e+01 29 | 4.690729290686621766e+01 2.634901408122698285e+01 2.176609425135061215e+01 30 | 6.935013899601086607e+00 3.459695074540121595e+01 2.814236314589308563e+01 31 | 2.119948675168858543e+01 4.106589148591054794e+01 2.338126537751555745e+01 32 | 3.674227173507995303e+01 2.492995025111369500e+01 4.236278568037083403e+01 33 | 5.236933741873750847e+01 2.067551514480049235e+01 3.711268092586902156e+01 34 | 2.228241688764281037e+01 2.019744055074011158e+01 3.969110776636915006e+01 35 | 2.130744082369674430e+01 4.721923289718749572e+01 4.351824693401744071e+01 36 | 4.699120325277385746e+01 1.507133177851777717e+01 3.065434420266941729e+01 37 | 3.295868137724012570e+01 1.524932407726601546e+01 2.578458985667520054e+01 38 | 1.283437168475211188e+01 3.056989625015430434e+01 3.489943083577264105e+01 39 | 2.300945802892550063e+01 4.931583447069881743e+01 3.172722377986649533e+01 40 | 2.839209307839914231e+01 3.585710864923187557e+01 3.724367047790141783e+01 41 | 5.215725050507459315e+01 1.903805111223845969e+01 2.517550330478292508e+01 42 | 3.375013316144195130e+01 3.704653934152812411e+01 2.849975773211482277e+01 43 | 2.184784341447354095e+01 2.573730250445615653e+01 2.440991063452080923e+01 44 | 3.042516662341402522e+01 1.142194774656296374e+01 3.560680774132244153e+01 45 | 4.457031675452192587e+01 8.948343001255567586e+00 3.770423890579704818e+01 46 | 2.201839732508406300e+01 3.181879328516549776e+01 3.648298866138389940e+01 47 | 2.223594767986720910e+01 1.195418212913122602e+01 2.488964524145891488e+01 48 | 1.290733371951980146e+01 5.033340924177025499e+01 3.142170435110497451e+01 49 | 2.833275099423902077e+01 1.297596382690498729e+01 2.063499086201612442e+01 50 | 4.009497174172786771e+01 1.428612312897973879e+01 2.646565611912425453e+01 51 | 1.025881053114370722e+01 3.878126469402126020e+01 2.254853184291968304e+01 52 | 2.221665027281855487e+01 3.368107725320694357e+01 2.622526320056871540e+01 53 | 4.921073384512089888e+01 3.186012770996105203e+01 2.669503061100941110e+01 54 | 1.377327678365052321e+01 3.574042803128452306e+01 4.115064633002509709e+01 55 | 2.403622575484527601e+01 4.388725747244257036e+01 3.724515825739447905e+01 56 | 8.357404024692920430e+00 4.082571468392387004e+01 3.309328333798517718e+01 57 | 2.792026895395805397e+01 2.389087298763484668e+01 2.050495345155781735e+01 58 | 3.475647001090059263e+01 2.857190101819390193e+01 2.140453327533638372e+01 59 | 3.763915202638531099e+01 1.789375265430135187e+01 4.185086782534155958e+01 60 | 5.188723791446562217e+01 2.717647831518723578e+01 3.750831026674563873e+01 61 | 1.633178301471090066e+01 4.918022582622469940e+01 2.419074597588388897e+01 62 | 2.349703246738504347e+01 1.440676704829516552e+01 4.187269971141702740e+01 63 | 4.043083162708470724e+01 2.952244413581930971e+01 4.030104914733857413e+01 64 | 5.036603148981546241e+01 1.328702030130045131e+01 2.201064097357318161e+01 65 | 4.470245884467929898e+01 1.003905815432113791e+01 2.763138669605305608e+01 66 | 1.602964090455344603e+01 3.082960847449701802e+01 2.912282155990185117e+01 67 | 2.803838635027370074e+01 3.638285130373451892e+01 2.638561225779321973e+01 68 | 5.150151434873797029e+01 1.489325978620822433e+01 4.001773944192832744e+01 69 | 2.238087813902857803e+01 4.655771586286323327e+01 2.632158555997096272e+01 70 | 2.306547286991071744e+01 1.246151430615701017e+01 3.571704433092660480e+01 71 | 5.219594058198210007e+01 1.902132963546375422e+01 3.122781412623651320e+01 72 | 3.066160840937655152e+01 2.355243855183899271e+01 4.279359414707665366e+01 73 | 3.917485245241268643e+01 3.521641439101703241e+01 3.132445196777372232e+01 74 | 4.214702666723158586e+01 2.184864529114950571e+01 2.108559295795624422e+01 75 | 4.111678698116459429e+01 2.781091660413359534e+01 2.165892601164786768e+01 76 | 2.267042087977640463e+01 2.613653746112573728e+01 3.952921618678742988e+01 77 | 3.385603631105205125e+01 3.085302801358049152e+01 4.035416128025595128e+01 78 | 1.578425849596685815e+01 4.312057318950186158e+01 2.311606556776300181e+01 79 | 5.142798082392634740e+01 1.163680538322963187e+01 2.866674222239702274e+01 80 | 1.465275423057787307e+01 4.143048880246990251e+01 4.022344226315149740e+01 81 | 3.143408051444244933e+01 1.797111794440979082e+01 2.093416608496682585e+01 82 | 4.407534754993624659e+01 2.130574663847877659e+01 4.178354402001338741e+01 83 | 3.083403161448025642e+01 1.470859371141165894e+01 3.092057080707997940e+01 84 | 2.116332494483597415e+01 2.038425041249231384e+01 2.984694638777040510e+01 85 | 5.187496514178377538e+01 3.088242892960359853e+01 3.147241177348680807e+01 86 | 1.653284096197758402e+01 4.884614799271696484e+01 4.000625133450777327e+01 87 | 4.626334882790962411e+01 3.129685324067638064e+01 3.832780556347724854e+01 88 | 4.360248842805254554e+01 1.380101186853375417e+01 3.551852468769274651e+01 89 | 9.796604404059893412e+00 3.317459901009193857e+01 2.377879467650013723e+01 90 | 3.416580558743983431e+01 3.326178289596978033e+01 2.394008082820801064e+01 91 | 4.824913966649959463e+01 1.069509982751697663e+01 4.108290078324836259e+01 92 | 5.174658653797660435e+01 2.450568885370509165e+01 2.474520693226589785e+01 93 | 2.581187829268923650e+01 1.194421930219914074e+01 2.897303955449822865e+01 94 | 3.081370708571146722e+01 3.748839972441894730e+01 3.291743360169642330e+01 95 | 3.589848973747556471e+01 1.301195536351683835e+01 2.958203926800024419e+01 96 | 4.493939137222852764e+01 3.074691993341910035e+01 2.364549421507049232e+01 97 | 4.718372489959198646e+01 1.069652067430923204e+01 3.340254437190237269e+01 98 | 8.164903906119812760e+00 4.045479985443006399e+01 2.801957056850176286e+01 99 | 1.040508872423271036e+01 4.541787082061737379e+01 3.251932553124979819e+01 100 | 2.606469252769308298e+01 8.677444733459667603e+00 2.203439804803755919e+01 101 | 2.805587094172808804e+01 1.157351694206069226e+01 4.226821389992471723e+01 102 | 3.623885438158252015e+01 1.684589486981487383e+01 2.198376924773732100e+01 103 | 4.411060790338764548e+01 3.459617821118025205e+01 2.945175651311200227e+01 104 | 1.614661735460898839e+01 3.241782909735467655e+01 3.822474612706082553e+01 105 | 2.984335078669252894e+01 7.952747461323877332e+00 3.910884542528877716e+01 106 | 3.303776295095967441e+01 1.515390846770508659e+01 3.750793729991982417e+01 107 | 4.589398928368260044e+01 1.127762407928516630e+01 2.250480535120044578e+01 108 | 2.622943208481087041e+01 2.055991738072020425e+01 4.256933143879074066e+01 109 | 2.701071629248309591e+01 7.947528212812991377e+00 3.511967165473397046e+01 110 | 4.952650816457268945e+01 2.284069496530395682e+01 4.043246627120158365e+01 111 | 2.020040650835885998e+01 4.990578142232572390e+01 3.591170471729322600e+01 112 | 2.583512288483763442e+01 4.281040484739629903e+01 2.699474730320024563e+01 113 | 8.482694131442061192e+00 3.252963840285642760e+01 3.566013700444906931e+01 114 | 4.153318409877287820e+01 1.317517802171164476e+01 3.099720771644323847e+01 115 | 2.143196509390433491e+01 4.517199058146494650e+01 2.104715678133446133e+01 116 | 1.875649016563060201e+01 4.366753415100122737e+01 4.025752045395344680e+01 117 | 1.009391434079795324e+01 4.149450862303535814e+01 3.838650785024906753e+01 118 | 1.815499045523446142e+01 3.765967121674863449e+01 2.255009061329405284e+01 119 | 1.337992580998195358e+01 4.972125604804246990e+01 3.599505003728154406e+01 120 | 4.889009638126371726e+01 7.130174836153660323e+00 3.823364872667519165e+01 121 | 2.518342249014737533e+01 3.912387955868311451e+01 3.745515606766734606e+01 122 | 5.211740639785597295e+01 1.452030448024229337e+01 3.517657091070007880e+01 123 | 5.031955335715641553e+01 3.122016208058219178e+01 3.569390261962875854e+01 124 | 1.906518587171796497e+01 5.147617831490030227e+01 3.137371160843245121e+01 125 | 2.131592886941770359e+01 2.046203178883630613e+01 3.435093024855758159e+01 126 | 3.317414756658016017e+01 3.515480721240719220e+01 3.791627810049023850e+01 127 | 2.239042526228692864e+01 1.616396286313936059e+01 2.643640077097054331e+01 128 | 3.130815054295518252e+01 1.110042403838642500e+01 2.585848815690987479e+01 129 | 2.062918988907147622e+01 2.967784659018998639e+01 2.733920419870036511e+01 130 | 4.356126148859679148e+01 3.373139465364539546e+01 3.579928929491522638e+01 131 | 6.331824716761349947e+00 3.689996434318582885e+01 3.293062263506966758e+01 132 | 4.933198557634050729e+01 2.037599991632310292e+01 2.209942616511477453e+01 133 | 3.408780962717223417e+01 2.101015820470366435e+01 4.264399497332600220e+01 134 | 8.696087133833653837e+00 3.214049560498391855e+01 3.143199752595410601e+01 135 | 2.453269269752824400e+01 3.907632332760874760e+01 2.506228738455711280e+01 136 | 2.445406486903336329e+01 2.869745047942334892e+01 2.290378565705611535e+01 137 | 2.291143793657226979e+01 1.668062401057035515e+01 3.539710441526951001e+01 138 | 5.445637343251022600e+01 2.686743180338973502e+01 3.328034282054238702e+01 139 | 5.241768637059895752e+01 1.458025892872780460e+01 2.544030525948007337e+01 140 | 3.093880132758377144e+01 2.704849617376569526e+01 2.057833159979768922e+01 141 | 7.092082336888840821e+00 3.709022443563588922e+01 2.477673384666978151e+01 142 | 2.721519741605650111e+01 1.713617095952674063e+01 2.022978717537812443e+01 143 | 2.513816110324481201e+01 3.080564856261539575e+01 3.900005384855221280e+01 144 | 5.183633519988288185e+01 2.867259979898069844e+01 2.652507245257576329e+01 145 | 1.222058749665957222e+01 3.082059864415082728e+01 2.760696697162311608e+01 146 | 2.617445402140775812e+01 4.439482810106402155e+01 3.356111739169931241e+01 147 | 4.109577149424660547e+01 1.793238997658305323e+01 2.158597276043014901e+01 148 | 3.382072096439770803e+01 1.376678620060184599e+01 3.349756604700216656e+01 149 | 2.818181982261524254e+01 1.442135326965050268e+01 3.405729645254029236e+01 150 | 4.172104542082946921e+01 1.599034522606046416e+01 4.015779948732400584e+01 151 | 1.888673086806174695e+01 3.054155976826172036e+01 3.427008216237205573e+01 152 | 2.729326836129839151e+01 1.648359306052144646e+01 4.282179363855289722e+01 153 | 3.942841841290034210e+01 2.147959007138794618e+01 4.219533395461463243e+01 154 | 2.284751767179649207e+01 3.562933916724358596e+01 3.746625956336333729e+01 155 | 1.004178415626058829e+01 3.720392276646614249e+01 4.085542027800506304e+01 156 | 2.366650150507333450e+01 1.279030091162564808e+01 2.123609837606328554e+01 157 | 3.184197237277119186e+01 2.729789226656221501e+01 4.213961311953554656e+01 158 | 2.105799194332371016e+01 4.821285387559141355e+01 3.938854461899953918e+01 159 | 2.989706947604109999e+01 3.211724082766735222e+01 4.003656085489581784e+01 160 | 2.092447948978812278e+01 2.343605615506804796e+01 3.723421076933015428e+01 161 | 4.844339543123187042e+01 8.285232407894868700e+00 2.869002950440944488e+01 162 | 2.588653397598072559e+01 2.442206986567103399e+01 4.191617250635237468e+01 163 | 2.189797974429091099e+01 2.003245659379976118e+01 2.596577382265007117e+01 164 | 1.757661191464434225e+01 3.578888067208639967e+01 4.025728126816309072e+01 165 | 1.535579430338658824e+01 5.128866381882425429e+01 2.805626400903162221e+01 166 | 5.081221480211009123e+01 1.898463658272779853e+01 4.025201057031321028e+01 167 | 2.010484416769062577e+01 4.947670301728398101e+01 2.506821119554648902e+01 168 | 4.460039332684559810e+01 1.214668150445712769e+01 3.989693988090710519e+01 169 | 2.981363131161092994e+01 9.397714877397577382e+00 2.267670673045131480e+01 170 | 1.617630923219012828e+01 4.740024474741289140e+01 2.080949625457684959e+01 171 | 5.088276513207004115e+01 1.529027332100856285e+01 2.961929265722820759e+01 172 | 3.122833658153204439e+01 1.397894227757952734e+01 4.074501875336730450e+01 173 | 4.011589330272131804e+01 1.445618394234355009e+01 3.704146765922385498e+01 174 | 3.153857911460034202e+01 2.278434756719577337e+01 2.022158200890740076e+01 175 | 4.360732286396833501e+01 1.378175548035368791e+01 2.418214309214064883e+01 176 | 3.704302433047237741e+01 2.540568983243698753e+01 2.069400003122141385e+01 177 | 5.341634562901694494e+01 2.259350974359492170e+01 3.404027337624230398e+01 178 | 2.271171853553975595e+01 2.204717673966086977e+01 2.264821305571796728e+01 179 | 1.690645037695826147e+01 4.716004114420144333e+01 4.334424477413809740e+01 180 | 1.190291767004797663e+01 4.818073511177896506e+01 2.735529161052387082e+01 181 | 1.446413351872821451e+01 3.972432186770809182e+01 2.228924938856056315e+01 182 | 4.043390087144290135e+01 2.613296940058925344e+01 4.185973455812592192e+01 183 | 3.180075042679584385e+01 3.605047177553185378e+01 2.551195044252286692e+01 184 | 2.572241639553465475e+01 3.299565232365685574e+01 2.483621959265570212e+01 185 | 1.616768142505602768e+01 5.243112053117175719e+01 3.526473706500619443e+01 186 | 2.461910528939930032e+01 4.655849546086635371e+01 2.924025658835006425e+01 187 | 2.676255255011336942e+01 3.931068412246040111e+01 2.825076936170512099e+01 188 | 1.077590661513496073e+01 4.207601057023405389e+01 2.407765709130423915e+01 189 | 1.501115503843796262e+01 4.525443659082920078e+01 3.951307328767774862e+01 190 | 1.959923572643926093e+01 2.388894830377785894e+01 2.904076645710000193e+01 191 | 2.741174859243925610e+01 2.738857092621854150e+01 2.115148755303070160e+01 192 | 2.467690916509134880e+01 8.861766941523312013e+00 2.753200734439851516e+01 193 | 1.793307764417672701e+01 3.221952427096409366e+01 2.642220427939479066e+01 194 | 4.811018270437752165e+01 3.366102971713517178e+01 2.973808302705616313e+01 195 | 2.002633426449544984e+01 2.728615275097129711e+01 3.522085572747878501e+01 196 | 3.865955775806003913e+01 3.055194956166380393e+01 2.309246540219005794e+01 197 | 3.690320482950559722e+01 1.493935435668585043e+01 2.504501353877837033e+01 198 | 4.397653298309882786e+01 1.351265704328958606e+01 2.768827896710821435e+01 199 | 1.265280727995473953e+01 3.143047190943278935e+01 3.831662735703033462e+01 200 | 3.150093635053733010e+01 1.364175075528073400e+01 2.301980792964575784e+01 201 | 4.027418644609785758e+01 3.232599840726633289e+01 3.803235172938664022e+01 202 | 4.888376633382866032e+01 7.874132376458736537e+00 3.459828388447771630e+01 203 | 2.262983165746398839e+01 1.088108683168154300e+01 3.992075281081113047e+01 204 | 5.123529201799407673e+01 9.501222768812377595e+00 3.934931310580017794e+01 205 | 2.691184949493872836e+01 4.095934845492500642e+01 3.502281325115185240e+01 206 | 1.859964169869532924e+01 2.819911140440406427e+01 3.157081194260887003e+01 207 | 1.185499051392188363e+01 3.058854959595218048e+01 3.154106311485979930e+01 208 | 4.853152209323025801e+01 2.857494973059983323e+01 3.968643936350768797e+01 209 | 4.921847039008563485e+01 1.651789791790806206e+01 2.160912741084833044e+01 210 | 4.946133214834776481e+01 9.773484212816331507e+00 2.250315808410466900e+01 211 | 4.543992789757665207e+01 2.276436090980806881e+01 2.131211848155146882e+01 212 | 2.270364699766953720e+01 4.127255398600468084e+01 3.901037779687368356e+01 213 | 1.394064167384457598e+01 3.597239403155521131e+01 2.187051983819361567e+01 214 | 5.012605122178288042e+01 1.241945407978818849e+01 3.334692936415165576e+01 215 | 2.775530471287389744e+01 1.519493476556609934e+01 2.955246303913380146e+01 216 | 4.828002930378293911e+01 2.904140651954966401e+01 2.331209082447855252e+01 217 | 1.788478800461036755e+01 5.211072197349491830e+01 2.478740190985363157e+01 218 | 2.418415639788994298e+01 1.792585489591003522e+01 4.224537603360653293e+01 219 | 3.622934246424197369e+01 3.625009174361220232e+01 3.249809033141755066e+01 220 | 2.681319194503891978e+01 3.759415007886645554e+01 3.490157948903718932e+01 221 | 1.266181684710686994e+01 4.591240403940687997e+01 2.419924142256540023e+01 222 | 4.509215689764950241e+01 8.738594689726387088e+00 2.462037810633265522e+01 223 | 3.886048494351322091e+01 2.020937077809032090e+01 2.083161621029097788e+01 224 | 3.050349667445926372e+01 3.740205357697825406e+01 2.847965781108543126e+01 225 | 2.007072122581025297e+01 3.526791725149562495e+01 2.435488672997874460e+01 226 | 2.346648378599670792e+01 4.727861446949910373e+01 3.422329913395807921e+01 227 | 3.707641439078781787e+01 2.802511379350585585e+01 4.143876286059309422e+01 228 | 3.106069789354117106e+01 3.273136823795793049e+01 2.316592824065586598e+01 229 | 3.827375105935634281e+01 3.511336073762416277e+01 2.821108444686877803e+01 230 | 2.998628293725569449e+01 1.345333427917094227e+01 2.797477858090947223e+01 231 | 4.204913464287297131e+01 3.463203881745852897e+01 3.308544073955774678e+01 232 | 1.023957615077767436e+01 4.396836407184091655e+01 3.589629058363998126e+01 233 | 4.793977677259435666e+01 1.208939834691350335e+01 2.987981955984499294e+01 234 | 1.145484967915527363e+01 4.731115561362023669e+01 3.507938219073716368e+01 235 | 4.312658505083857108e+01 3.353587387627559480e+01 2.658126438996078633e+01 236 | 3.187418193895575769e+01 2.993255210621704521e+01 2.181531517530821418e+01 237 | 3.119112275657366240e+01 3.691772473023709722e+01 3.605456534363236187e+01 238 | 2.201390240206218607e+01 1.406143917661976417e+01 3.828556971730206016e+01 239 | 2.445551181294313636e+01 2.455265425947102287e+01 2.167969323463004372e+01 240 | 9.165670058613169857e+00 3.197468301836292426e+01 2.827634280533343869e+01 241 | 7.514758955352302650e+00 3.903859475797528233e+01 3.656975420263807308e+01 242 | 2.465867685891140226e+01 1.489648184042454915e+01 2.879931140208016416e+01 243 | 4.755189701771765698e+01 2.051999077838087970e+01 4.129423760536468535e+01 244 | 5.235144282384199244e+01 1.752937968970614335e+01 3.612695878558536577e+01 245 | 3.613910272675466473e+01 3.483098545022378545e+01 2.584069195931405005e+01 246 | 1.948725052088830267e+01 5.182634599533230357e+01 2.785631606348217559e+01 247 | 4.383470357387014360e+01 3.001050252767630866e+01 3.981037456879627001e+01 248 | 3.689661609380807050e+01 3.104260317826794946e+01 3.970268490753890234e+01 249 | 5.237675683077626587e+01 1.259608318593438447e+01 3.810447804977920327e+01 250 | 9.974861192472712190e+00 4.404816552853335310e+01 2.946762275676979215e+01 251 | 2.724374846742552947e+01 2.087790625868457184e+01 2.035648554180572845e+01 252 | 3.638716885075130136e+01 1.387959466494903893e+01 3.660106019059648474e+01 253 | 2.672393601152607445e+01 1.169664043029318456e+01 3.398159292756403715e+01 254 | 4.402181954007860298e+01 2.439397409675476425e+01 4.182901720165201453e+01 255 | 2.503314446694552231e+01 2.815502982818898658e+01 4.055756653071853890e+01 256 | 4.504498447259143035e+01 1.971178078531074718e+01 2.137092668050065924e+01 257 | 3.477800913807168115e+01 1.592895059762480514e+01 3.990390458373641991e+01 258 | 2.902093428549901333e+01 2.611055035622127107e+01 4.245722129240414944e+01 259 | 1.680289956892868020e+01 3.067348302178292130e+01 3.205735748167975174e+01 260 | 2.249384927032311055e+01 4.360446680390854368e+01 2.441689972941399134e+01 261 | 1.908852545091844277e+01 3.249665098792181084e+01 3.672528794188917090e+01 262 | 3.117041989481365505e+01 1.489215496994404120e+01 3.437936493824727080e+01 263 | 1.011622963796592600e+01 3.564852491878288276e+01 2.211174469109937846e+01 264 | 1.853639187041317982e+01 4.533892866446198155e+01 2.029146221500742087e+01 265 | 2.269444001809810629e+01 2.960774395037815410e+01 2.517928068808298292e+01 266 | 6.851783576251627039e+00 3.869967689327658888e+01 3.004636749123040929e+01 267 | 4.922726617602604904e+01 2.461009451924973490e+01 2.245495963366519376e+01 268 | 5.314705376554639571e+01 2.508660340720890858e+01 3.583315438065626779e+01 269 | 1.592782318922410489e+01 5.167901037768440631e+01 3.092644424535161818e+01 270 | 5.369579226082478840e+01 2.258180378948955891e+01 3.110156281819633861e+01 271 | 1.732253719163991690e+01 3.972275866633739838e+01 4.054320150903266295e+01 272 | 2.478160731588368293e+01 3.648021651179241331e+01 2.639344489385614523e+01 273 | 2.337217941984617298e+01 1.569138253933669702e+01 2.122636888231474117e+01 274 | 2.207710243770076275e+01 3.805209061847407526e+01 2.389142735852468746e+01 275 | 2.098605485796114678e+01 4.458534138706484384e+01 4.238169011330777636e+01 276 | 4.374777700424419891e+01 1.845187848673445785e+01 4.152070768595929451e+01 277 | 2.205613548525584022e+01 1.914588519307728021e+01 3.679814883097365197e+01 278 | 5.320774341296083065e+01 2.350037426214217717e+01 2.765908166958866232e+01 279 | 3.428436331015678462e+01 2.470190899263022288e+01 2.033766865929329626e+01 280 | 1.388208522238049625e+01 4.801507140585633948e+01 3.823287802118190370e+01 281 | 1.601936309173095907e+01 5.031742640922156795e+01 3.717839718770459001e+01 282 | 2.342021310341871043e+01 9.668773294492090997e+00 3.614276336154259184e+01 283 | 3.865602004166058947e+01 1.261868699858626997e+01 3.015984728513325308e+01 284 | 2.709718917624742218e+01 7.304564126068593843e+00 2.434903218623295729e+01 285 | 4.347509127606837609e+01 2.480450083522537597e+01 2.114566156178507939e+01 286 | 2.015672790058262720e+01 4.942825246427307917e+01 2.223233193328270829e+01 287 | 4.842105252292569872e+01 1.607361183638138158e+01 4.154078450512407272e+01 288 | 5.124347211644516875e+01 3.108760992889319397e+01 2.872683953113045519e+01 289 | 2.041191605243149709e+01 2.558077499754683259e+01 2.682926453663515431e+01 290 | 2.339267917843667988e+01 1.250441154989764314e+01 2.764629445991197443e+01 291 | 2.438921167142494184e+01 1.174645895862206757e+01 4.207705115467067003e+01 292 | 5.249674140609413087e+01 1.941839175234660431e+01 2.846017365109975472e+01 293 | 2.294762229671248122e+01 2.921322566256249331e+01 3.825581772963570870e+01 294 | 4.685980619787379453e+01 8.550252384347551526e+00 3.992490051989049960e+01 295 | 5.086621310726881973e+01 2.501364794951190618e+01 3.926952529822020210e+01 296 | 4.933972390714930611e+01 1.642471900179615218e+01 3.166162840509711884e+01 297 | 1.096036462352117802e+01 3.456508833800796054e+01 4.087957367967221245e+01 298 | 4.390877270908052310e+01 1.417621350771226574e+01 3.205170244666466317e+01 299 | 4.852202158587135017e+01 2.543920958171169033e+01 4.079692705543492082e+01 300 | 1.820441728946393312e+01 4.042280488216410106e+01 2.266098927055933743e+01 301 | 5.152596153432330794e+01 1.671546729602071224e+01 2.311520597209718275e+01 302 | 2.515803329367049201e+01 4.691241395273281967e+01 3.192305756704185882e+01 303 | 7.852963438141463470e+00 3.363659277350613053e+01 2.573479755880830311e+01 304 | 2.649435182699881608e+01 1.385951558043496590e+01 4.277120556114179095e+01 305 | 4.532683801290026793e+01 8.847930418125603325e+00 3.507462131542466466e+01 306 | 1.891732264721112600e+01 4.971645125400626597e+01 4.100223309046390341e+01 307 | 1.436308266681354517e+01 4.978186908428205015e+01 2.601652692829169311e+01 308 | 3.673594375403335732e+01 2.045219819563097730e+01 4.237470046311200633e+01 309 | 1.902149026986943170e+01 5.374303133209625116e+01 3.549938631847999204e+01 310 | 5.129712126925163318e+01 1.651692434523117115e+01 3.352823470909493864e+01 311 | 6.881020340891314646e+00 3.488835533902101105e+01 3.599588824957845645e+01 312 | 5.278329508492131339e+01 2.865111764327675914e+01 3.442479263848439786e+01 313 | 8.874074681293771860e+00 4.045339435096403236e+01 2.505761909061185833e+01 314 | 4.797985012461256815e+01 3.281055013143517840e+01 3.558781919259749316e+01 315 | 4.262516272008217300e+01 3.192752039581026935e+01 2.449905186100474097e+01 316 | 3.874945202147536349e+01 1.636566608453718530e+01 2.271544086618476399e+01 317 | 7.897336219406855484e+00 3.383035202895663218e+01 3.825634171101430780e+01 318 | 1.171329945957308283e+01 3.150695090169779178e+01 2.509794395573460335e+01 319 | 2.888854726362412606e+01 3.769873165485462607e+01 3.110896474548457746e+01 320 | 3.910488472048167097e+01 1.553784661752430374e+01 3.923696192519908266e+01 321 | 5.054944517102001811e+01 2.799959150976429356e+01 2.431213667360978548e+01 322 | 4.646553420298398152e+01 7.264907100539202744e+00 3.686233791788281877e+01 323 | 2.012226156619624717e+01 2.174021621805346172e+01 3.186464350067821982e+01 324 | 4.563847537373147389e+01 1.410065068082076323e+01 2.205541197441825574e+01 325 | 3.792467591017955186e+01 2.841725689510753483e+01 2.172871099714286558e+01 326 | 2.100045551845933289e+01 4.663654590346332895e+01 1.890787595378704111e+01 327 | 6.563229194944381284e+00 3.716680905756506093e+01 2.734717197766620700e+01 328 | 5.090995258053407468e+01 2.235371596009002104e+01 2.353503235749791145e+01 329 | 1.693129352818262490e+01 4.526585998759816221e+01 4.126615039222986070e+01 330 | 4.087379771419796270e+01 1.934545103834459212e+01 4.186432509418519743e+01 331 | 1.321242265281818895e+01 4.329947936965187694e+01 2.341510276311114325e+01 332 | 3.353072985805901851e+01 1.380260894419349782e+01 3.029185164632092864e+01 333 | 1.562905645353522210e+01 4.624176698129765128e+01 2.306541209337849097e+01 334 | 4.692688150015626292e+01 3.307211101390655017e+01 2.688155649656328450e+01 335 | 2.581753878323239704e+01 1.385799803178606560e+01 2.026429524255399528e+01 336 | 4.735569393948304651e+01 8.241185550626324741e+00 2.346607583587458379e+01 337 | 5.257493606065625613e+01 1.942281854147806541e+01 3.438004735944068102e+01 338 | 4.168378718561716312e+01 1.601453325295839747e+01 2.320959786432300831e+01 339 | 7.098660557649033365e+00 3.389770170695846474e+01 3.243383098641311335e+01 340 | 5.070647632942201000e+01 8.144073576667016923e+00 2.737251690086444356e+01 341 | 2.223159850378011626e+01 1.960697702040175372e+01 2.344803476015888322e+01 342 | 2.117743415524004646e+01 2.934491918179647030e+01 3.625278999274196678e+01 343 | 2.313423310250501430e+01 3.798880019511801009e+01 3.851521692926775131e+01 344 | 4.104432668283362773e+01 3.468607662103234901e+01 2.964404238778540446e+01 345 | 4.058143465505425951e+01 1.338425581027099653e+01 3.475963522221091040e+01 346 | 2.998830910034422104e+01 9.411442752025484637e+00 2.726189455193336286e+01 347 | 2.778018331830991983e+01 1.036558424379036758e+01 2.116564169020325537e+01 348 | 4.473526018322652931e+01 1.162250915390683303e+01 3.481049997260721085e+01 349 | 2.285549332157449598e+01 9.477839360978423500e+00 2.486844444699994483e+01 350 | 3.591458774051616132e+01 3.048435335329639884e+01 2.263461392009839912e+01 351 | 1.850996254148420661e+01 5.182426405026544103e+01 3.389685710991434320e+01 352 | 2.779955149855194918e+01 3.444503851522922844e+01 2.472760289773186315e+01 353 | 3.968654042164871498e+01 3.412769777478526123e+01 3.577994202797734147e+01 354 | 5.332133724614745773e+01 2.888590098723080146e+01 3.088327792336630395e+01 355 | 1.284251602884009991e+01 5.004561209137656164e+01 2.878916359022190719e+01 356 | 1.770572038631183531e+01 4.803013213432514306e+01 1.876777517584099542e+01 357 | 1.592826774238199938e+01 5.348078950423394673e+01 2.615248771200916522e+01 358 | 1.795157425557048825e+01 3.383568225091264736e+01 2.432237352257602936e+01 359 | 4.961507013853895387e+01 3.281944969466548656e+01 3.306823354273031157e+01 360 | 4.383500491372993935e+01 1.161052834913114751e+01 2.541969975152663253e+01 361 | 4.497765385262505333e+01 3.458893745510663820e+01 3.290041336234888547e+01 362 | 3.366390831319944965e+01 1.603167848713754040e+01 2.351394233620529661e+01 363 | 1.477400070805972199e+01 5.132545601958796055e+01 3.311405445621111454e+01 364 | 2.749103655965683757e+01 3.146617860142536216e+01 3.992449281144199347e+01 365 | 3.396547750248382158e+01 3.707101875264186219e+01 3.314819148864097542e+01 366 | 1.522768472481879343e+01 3.058514542362262034e+01 3.398786077319679322e+01 367 | 2.790858729922387482e+01 9.213305501844809342e+00 4.147953543719614089e+01 368 | 3.555816233486263656e+01 3.558586656890457789e+01 3.629471758318074137e+01 369 | 3.110182016368174729e+01 1.009638970597478291e+01 3.919438373262256192e+01 370 | 9.600318728938129098e+00 4.313712040509991397e+01 3.193901233553300756e+01 371 | 2.332694748727319833e+01 1.806208443606957204e+01 3.069730142838284337e+01 372 | 6.406904040031165870e+00 3.586338576853656690e+01 3.020309708648534297e+01 373 | 2.224500007872466512e+01 1.715713659256952184e+01 2.287686830968128859e+01 374 | 2.878211851241885100e+01 7.535025972778600867e+00 3.679184767095213004e+01 375 | 3.048430192539691319e+01 2.957497056919124745e+01 4.126185786765463348e+01 376 | 2.221564039290985448e+01 4.441864429924549995e+01 3.882191571455587820e+01 377 | 2.852370362049450847e+01 1.968103252256046076e+01 4.277164607918022909e+01 378 | 1.932769502649800231e+01 4.265553245454189835e+01 2.321722082774389406e+01 379 | 1.173225114434531768e+01 4.851940499779402671e+01 3.259788624023852321e+01 380 | 1.607380908930757712e+01 3.763097641614474753e+01 4.089174160123649671e+01 381 | 3.097660701868833755e+01 3.404454527998075974e+01 3.895342277460672875e+01 382 | 1.533762144576419573e+01 3.387832445072402976e+01 4.003104594087468371e+01 383 | 5.111929871121989777e+01 7.964426951588129633e+00 3.743609819039734532e+01 384 | 2.413929498873145718e+01 3.361333570713473051e+01 3.693565868133583763e+01 385 | 4.753227823278624697e+01 7.181431402361560856e+00 2.670157868448227845e+01 386 | 3.485182448948531686e+01 2.341858123530388625e+01 4.268191156686944510e+01 387 | 2.364872975976331659e+01 2.124307863224480641e+01 4.141889234157144983e+01 388 | 1.510429999780689947e+01 3.105453966864104132e+01 2.688130781817977422e+01 389 | 2.551455172576764951e+01 4.150495476324829980e+01 3.706683085783046749e+01 390 | 2.938982129463617810e+01 1.973669272711973832e+01 2.027453214474636312e+01 391 | 2.491064991029114495e+01 2.136832419511949155e+01 2.082037107146038935e+01 392 | 2.540851334366785252e+01 1.535954312843761826e+01 3.381176941571418837e+01 393 | 4.358832837710973962e+01 1.429243328789411649e+01 3.939559176996731082e+01 394 | 2.907684462474604459e+01 2.928906983742072967e+01 2.151250307395002181e+01 395 | 4.785207486524811316e+01 1.851051511280969208e+01 2.146742793414753336e+01 396 | 1.521725702438808625e+01 3.106554475932616199e+01 3.644808415354905407e+01 397 | 2.699924137252979861e+01 7.369160495615963313e+00 3.955572035429833022e+01 398 | 3.382185631314574437e+01 1.822491309843598728e+01 2.108752554144087554e+01 399 | 3.782284726952531884e+01 1.312670277929958473e+01 2.796110386710203244e+01 400 | 1.273284600420319634e+01 4.000890034352340052e+01 4.046503594555023398e+01 401 | 5.242420400801037061e+01 1.242003467158970587e+01 2.648023042507432834e+01 402 | 5.194058179321057622e+01 1.269386192208832576e+01 2.370967913150290229e+01 403 | 1.976717713423315459e+01 2.452095447719896626e+01 3.474570302361476593e+01 404 | 2.200607403958544595e+01 1.422368826989482038e+01 2.423173893371237142e+01 405 | 5.243260029645031750e+01 2.212897069948511586e+01 2.589037824116810071e+01 406 | 2.156356950089576685e+01 4.755090926903888970e+01 2.193145206885986909e+01 407 | 3.288561293172875111e+01 2.085264596651094493e+01 2.038383407997354624e+01 408 | 1.432129635335301820e+01 3.188487421875458594e+01 2.476677159316190568e+01 409 | 1.284839644891003374e+01 4.278530160924930925e+01 3.957678531206911998e+01 410 | 3.134530513269238128e+01 1.323806637813073017e+01 3.676436271105924902e+01 411 | 2.204723223390359266e+01 4.631312600945588542e+01 2.401676576663952645e+01 412 | 2.979747441751659309e+01 1.630473245013479655e+01 2.088907948948586224e+01 413 | 3.398569831366018690e+01 2.814685785287356268e+01 4.176442859813471387e+01 414 | 4.847909147352589088e+01 3.059406944115106342e+01 3.814521117706198083e+01 415 | 2.212620470491768288e+01 1.798560430022257961e+01 3.900257030226499211e+01 416 | 3.493970683341532180e+01 1.437282974000403257e+01 2.660962575635176819e+01 417 | 1.169319428878051959e+01 3.398298450105158963e+01 2.244283991780620724e+01 418 | 4.571264349910436664e+01 1.153588224232663961e+01 2.907920636530360170e+01 419 | 1.855963322948604244e+01 4.796494225877756890e+01 4.474242852951486071e+01 420 | 3.186144989188024468e+01 3.746847412380160591e+01 3.034632899292516584e+01 421 | 2.867973687967234397e+01 3.384029350272369641e+01 3.888361668352732892e+01 422 | 1.590500937241872492e+01 3.744407087293464542e+01 2.210251958178396947e+01 423 | 2.317341751912919534e+01 1.735294794628471848e+01 2.823895012065025867e+01 424 | 3.164396283859234771e+01 1.491470062980924105e+01 2.859241408816166441e+01 425 | 5.253603879649527642e+01 2.321179928597051756e+01 3.700638932911418522e+01 426 | 3.935678148564325340e+01 2.376979264160142691e+01 4.227166773061495775e+01 427 | 4.912753766788214449e+01 1.278574568827723645e+01 4.136451779105993865e+01 428 | 2.618576825672757380e+01 4.404518104889970687e+01 2.888047907833244565e+01 429 | 2.229338860274264178e+01 1.171560309018153845e+01 3.782604996197785141e+01 430 | 4.833459860170517430e+01 1.230979692501192524e+01 2.169150259429934025e+01 431 | 8.370086876594408309e+00 3.490893170764683617e+01 2.341630104890524677e+01 432 | 3.668304939214706195e+01 1.266524172906346735e+01 3.249398276124512819e+01 433 | 2.434936923476041315e+01 4.258044223420047558e+01 2.523416536815497224e+01 434 | 4.233453173034918393e+01 2.274220761654721557e+01 4.198868900881263500e+01 435 | 2.021305947994538244e+01 3.894352007183624664e+01 2.297430172599574050e+01 436 | 1.944392805549549763e+01 2.851300661745435150e+01 2.886664362503145398e+01 437 | 4.459007440303644643e+01 3.254803930957345415e+01 3.740319775760774235e+01 438 | 2.700441007891425826e+01 4.169740209594530000e+01 2.855143770417795324e+01 439 | 3.610691538840330139e+01 3.315625461289392462e+01 3.847808535722875689e+01 440 | 3.441222431720360220e+01 3.609637572244284343e+01 2.648372460346179835e+01 441 | 2.324718301469546589e+01 1.807998598992697126e+01 3.369408267090291531e+01 442 | 1.247555451995395615e+01 4.063256885174872224e+01 2.272435043828149404e+01 443 | 2.203890954243212619e+01 2.344305416398250941e+01 3.916420053557826009e+01 444 | 1.198658580426996778e+01 3.752120802834840418e+01 2.194451791847422584e+01 445 | 1.712103677464568818e+01 4.939153367121211602e+01 2.057203465764355954e+01 446 | 1.028645722222972125e+01 3.114557146078599459e+01 3.300301540254695709e+01 447 | 1.702879504093022334e+01 5.457681753678728853e+01 3.598667532513992739e+01 448 | 8.356382388646302672e+00 3.866971768802141440e+01 2.385609876501341020e+01 449 | 4.639801977354161266e+01 2.239119321621667069e+01 4.153077667152086860e+01 450 | 3.360173539455784208e+01 2.677915039965924038e+01 2.064892064718214826e+01 451 | 4.544200608273011710e+01 2.796915643065058177e+01 2.206174391808141166e+01 452 | 5.144077809034367732e+01 1.756487053756759664e+01 2.975934200883581582e+01 453 | 2.558343021003109286e+01 4.332182073120178956e+01 3.578485755016696857e+01 454 | 3.189509648933479014e+01 2.116361275219702165e+01 4.272398770082332931e+01 455 | 3.832895716259410079e+01 1.798844699457042751e+01 2.130999429970994541e+01 456 | 2.412986333716149900e+01 8.699755139189484510e+00 2.305429892234233336e+01 457 | 4.005909828392822902e+01 1.328396608713083182e+01 2.840716742870565881e+01 458 | 4.015382817646907654e+01 1.280060859055680034e+01 3.270405124928056750e+01 459 | 4.638908307360491534e+01 9.003932423673090213e+00 2.870311092207196069e+01 460 | 2.406887564182353501e+01 1.067582481982508291e+01 2.154564350796928807e+01 461 | 2.012608880992583948e+01 2.243964909138986741e+01 3.423783870326306555e+01 462 | 1.817949523747336826e+01 4.994097484440221280e+01 2.296357237303005050e+01 463 | 2.070009212898368389e+01 3.181908427027343933e+01 2.701560689889958056e+01 464 | 4.551779846348149761e+01 7.970730220320924708e+00 2.663597177358178669e+01 465 | 1.839234703785865577e+01 5.475819231973350298e+01 2.570684412461966772e+01 466 | 1.925362305440259547e+01 5.153574832635540304e+01 3.695963066138779851e+01 467 | 1.057572248827805339e+01 3.196553752680737404e+01 3.843554918273209609e+01 468 | 2.314460918724073935e+01 4.568194367453779137e+01 3.647250188658082237e+01 469 | 1.815811032630238131e+01 3.128980750409212774e+01 2.834504015595903326e+01 470 | 4.610953250670250725e+01 1.269074486385976996e+01 3.355298625201552909e+01 471 | 4.872121433293961701e+01 1.467357727020580072e+01 3.273471852364335888e+01 472 | 2.651444889164942609e+01 2.646409519524421228e+01 4.176925688710498008e+01 473 | 8.370371500108829466e+00 3.771625431134830819e+01 3.962439666367068014e+01 474 | 3.761142250676890342e+01 3.342555420377046715e+01 2.519028082963756887e+01 475 | 4.928625429405019531e+01 3.016525054277037654e+01 2.480999010271640159e+01 476 | 4.253298519312166803e+01 1.444654565717396366e+01 3.755927988707217935e+01 477 | 1.723804647166686621e+01 4.512129039231971461e+01 2.226073725781848367e+01 478 | 4.601355022851053178e+01 3.412994058658728846e+01 2.864808406634661253e+01 479 | 2.060130807226279614e+01 2.571265164527018499e+01 3.651548986248651119e+01 480 | 1.734996115129949956e+01 4.912049311385551675e+01 4.269601877459621875e+01 481 | 5.144571632000801031e+01 1.066306142358451758e+01 2.343844375936753721e+01 482 | 4.585413904044990829e+01 1.849922690489637489e+01 4.154263579365366610e+01 483 | 2.343452210021471771e+01 4.831942886552455008e+01 2.992519752848195225e+01 484 | 2.277865447848484948e+01 2.437338173501183292e+01 2.293483031744998257e+01 485 | 5.067668661152497123e+01 2.886704635854532697e+01 3.781774304934925368e+01 486 | 3.573882373775595056e+01 1.700631274086517664e+01 4.142747207343043669e+01 487 | 2.522506656946629278e+01 7.562615113530487321e+00 2.597974219652425276e+01 488 | 2.160094690231197490e+01 5.033416070371328743e+01 3.055799960889450517e+01 489 | 2.582329135943799159e+01 1.869883848354181310e+01 2.030259969071088832e+01 490 | 2.426917359099547866e+01 7.812358761900679127e+00 3.831388498538136389e+01 491 | 1.702780028931169554e+01 5.232945206317550912e+01 2.874676206385375821e+01 492 | 2.710095434500524547e+01 4.256927716272894457e+01 3.318241573195127359e+01 493 | 2.503340638794932005e+01 8.532721848182838187e+00 3.538945817627553936e+01 494 | 2.582048226252420164e+01 3.126113802760591653e+01 2.369578958258683343e+01 495 | 2.332313150882625408e+01 3.196911269788840926e+01 2.582804203478177030e+01 496 | 3.205310059794850019e+01 1.612467123694759152e+01 4.091849593793634199e+01 497 | 2.484387771025788894e+01 4.533720930215854850e+01 3.484529350846436557e+01 498 | 5.270724827942563451e+01 2.550420633536280590e+01 2.628809173559438506e+01 499 | 5.032403873158974505e+01 1.663082002214275690e+01 4.096762020307657792e+01 500 | 5.008291122276956742e+01 2.724380563790971621e+01 3.940089431051225688e+01 501 | 6.617547045776401404e+00 3.736413557964976206e+01 3.576570203285477589e+01 502 | 2.129961251449061876e+01 2.144832287832344164e+01 3.687801727510317562e+01 503 | 2.353565671033788576e+01 2.462863973773584902e+01 4.061946928402051782e+01 504 | 5.096134859649159665e+01 8.771073632372656803e+00 3.495001779754062454e+01 505 | 2.947585285050649517e+01 3.560217715337829247e+01 2.515407499693648674e+01 506 | 2.505634321710557089e+01 1.643775701448699778e+01 2.034756307941740161e+01 507 | 3.311896375824410654e+01 3.257628024927274879e+01 3.954718195044044649e+01 508 | 1.309389374104098280e+01 3.272539538250021707e+01 3.982793561125428283e+01 509 | 2.245642822069022770e+01 1.378348054634774122e+01 2.637046080420203253e+01 510 | 9.285352007936602092e+00 4.208396919114531443e+01 2.754463101243619150e+01 511 | 1.242776230695353057e+01 4.774501538869913020e+01 2.544133870802784969e+01 512 | 3.728349948612700615e+01 2.339776588399059420e+01 2.057372811269087265e+01 513 | -------------------------------------------------------------------------------- /计算机视觉导论/HW3/mesh_pc/uniform_sampling_vis.txt: -------------------------------------------------------------------------------- 1 | 4.351841180774945173e+01 2.383368892625319546e+01 2.111497932957561119e+01 2 | 2.427599633789729694e+01 3.719205247516200785e+01 2.583128272966948913e+01 3 | 4.189777202668810929e+01 2.779298976784836483e+01 4.120375035298479816e+01 4 | 3.161196556959770376e+01 2.415474744905809246e+01 2.021592811836665504e+01 5 | 3.183825640093319720e+01 1.441250256000470920e+01 3.700419638604002159e+01 6 | 1.365612388291746804e+01 3.059454154989280639e+01 2.824047949025308313e+01 7 | 2.236349972933584596e+01 1.129142771673745571e+01 2.396072590357320564e+01 8 | 3.360942829451407476e+01 3.706363934392266657e+01 3.398765607024599689e+01 9 | 2.201047766678824402e+01 1.399425999296965273e+01 2.453901229776309023e+01 10 | 2.041541712974062150e+01 2.259659982950146784e+01 2.772919510042188307e+01 11 | 1.821501052499343842e+01 4.996382983021527480e+01 2.118767524681777203e+01 12 | 3.581716459766668947e+01 1.867378796071292868e+01 2.088870718706270679e+01 13 | 2.280017404334437003e+01 1.065462243746887694e+01 4.016554247584777215e+01 14 | 1.753674421998249500e+01 5.164322280049238856e+01 3.243720220901021634e+01 15 | 1.891517787936649597e+01 5.458051446491415248e+01 2.643191660428917444e+01 16 | 2.374881409421817935e+01 9.009746856357963907e+00 2.676359142297678773e+01 17 | 1.845808582425642541e+01 5.501767715954445492e+01 2.649213232442187760e+01 18 | 4.668942270926379479e+01 3.263355909075411887e+01 2.616336656696988783e+01 19 | 1.771459658583080810e+01 4.467165100479342499e+01 4.104056239366278902e+01 20 | 5.230601574581023527e+01 1.961145639833847554e+01 2.591758544871301950e+01 21 | 1.771872539524822443e+01 4.884884741643531925e+01 4.362479956513725909e+01 22 | 4.853999363776279807e+01 8.568845288997696485e+00 2.302777747120339313e+01 23 | 5.215366597467664889e+01 1.995755374519259462e+01 3.781654484820354867e+01 24 | 2.326707150222240728e+01 1.333287381830144547e+01 2.151353185937196955e+01 25 | 2.234478994213309022e+01 4.581190060670958530e+01 2.462450224081401018e+01 26 | 2.335103054959920144e+01 1.478555546633684692e+01 2.130709103976982632e+01 27 | 1.888559043330971221e+01 4.337435015771099955e+01 3.999646227727762238e+01 28 | 3.531699628325046803e+01 3.434019098385996926e+01 2.495047492676427936e+01 29 | 9.007789061518231222e+00 3.296480637782868683e+01 3.860515830130520953e+01 30 | 3.546531010796326200e+01 2.164235914944084627e+01 2.045316986163010498e+01 31 | 4.203886301268948955e+01 2.138579458434474034e+01 4.191826446651215576e+01 32 | 4.410514625024681834e+01 3.451281823890246869e+01 2.904907191772809938e+01 33 | 1.922514661600196106e+01 4.504637127020475162e+01 4.319713454412468678e+01 34 | 1.877781494417554953e+01 5.000528102897280291e+01 2.153250459147858109e+01 35 | 2.625638484384982974e+01 4.426195976284881084e+01 2.939755397959240213e+01 36 | 4.830661163206900000e+01 7.239669543759849724e+00 3.555892233364315302e+01 37 | 1.403379927804108718e+01 3.664112595944944673e+01 2.183320490055347918e+01 38 | 4.671931548017423808e+01 3.329618147987712717e+01 3.563546013491115616e+01 39 | 2.031420695124371179e+01 2.180713215344572475e+01 3.374024454550475127e+01 40 | 3.784747565806235059e+01 1.551792890963865368e+01 2.417903231217794513e+01 41 | 2.744474486440375927e+01 4.153143061351986631e+01 3.077311726357084964e+01 42 | 2.186115161081419700e+01 4.677085930638618549e+01 2.307297745636218522e+01 43 | 5.243331941066467294e+01 1.437312967212538517e+01 3.739184669172470166e+01 44 | 2.877568826148267433e+01 1.445534875992127688e+01 2.058846398776671549e+01 45 | 2.802116290108264707e+01 1.454177971504337563e+01 3.400872922659539199e+01 46 | 5.199938306077967098e+01 3.068615822954653893e+01 3.078094799937592541e+01 47 | 3.221454252820852560e+01 3.375074250353812033e+01 3.904409397541727600e+01 48 | 4.203066000234172606e+01 2.716862394095537780e+01 4.145459210803376493e+01 49 | 4.380421933882684016e+01 2.437716566361740078e+01 4.185132719558696124e+01 50 | 2.164796386206755230e+01 4.778527103302041468e+01 2.654909609226499967e+01 51 | 6.355438200806267091e+00 3.654423525987724020e+01 2.999253022403718560e+01 52 | 2.320191257747269731e+01 8.952281744323281387e+00 2.529164643292535430e+01 53 | 5.279980791297227682e+01 2.575401496233694587e+01 3.653902882257435891e+01 54 | 1.681163078247256948e+01 4.951563268924094530e+01 2.446928667776879252e+01 55 | 8.169462934344513982e+00 3.484212083200758769e+01 2.364490416060204225e+01 56 | 5.237440397116399282e+01 1.818048560355098431e+01 2.707917346567398198e+01 57 | 4.943578540525322040e+01 1.811749812320233488e+01 4.119045265862435912e+01 58 | 4.536305573874888353e+01 2.846452964833947519e+01 2.227331035304274920e+01 59 | 2.696716148031579863e+01 4.194700810524399515e+01 3.445717584862313743e+01 60 | 3.203162399792603310e+01 1.733225060381336036e+01 4.177468568332430010e+01 61 | 2.982556384841640806e+01 8.352376553835350492e+00 3.975759344932496475e+01 62 | 4.127194299613845629e+01 3.455416014319866491e+01 2.894175566754151419e+01 63 | 2.053978244623520766e+01 2.159642771845688713e+01 2.890317057928129074e+01 64 | 4.304420647375205533e+01 1.463844429525965118e+01 3.904592881450269459e+01 65 | 3.712214524917876446e+01 3.573135729865736465e+01 2.860387656715786875e+01 66 | 2.170555941118834298e+01 4.537462821739806884e+01 4.147120469099702689e+01 67 | 4.400780833275349835e+01 2.609670232345052199e+01 2.134718073915909287e+01 68 | 2.531877582117435210e+01 1.630511416097333921e+01 3.323737954768613889e+01 69 | 1.564505241418188852e+01 4.695545093455672259e+01 2.215060159051651212e+01 70 | 1.650793713157994347e+01 3.089743952008502959e+01 3.443146490213842270e+01 71 | 4.112041934720482317e+01 1.551279209926994440e+01 3.919063431824834964e+01 72 | 4.602384876381704260e+01 2.748126257959800967e+01 2.192166851046280840e+01 73 | 4.204481420377258161e+01 2.850576919446225332e+01 4.083994549126014562e+01 74 | 4.672317712004292645e+01 7.762611881444446915e+00 2.763703641475900241e+01 75 | 8.489370039918551214e+00 4.051557307674203656e+01 2.629106352754313036e+01 76 | 2.278404320417903861e+01 2.704996759756212654e+01 3.933940803104326278e+01 77 | 2.368102752410877088e+01 2.458924830810925499e+01 2.220601516470495440e+01 78 | 2.849207699034878161e+01 1.451580187376913500e+01 2.049073212283677492e+01 79 | 3.069956804309930476e+01 8.924349552613648484e+00 3.887892988231209301e+01 80 | 3.332094985311395163e+01 3.337038412126850773e+01 2.381555277151787919e+01 81 | 4.066677282716347719e+01 1.411765206843124609e+01 2.700954828655938655e+01 82 | 1.875720232311276447e+01 4.428788141388626087e+01 4.143209731520006756e+01 83 | 4.136262669913991630e+01 3.218024027863059899e+01 2.473061771486788274e+01 84 | 5.123426428412548717e+01 2.960815475812182740e+01 3.630454815827508952e+01 85 | 3.420052803226987237e+01 1.539637215730724584e+01 3.841057458915334877e+01 86 | 2.072515457817828377e+01 4.132536351259851415e+01 3.966093593187902400e+01 87 | 5.281307684228508492e+01 2.018213585605768401e+01 3.326966141780975761e+01 88 | 2.097116770435578559e+01 2.501129272839035877e+01 3.735848519797585965e+01 89 | 4.780692984459123807e+01 3.346148108019549028e+01 2.841715421027034338e+01 90 | 3.037035431676680020e+01 1.334691780618994983e+01 2.168044321314611622e+01 91 | 1.873813216431015860e+01 3.802682045431659219e+01 2.265902573123124952e+01 92 | 3.477230540852934837e+01 3.017456287776958135e+01 2.226134201791049350e+01 93 | 3.229728125278062834e+01 2.800285270626785916e+01 2.103204964680523403e+01 94 | 4.132597418052355209e+01 1.789892705592824029e+01 2.162164541189842026e+01 95 | 1.774253911692132490e+01 5.158838032729500611e+01 3.809196319288541588e+01 96 | 1.276225105755283451e+01 4.968854158505182994e+01 2.789945011315897005e+01 97 | 5.247048702427531452e+01 2.852351874898960205e+01 3.530605735187339178e+01 98 | 2.615288496089103631e+01 3.095359741262192443e+01 3.956423303673842895e+01 99 | 2.734101652407888849e+01 3.248539052092248625e+01 2.363801585068585354e+01 100 | 2.191378913126979810e+01 1.991788381104685968e+01 2.571211003793611383e+01 101 | 1.712793141559225774e+01 5.472025538590284555e+01 2.710946067064162790e+01 102 | 4.776074419063149890e+01 6.950481730681727477e+00 3.648038421427863653e+01 103 | 1.878144365322103226e+01 5.194337426123934875e+01 2.885501983638636858e+01 104 | 4.292239408217492524e+01 1.640148647780258173e+01 2.246200375952829376e+01 105 | 2.255609510535460061e+01 4.403528804233197746e+01 2.448632369436714740e+01 106 | 1.874402611482773651e+01 4.159945830968406710e+01 3.998190415273860765e+01 107 | 2.014341192769660438e+01 4.155993307635296219e+01 2.323538458359951164e+01 108 | 5.186097513852675434e+01 3.048644997607025431e+01 3.351475661041523324e+01 109 | 2.261792525838939838e+01 2.887246968185671037e+01 3.813672234819554063e+01 110 | 2.156397899321265754e+01 4.630309660909217939e+01 1.992603130364717501e+01 111 | 5.112414086349142650e+01 2.983637444288847007e+01 2.658118525635570251e+01 112 | 2.433022610979913125e+01 4.676237470724411338e+01 3.376730692594642846e+01 113 | 5.200162357279646841e+01 9.378680453040338705e+00 2.515686187656003980e+01 114 | 4.415943272696129895e+01 1.315426557959582254e+01 3.513256739652730687e+01 115 | 2.548028607156968306e+01 3.266638569168361528e+01 2.481671989262509825e+01 116 | 9.332631270808869672e+00 4.246342810785473887e+01 3.326865000175614995e+01 117 | 4.728677853566038181e+01 1.538111887614819473e+01 2.151965288434421097e+01 118 | 4.668965071879710393e+01 1.060171515433403933e+01 4.080962817421547584e+01 119 | 4.587610063264650506e+01 3.348397756444011009e+01 3.571594029258265834e+01 120 | 2.254701040889582231e+01 4.147210791339129798e+01 3.904092397972072348e+01 121 | 2.360740679166836387e+01 1.473512598809371354e+01 4.199570134982238301e+01 122 | 1.049134179278784984e+01 4.314969837152870724e+01 3.769202444726615653e+01 123 | 3.052044478091918478e+01 3.676512970535907954e+01 2.641329849825870113e+01 124 | 8.970406781224479431e+00 3.343962741609530553e+01 2.416567559802903631e+01 125 | 5.101981402315483649e+01 8.069170730264435321e+00 2.544579219371723866e+01 126 | 1.073116959442246809e+01 4.568810409353350366e+01 2.772035097377530022e+01 127 | 4.539339000487971987e+01 2.587844394824427852e+01 4.153434159305163575e+01 128 | 8.488235478626274144e+00 4.107606559749831376e+01 3.030302943576269570e+01 129 | 4.497716085527964225e+01 1.415675699920792141e+01 3.342226898277428404e+01 130 | 3.380282511455440186e+01 3.282028267508469810e+01 2.361600748662944582e+01 131 | 3.184665373803060007e+01 1.392760720815894260e+01 3.788284922693672740e+01 132 | 4.371024954268342100e+01 1.216418072105963866e+01 3.761227197388640064e+01 133 | 2.552634008318519676e+01 2.684147013220207612e+01 4.131118455746294416e+01 134 | 7.053957426644384299e+00 3.898315306105222788e+01 3.354297283651676764e+01 135 | 2.183957569032946466e+01 2.599298116363820910e+01 2.446399133665050485e+01 136 | 2.751099363521415242e+01 7.918370466780435990e+00 2.758370351231576834e+01 137 | 2.144338089707176565e+01 2.549193079992530997e+01 3.801751544813026129e+01 138 | 2.643946068287616313e+01 1.579266131039796228e+01 3.127211849665658150e+01 139 | 1.529686970368565113e+01 3.072141405498915390e+01 2.877653141743356713e+01 140 | 7.758549180740274664e+00 3.353885357505406262e+01 3.718795691253473024e+01 141 | 8.170172673800902174e+00 3.383884753737685003e+01 3.870340597860110421e+01 142 | 2.561055115203557619e+01 1.634990309494683913e+01 3.065243665418697461e+01 143 | 4.551855893182060697e+01 3.434329585193386691e+01 3.359693518845877946e+01 144 | 7.331134449753428761e+00 3.920241084960728983e+01 3.490590471416469143e+01 145 | 3.782423948983860384e+01 1.592754200134056575e+01 2.336866752990024310e+01 146 | 4.803670289061837906e+01 1.927437456381390035e+01 2.156146959819830400e+01 147 | 1.942320496733966806e+01 4.685059559325397771e+01 1.845820488235599299e+01 148 | 3.686731464412267201e+01 3.602430987125814710e+01 3.023227297569900074e+01 149 | 3.424677306368970164e+01 1.363661389010614045e+01 3.370477844064865991e+01 150 | 2.702879953243157374e+01 3.216890427323889412e+01 3.927818304571275121e+01 151 | 1.279229609254335287e+01 4.310754959219782023e+01 2.347091266519330688e+01 152 | 3.893554593148354570e+01 1.842705337108511898e+01 2.121195540168562488e+01 153 | 3.999172877048886221e+01 1.982151889108163445e+01 2.102018078699433090e+01 154 | 2.338158788654832421e+01 1.889150970554233311e+01 4.149640951604344252e+01 155 | 5.266881769397370050e+01 2.404116202823128035e+01 3.674876860362675757e+01 156 | 2.718149863747310491e+01 2.822842993323152072e+01 4.138425400512455354e+01 157 | 2.228379604356500820e+01 2.487477374106586936e+01 2.366082866960827857e+01 158 | 5.158286963297609873e+01 2.148497004050534898e+01 3.875033050876165674e+01 159 | 4.367028968295020519e+01 3.295089774714752195e+01 2.566565417166581398e+01 160 | 4.474432385905803500e+01 1.078551188011696560e+01 2.800786336257939269e+01 161 | 1.094249528860294518e+01 3.761773395307299950e+01 2.205351642650179400e+01 162 | 2.516609780317265788e+01 4.048705615849643635e+01 2.534584023127522201e+01 163 | 3.455773019370590049e+01 3.641490376661655404e+01 2.710201904429175102e+01 164 | 3.944356999236201489e+01 3.484653826328023740e+01 2.880213489122640880e+01 165 | 4.748359415870457667e+01 9.933858558093554336e+00 2.940996730794283565e+01 166 | 4.200503057597988033e+01 1.457738066711246638e+01 2.705668101880984366e+01 167 | 4.757476626669460273e+01 2.353896771524710374e+01 4.126350798585333024e+01 168 | 4.500503602110742918e+01 1.174331060563064710e+01 3.444981807769383408e+01 169 | 1.848997667353476615e+01 2.894470295628903500e+01 3.192671939120306135e+01 170 | 3.924680678668475053e+01 1.787294026605972164e+01 4.169197340306410382e+01 171 | 2.577858429883480085e+01 1.617945209495287529e+01 3.120093684211762763e+01 172 | 1.668339659310898071e+01 5.265579662933073735e+01 3.481717328452049998e+01 173 | 2.355583164733112866e+01 1.792559973812143070e+01 3.033349087327406224e+01 174 | 3.121665578521101736e+01 2.881950436574389585e+01 2.126795823171024935e+01 175 | 1.030955596157207488e+01 4.507784967112896624e+01 3.286179497736579691e+01 176 | 6.641087532079330558e+00 3.721523143665080369e+01 3.609672250520925729e+01 177 | 3.561898140444836969e+01 3.088649612358261720e+01 2.283007840401471711e+01 178 | 1.890305827523310711e+01 2.655152102639570799e+01 3.073507074934393302e+01 179 | 1.486937449456515914e+01 3.432921504192515272e+01 2.275339418120553603e+01 180 | 4.739609658053780095e+01 2.458917670869880112e+01 4.128344042839949424e+01 181 | 4.449313274462897283e+01 1.037279226905478069e+01 2.733984417644980880e+01 182 | 2.847454826295387065e+01 1.167545316379407971e+01 2.096616361337692425e+01 183 | 9.318644151089706895e+00 3.168893190460214626e+01 3.222946762181459235e+01 184 | 4.350803067917889422e+01 2.492215751767917453e+01 2.115412216922264577e+01 185 | 6.460847898687509527e+00 3.765796840857527883e+01 3.262758335044388502e+01 186 | 2.720160567906051341e+01 1.369970563758688264e+01 3.392854659668226702e+01 187 | 4.506648497151523003e+01 2.959968123576173227e+01 4.000496536614161158e+01 188 | 4.394311827495551626e+01 3.442009281457147551e+01 3.407499125455365174e+01 189 | 3.300377992765297819e+01 3.722306202511116879e+01 3.340882410592834617e+01 190 | 3.506408818795718219e+01 2.938372166818734144e+01 2.184634064911663032e+01 191 | 4.793831983528710339e+01 1.326226509135434206e+01 3.000168039617350502e+01 192 | 2.169242084854770169e+01 4.670792333956605802e+01 4.207225762357380461e+01 193 | 9.852560414902503894e+00 3.174028599041098531e+01 2.706019407522916609e+01 194 | 1.062505329272521415e+01 4.407686276526832359e+01 3.724164099330628375e+01 195 | 6.853981578308955491e+00 3.623230602119613764e+01 2.562206071668284579e+01 196 | 1.534311190702972461e+01 4.023491607428830719e+01 2.239544075384627675e+01 197 | 7.961998326790795666e+00 4.026998911825369731e+01 2.882378136194451201e+01 198 | 3.490669343434525729e+01 2.369718991799328478e+01 4.266729552129610425e+01 199 | 2.259104078444459418e+01 2.858781588898795079e+01 2.458713139473215392e+01 200 | 2.233657773143283620e+01 1.268570564428528691e+01 3.723381339700580384e+01 201 | 4.787494261832163289e+01 2.928498696795482559e+01 2.329492135736636627e+01 202 | 4.293314788835010631e+01 3.332235982724017731e+01 3.653555844231770777e+01 203 | 6.547886359315688409e+00 3.570016919553940227e+01 2.842046056003264454e+01 204 | 4.720621391360289465e+01 2.422566187373900704e+01 2.164257320056334422e+01 205 | 1.021200014653093469e+01 4.291617563478356345e+01 3.726736301230113213e+01 206 | 4.669879721390162075e+01 1.453506561406570263e+01 3.040400732020470187e+01 207 | 1.899151883854501222e+01 5.021581984993635217e+01 3.749016073193907062e+01 208 | 5.206699267124956521e+01 1.868464586155690910e+01 2.474136730067550971e+01 209 | 3.771356823456400065e+01 3.376333193286172474e+01 2.558041811844357483e+01 210 | 3.412845395918964186e+01 2.246829757320115206e+01 4.273308563013378603e+01 211 | 3.094894894285737763e+01 3.734176523484798338e+01 2.809839640203898981e+01 212 | 3.626167094595840013e+01 2.283711359176761491e+01 4.253539105317931046e+01 213 | 1.290549988300775830e+01 4.518253578246171998e+01 3.907735563320540706e+01 214 | 3.425468926972128969e+01 1.637592398102173874e+01 4.052780099925866608e+01 215 | 2.274335776974873724e+01 2.793263005708244862e+01 2.400411475590477650e+01 216 | 2.892520087558004604e+01 2.032949632828260889e+01 4.274366033257804531e+01 217 | 1.605443822124519926e+01 5.077321338220060198e+01 2.585182224425846798e+01 218 | 4.906148584895443321e+01 9.325155750591511250e+00 2.261678173728209984e+01 219 | 4.659921712158320872e+01 3.436385399290040965e+01 3.226354240811043894e+01 220 | 4.530891727870872643e+01 8.167217227145208369e+00 2.669068140494839980e+01 221 | 5.013880868105292166e+01 1.468784928022262903e+01 2.191267458703127602e+01 222 | 5.280047717423779829e+01 2.100734795311646153e+01 2.785954336622024030e+01 223 | 2.132501552346449003e+01 3.208895607673226635e+01 3.625141615939278950e+01 224 | 2.807864579262340854e+01 1.653914650171219236e+01 4.272076159441748899e+01 225 | 4.265626640798841862e+01 2.438671459248316964e+01 4.195584841122791175e+01 226 | 1.376510898701170227e+01 5.089930619314743865e+01 3.292941623091045500e+01 227 | 1.768819426968380171e+01 3.215020392134405114e+01 3.693513823358927795e+01 228 | 2.215405894008402754e+01 1.782423570146070446e+01 2.372499717094499161e+01 229 | 2.461639469041064032e+01 2.862270795583016891e+01 2.275973547869492108e+01 230 | 9.804422197532286276e+00 3.988372866502000846e+01 2.347308811191106059e+01 231 | 2.465695765884277790e+01 2.091726074072402142e+01 4.207482472122323003e+01 232 | 1.716714406359320222e+01 3.302090747290458239e+01 3.847023973399667796e+01 233 | 9.482732725146876263e+00 4.101255731461657916e+01 2.478561359746455395e+01 234 | 3.023968659276973270e+01 1.485415342364827751e+01 3.307222133583830725e+01 235 | 1.092193795130464196e+01 3.646319543235786398e+01 2.191138964205245188e+01 236 | 2.550412236544179834e+01 3.241433072974457019e+01 2.466250968983619174e+01 237 | 4.880200372196729575e+01 3.212168855430442704e+01 2.671534681798425481e+01 238 | 2.952738081053900743e+01 3.029332325505911427e+01 2.196087596661214292e+01 239 | 4.102815747384261869e+01 2.907886579632694790e+01 2.228106502799030864e+01 240 | 2.288496523160133478e+01 1.075159147565975637e+01 3.652978970909508405e+01 241 | 2.091095350404374642e+01 4.860355638844039561e+01 2.305532920725468671e+01 242 | 6.706514836272382318e+00 3.479848536254012714e+01 3.349294989909958531e+01 243 | 2.148311546594527144e+01 4.766069645811268174e+01 2.501346936630205064e+01 244 | 4.439097768593057936e+01 1.275368686866667645e+01 2.339073397525244502e+01 245 | 2.933524661008315348e+01 3.577956506431652883e+01 3.753558224440595126e+01 246 | 1.774083283648721121e+01 4.451664604928530622e+01 2.262238329877029486e+01 247 | 4.894840856659968864e+01 2.638269842390188913e+01 2.251954100525249558e+01 248 | 4.158950944996902166e+01 2.426667025272670841e+01 4.204792506156649523e+01 249 | 2.546423636436911764e+01 1.391997706000017843e+01 3.393415293913697184e+01 250 | 2.147742302402528836e+01 2.321433551330051870e+01 3.825336048148596291e+01 251 | 4.403115983437908199e+01 3.070892844507295649e+01 3.928292097604089861e+01 252 | 3.497710076394293566e+01 1.423872733696970627e+01 2.681502461728187825e+01 253 | 3.566040328719362407e+01 2.632979730062580259e+01 2.073168872006239027e+01 254 | 1.820949026898981415e+01 4.997134799551088236e+01 2.154531664249451239e+01 255 | 1.942990643193673961e+01 3.142848479656354854e+01 2.749086551557084590e+01 256 | 3.600203043400895808e+01 1.602268732741583790e+01 2.338701020376234752e+01 257 | 5.190588564579512365e+01 1.001281310320201179e+01 3.876622769929536361e+01 258 | 1.709613126739564848e+01 4.938294791003730211e+01 2.058402918209532828e+01 259 | 9.788717669226034701e+00 3.940035813528484709e+01 3.972486736602091639e+01 260 | 3.619831177434657832e+01 3.626089038676135345e+01 3.253067688587903916e+01 261 | 4.247143837468866678e+01 2.322861874641474600e+01 4.199630019564767025e+01 262 | 5.091891926488631981e+01 1.628397188070124812e+01 2.242034856768362516e+01 263 | 1.463941621355267131e+01 4.238545817590100739e+01 3.997431991366147486e+01 264 | 1.172016426479222417e+01 4.818609162253098077e+01 2.853320645454941484e+01 265 | 2.095152160138418296e+01 4.812883028340451119e+01 4.359552513836875676e+01 266 | 5.167412898023845713e+01 1.549205495889381545e+01 3.413077371503305812e+01 267 | 1.621890405539674873e+01 3.961487852637569773e+01 4.068066644669889342e+01 268 | 1.016299585274623496e+01 3.749064447459348060e+01 4.080720314316313591e+01 269 | 4.837234793216658346e+01 7.196032982758618246e+00 2.519024098291779978e+01 270 | 4.581008359781526451e+01 1.444367473085509168e+01 3.312028479645718448e+01 271 | 1.174534246968774021e+01 3.492116672939827282e+01 4.108969768298412362e+01 272 | 4.860037168572495858e+01 2.435558204313697672e+01 2.213836276155103988e+01 273 | 2.233573678011894970e+01 1.587072461520973654e+01 2.631554812376796093e+01 274 | 1.428145713211284829e+01 5.124456635106667335e+01 3.196792167069096990e+01 275 | 4.994838753752320315e+01 7.877773432891932437e+00 2.437478218159912657e+01 276 | 1.402647297546377381e+01 4.124439582745530686e+01 4.022802647047996061e+01 277 | 4.570573269460190602e+01 2.176738102369672134e+01 2.137070268824383845e+01 278 | 4.234774862905803161e+01 2.272558678849870972e+01 2.105092085022560155e+01 279 | 2.089784601528083741e+01 2.063023604903908392e+01 3.065749034891957336e+01 280 | 1.898650557042040532e+01 4.356256893524635387e+01 4.029780649142392690e+01 281 | 4.911644746203813128e+01 2.047107327915423625e+01 2.201682953832174050e+01 282 | 2.244779017965954182e+01 1.718169365621507794e+01 4.049743709139836767e+01 283 | 2.539177697423726343e+01 2.359041769261974508e+01 2.106464334128744653e+01 284 | 2.326252530021136522e+01 1.690037872096477756e+01 2.132012467382476828e+01 285 | 2.750142687590470914e+01 1.248427391761154048e+01 2.893117065971729218e+01 286 | 4.217184367836919279e+01 3.473930952977688946e+01 3.043282976929313932e+01 287 | 5.312930952377463711e+01 2.913546799423633260e+01 3.087918024623274249e+01 288 | 4.285078752585471307e+01 1.367654369834218109e+01 3.191003844040879756e+01 289 | 1.981783666675536182e+01 2.234066323423617462e+01 3.195965303470404706e+01 290 | 1.532073368143518266e+01 3.053735692546928604e+01 3.267054373320426919e+01 291 | 2.227366788188131608e+01 4.018513401199520985e+01 3.934504672001565950e+01 292 | 2.322242476029089531e+01 1.599830935842815371e+01 2.791775730411774248e+01 293 | 2.436689791386035253e+01 9.802542141035701206e+00 2.183695264019664251e+01 294 | 3.748261714593512295e+01 3.561367619409745799e+01 2.876588284600243739e+01 295 | 2.105693070908538189e+01 2.650412813280746605e+01 2.577089123569450990e+01 296 | 8.422857438389829809e+00 3.288296550506827032e+01 2.630206071344991514e+01 297 | 1.339876118540864347e+01 5.032834417485733525e+01 2.808938983483892216e+01 298 | 9.247393025103031405e+00 4.094574430794094155e+01 2.503615041830130750e+01 299 | 1.585573211586677189e+01 3.206341481860465592e+01 2.539161301812435667e+01 300 | 3.911218705424742126e+01 1.279636315320850848e+01 2.947837589430939076e+01 301 | 5.096557553638939453e+01 8.541979207758622294e+00 3.522956626148040016e+01 302 | 1.581858740497567517e+01 4.663456958751212511e+01 4.122072253695728961e+01 303 | 5.156601006733941972e+01 1.453971553248373461e+01 3.996163664133295867e+01 304 | 2.576310939964234947e+01 3.271676173136758337e+01 2.466250684886394495e+01 305 | 5.227988241941476844e+01 1.118974944211948497e+01 2.704091054131244576e+01 306 | 4.395739436166320502e+01 3.119698975228005722e+01 3.889986006679624353e+01 307 | 2.874694967502938425e+01 3.326215876427281870e+01 3.924191877908133819e+01 308 | 2.566448997674931221e+01 3.795705494887384646e+01 3.633923664328842307e+01 309 | 1.208352417666384326e+01 4.908417971876679076e+01 2.934132346304853201e+01 310 | 7.986102076510352532e+00 3.291054289026428137e+01 3.536623133692219056e+01 311 | 2.454137789553174898e+01 4.765075546508223425e+01 3.199809531288544662e+01 312 | 3.106162950545630608e+01 2.691506923655656891e+01 2.054982410950455218e+01 313 | 4.681771149258229059e+01 1.099881739877474729e+01 2.955869919472820939e+01 314 | 2.515973085637054396e+01 1.031036879624565294e+01 3.444663905821303018e+01 315 | 3.570732125243429067e+01 3.649834882971467920e+01 3.136592845581439803e+01 316 | 1.927203063417059425e+01 5.023132589260060854e+01 2.562245011485364543e+01 317 | 1.953205850533100474e+01 4.834103969837282477e+01 1.822582128528829415e+01 318 | 1.745070893499248044e+01 3.786791428355747513e+01 2.237441687821492309e+01 319 | 5.401543677180072223e+01 2.714725019367926606e+01 2.913769744455458266e+01 320 | 2.720207530389608408e+01 7.053793601881247710e+00 3.683768859564815301e+01 321 | 1.841443361626143727e+01 5.171930062505487058e+01 2.522843424662050893e+01 322 | 3.337676685450943381e+01 3.225220154705144182e+01 2.323755235598089541e+01 323 | 3.649080797758541195e+01 1.367011381209438525e+01 3.622253578742846969e+01 324 | 2.027503001547053074e+01 4.937661582438278174e+01 2.049255034230202455e+01 325 | 3.349040744111454870e+01 3.689731830429670367e+01 3.502155548766516802e+01 326 | 2.939300710133200667e+01 3.519520236459027274e+01 2.482552031967053807e+01 327 | 2.758410942959674017e+01 1.113965300135305547e+01 2.889198857027306744e+01 328 | 4.061665572231856913e+01 1.528333339229395094e+01 2.500168168298804616e+01 329 | 2.157411399347533631e+01 4.794505773702410067e+01 3.608253367062790318e+01 330 | 2.677490049788280402e+01 9.575760463648567367e+00 4.180774760716338534e+01 331 | 5.348291541833795293e+01 2.280932090817261226e+01 3.394187709584963386e+01 332 | 2.442885670274442944e+01 3.995729700407902385e+01 2.479783120297791754e+01 333 | 4.733186312029270226e+01 2.017863025136035304e+01 2.158829832025788065e+01 334 | 3.409619254959076073e+01 1.730014698413005192e+01 2.174667359360438823e+01 335 | 3.579001597613189034e+01 1.601162796015883316e+01 4.023491736381509298e+01 336 | 4.107622001336685713e+01 3.134011471078576605e+01 3.885880112162899991e+01 337 | 4.737789342212105481e+01 2.861552426953452510e+01 4.013192106620249433e+01 338 | 1.831445918723963118e+01 2.960022087091912724e+01 3.186496952032405616e+01 339 | 3.802293530300708824e+01 2.738628381910750775e+01 4.159919368396890604e+01 340 | 2.712045030101840126e+01 1.419968458495692687e+01 2.917287116450762952e+01 341 | 3.525538364680295444e+01 1.730722339572731627e+01 2.168031285031485211e+01 342 | 2.315918728680101069e+01 2.487843032607299776e+01 4.029949139110919276e+01 343 | 2.909243465764789249e+01 1.974432995544092151e+01 2.025383485641837211e+01 344 | 1.671820433507936698e+01 4.922862441815736645e+01 2.149009889120583594e+01 345 | 7.532979590842301398e+00 3.544545282247268858e+01 3.888051342269488231e+01 346 | 3.489899805160948176e+01 3.682727478667995769e+01 3.105741636564216890e+01 347 | 4.413349212418852119e+01 1.172581994449294740e+01 3.594721111943430003e+01 348 | 2.313118798241506369e+01 8.851309464455015430e+00 3.857442856337627290e+01 349 | 2.778465870492980017e+01 2.150292155506325287e+01 2.036702365411823834e+01 350 | 2.474253908560922355e+01 1.513739083393800300e+01 3.412511571916148512e+01 351 | 5.065041914574198501e+01 1.343187163224724756e+01 4.079454366755413020e+01 352 | 3.256422556703046922e+01 3.085465111477747868e+01 2.235075712883824650e+01 353 | 2.627475907823862755e+01 8.840801758582720993e+00 2.188742599220448071e+01 354 | 2.419122223928726356e+01 3.470327437761797285e+01 3.678628444058352898e+01 355 | 5.343114418926290199e+01 2.880068134079505171e+01 3.157133803597120902e+01 356 | 2.264103636235996220e+01 1.964291363694923120e+01 2.248839682682963215e+01 357 | 2.357626711186734170e+01 9.003863481499333687e+00 2.338256195936147819e+01 358 | 2.499844116984973397e+01 2.797581398303720945e+01 4.061887467327893830e+01 359 | 2.174091079728410847e+01 3.946948459732246306e+01 2.345392856394806458e+01 360 | 3.415322451791594460e+01 1.607621040883016406e+01 2.352343282559968429e+01 361 | 2.137520502475415185e+01 4.728021945192019615e+01 4.327861036024891206e+01 362 | 1.118898574648580002e+01 3.324296236638414825e+01 4.018178856488089679e+01 363 | 5.101825016453759787e+01 2.297518857532205772e+01 2.373725920616549345e+01 364 | 2.860040777193841421e+01 2.413875534436945713e+01 4.258789198433757406e+01 365 | 2.408221431554177272e+01 4.222865828022164436e+01 2.483010342187383657e+01 366 | 6.621728220172388824e+00 3.707956814040500859e+01 3.616502334458063217e+01 367 | 3.363070780008080618e+01 3.665314397698948312e+01 3.561938289143654401e+01 368 | 1.943598265840892481e+01 4.790533183076494339e+01 1.809940325701635544e+01 369 | 1.632111441206814106e+01 4.694777558661060368e+01 2.073432130662676798e+01 370 | 4.282249438760852911e+01 3.287616146377468596e+01 2.555051854253283850e+01 371 | 2.522243896855657042e+01 1.642465920131627755e+01 3.318305206102871097e+01 372 | 3.717845272004537094e+01 1.261316186882397616e+01 3.298442576691055450e+01 373 | 5.164231757784583721e+01 1.253931545456916297e+01 2.323521581473628217e+01 374 | 4.921737718924617155e+01 2.816803663553891113e+01 2.334750238809328948e+01 375 | 4.868505237674603592e+01 7.145577503066380842e+00 2.561910625903330185e+01 376 | 4.717023676869357729e+01 3.159175641571194149e+01 2.507374197402523208e+01 377 | 5.250007180363574122e+01 1.296772821377230933e+01 3.723786848447365116e+01 378 | 6.925032554133128571e+00 3.789399532038535057e+01 3.666562783793488478e+01 379 | 1.419726930047115054e+01 3.543384661958002368e+01 2.207806338617130137e+01 380 | 1.039966834789668404e+01 4.307773970905265770e+01 2.531244016632538063e+01 381 | 4.093334618126418434e+01 1.314190724622858752e+01 3.350130446367528236e+01 382 | 3.195771107360337382e+01 3.542215618785579068e+01 3.792910935574660414e+01 383 | 3.706279307976964787e+01 2.838400538727262656e+01 2.163999538339515638e+01 384 | 1.906070701354366292e+01 3.248067312439997778e+01 3.671965188732549734e+01 385 | 4.762874397772224455e+01 3.140304279372026741e+01 2.502560279034979729e+01 386 | 3.726700022344406449e+01 3.474475306056315560e+01 2.651207419516135033e+01 387 | 5.206828469831773987e+01 1.705355069095990572e+01 3.866340255884385613e+01 388 | 2.602455674610749981e+01 1.333630295205979621e+01 3.386751814651972836e+01 389 | 1.433218657946792618e+01 3.094202048327585430e+01 2.686655478107574524e+01 390 | 4.019658089176815707e+01 3.468280047890691975e+01 3.369955072277811325e+01 391 | 1.449233398454550503e+01 4.247564060269976949e+01 3.994235706849939049e+01 392 | 2.947109583945801958e+01 1.206863944596481275e+01 3.481540530549142431e+01 393 | 4.571645668156096320e+01 1.181702813839735988e+01 2.245007130625659997e+01 394 | 3.249269319313004445e+01 2.191284101890790836e+01 2.028606595266240831e+01 395 | 4.457208377584203163e+01 1.286561629547559349e+01 3.467547196175721780e+01 396 | 5.440897184739181824e+01 2.585217976233140647e+01 3.337250064934960392e+01 397 | 3.556650397087577176e+01 2.553257786334158297e+01 4.237499975217686909e+01 398 | 5.197702164131566605e+01 1.768474120826435581e+01 2.416215390171096189e+01 399 | 2.251111384771865787e+01 3.414901000101794892e+01 3.695153500433730898e+01 400 | 9.564689414566020176e+00 3.596379045891771398e+01 2.228862654261606835e+01 401 | 3.674938438555454212e+01 2.996804380058769368e+01 4.045114757556478935e+01 402 | 5.246501314946751648e+01 1.391014665595791655e+01 3.730754025826888665e+01 403 | 4.491160916353138077e+01 1.859877410578099344e+01 4.151892532689884519e+01 404 | 2.200234532649703922e+01 1.520873283163330036e+01 3.871804809168961725e+01 405 | 1.354913321130447024e+01 3.816916401668787984e+01 2.198011926996066734e+01 406 | 2.217832182112355000e+01 1.589207253928594632e+01 2.584690636008940956e+01 407 | 2.141385806278507076e+01 4.759603147587078809e+01 3.860583680399990669e+01 408 | 2.411409599911985779e+01 3.786602709542023604e+01 2.534233050378512786e+01 409 | 1.687455552682546767e+01 4.156284589065975865e+01 4.015800691950998669e+01 410 | 3.979410269364434072e+01 3.222207598020229113e+01 3.818516419074402535e+01 411 | 4.109416820633123280e+01 1.400479699929419297e+01 2.754181842344129194e+01 412 | 2.637979995778498221e+01 1.413569163674107898e+01 3.376757981795980612e+01 413 | 2.079563717467861039e+01 2.294854631041773985e+01 2.644438091584564887e+01 414 | 2.084827204894008545e+01 2.628149145787834584e+01 2.608783321963930035e+01 415 | 5.190752307349408312e+01 9.776991368976096553e+00 2.725991227659729788e+01 416 | 2.025268732619351297e+01 3.916039556731959692e+01 3.997990630108252219e+01 417 | 2.552222802777286859e+01 1.704067295615034894e+01 4.273568960091146351e+01 418 | 3.218011558670231409e+01 3.705056174338486841e+01 2.710277428876749539e+01 419 | 2.578608713261263574e+01 1.618674905220427362e+01 2.986689499075689724e+01 420 | 3.391700578742530325e+01 2.313167431236712446e+01 2.026534841599172410e+01 421 | 4.880506235763282064e+01 9.878112838510634930e+00 2.232792635599858855e+01 422 | 2.137113803800905387e+01 3.089142180016999717e+01 3.616455128668118846e+01 423 | 3.599300597920105815e+01 1.445489481185564706e+01 2.590631398722180379e+01 424 | 3.146325487910412022e+01 1.233203549383336650e+01 3.976352691713555032e+01 425 | 2.712339324937777363e+01 1.946150867151712660e+01 4.276695036050367094e+01 426 | 4.436394044830139904e+01 1.084078407162980540e+01 3.905181783132680806e+01 427 | 2.937167431082784219e+01 1.051850039775493961e+01 4.146638792702004395e+01 428 | 5.186803408285584993e+01 1.444594436806421633e+01 2.353543312868666249e+01 429 | 2.100513946605872917e+01 2.366004890306505359e+01 2.570378029757214478e+01 430 | 2.641249804593353545e+01 2.392573309041539886e+01 4.216049140664993189e+01 431 | 3.952980409096594627e+01 3.511497630994140451e+01 3.096094060125465219e+01 432 | 1.236267763513679974e+01 4.570000231448063488e+01 2.428861358653551861e+01 433 | 1.878115612466769235e+01 3.272909742794468713e+01 3.716591075596443261e+01 434 | 2.471250983293530723e+01 2.140273885194969949e+01 4.201691800336050164e+01 435 | 3.297442813026548691e+01 1.474392401673529207e+01 3.560047589326698159e+01 436 | 4.551335607102162584e+01 1.444805009090985415e+01 2.995299394983599939e+01 437 | 3.166693175000037641e+01 1.383023901046968618e+01 3.732370702149305686e+01 438 | 2.627549491810977500e+01 1.453417187817683853e+01 4.280990802662607564e+01 439 | 1.165020240402665230e+01 3.278036899699826989e+01 2.339053423979378721e+01 440 | 2.479655806391646422e+01 2.055552820344411913e+01 4.219162625989056892e+01 441 | 4.971646746015075990e+01 1.777582063687187741e+01 2.185779300887194765e+01 442 | 8.913876519275568455e+00 3.194880546076088024e+01 3.192418930815460953e+01 443 | 4.726538846782708703e+01 7.152533900524229438e+00 2.603214306139453527e+01 444 | 3.841131474850138972e+01 1.284824012303984198e+01 3.435309413009156998e+01 445 | 3.257270261646106491e+01 1.791029875587543430e+01 4.197364345322868928e+01 446 | 5.088573524216265298e+01 8.394774832817567756e+00 2.750186800919859564e+01 447 | 2.790834943537463175e+01 1.900839386000928499e+01 4.280065909320191508e+01 448 | 2.581606353792684772e+01 1.497123399059532822e+01 3.377925589879121304e+01 449 | 4.575333427440532574e+01 1.125592468565477766e+01 2.904738373170150467e+01 450 | 1.554881223459458539e+01 5.132471515381640614e+01 3.393146167378701961e+01 451 | 1.043474296223416964e+01 3.154718918990409193e+01 3.719745750334003986e+01 452 | 2.362708852247375546e+01 1.859568696489539263e+01 4.174827137110883513e+01 453 | 3.809497266072150268e+01 3.011866887512490010e+01 2.273693711485524105e+01 454 | 5.235852641133521246e+01 1.611990227495130057e+01 2.602267904188677861e+01 455 | 4.878677185788166071e+01 3.259563339038413687e+01 2.753486131783542845e+01 456 | 2.963253984836620347e+01 1.293556358916108451e+01 2.813648566648208060e+01 457 | 5.231781827768293880e+01 1.292316735217623602e+01 2.720943924563179905e+01 458 | 1.817841615278019418e+01 5.449238022761814193e+01 3.550947947283102479e+01 459 | 3.727045478938524781e+01 1.579566293983025993e+01 4.000082563624217613e+01 460 | 2.777872267848536580e+01 3.584785006047635392e+01 3.702816321693786961e+01 461 | 5.227178530723112004e+01 1.050918778317297608e+01 2.531982794286329863e+01 462 | 3.355800537145297824e+01 1.415561368041958801e+01 2.864319008535522926e+01 463 | 2.361969099489881785e+01 2.581907597525092868e+01 4.048231636213854046e+01 464 | 1.571278621272304399e+01 3.904214366078623044e+01 4.082877183635737595e+01 465 | 4.549736472041035995e+01 2.385725482394465757e+01 2.130143292020091295e+01 466 | 1.583000479489654744e+01 4.808247016695059273e+01 4.083537485935420364e+01 467 | 2.204199635740235408e+01 1.372942929229114384e+01 2.438139573691434236e+01 468 | 3.535273278709871647e+01 2.306385595556448109e+01 4.264136148849920005e+01 469 | 2.575642481126065775e+01 2.105073522576471845e+01 4.242102094293394998e+01 470 | 4.611692758109553836e+01 2.973728169515046460e+01 3.977618729311626566e+01 471 | 3.670359478683369048e+01 2.126285199823503547e+01 4.242879158048715027e+01 472 | 3.202544181975314075e+01 1.472561258752159219e+01 2.389505357486874360e+01 473 | 2.675263238534044419e+01 1.231416651051046252e+01 4.259415154060016562e+01 474 | 4.415274369619302774e+01 1.241538060168321422e+01 2.735068275403272153e+01 475 | 5.457748474683057083e+01 2.707867672706488094e+01 3.293145902801690283e+01 476 | 2.284494440285235939e+01 1.265065696115560812e+01 3.597277858467578682e+01 477 | 2.096278559161557453e+01 4.502257182641581323e+01 4.308601089651984495e+01 478 | 3.852918244695209182e+01 1.327021256620581369e+01 2.768260089893805187e+01 479 | 2.245711068493859841e+01 2.508379037747103979e+01 2.347418645239918078e+01 480 | 2.534751505174785535e+01 4.024137241690039701e+01 2.555356815605880172e+01 481 | 4.932173360634077142e+01 1.641755873556688172e+01 3.133671814582609372e+01 482 | 2.996037724916445200e+01 1.235405594932044870e+01 4.157902123592330668e+01 483 | 2.017425992413490476e+01 3.647205713142231076e+01 3.942974880121123249e+01 484 | 4.464801751611302194e+01 9.609822691630601099e+00 3.562939314134039392e+01 485 | 2.732866849571038514e+01 2.359389760940165104e+01 4.241707549405445121e+01 486 | 2.501292948224122625e+01 2.598836201443219807e+01 4.134005911215793816e+01 487 | 2.256133055053497571e+01 1.042075132013681227e+01 2.389722038776526603e+01 488 | 2.324095721980225804e+01 3.743454335121910503e+01 3.816170478862598969e+01 489 | 4.681976025265205266e+01 3.021647398286063435e+01 3.923097326703151566e+01 490 | 3.362266951430872552e+01 3.610554965101169955e+01 3.667832080248009419e+01 491 | 3.094855244886993972e+01 1.194281929502509065e+01 2.263925297555747207e+01 492 | 4.637793606441758243e+01 8.886652369245377159e+00 2.861082968288282657e+01 493 | 5.366484869161779159e+01 2.254345320357126425e+01 3.245456565795196724e+01 494 | 4.338977535379629558e+01 2.961000753737638647e+01 2.274593049244221277e+01 495 | 1.802243288544189070e+01 4.993949326670453814e+01 2.094399816124499836e+01 496 | 2.779839776696424636e+01 1.331409464150400801e+01 2.042753692731683302e+01 497 | 2.159221569681791664e+01 2.151078630771409905e+01 3.802110302109306872e+01 498 | 1.208160360634593644e+01 3.806481743511194082e+01 2.203478163976712523e+01 499 | 1.168316368607479738e+01 4.552966919100003196e+01 3.816075173958227396e+01 500 | 1.016881198188106872e+01 4.386273402485616657e+01 2.698445457175754569e+01 501 | 9.651375416535586282e+00 4.284222788918159353e+01 3.494458869685072244e+01 502 | 4.886420928322049662e+01 2.850867868296339935e+01 3.955605460308105137e+01 503 | 2.269081014047188205e+01 9.727095383401948681e+00 3.904491830712186839e+01 504 | 1.951601803356619769e+01 4.704742566497522915e+01 4.489647227004693519e+01 505 | 3.513964490872814395e+01 3.467564645947101809e+01 2.519484068386460862e+01 506 | 1.196643913257915770e+01 4.083316198143199216e+01 3.996938567863585234e+01 507 | 2.214526683254928230e+01 2.718508010732417191e+01 3.849032939164171552e+01 508 | 2.168024336583998135e+01 4.703775554850142271e+01 3.837109692879774059e+01 509 | 1.412898770728669007e+01 3.341600508363703170e+01 2.313749638137290532e+01 510 | 1.759827785489469321e+01 3.439183043926206551e+01 3.951127254488831397e+01 511 | 2.211003565822789341e+01 1.516091316933289157e+01 2.329826368953102289e+01 512 | 1.938283460858642826e+01 3.641258177145180497e+01 3.977674844959634015e+01 513 | -------------------------------------------------------------------------------- /计算机视觉导论/HW3/pack.py: -------------------------------------------------------------------------------- 1 | import os 2 | import zipfile 3 | 4 | 5 | def zipHW3(input_path: str, output_path: str, zip_name: str): 6 | zip = zipfile.ZipFile(output_path, "w", zipfile.ZIP_DEFLATED) 7 | for path, dirnames, filenames in os.walk(os.path.join(input_path, "camera_calibr")): 8 | fpath = path.replace(input_path, f'HW3_{zip_name}') 9 | for filename in filenames: 10 | if filename in ["calibr.ipynb"]: 11 | zip.write(os.path.join(path, filename), os.path.join(fpath, filename)) 12 | for path, dirnames, filenames in os.walk(os.path.join(input_path, "depth_pc")): 13 | fpath = path.replace(input_path, f'HW3_{zip_name}') 14 | for filename in filenames: 15 | if filename in ["depth_pc.ipynb"]: 16 | zip.write(os.path.join(path, filename), os.path.join(fpath, filename)) 17 | for path, dirnames, filenames in os.walk(os.path.join(input_path, "marching_cube")): 18 | fpath = path.replace(input_path, f'HW3_{zip_name}') 19 | for filename in filenames: 20 | if filename in ["marching_cube.ipynb"]: 21 | zip.write(os.path.join(path, filename), os.path.join(fpath, filename)) 22 | for path, dirnames, filenames in os.walk(os.path.join(input_path, "mesh_pc")): 23 | fpath = path.replace(input_path, f'HW3_{zip_name}') 24 | for filename in filenames: 25 | if filename in ["mesh_pc.ipynb"]: 26 | zip.write(os.path.join(path, filename), os.path.join(fpath, filename)) 27 | for path, dirnames, filenames in os.walk(os.path.join(input_path, "results")): 28 | fpath = path.replace(input_path, f'HW3_{zip_name}') 29 | for filename in filenames: 30 | zip.write(os.path.join(path, filename), os.path.join(fpath, filename)) 31 | zip.close() 32 | 33 | 34 | if __name__ == "__main__": 35 | 36 | # --------------------------------------------------------- 37 | # 请用你的学号和姓名替换下面的内容,注意参照例子的格式,使用拼音而非中文 38 | id = 1900012950 39 | name = 'ZhangSan' 40 | # --------------------------------------------------------- 41 | 42 | zip_name = f'{id}_{name}.zip' 43 | input_path = os.path.dirname(os.path.abspath(__file__)) 44 | output_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), zip_name) 45 | 46 | zipHW3(input_path, output_path, zip_name.split(".")[0]) 47 | -------------------------------------------------------------------------------- /计算机视觉导论/HW3/results/calibr.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/results/calibr.npy -------------------------------------------------------------------------------- /计算机视觉导论/HW3/results/fps_results.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/results/fps_results.npy -------------------------------------------------------------------------------- /计算机视觉导论/HW3/results/metrics.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/results/metrics.npy -------------------------------------------------------------------------------- /计算机视觉导论/HW3/results/one_way_CD.txt: -------------------------------------------------------------------------------- 1 | 1.008134225744941950e-02 2 | -------------------------------------------------------------------------------- /计算机视觉导论/HW3/results/uniform_sampling_results.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算机视觉导论/HW3/results/uniform_sampling_results.npy -------------------------------------------------------------------------------- /计算理论导论/HW1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算理论导论/HW1.pdf -------------------------------------------------------------------------------- /计算理论导论/HW2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算理论导论/HW2.pdf -------------------------------------------------------------------------------- /计算理论导论/HW3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算理论导论/HW3.pdf -------------------------------------------------------------------------------- /计算理论导论/HW4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算理论导论/HW4.pdf -------------------------------------------------------------------------------- /计算理论导论/HW5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算理论导论/HW5.pdf -------------------------------------------------------------------------------- /计算理论导论/HW6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/计算理论导论/HW6.pdf -------------------------------------------------------------------------------- /随机过程引论/HW1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/随机过程引论/HW1.pdf -------------------------------------------------------------------------------- /随机过程引论/HW2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/随机过程引论/HW2.pdf -------------------------------------------------------------------------------- /随机过程引论/HW3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/随机过程引论/HW3.pdf -------------------------------------------------------------------------------- /随机过程引论/HW4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/随机过程引论/HW4.pdf -------------------------------------------------------------------------------- /集合论与图论/SG HW1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/集合论与图论/SG HW1.pdf -------------------------------------------------------------------------------- /集合论与图论/SG HW2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/集合论与图论/SG HW2.pdf -------------------------------------------------------------------------------- /集合论与图论/SG HW3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/集合论与图论/SG HW3.pdf -------------------------------------------------------------------------------- /集合论与图论/SG HW4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/集合论与图论/SG HW4.pdf -------------------------------------------------------------------------------- /集合论与图论/SG HW5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CS-icez/pku-cs-homework/1040ca9fae63f9aea17dbf807ba1de8a1f668b92/集合论与图论/SG HW5.pdf --------------------------------------------------------------------------------