PiCapture Color problems

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1448
    Anonymous
    Inactive

    The script:

    from time import sleep
    from picamera import PiCamera

    camera = PiCamera (sensor_mode = 1, resolution = (1920,1080))
    camera.sharpness = 0
    camera.contrast = 0
    camera.brightness = 50
    camera.saturation = 0
    camera.iso = 0
    camera.exposure_compensation = 0
    camera.exposure_mode = “off”
    camera.awb_mode = “off”
    camera.awb_gains = (1.0,1.0)
    camera.image_effect = “none”
    camera.color_effects = None
    camera.start_preview()
    sleep(5)
    camera.capture(“/home/pi/X.jpg”)
    sleep(5)
    camera.stop_preview()

    I have connected the PiCapture to a laptop that sends hdmi input signals to the capture card. See the first picture below for the setup.

    What it more or less does, it creates the desktop picture (or the powerpoint slide) as a camera output which then i can connect to the PiCapture. The problem is as following: The color spectrum seems to be little wrong here. I have downloaded a standard SMPTE bars from google (1920×1080), and you could slightly see the different between the original and the picture captured with PiCapture, especially with red and pink. It seems like they are somewhat brighter (or maybe even darker, i can’t quite get difference).

    See the original picture here:

    The PiCapture picture:

    Maybe it’s not that noticable in the SMPTE picture, so i took a picture of a landscape (which i downloaded from Google), and then also tried to run the script, and the results were quite shocking.

    Landscape original:

    Landscape PiCapture:

    I have tried to tweak some of the setting in the script at top, but in no where close to the original picture. What is wrong? Are there some other settings that i am not aware of, or do i have to install another library other than PiCamera to correct this problem?

    Thank you in advance 🙂

    PS: Forgive me for my broken English 🙂

    #1451
    Anonymous
    Inactive

    I forgot to mention that the white is coming out as grey, as can clearly be seen in the picture.

    #1454
    mwlinder
    Keymaster

    Thank you for including the sample images – it is very helpful to see what you are seeing.

    The simplest first step to try would be to reduce the brightness setting for the capture. We have also found that there are some big differences in the way that computers handle HDMI output to the PiCapture “emulated monitor”. Adjusting the “gamma” setting can help a lot. Some graphics drivers can handle this directly, but a useful utility is “QuickGamma” for making changes easily and on the fly: QuickGamma (https://quickgamma.de/indexen.html)

    Please let us know if that helps with the issue.

    #1455
    Anonymous
    Inactive

    Hi again! I have tried to lower the brightness, as this also seemed to be the most logical thing to do, but it didn’t quite give the result i wanted. I’ll give you an example of the same landscape with the same settings, but with lower brightness here:

    Landscape (same settings, brightness 48):

    Landscape (same settings, brightness 45):

    Landscape (same settings, brightness 40):

    It is true that it looks better, but you can still see that the color is off compared to the original. Just look at the sea or the buildings. I have tried to lower the saturation and other the other settings, but have not found it appealing.

    I have read that the raspberry pi might read the colors as BRG instead of RGB (according to other forums), and i have tried to write a code to convert the data but could not find a solution there either.

    The laptop solution here is only meant to be a sample. By that i mean to see how the PiCapture HD1 device would work. Without me going into to much details, but i was thinking to use it with a mechanical device that delivers picture. I’ll see if i can give samples from that device tommorow for more spesific examples. So the QuickGamma won’t really be useful here, since the laptop is not really the object of interest for the usage of PiCapture HD1 model.

    Thanks again 🙂

    #1456
    mwlinder
    Keymaster

    We have found that different source devices deal with the EDID information a bit differently, and PCs are some of the most difficult in terms of color matching because they don’t seem to honor the EDID device settings.

    I am quite sure that there is not an issue with the color sequence (RGB) – in fact, the data is sent as a “bayer” format picture and converted in the RPi GPU.

    #1468
    Anonymous
    Inactive

    Hi again!

    I have now tried to connect a digital camera with the same setup (with hdmi input), and the results are still the same (don’t have sample pictures unfortunately). It seems that the HDMI input method “washes” the colors of the picture or that the whitebalance seems to be off. Is it possible to manually choose the video input and the video type/colorspace/resolution etc. on the capture card (without have to depend on the picamera library)?

    That may or may not help.

    Thanks 🙂

    #1469
    mwlinder
    Keymaster

    There is no method of adjusting the colorspace or resolution because these are controlled by the source device. There are multiple stages in the conversion of the video signal to emulate the Raspberry Pi Camera, and after being received the signal is also manipulated in the Raspberry Pi GPU.

    Originally you were trying to resolve the color issue you are seeing with a PC source, but you have switched to a camera – the solutions may be different for different sources. Which source are you most interested in using with PiCapture?

    If you are working with a PC, starting with the gamma settings as described above are a good first step. For cameras which may not have output controls, it may be necessary to manually adjust the white balance settings on the Raspberry Pi side. You mention using the PiCamera library, but it may be easier to start with using Raspivid to adjust settings until you are satisfied with the color.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Color problems