[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80911":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":14,"starSnapshotCount":14,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},80911,"Fisheye-Calibration","L42ARO\u002FFisheye-Calibration","L42ARO","Some code that makes it easier to calibrate really wide angle cameras",null,"Python",34,5,33,0,1,2.33,false,"main",true,[],"2026-06-12 02:04:08","# 🐟 Fisheye Camera Undistortion Toolkit\n\n![Calibration Example](https:\u002F\u002Fgithub.com\u002FL42ARO\u002FFisheye-Calibration\u002Fblob\u002Fmain\u002Fmedia\u002FRecording2026-05-05182901-ezgif.com-video-to-gif-converter.gif)\n\n![Undistorted Example](https:\u002F\u002Fgithub.com\u002FL42ARO\u002FFisheye-Calibration\u002Fblob\u002Fmain\u002Fmedia\u002FRecording2026-05-05072724-ezgif.com-video-to-gif-converter.gif)\n\nI made this because I was trying to get usable undistorted video from a wide-angle Amazon fisheye camera, there are plenty of other solutoins out there but figured to give it a shot at making my own and hey it worked out, and specifically for wide angle cameras so figured to put it out there if it helps anyone.\n\nThis was the camera I used, but as long as you perform the calibration well any other wide angled camera should also work.\nhttps:\u002F\u002Fwww.amazon.com\u002Fdp\u002FB07ZS75KZR\n\nThis is the website I used for my checkerboard in case you want to make your own:\nhttps:\u002F\u002Fcalib.io\u002Fpages\u002Fcamera-calibration-pattern-generator\n\n---\n\n## What this repo does\n\n- Lists available USB cameras\n- Records raw fisheye test videos\n- Calibrates a fisheye \u002F wide-angle camera using a ChArUco board\n- Undistorts recorded videos\n- Re-encodes the result into a web-compatible H.264 MP4\n\nThere is also a test video included in `test_videos` if you just want to try the undistortion script without recording your own video.\n\n---\n\n## Setup\n\nThis is mainly intended for Windows users.\n\nRun the activation\u002Fsetup script:\n\n```powershell\n.\\activate_venv.ps1\n```\n\nThat should create\u002Factivate the Python environment and install the needed packages.\n\n\nYou should also have `ffmpeg` installed and available in your PATH if you want the final undistorted video to be broadly accepted by websites and video players.\n\n---\n\n## 1. List cameras\n\nUse this first if you do not know your camera index:\n\n```powershell\npython list-cameras.py\n```\n\n---\n\n## 2. Record a test video\n\n```powershell\npython record-video.py\n```\n\nBy default, this records from `DEVICE_ID = 1` at `640x480` and saves the output into `test_videos`. \n\n\n---\n\n## 3. Calibrate the camera\n\nPrint the included ChArUco board PDF, or generate your own from calib.io.\n\nThen run:\n\n```powershell\npython fisheye_calibration.py\n```\n\nOptional audio guide:\n\n```powershell\npython fisheye_calibration.py --audio\n```\n\nYou can also choose a camera index:\n\n```powershell\npython fisheye_calibration.py --device 1\n```\n\nAnd choose where to save the calibration file:\n\n```powershell\npython fisheye_calibration.py --output fisheye_calib_data.npz\n```\n\nThe script walks through six capture phases: center flat, center tilted, image edges, image corners, close range, and far\u002Fmixed range. It aims for 60 captures total, with 10 per phase. \n\n---\n\n## 4. Undistort a video\n\n```powershell\npython fisheye_undistort.py test_videos\\your_video.mp4\n```\n\nThis will create an output file next to the input video, usually named something like:\n\n```txt\nyour_video_undistorted_h264.mp4\n```\n\nYou can also choose the output path:\n\n```powershell\npython fisheye_undistort.py test_videos\\your_video.mp4 -o output\\undistorted.mp4\n```\n\nUse a specific calibration file:\n\n```powershell\npython fisheye_undistort.py test_videos\\your_video.mp4 -c fisheye_calib_data.npz\n```\n\nDisable the preview window:\n\n```powershell\npython fisheye_undistort.py test_videos\\your_video.mp4 --no-preview\n```\n\nThe undistortion script writes a temporary AVI first, then uses `ffmpeg` to re-encode the final video as H.264 with `yuv420p` pixel format and `+faststart`, which makes the MP4 much more compatible with websites and players. \n\n---\n\n## Useful parameters to change\n\n### In `fisheye_calibration.py`\n\nCamera index:\n\n```python\nDEVICE_ID = 1\n```\n\nBoard settings:\n\n```python\nSQUARES_X = 5\nSQUARES_Y = 7\nSQUARE_LENGTH = 0.030\nMARKER_LENGTH = 0.022\n```\n\nThese must match your printed ChArUco board. The values are the number of chessboard squares, not inner corners. \n\nCapture settings:\n\n```python\nTARGET_CAPTURES = 60\nCOOLDOWN_TIME = 2.0\nMIN_CHARUCO_CORNERS = 15\n```\n\nUse more captures if your undistortion looks bad. For fisheye lenses, edge and corner coverage matters a lot.\n\n### In `record-video.py`\n\n```python\nDEVICE_ID = 1\nWIDTH = 640\nHEIGHT = 480\nFPS = 30\n```\n\nChange these if your camera uses a different index or supports a different resolution\u002FFPS. \n\n### In `fisheye_undistort.py`\n\n```powershell\n--balance 0.0\n```\n\n`0.0` gives a more cropped image with fewer black borders.\n`1.0` keeps more field of view but may show more black edges.\n\n```powershell\n--scale 1.0\n```\n\nAdjust this if you want to experiment with the final field of view.\n\n---\n\n## Notes\n\nCalibration quality depends heavily on the poses you capture. Try to follow the guide it tells you how to get very varied shots.\n\nIf the undistorted video looks worse, the calibration data is probably weak. Re-run calibration and make sure the board appears in many different parts of the image.\n\nThat is basically it. Fisheye camera gets less fishy.\n\n","该项目旨在简化广角鱼眼相机的校准过程。其核心功能包括列出可用USB摄像头、录制原始鱼眼测试视频、使用ChArUco标定板对鱼眼或广角相机进行校准、对录制视频进行去畸变处理，并将结果重新编码为Web兼容的H.264 MP4格式。项目主要采用Python语言开发，适合需要从广角鱼眼镜头中获取无畸变视频的应用场景，如安防监控、虚拟现实等领域的视频采集与处理。该工具特别适用于Windows用户，通过简单的命令行操作即可完成整个校准流程。",2,"2026-06-11 04:02:47","CREATED_QUERY"]