Support for Waveshare IMX 219 wide angle camera

Hello!

I’m doing some robotics work with the Jetson Nano and am having trouble with my current Wide Angle Camera.

The Jetbot guide (https://github.com/NVIDIA-AI-IOT/jetbot/wiki/bill-of-materials) recommends using either the Leopard Imaging 145 degree CSI camera or the Waveshare module to replace the Raspberry Pi V2 camera. Since the Leopard Imaging camera was out of stock at the time and the Waveshare module offered a wider view (160 vs 145), I went with the Waveshare module.

I got images from the Waveshare module, but they were all heavily tinted pink. Experimenting with GStreamer settings showed that if I turned white balance off it reduced the pinkness some but there was still a lot of non-uniform color distortion (pinker further from the center). I contacted Waveshare about the problem and they acknowledged that it was a problem with this board but didn’t seem to know how to fix it (email below).

All of the CSI cameras are based off of the IMX219 module, but I believe that I ran across a thread that indicated the current CSI support had been customized for the Raspberry Pi V2 module.

  1. I just ordered the Leopard Imaging wide angle camera. Am I going to run into similar problems with that?
  2. Since NVidia released the JetBot and their docs recommends the Waveshare camera, is there a know way to fix the issue?
  3. If not, would it be possible to get notes on how to calibrate the settings for a camera? I could forward it to Waveshare and see if they can come up with a fix.

Thanks,
Charlie West

Email:

Hello,

Thanks for your feedback.
We found that the camera have pink effect when working with Jetson Nano. And now there isn’t solution for it.
We will test and try to solve it. We are very sorry about this problem. For Jetson nano, maybe you can think about our IMX219-77 Camera if you don’t plan to use the camera with Raspberry Pi.

发件人:Charles West crwest@ncsu.edu
发送日期:2019-05-16 20:03:01
收件人:service service@waveshare.com
主题:Re: Color tint in IMX219-160

Hello,

It was an Nvidia Jetson Nano.  They are using GStreamer to provide access.

It can accessed via command line via:

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12' ! nvvidconv flip-method=0 ! 'video/x-raw,width=960, height=616' ! nvvidconv ! nvegltransform ! nveglglessink -e

Further searching seems to indicate that by modifying GStreamer to (disabling white balance):
gst-launch-1.0 nvarguscamerasrc wbmode=9 ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12' ! nvvidconv flip-method=0 ! 'video/x-raw,width=960, height=616' ! nvvidconv ! nvegltransform ! nveglglessink -e

can make more of the colors come out somewhere close to correct.  However, everything green still comes out pink. 
My guess is that the core issue is that they have calibrated for the default RPi camera V2 and it isn't handling different modules correctly.  I'm not sure how to correct it.  Color seems better with the RPi3, but I haven't tested the 
"green is pink" part yet on that platform.

If I may ask, do you have any suggestions what I should do?

Thanks,

Charlie West

I have the same module ( Waveshare 160 degree, imx219). No pink problem. If it happens on a Pi as well I would definitely send the module back for an exchange as it sounds defective. Just make sure to try it in different lighting before you do. It may just be the color balance issue or something like that.

Hi crwest,

We have noticed the pink distortion with some wider angle configurations of this sensor. I just tested the tuning file provided in this comment:

https://devtalk.nvidia.com/default/topic/1051913/jetson-nano/how-to-close-gstreamer-pipeline-in-python/post/5340291/#5340291

It successfully removed the pink distortion I noticed.

I haven’t tested this with the Waveshare module though. Could you try the instructions there to see if this works for you?

Thanks,
John

@Mdegans:
Interesting. I had dismissed the defective module explanation because it worked fine with the Raspberry Pi 3 (no pink issue) and support at Waveshare had acknowledged it as a problem.

@Jaybdub:
Thanks! I will try that tomorrow and see if it helps!

I wasn’t near my Nano when I wrote before. I have tried it again after testing in different locations. The edges of the image do seem to be more pink than the center. I didn’t really notice it before since the effect is quite subtle with the colors of what the camera is pointing at (the colors in this room are very saturated). I wonder if it’s the lens or the sensor causing that.

Thank you very much. That worked for me. Pink is all gone, even with the camera pointing at a greycard.

@mdegans Excellent! Thanks for letting me know.

@crwest Please let me know if this works in your case too.

I’m curious to see if this works consistently.

This feedback is very helpful, and I think will improve others experience. Thanks for testing and sharing.

Best,
John

I tried the ISP fix. It’s still strongly pink. Since it seems to be much worse for me than others, I am going to try to return my module and see if a new one does any better with the fix.

Thanks.

I got the new module in today and tested it. The pink problem was present with the new module but to a lesser degree (pink on the edges but not everywhere). Installing the recommended ISP file did solve the problem for this module.

It’s working now.

Thanks!

Great to hear! Thanks for following up.

Best,
John

Have anyone done Livestreaming from Jetson Nano with Raspberry Pi Camera to any network?? Please help me regarding this.

This is not working with my camera rasberry pi NoIR V2. Though it has reduced some distortion but image quality is still far from normal.

Noir (no ir) cameras have the IR filter pulled off so it’s normal for the colors to look wrong during the daytime.

You are right! At night it seems to work properly. But , is there any solution to it?

Someone on another forum suggested a servo to put a filter in front during the daytime. You can get an ir filter at a photography store.

Other than that, it would be difficult to fix in post. A 3D LUT might work but idk if Nvidia has any gstreamer elements or other software to apply one. You could have to write your own, and that could be difficult.

In any case you would need to generate a LUT (actually, probably a series of them) with stills taken with and without a filter, so you would need to buy a filter anyway. It’s probably much easier to just use the servo and filter if that solution isn’t out of the question.

The solution to “my night camera without IR filter doesn’t work in daylight” is to use a camera WITH an IR filter in daylight.

That only works if you don’t need the same camera to be used at day and night. I have this problem with a Pi NoIR based “security camera” outside. My solution is just to not care if colors are wrong during the day (actually, I think it looks kinda cool), but if you do care enough, a filter on a servo or a LUT might work.

Hey,

I saw that there were isp files in the other thread. But it is now a deadlink, does anyone have a fix to the pink / purple hue given off that used to be clear.

Moreover, does anyone know how to close the pipes once done with gstreamer. I have been running multiple python files from the “Jetson Inference project” however after running a few times it begins to segfault / core dump.

Hi bhogvu,

Please help to open a new topic for your issue. Thanks