{"id":18264595,"url":"https://github.com/cheanus/starphotopositioning","last_synced_at":"2025-07-29T05:05:20.723Z","repository":{"id":231503488,"uuid":"769499993","full_name":"cheanus/StarPhotoPositioning","owner":"cheanus","description":"Only use stars and time to locate the shooting location of photos","archived":false,"fork":false,"pushed_at":"2024-10-29T05:58:46.000Z","size":3679,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T21:39:43.539Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheanus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-09T08:53:03.000Z","updated_at":"2025-01-05T16:54:57.000Z","dependencies_parsed_at":"2024-06-08T08:39:38.844Z","dependency_job_id":"583d351e-5dee-4348-bb41-c270945197f6","html_url":"https://github.com/cheanus/StarPhotoPositioning","commit_stats":null,"previous_names":["cheanus/starphotopositioning"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cheanus/StarPhotoPositioning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheanus%2FStarPhotoPositioning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheanus%2FStarPhotoPositioning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheanus%2FStarPhotoPositioning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheanus%2FStarPhotoPositioning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheanus","download_url":"https://codeload.github.com/cheanus/StarPhotoPositioning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheanus%2FStarPhotoPositioning/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267632878,"owners_count":24118749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:15:19.250Z","updated_at":"2025-07-29T05:05:20.700Z","avatar_url":"https://github.com/cheanus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StarPhotoPositioning\n仅使用星星和拍摄时间来定位照片的拍摄地点  \nOnly use stars and time to locate the shooting location of photos  \n## NOTE\n对本项目感兴趣的朋友可以移步至新项目[StarLocator](https://github.com/BengbuGuards/StarLocator)，目前正在持续迭代中，这将为你带来更好的**交互体验、定位精度和快速反馈渠道**！  \nFriends interested in this project can move to the new project [StarLocator](https://github.com/BengbuGuards/StarLocator), which is currently undergoing continuous iteration. This will bring you a better **interactive experience, positioning accuracy, and fast feedback channel**!\n## Features\n- 一般只需**2颗星星**即可定位，图中需包含至少**2条铅垂线**\n- **半自动**程序，需要通过拍摄时间的星图辨认星名，手动输入天文数据\n- 输出拍摄地点的经维度格式的数据\n- 拍摄时间精确在分钟为好，1小时的误差可能导致经维度10-20度的误差\n- **误差一般在50km以下**\n## Requirements\n- python\n- pyyaml\n- opencv\n- scipy\n- sympy\n- matplotlib\n- sklearn\n## Get Started\n为查看对默认图像的定位效果，可直接运行\n```bash\npython calculate.py\n```\n默认图像的拍摄时间为`2024年3月2日20:6:30`，拍摄地点为`西北工业大学长安校区云天苑C座门口`。\n## Tutorial\n1. 将照片放入`images/`目录下，或者使用该目录下的默认照片\n2. 在`config.yaml`中填写照片路径`image_path`，运行`stars.py`，用小框框选星星，并将得到的坐标填在`stars_img_pst`下\n3. 通过[stellarium](https://stellarium.org)等天文软件查看拍摄时星空，辨认星星。在软件中设定观测点坐标为(0°N, 0°E)，读取星星的（时角，赤纬），按`stars_img_pst`的顺序填入`stars_sky_pst`\n4. 查看`output/axis.png`，估计图中铅垂线的灭点（[Vanishing Point](https://en.wikipedia.org/wiki/Vanishing_point)）在图像坐标系的坐标，在`config.yaml`中修改`expected_center`和`expected_radius`。为排除某些伪铅垂线的干扰，设置`ignore_angle_scope`区间（规定指向照片上方为0°，顺时针旋转至下方为180°）以滤除此角度范围内的直线。运行`sky_top.py`以得到灭点的图中坐标，查看`output/sky_top.jpg`确认\n5. 将灭点的图中坐标填入`sky_top_img_pst`，运行`calculate.py`得到拍摄地点地理位置\n## Tips\n- 一般使用`config.yaml`的默认参数即可获得良好效果，有特殊需求的情况下可参照opencv相关函数参数的含义来调整\n- `is_fix_refraction_error`可用来修正大气折射误差，但运算量较大且修正幅度不高，不建议使用\n- 该程序的主要误差一是灭点定位，二是照片畸变。如果你需要更好的效果，需通过专业软件修正照片畸变后再使用本程序\n## How it works\n- [仅凭星星和时间就能定位照片位置？](https://caveallegory.cn/2024/04/%E4%BB%85%E5%87%AD%E6%98%9F%E6%98%9F%E5%92%8C%E6%97%B6%E9%97%B4%E5%B0%B1%E8%83%BD%E5%AE%9A%E4%BD%8D%E7%85%A7%E7%89%87%E4%BD%8D%E7%BD%AE%EF%BC%9F/)\n## Credits\n- [天文学真的对个人来说，毫无用处吗？ - 鬼蝉的回答 - 知乎](\nhttps://www.zhihu.com/question/603566190/answer/3313965267)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheanus%2Fstarphotopositioning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheanus%2Fstarphotopositioning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheanus%2Fstarphotopositioning/lists"}