dinvlad I restarted the whole process to properly document every step of it in case anyone else interested. Im using a Raspbarry Pi 4:
- Installed Raspios with desktop (https://downloads.raspberrypi.…-raspios-buster-armhf.zip)
- Enabled SSH and configured Wifi by wpa_supplicant file on boot partition
- After first boot, applied updated with sudo apt update && sudo apt upgrade
- Installed Hyperion NG with the deb package (wget https://github.com/hyperion-project/hyperion.ng/releases/download/2.0.0-alpha.9/Hyperion-2.0.0-alpha.9-Linux-armv7l.deb && sudo apt install ./Hyperion-2.0.0-alpha.9-Linux-armv7l.deb)
- After installation, the 4K output to the TV is gone, but its "normal" in this case, you should turn off Platform Capture under capturing hardware on the hyperion web interface (http://YourIp:8090/#conf_grabber)
- sudo reboot via ssh
- Checked out Your repo (git clone https://github.com/dinvlad/HyperVision.git)
- Your suggestion is already insatalled but found the package I installed: sudo apt install libatlas-base-dev to make it work.
- Installed the requirements "by hand" (pip3 install requests opencv-python screeninfo)
- Calibrate camera runs without problem after all of the above
- params.json
{
"model": "pinhole",
"dims": [
1280,
720
],
"k": [
[
766.7134975473682,
0.0,
630.6505932315317
],
[
0.0,
747.5824606212268,
344.49610924731536
],
[
0.0,
0.0,
1.0
]
],
"d": [
[
-0.275645578998617,
0.19176572537794795,
0.0021488936528126163,
-0.0021569609390377853,
-0.1643065680854339
]
]
}
Alles anzeigen
- python3 calibrate_screen.py in my case need some fixes, I did figure out the followings:
diff --git a/calibrate_screen.py b/calibrate_screen.py
index 2cf64a1..28e9a74 100755
--- a/calibrate_screen.py
+++ b/calibrate_screen.py
@@ -189,10 +189,10 @@ def get_screen_transforms(blank: np.array, cam: CameraParams, cam_alpha: float):
corners = np.float32(corners)
if cam.model == CameraModel.PINHOLE:
- new_k = cv2.getOptimalNewCameraMatrix(
+ new_k, _ = cv2.getOptimalNewCameraMatrix(
cam.k,
cam.d,
- cam.dims,
+ (cam.dims[0], cam.dims[1]),
cam_alpha,
)
undist_points = cv2.undistortPoints
Alles anzeigen
- At this point I stuck with the following error:
Traceback (most recent call last):
File "calibrate_screen.py", line 381, in <module>
main()
File "calibrate_screen.py", line 373, in main
vert_led_depth,
File "calibrate_screen.py", line 257, in calculate_leds
dp = distort([[[i / leds_top, 0]] for i in range(0, leds_top + 1)])
File "calibrate_screen.py", line 255, in distort
return distort_points(cam, np.float32(points), p_t, new_k_inv)
File "calibrate_screen.py", line 234, in distort_points
perspective_points, np.zeros(3), np.zeros(3), cam.k, cam.d
cv2.error: OpenCV(4.5.1) /tmp/pip-wheel-qd18ncao/opencv-python/opencv/modules/calib3d/src/calibration.cpp:3563: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_64F) in function 'projectPoints'
Alles anzeigen
- A picture of the enviroment
Python version: 3.7.3
OpenCV version: 4.5.1
Could you please help me out with this? I also tried the fisheye calibration but that failed as well for me.