Adjust Camera in Hyperion - Color - Help required

  • luchow3cu @Luminis I wonder if this maybe has to do with electrical noise for 50hz lighting (in countries with 50hz electricity..) somehow? I.e. what happens if you turn off all lights Luminis ?


    stewe93 I've fixed it! Had to do with the order of perspective transform operations (3d vs 2d matrices..). Here's my result from a C920!

  • Wow the skript does a very good job calculating the coordinates.

    Thanks! Could you test it as well if you can?


    I'm planning to 3d-print a AmbiVision-like camera holder after all else is figured out ^^ Right now just need to mount the strip, but also to somehow compensate for the blue tint introduced by Pi camera. I've briefly played with gamma but have not yet found the right settings (coming back to the original topic lol..). Going to play with v4l2-ctl settings also.

  • dinvlad I tried the new script, calibrate_screen still fails with the following error:

    Code
    python3 calibrate_screen.py 
    Waiting for shutdown of Hyperion V4L component ...
    Traceback (most recent call last):
      File "calibrate_screen.py", line 382, in <module>
        main()
      File "calibrate_screen.py", line 377, in main
        show_leds(mon, cap, leds, crop, args.frame_preview_delay_ms)
      File "calibrate_screen.py", line 297, in show_leds
        cv2.rectangle(img, np.int32((p[0], p[2])), np.int32((p[1], p[3])), (255, 0, 0))
    TypeError: Scalar value for argument 'color' is not numeric

    I was able to fix this issue with the following changes:

    Code
         for p in leds:
    -        cv2.rectangle(img, np.int32((p[0], p[2])), np.int32((p[1], p[3])), (255, 0, 0))
    +        pt1=(int(p[0]),int(p[2]))
    +        pt2=(int(p[1]), int(p[3]))
    +        cv2.rectangle(img=img, pt1=pt1, pt2=pt2, color=(255, 0, 0))
    
         img = img[crop.y : crop.y + crop.h, crop.x : crop.x + crop.w, :]

    And the result is almost fine:

  • stewe93 hmm, looks like the entire screen is not in the field of view? The script won't work if it isn't..


    Also, there's a delay when flashing the blank white screen, maybe it's not sufficient enough that the script takes the image of your desktop before the white screen is shown? In that case, try increasing the delay as such:

    Code
    python3 calibrate_screen.py -fs 5000
  • OK, I finally have my fisheye test results! All I can say is wow - it totally worked. Most notable things:


    1) it produces this nice "Hue" effect (without any smoothing, but purely thanks to my Hue-like LED strip and it being ~6" away from the wall)


    2) very small, almost imperceptible delay, thanks to Pi camera in 57fps capture mode and LED output on the same Pi. This is exactly what I was going for, to reduce any hardware-related latency.


    3) color reproduction towards some edges is not the most accurate. This is likely due to positioning of the camera directly in front of the screen, so the geometric distortions become more noticeable. Likely I can tweak it further with some proper positioning, but even this might just be "good enough".


    4) unfortunately, the Pi camera suffers from a blue hue (basically anything white is seen with a heavy blue tint). I've played with gamma and v4l2 settings, but nothing worked "great" so far. Some options seem promising, but they reduce or over-exaggerate other colors. Perhaps I will have to find a USB fisheye that works better :-/


    All in all though, this is looking very nice even without any tweaks, other than a couple geometric ones for the screen calibration script. Here're a couple first tests :)

    External Content www.youtube.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

    External Content www.youtube.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

  • Thanks @luchow3cu! There might still be some hiccups as stewe93 discovered, so I might still need to polish a few.


    Since Mon, I've also noticed some delays when switching from a dark scene to bright, for example. I think this has to do more with the camera since it takes time to adjust its "perception" of the color/brightness (possibly due to auto-exposure, but maybe something else), but it's not too bad in any case.


    One thing I'm still planning to work on (in addition to fixing any more issues you discover) is to improve calculation of the areas towards the corners of the screen. Right now, they include "out of screen" pixels and that's why the colors there are off, I think. I'll look into how to "cut off" those areas so that only the pixels of the screen are counted. The ultimate solution would be however to produce non-rectangular areas, if that was supported by Hyperion. But for now, even the cutoff workaround seems like it would work.

  • Hi guys, was just pointed to this thread as I'm planning on setting up Hyperion with a camera. The thread suggests setting up camera at some distance from the tv 1.5m - 4m however, on pictures posted here noticed some people have it on the tv or below.

    As I don't really have anywhere to mount the camera at a distance from a tv could someone recommend decent quality camera for 65 inch tv that I could mount on top or under the tv ( at the edge of the tv stand before the fron speaker)please? I've attached a photo of my setup in case that helps


    Many thanks


  • ptrh yep, I'm in the same boat - I set up a Picam with a fisheye lens as explained a few posts above. This works "ok" but the color reproduction on this particular camera is not the best. I'm still going to play with manual white balance adjustment on the camera though, so if that works I'd recommend going that path, since I haven't yet found as cheap fisheye cams as this one. For fisheye, you need ~170-180deg horizontal (!) lens. Some manufacturers claim 165-170deg fisheye but it's actually closer to 130deg horizontal, which wasn't sufficient for my 77". Even for 65", I'd still recommend not less than 170deg horiz. Mine is actually 194deg, which makes it a bit harder to calibrate the camera: https://smile.amazon.com/gp/product/B013JWEGJQ. So if you can find a 170-180deg horiz that'd be ideal I think. Maybe try this one also (almost as cheap, and comes in a nice mount): SVPRO 170degree Megapixel Resolution Computer


    For calibration, you can use my scripts here: https://github.com/dinvlad/HyperVision

    Overall, I'd say fisheye is much trickier to set up than what luchow3cu has. But the reward is there :)

  • I made a new video with new v4l2-ctl settings. These are the best results until now.

    External Content www.youtube.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

  • hanks for trying it out! This looks like an OpenCV library problem. Did you install it using `pip3 install opencv-python` or some other method? Tbh mine was cross-compiled on another host, so even pip3 install might not be sufficient.


    Digging deeper into the error, looks like it complains about BLAS library - could you try the following?

    Hey there, I tried you recommendations and used the troubleshoot from stewe93. However, i receive the following Error:




    As I am relativly new to phyton programming i really hope you got an idea here.


    Have a nice day, you did a great job :)


    Grygal

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!