Arducam MIPI_Camera got green frame

Published by zone870426 on

  • This topic has 24 replies, 5 voices, and was last updated 2 months ago by bin.
Viewing 24 reply threads
  • Author
    Posts
    • #25777
      zone870426
      Participant

      when I run 1_test.py I still got the green frame, I don’t know why, and try several times but still green. 

    • #25810
      bin
      Keymaster

      Hi,

      It is due to we don’t have awb. The image looks green, which  will not affect the algorithm calculation

    • #25837
      zone870426
      Participant

      Thank you so much, but how can we add the awb in python to solve, if I want to make it normal.

    • #25839
      zone870426
      Participant

      thank you, I solve the problem

       

    • #25778
      zone870426
      Participant

      still green

    • #26085
      bin
      Keymaster

      Hi,

      Arducam technology team are developing ISP camera which will solve AE AWB  and other problems.

       

    • #33128
      aeae
      Participant

      Hi zone870426,

       

      may I know how you solve the green frame problem? Mine is still showing green. Thanks a lot!

       

      aeae

    • #33130
      bin
      Keymaster

      Hello,

      It is due to the image is original raw bayer image without post  ISP process.  Green channel

      account for 50% of the data volume. So the image looks green, It needs ISP to do AWB to compensate R and B channel.  At present, we are developing our own ISP.  For the raw image, the green is normal.

       

       

    • #34156
      lucabu
      Participant

      I have the same problem, I cannot get a normal-color image from the dual cam system (I just bought a B0265R kit).
      In these instructions you clearly demonstrate that the images are good, so why can’t we get the same results? where is the problem?

      Camarray – Arducam 12MP Synchronized Stereo Camera Bundle Kit

    • #34157
      bin
      Keymaster

      Hi,

      In the instructions, we use raspistill tool to test instead of MIPI_Camera. Due the MIPI_Camera driver does not have ISP to process. The image you get without AWB and AE, so the image is green. You can use raspistill to get the normal image.

      Feel free to let me know if you need more help.

       

    • #34176
      lucabu
      Participant

      Hi @Bin, thank you for your answer, but in the instruction you provided on your website you are clearly using the MIPI_Camera driver and arducamstill to get a good colored image in “mode 1” using ./arducamstill -t 0 -m 1.


      Is this a documentation error? I am asking because I bought this kit to have something usable almost “out-of-the-box”, and right now I don’t have the resources or competences to develop a new driver/program by myself.
      If this is the case, I will have to send the B0265R kit back and find another solution…

      Using the standard raspistill software is not an option because it gives an half-resolution shrinked images, while I need a dual full resolution frame.

      I also noticed that the latest version of the libarducam_mipicamera.so (from git) lacks the support of Mode1 (8112×3040 resolution), I had to download an older version to have the Mode1 working.

      Is there something else I can do or try? Or can you point me to some other resources, or beta driver or something I can use?

      Thanks for your support

      • This reply was modified 4 months ago by lucabu. Reason: added image from documentation
    • #34188
      bin
      Keymaster

      Hi,

      On Raspberrypi Platform, we have software ISP but the result is not very well.

      On Jetson Nano Platform, we does not have ISP, so the image is green.

      Please attach me your hardware and  the image you get. I will help you check it in detail

    • #34214
      bin
      Keymaster

      About lacks the support of Mode1 (8112×3040 resolution), I have fixed the issue today

    • #34327
      lucabu
      Participant

      Hi @bin, thank you again for your support. I was able to do some tests today and this is the results.

      I am using a RPI 4B 8Gb, with Raspberry OS 2020-12-02-raspios-buster-armhf.img image installed and kernel 5.4.79-v7l+ #1373 SMP (also tested with older and newer releases), connected with the B0265R kit (Arducam 12MP Synchronized Stereo and 2 imx477 HQ camera)

      With the new libarducam_mipicamera.so that you fixed, the problem with the missing Mode1 is resolved.
      With the default arducamstill demo I was able to live-view a colored image (after adding a lot of illumination in the room), but the same image saved using:
      ./arducamstill -t 1000 -m 1 -q 100 -r -e jpg -o test2_green.jpg

      was still dark green; I found out that adding more time to the -t option, the image was saved correctly:
      ./arducamstill -t 2000 -m 1 -q 100 -r -e jpg -o test1_good.jpg

      when trying to save in bmp format I get a timeout error:

      — begin —
      ./arducamstill -t 3000 -m 1 -e bmp -o test3.bmp
      Open camera…
      Found sensor imx477 at address 1A
      mode: 0, width: 4056, height: 3040, pixelformat: BA81, desc: (null)
      mode: 1, width: 8112, height: 3040, pixelformat: BA81, desc: Used for Arducam synchronized stereo camera HAT, 4056×3040 * 2
      Get ctrl V4L2_CID_FOCUS_ABSOLUTE fail.
      index: 0, CID: 0x009A090A, desc: V4L2_CID_FOCUS_ABSOLUTE, min: 0, max: 1023, default: 190, current: 0
      Can’t open the file
      mmal: Failed to fix lens shading, use the default mode!
      The stereo hat firmware version: 5.1 2020/10/15
      Failed to set focus, the camera may not support this control.
      Failed to set focus, the camera may not support this control.
      Failed to set exposure, the camera may not support this control.
      Start preview…
      Current mode: 1, width: 8112, height: 3040, pixelformat: BA81, desc: Used for Arducam synchronized stereo camera HAT, 4056×3040 * 2
      [Framerate]: 06 pfs, [Exposure]: 0000, [Focus]: 0000,[Rgain]: 0000, [Bgain]: 0000mmal: Enable BMP encoder.
      mmal: mmal_vc_port_enable: failed to enable port vc.ril.image_encode:out:0(BMP ): ENOSPC
      mmal: mmal_port_enable: failed to enable port vc.ril.image_encode:out:0(BMP )(0x140fed0) (ENOSPC)
      mmal: Failed to enable isp outptu.
      mmal: Faild to enable image encoder output.
      mmal: Failed to enable image encoder.
      capture timeout.
      — end —

      Using the same command with Mode0 the image is saved without errors (of course the image is “shrinked”).

      also using the command ./capture, selecting the Mode1, after a minute the process ends with this error:

      — begin —
      Open camera…
      Found sensor imx477 at address 1A
      mode: 0, width: 4056, height: 3040, pixelformat: BA81, desc: (null)
      mode: 1, width: 8112, height: 3040, pixelformat: BA81, desc: Used for Arducam synchronized stereo camera HAT, 4056×3040 * 2
      Get ctrl V4L2_CID_FOCUS_ABSOLUTE fail.
      index: 0, CID: 0x009A090A, desc: V4L2_CID_FOCUS_ABSOLUTE, min: 0, max: 1023, default: 190, current: 0
      Please choose sensor mode: 1
      Setting the mode…
      choose the mode 1
      Can’t open the file
      mmal: Failed to fix lens shading, use the default mode!
      The stereo hat firmware version: 5.1 2020/10/15
      Current mode is 1
      Notice:You can use the list_format sample program to see the resolution and control supported by the camera.
      Failed to set focus, the camera may not support this control.
      Capture image mode1.bmp…
      Enable Software Auto Exposure…
      Enable Software Auto White Balance…
      Waiting for automatic adjustment to complete…
      mmal: Enable BMP encoder.

      mmal: mmal_vc_port_enable: failed to enable port vc.ril.image_encode:out:0(BMP ): ENOSPC
      mmal: mmal_port_enable: failed to enable port vc.ril.image_encode:out:0(BMP )(0x146feb0) (ENOSPC)
      mmal: Failed to enable isp outptu.
      mmal: Faild to enable image encoder output.
      mmal: Failed to enable image encoder.
      capture timeout.
      Close camera…
      — end —

       

      using ./capture_raw I get a file named 0x0.raw, but there is no way to open it, even with the python demo programs.

      What can I do to obtain a raw or bmp image (or any other high quality file format) ?

      Sorry for the long post, hope you can help me solve this problem !
      thank you again

      PS: If you need them, here you can find the original images and the 0x0.raw file:

      https://drive.google.com/file/d/1dHDImVr3m_x_rzKel2RCc479hhVgqOTz/view?usp=sharing

      Luca

    • #34429
      bin
      Keymaster

      Hello,

      Thanks for your patience. About the first issue, it is due to the software ISP need time to adjust AWB. So you should preview the image for a while to wait the awb normal.

      About the mode1 error in BMP mode, It may be due to the RPI image encoder does not support so big resolution. I will test it when I have time.

      Feel free to let me know if you find something new.

    • #34434
      lucabu
      Participant

      Hi again, I did some other tests in daylight, but the results were terrible. The image was very overexposed, I had to close the diaphragm but it is very sensible, and is very difficult to obtain the same exposition on both cameras.

      I’ve tryied to manually set the exposure via sw, but I didn’t succeded. It seems that the camera (using arducamstill) doesn’t support the exposure or gain control:

      Open camera…
      Found sensor imx477 at address 1A
      mode: 0, width: 4056, height: 3040, pixelformat: BA81, desc: (null)
      mode: 1, width: 8112, height: 3040, pixelformat: BA81, desc: Used for Arducam synchronized stereo camera HAT, 4056×3040 * 2
      Get ctrl V4L2_CID_FOCUS_ABSOLUTE fail.
      index: 0, CID: 0x009A090A, desc: V4L2_CID_FOCUS_ABSOLUTE, min: 0, max: 1023, default: 190, current: 0
      Can’t open the file
      mmal: Failed to fix lens shading, use the default mode!
      Failed to set focus, the camera may not support this control.
      Failed to set focus, the camera may not support this control.
      Failed to set exposure, the camera may not support this control.
      Start preview…

      Even using the UP/DOWN arrow key to change it, the sw give an error:

      Current mode: 1, width: 8112, height: 3040, pixelformat: BA81, desc: Used for Arducam synchronized stereo camera HAT, 4056×3040 * 2
      Failed to set exposure, the camera may not support this control.
      [Framerate]: 07 pfs, [Exposure]: 0500, [Focus]: 0000,[Rgain]: 0000, [Bgain]: 0000Failed to set exposure, the camera may not support this control.
      Failed to set exposure, the camera may not support this control.
      Failed to set exposure, the camera may not support this control.

      I also noticed that the code list_format don’t say anything about exposure or gain:

      Get ctrl V4L2_CID_FOCUS_ABSOLUTE fail.
      index: 0, CID: 0x009A090A, desc: V4L2_CID_FOCUS_ABSOLUTE, min: 0, max: 1023, default: 190, current: 0
      close camera status = 0

      I tryed some other codes that found on this forum, but nothing seems to work using the functions

      arducam_set_control(camera_instance, V4L2_CID_EXPOSURE, globalParam.exposureVal);
      arducam_set_control(camera_instance, V4L2_CID_GAIN, globalParam.GainVal);

      In another post, you said to try using the function arducam_write_sensor_reg
      but I don’t understand how to use it and where to find the registers for the imx477 camera.

      if I don’t ask too much, could you provide some working example?

      Luca

    • #34437
      bin
      Keymaster

      Hello,

      Sorry to hear that, I have add exposure control for imx477. I have update the lib and arducamstill application. Please download the latest lib to try. IN fact if you want to adjust the exposure, Just adjust the 0x0202 and 0x0203 register.  If you wan to adjust the gain. Just adjust the 0x0205 register.

      Feel free to let me know if you need more help.

    • #34508
      lucabu
      Participant

      Hi, thanks, by changing those registers I was able to do other tests:

      I wrote a python program to cycle all the GAIN and EXPOSURE values of the registers and I was able to change the image. However, the image is not yet usable, many other adjustments would be needed to be useful.

      Here you can find a video made inside:

      https://drive.google.com/file/d/12lzZlM25fpekct58B_WrCnFKteUA-Lkc/view?usp=sharing

      as you can see the colors are always greenish. I also tried outside in sunlight, but the image is always overexposed and obviously with wrong colors.

      Of course, colors are fine when using raspistill, but the image is compressed into one frame.

      At this point I don’t know what else to do

    • #34516
      bin
      Keymaster

      Hello,

      Using raspistill, which has ISP post process, so the image we get is great. But the raspistill just support RPI camera 5mp/8mp/12mp. Our MIPI_Camera support all of arducam camera, but without ISP. So the image we get is original image without ISP post process. We can adjust the digital gain and exposure time to fine tuning the image quality manually. If the image is green, you can try to reduce the GR and GB channel. and increase the R and B channel.

      Feel free to let me know if you need more help.

       

       

    • #34675
      bolteon
      Participant

      How much longer until AWB & AE is ready for the arducam? I too purchased a B265R (after purchasing two B270’s, which apparently aren’t compatible with the stereo hat) and would appreciate the functionality for which we paid for…

      The documentation shows AWB and AE functional when using Arducam but currently it doesn’t work.

      At least an ETA would be very helpful.

      • This reply was modified 3 months, 2 weeks ago by bolteon.
    • #34735
      bin
      Keymaster

      Hello,

      Sorry for our document mislead you. Only when you use raspistill tool. it supports AE and AWB function due to it has RPI hardware ISP support. Using our MIPI_Camera driver, due to it does not have ISP support, so we just have software AE and AEB function and the result is not very well. Currently our ISP is in the theoretical testing stage and made great process.

    • #34743
      bolteon
      Participant

      Thank you for replying Bin.

      Do you have a direct email? I have some more questions that I would like to keep off the main forums; I also contacted regarding a custom order for design of a camera solution, have not heard back from anyone in over a month…

    • #34762
      bin
      Keymaster

      You are welcome. We can chat through skype ID: “[email protected]

      or send email to our [email protected]. I will try my best to help you.

       

    • #35222
      lucabu
      Participant

      Any news about  AWB & AE support? when will they be available?

      right now we all have a pretty much useless kit on our desks…

      Thanks

    • #35270
      bin
      Keymaster

      Hi, Our ISP is still developing. Please waiting .

Viewing 24 reply threads
  • You must be logged in to reply to this topic.