Arducam UC-625 with UC506

Published by sahil on

Viewing 37 reply threads
  • Author
    Posts
    • #22145
      sahil
      Participant

      Hi, I have managed to get to the point where 1_test.py runs however after I select the mode [7], I have an error. I have connected the board onto Raspberry PI 4 4G and have set 180Mb of memory for the GPU.  I have tested on raspistill and it worked fine. I have upgrade the firmware etc. on the Pi. Please can you help?

      “~/MIPI_Camera/RPI/stereo_depth_demo $ python 1_test.py
      Open camera…
      Found sensor imx219 at address 10
      mode: 7, width: 1600, height: 600
      mode: 8, width: 2560, height: 720
      mode: 9, width: 3840, height: 1080
      mode: 10, width: 5184, height: 1944
      mode: 11, width: 6528, height: 1848
      mode: 12, width: 6528, height: 2464
      Please enter the mode number:7
      mmal: Failed to fix lens shading, use the default mode!
      Current mode: 7,resolution: 1600×600
      ^CTraceback (most recent call last):
      File “1_test.py”, line 85, in <module>
      cv2.imshow(“Arducam”, frame)
      KeyboardInterrupt”

    • #22156
      bin
      Keymaster

      Please ensure you have installed all the additional repositories

    • #22218
      sahil
      Participant

      Hi Bin, could you please post the link because, I found one on a blog which I followed and didn’t have much success with and and I then followed steps in a readme file with which i got further but not far enough to be able to run the 1_tests.py etc.

      Is there a way to find what the missing files/repositories are?

      Thank you in advance.

    • #22219
      sahil
      Participant

      Hi Bin, please see below output of installing libraries i thought may have been missing.

       

      [email protected]:~/MIPI_Camera/RPI $ sudo apt-get update && sudo apt-get install libzbar-dev libopencv-dev
      Hit:1 http://archive.raspberrypi.org/debian buster InRelease
      Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
      Reading package lists… Done
      Reading package lists… Done
      Building dependency tree
      Reading state information… Done
      libopencv-dev is already the newest version (3.2.0+dfsg-6).
      libzbar-dev is already the newest version (0.22-1).
      The following package was automatically installed and is no longer required:
      libmicrodns0
      Use ‘sudo apt autoremove’ to remove it.
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      [email protected]:~/MIPI_Camera/RPI $ make clean && make
      rm -f *.o
      rm -f video4cameras preview_setMode arducamstill capture video list_format capture_raw raw_callback yuv_callback read_write_sensor_reg ov9281_external_trigger 2MPGlobalShuterDemo preview-camera0 preview-dualcam capture-dualcam video2stdout capture2opencv qrcode_detection opencvGui
      gcc -I. -g -O0 -std=gnu11 -o video4cameras video4cameras.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o preview_setMode preview_setMode.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o arducamstill arducamstill.c -larducam_mipicamera -lpthread
      arducamstill.c: In function ‘main’:
      arducamstill.c:408:50: warning: passing argument 3 of ‘pthread_create’ from incompatible pointer type [-Wincompatible-pointer-types]
      int ret = pthread_create(&processCmd_pt, NULL, prcessCmd,&processData);
      ^~~~~~~~~
      In file included from arducamstill.c:9:
      /usr/include/pthread.h:236:15: note: expected ‘void * (*)(void *)’ but argument is of type ‘void (*)(PROCESS_STRUCT *)’ {aka ‘void (*)(struct <anonymous> *)’}
      void *(*__start_routine) (void *),
      ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
      gcc -I. -g -O0 -std=gnu11 -o capture capture.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o video video.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o list_format list_format.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o capture_raw capture_raw.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o raw_callback raw_callback.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o yuv_callback yuv_callback.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o read_write_sensor_reg read_write_sensor_reg.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o ov9281_external_trigger ov9281_external_trigger.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o 2MPGlobalShuterDemo 2MPGlobalShuterDemo.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o preview-camera0 preview-camera0.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o preview-dualcam preview-dualcam.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o capture-dualcam capture-dualcam.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o video2stdout video2stdout.c -larducam_mipicamera -lpthread
      g++ -I. -g -std=gnu++11 pkg-config --cflags --libs opencv -o capture2opencv capture2opencv.cpp -larducam_mipicamera -lpthread
      g++ -I. -g -std=gnu++11 pkg-config --cflags --libs opencv -o qrcode_detection qrcode_detection.cpp -larducam_mipicamera -lpthread -lzbar
      g++ -I. -g -std=gnu++11 pkg-config --cflags --libs opencv -o opencvGui opencvGui.cpp -larducam_mipicamera -lpthread
      [email protected]:~/MIPI_Camera/RPI $ ./video
      Open camera…
      Found sensor imx219 at address 10
      Setting the resolution…
      Can’t open the file
      mmal: Failed to fix lens shading, use the default mode!
      Current resolution is 1920×1080
      Notice:You can use the list_format sample program to see the resolution and control supported by the camera.
      Start preview…
      Enable Software Auto Exposure…
      Enable Software Auto White Balance…
      Start video encoding…
      Total frame count = 1
      TimeElapsed = 10.000084
      Stop video encoding…
      Close camera…
      [email protected]:~/MIPI_Camera/RPI $

    • #22220
      sahil
      Participant

      Hi Bin, please see below output of installing libraries i thought may have been missing.

       

      [email protected]:~/MIPI_Camera/RPI $ sudo apt-get update && sudo apt-get install libzbar-dev libopencv-dev
      Hit:1 http://archive.raspberrypi.org/debian buster InRelease
      Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
      Reading package lists… Done
      Reading package lists… Done
      Building dependency tree
      Reading state information… Done
      libopencv-dev is already the newest version (3.2.0+dfsg-6).
      libzbar-dev is already the newest version (0.22-1).
      The following package was automatically installed and is no longer required:
      libmicrodns0
      Use ‘sudo apt autoremove’ to remove it.
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      [email protected]:~/MIPI_Camera/RPI $ make clean && make
      rm -f *.o
      rm -f video4cameras preview_setMode arducamstill capture video list_format capture_raw raw_callback yuv_callback read_write_sensor_reg ov9281_external_trigger 2MPGlobalShuterDemo preview-camera0 preview-dualcam capture-dualcam video2stdout capture2opencv qrcode_detection opencvGui
      gcc -I. -g -O0 -std=gnu11 -o video4cameras video4cameras.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o preview_setMode preview_setMode.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o arducamstill arducamstill.c -larducam_mipicamera -lpthread
      arducamstill.c: In function ‘main’:
      arducamstill.c:408:50: warning: passing argument 3 of ‘pthread_create’ from incompatible pointer type [-Wincompatible-pointer-types]
      int ret = pthread_create(&processCmd_pt, NULL, prcessCmd,&processData);
      ^~~~~~~~~
      In file included from arducamstill.c:9:
      /usr/include/pthread.h:236:15: note: expected ‘void * (*)(void *)’ but argument is of type ‘void (*)(PROCESS_STRUCT *)’ {aka ‘void (*)(struct <anonymous> *)’}
      void *(*__start_routine) (void *),
      ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
      gcc -I. -g -O0 -std=gnu11 -o capture capture.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o video video.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o list_format list_format.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o capture_raw capture_raw.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o raw_callback raw_callback.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o yuv_callback yuv_callback.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o read_write_sensor_reg read_write_sensor_reg.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o ov9281_external_trigger ov9281_external_trigger.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o 2MPGlobalShuterDemo 2MPGlobalShuterDemo.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o preview-camera0 preview-camera0.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o preview-dualcam preview-dualcam.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o capture-dualcam capture-dualcam.c -larducam_mipicamera -lpthread
      gcc -I. -g -O0 -std=gnu11 -o video2stdout video2stdout.c -larducam_mipicamera -lpthread
      g++ -I. -g -std=gnu++11 pkg-config --cflags --libs opencv -o capture2opencv capture2opencv.cpp -larducam_mipicamera -lpthread
      g++ -I. -g -std=gnu++11 pkg-config --cflags --libs opencv -o qrcode_detection qrcode_detection.cpp -larducam_mipicamera -lpthread -lzbar
      g++ -I. -g -std=gnu++11 pkg-config --cflags --libs opencv -o opencvGui opencvGui.cpp -larducam_mipicamera -lpthread

    • #22271
      bin
      Keymaster

      Hi,

      I have searched this error. This seems to be a coding problem instead of compiling error.I think your code is right.

      Can you try to delete the old file and create a new file to retry?

       

    • #22279
      sahil
      Participant

      Hi Bin, and thank you for your help.

       

      I am only trying to run the example code from the arducam github repository in http://github.com/ArduCAM/MIPI_Camera/tree/master/RPI/stereo_depth_demo or even just the ./video file and it crashed.

      This is not my own code. Do you mean I should delete and reinstall the MIPI repository from GitHub? I can do that no problem however please confirm this is what you would like me to try.

       

      Thank you.

       

    • #22317
      bin
      Keymaster

      Hi,

      Yes, you can try to delete and reinstall the MIPI_Camera library. If the problem is still exist, I will tell our engineer to check it.

       

    • #22353
      sahil
      Participant

      Hi Bin,

      Ok I deleted the folder and followed the steps to download the repository and compile the files and install and i was able to run ./video this time but i am still not able to run the demos in /stereo_depth_demo and I still get the error “mmal: Failed to fix lens shading, use default mode!”

      The farthest I got was to be able to run “python 1_test.py” which displayed a dual screen image upside down and in green colour I have been able to test “1_test.py” in mode 7 through to 10 all were upside down and green in colour.

      I cant run any of the other demos in the folder.

       

       

    • #22354
      sahil
      Participant

      Ok I was able to run ./video before from the main RPI folder but i can not do that anymore it just closes after 1 frame.

      It recognises my dual camera on the board UC506 as IMX219 (i am supposed to have dual 8Mpix cameras) but in the folder lens_shading_table I can not see a folder name IMX219. Only the following.

      1) ov5647

      2) imx298

      3) imx135

      4) ar1820

    • #22429
      bin
      Keymaster

      Hi,

      We optimized the frame rate and Angle of 219. the lens shading table we create before is not suitable for it now. When I am free, I will recreate new lens shading table again.

       

    • #22454
      sahil
      Participant

      Hi Bin,

      Does that mean I can now test the camera until the lens shading table is created?

    • #22494
      sahil
      Participant

      Hi Bin, good morning, when would the the lens shading table for IMX219 be available? My understanding is that without it cant test all the demo casses.

       

       

    • #22523
      bin
      Keymaster

      Hi,

      I am too busy to create the lens shading table recently. Tomorrow I will spare some time to help you fix it.

      It does not affect your  to test various modes.

    • #22528
      sahil
      Participant

      Hi Bin, Thank you very much for making that table.

      So do you think i should be able to run the stereo depth demos without updated lens shading table?

      I have tested 1_test.py again just now and again the image is upside down and green, I can only run mode 7 to 10 anything higher I get “Null Pointer Access”.  In addition i am not able to run 2_chess_cycle.py and get the error below still.

      [email protected]:~/MIPI_Camera/RPI/stereo_depth_demo $ python 2_chess_cycle.py
      Open camera…
      Found sensor imx219 at address 10
      Can’t open the file
      mmal: Failed to fix lens shading, use the default mode!
      Current mode: 2,resolution: 1600×1200
      Used camera resolution: 1600 x 1200
      Scaled image resolution: 1280 x 480
      Starting photo sequence
      Traceback (most recent call last):
      File “2_chess_cycle.py”, line 88, in <module>
      frame = get_frame(camera)
      File “2_chess_cycle.py”, line 44, in get_frame
      image = frame.as_array.reshape(int(height * 1.5), width)
      File “/home/pi/MIPI_Camera/RPI/stereo_depth_demo/arducam_mipicamera.py”, line 266, in as_array
      return np.ctypeslib.as_array(self.buffer_ptr[0].data, shape=(self.length,))
      ValueError: NULL pointer access

      and then

      [email protected]:~/MIPI_Camera/RPI/stereo_depth_demo $ python 3_pairs_cut.py
      No file named ./scenes/scene_1280x480_1.png
      No file named ./scenes/scene_1280x480_2.png
      No file named ./scenes/scene_1280x480_3.png
      No file named ./scenes/scene_1280x480_4.png
      No file named ./scenes/scene_1280x480_5.png
      No file named ./scenes/scene_1280x480_6.png
      No file named ./scenes/scene_1280x480_7.png
      No file named ./scenes/scene_1280x480_8.png
      No file named ./scenes/scene_1280x480_9.png
      No file named ./scenes/scene_1280x480_10.png
      No file named ./scenes/scene_1280x480_11.png
      No file named ./scenes/scene_1280x480_12.png
      No file named ./scenes/scene_1280x480_13.png
      No file named ./scenes/scene_1280x480_14.png
      No file named ./scenes/scene_1280x480_15.png
      No file named ./scenes/scene_1280x480_16.png
      No file named ./scenes/scene_1280x480_17.png
      No file named ./scenes/scene_1280x480_18.png
      No file named ./scenes/scene_1280x480_19.png
      No file named ./scenes/scene_1280x480_20.png
      No file named ./scenes/scene_1280x480_21.png
      No file named ./scenes/scene_1280x480_22.png
      No file named ./scenes/scene_1280x480_23.png
      No file named ./scenes/scene_1280x480_24.png
      No file named ./scenes/scene_1280x480_25.png
      No file named ./scenes/scene_1280x480_26.png
      No file named ./scenes/scene_1280x480_27.png
      No file named ./scenes/scene_1280x480_28.png
      No file named ./scenes/scene_1280x480_29.png
      No file named ./scenes/scene_1280x480_30.png
      End cycle

       

    • #22531
      toppenhe
      Participant

      Hello, I am having the same issues as sahill with 2_chess_cycle.py.  I get the following:

      python 2_chess_cycle.py
      Open camera…
      Found sensor imx219 at address 10
      Can’t open the file
      mmal: Failed to fix lens shading, use the default mode!
      Current mode: 2,resolution: 1600×1200
      Used camera resolution: 1600 x 1200
      Scaled image resolution: 1280 x 480
      Starting photo sequence
      Traceback (most recent call last):
      File “2_chess_cycle.py”, line 88, in <module>
      frame = get_frame(camera)
      File “2_chess_cycle.py”, line 44, in get_frame
      image = frame.as_array.reshape(int(height * 1.5), width)
      File “/home/pi/MIPI_Camera/RPI/stereo_depth_demo/arducam_mipicamera.py”, line 266, in as_array
      return np.ctypeslib.as_array(self.buffer_ptr[1].data, shape=(self.length,))
      ValueError: NULL pointer access

       

    • #22539
      bin
      Keymaster

      Hi,

      Yes,  the lens shading  just improving the dark Angle of the lens.  You can try it without lens shading.

      ValueError: NULL pointer access  means it does not receive image from the sensor. There is nothing to do with the lens shading. Do you use our new libarducam_mipicamera.so ?

      Recently, I have updated our libarducam_mipicamera.so. You can try to download our new lib to try. Notice to run make install to install the new lib.

      What’s more, you can use arducamstill demo to test each mode firstly to ensure each mode can work normally.

      https://github.com/ArduCAM/MIPI_Camera/blob/master/RPI/arducamstill.c

      just run ./arducamstill -t 0 -m [mode]

      Let me know if you need more help.

       

    • #22556
      toppenhe
      Participant

      Thanks, Bin.  I am still getting a green screen when I run python 1_test.py.  I played with ./arducamstill -t 0 and was able to tune the color brightness and focus.  However, when I run 1_test.py, it goes back to green.

      I saw in another post that you changed the register values or the set mode?  Which exact file would you make those changes to and if the file is a c file, do you need to compile after?  How would you compile that file on the command line?

      Also, when i run 4_calibration.py, it ignores all 30 of my images.  I am assuming because too dark and green?

      Best,

      Tom

    • #22562
      sahil
      Participant

      Hi Bin,

      I have just downloaded and compiled the github repository as per your instructions and I still get the results below. Is the hardware faulty?

       

      [email protected]:~/MIPI_Camera/RPI $ ./arducamstill -t 0 -m 1 -awb 1 -ae 1 <—This failed to load an image and just hung!
      Open camera…
      Found sensor imx219 at address 10
      mode: 0, width: 800, height: 600, pixelformat: pRAA, desc: (null)
      mode: 1, width: 1280, height: 720, pixelformat: pRAA, desc: (null)
      mode: 2, width: 1600, height: 1200, pixelformat: pRAA, desc: (null)
      mode: 3, width: 1920, height: 1080, pixelformat: pBAA, desc: (null)
      mode: 4, width: 2592, height: 1944, pixelformat: pRAA, desc: (null)
      mode: 5, width: 3264, height: 1848, pixelformat: pRAA, desc: (null)
      mode: 6, width: 3264, height: 2464, pixelformat: pRAA, desc: (null)
      mode: 7, width: 1600, height: 600, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 8, width: 2560, height: 720, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 9, width: 3840, height: 1080, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 10, width: 5184, height: 1944, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 11, width: 6528, height: 1848, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 12, width: 6528, height: 2464, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      index: 0, CID: 0x00980911, desc: V4L2_CID_EXPOSURE, min: 0, max: 65535, default: 1606, current: 1000
      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.
      Start preview…
      Current mode: 1, width: 1280, height: 720, pixelformat: pRAA, desc: (null)

      [email protected]:~/MIPI_Camera/RPI $ ./arducamstill
      Open camera…
      Found sensor imx219 at address 10
      mode: 0, width: 800, height: 600, pixelformat: pRAA, desc: (null)
      mode: 1, width: 1280, height: 720, pixelformat: pRAA, desc: (null)
      mode: 2, width: 1600, height: 1200, pixelformat: pRAA, desc: (null)
      mode: 3, width: 1920, height: 1080, pixelformat: pBAA, desc: (null)
      mode: 4, width: 2592, height: 1944, pixelformat: pRAA, desc: (null)
      mode: 5, width: 3264, height: 1848, pixelformat: pRAA, desc: (null)
      mode: 6, width: 3264, height: 2464, pixelformat: pRAA, desc: (null)
      mode: 7, width: 1600, height: 600, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 8, width: 2560, height: 720, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 9, width: 3840, height: 1080, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 10, width: 5184, height: 1944, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 11, width: 6528, height: 1848, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 12, width: 6528, height: 2464, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      index: 0, CID: 0x00980911, desc: V4L2_CID_EXPOSURE, min: 0, max: 65535, default: 1606, current: 876
      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.
      Start preview…
      Current mode: 0, width: 800, height: 600, pixelformat: pRAA, desc: (null)
      [Framerate]: 21 pfs, [Exposure]: 2493, [Focus]: 0000,[Rgain]: 0100, [Bgain]: 0100

      —————————————————–

      [email protected]:~/MIPI_Camera/RPI/stereo_depth_demo $ python 1_test.py
      Open camera…
      Found sensor imx219 at address 10
      mode: 7, width: 1600, height: 600
      mode: 8, width: 2560, height: 720
      mode: 9, width: 3840, height: 1080
      mode: 10, width: 5184, height: 1944
      mode: 11, width: 6528, height: 1848
      mode: 12, width: 6528, height: 2464
      Please enter the mode number:12
      mmal: Failed to fix lens shading, use the default mode!
      Current mode: 12,resolution: 6528×2464
      ^CTraceback (most recent call last):
      File “1_test.py”, line 83, in <module>
      frame = get_frame(camera)
      File “1_test.py”, line 48, in get_frame
      image = cv2.cvtColor(image, cv2.COLOR_YUV2BGR_I420)
      KeyboardInterrupt
      [email protected]:~/MIPI_Camera/RPI/stereo_depth_demo $ python 2_chess_cycle.py
      Open camera…
      Found sensor imx219 at address 10
      Can’t open the file
      mmal: Failed to fix lens shading, use the default mode!
      Current mode: 2,resolution: 1600×1200
      Used camera resolution: 1600 x 1200
      Scaled image resolution: 1280 x 480
      Starting photo sequence
      Traceback (most recent call last):
      File “2_chess_cycle.py”, line 88, in <module>
      frame = get_frame(camera)
      File “2_chess_cycle.py”, line 44, in get_frame
      image = frame.as_array.reshape(int(height * 1.5), width)
      File “/home/pi/MIPI_Camera/RPI/stereo_depth_demo/arducam_mipicamera.py”, line 266, in as_array
      return np.ctypeslib.as_array(self.buffer_ptr[0].data, shape=(self.length,))
      ValueError: NULL pointer access

    • #22565
      wong
      Moderator

      Hi @sahil ,

      You made a mistake in the first step, you should press ‘q’ to exit instead of using Ctrl + c.

      One more thing: please use python3 to run the sample code.

    • #22566
      bin
      Keymaster

      @toppenhe

      Hi,

      The arducamstill supports for online debugging, will revert to the default value after exit.

      So when you exit the arducamstill and run the python demo, it will user the default value.

      I advise you using arducamstill to fine tune the image, then remember the value of each parameters. Each parameter’s value will display as the below image shows.

      Then you can use the set_control API to set the suitable values referring the images I attached for you:

      About the image is green, have you enable the awb function?

      Referring code:

      print(“Enable Auto White Balance…”)
      camera.software_auto_white_balance(enable = True)

       

      Let me know if you need more help.

       

    • #22567
      sahil
      Participant

      Hi Wong,

      Good morning and thank you, ok now 2_chess_cycle.py is working with python3. I did try that before I posted a comment on this forum but could not get it to work. so I kept with the instructions in the readme of using python and not python3.

      I am having strange behaviour, now 2_chess_cycle.py is working (with python3) but the command ./arducamstill in ~/MIPI_Camera/RPI isnt opening the camera. This has been like that for 2-3 minutes with no image from the camera.

      [email protected]:~/MIPI_Camera/RPI $ ./arducamstill -t 5000 -m 1 -e jpg -o test.jpg
      Open camera…
      Found sensor imx219 at address 10
      mode: 0, width: 800, height: 600, pixelformat: pRAA, desc: (null)
      mode: 1, width: 1280, height: 720, pixelformat: pRAA, desc: (null)
      mode: 2, width: 1600, height: 1200, pixelformat: pRAA, desc: (null)
      mode: 3, width: 1920, height: 1080, pixelformat: pBAA, desc: (null)
      mode: 4, width: 2592, height: 1944, pixelformat: pRAA, desc: (null)
      mode: 5, width: 3264, height: 1848, pixelformat: pRAA, desc: (null)
      mode: 6, width: 3264, height: 2464, pixelformat: pRAA, desc: (null)
      mode: 7, width: 1600, height: 600, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 8, width: 2560, height: 720, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 9, width: 3840, height: 1080, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 10, width: 5184, height: 1944, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 11, width: 6528, height: 1848, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      mode: 12, width: 6528, height: 2464, pixelformat: pRAA, desc: Used for Arducam synchronized stereo camera HAT
      index: 0, CID: 0x00980911, desc: V4L2_CID_EXPOSURE, min: 0, max: 65535, default: 1606, current: 1000
      len = 8
      name= test.jpg
      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.
      Start preview…
      Current mode: 1, width: 1280, height: 720, pixelformat: pRAA, desc: (null)
      mmal: Enable JPEG encoder.

    • #22568
      sahil
      Participant

      Hi Again, also why doesn’t the focus function work?

    • #22555
      toppenhe
      Participant

      Thanks, Bin.  I got most of the above to work.  I am still dealing with a green screen when i run all the demo python scripts which seems to be affecting the calibration?  I can tune the color and brightness of the screen using ./arducamstill -t 0 but then when i run python 1_test.py it shows up as green.  I found your post here which seems like a potential solution:

      https://www.arducam.com/forums/search/green/

      However which exact file (name and file extension) do I need to update in order to do that.  If it’s a .c file, how would you compile the c code using the command line?

      when  i run the 4_calibration.py file, it ignores all of my 30 images.

      I look forward to hearing from you.

      Best,

      Tom

    • #22578
      bin
      Keymaster

      Hi,

      After you have set camera.software_auto_white_balance(enable = True)

      Please add some delay to wait the awb stable.

      Can you attach me some image you get?

       

    • #22591
      sahil
      Participant

      Hi Bin,

      I have added auto-exposure and auto white balance along with a time delay of 0.01 seconds within the function “def get_frame (camera):”, within the stereo_depth_demo samples provided, as the first think the program does. So it works, it is a little bit red but that’s a smaller issue than a completely green image.

      Am I correct that I would need to add the auto white balance to all of the source files that are capturing an image?

      How do I correct for the image coming upside down on screen?

      I am still unable to run the simple examples in ~/MIPI_Camera/RPI such as “preview-dualcam” and “capture-dualcam” , I get the text “Open camera… , init camera status = 4100, open camera, init camera status = 4100” and then it exits the program.

      • This reply was modified 1 month, 2 weeks ago by sahil.
    • #22595
      toppenhe
      Participant

      Hi Bin,

      I got the awb to work with the python code!  thanks!  I am not trying to run 4_calibration.py but get this:

      python3 4_calibration.py
      Traceback (most recent call last):
      File “4_calibration.py”, line 26, in <module>
      import cv2
      File “/usr/local/lib/python3.7/dist-packages/cv2/__init__.py”, line 3, in <module>
      from .cv2 import *
      ImportError: libjasper.so.1: cannot open shared object file: No such file or directory

      I am attaching my paired images as well just in case.

      Thanks again!

      Tom

    • #22596
      toppenhe
      Participant

      Hi Bin,

      I got the awb to work within pythode code!  Thanks!

      Now when I try to run the 4_calibration.py, I get this:

      python3 4_calibration.py
      Traceback (most recent call last):
      File “4_calibration.py”, line 26, in <module>
      import cv2
      File “/usr/local/lib/python3.7/dist-packages/cv2/__init__.py”, line 3, in <module>
      from .cv2 import *
      ImportError: libjasper.so.1: cannot open shared object file: No such file or directory

      Here is one of my checkerboard images:

    • #22612
      bin
      Keymaster

      @sahil

      Hi,

      Great to hear that. You just need to add  once auto white balance enable after you have open the camera. Expect you close the camera, you don’t need to add awb_white _balance in each get image.

      “preview-dualcam” and “capture-dualcam”  those demos are used on CM3 platform instead of Pi mode 3b.

      About  the image coming upside down on screen, Can you attach me a image? It need to update our lib to rotate the direction, which is not easy. It may influence the bayer’s order.

       

      Let me know if you need more help.

       

       

    • #22613
      bin
      Keymaster
    • #22627
      sahil
      Participant

      Hi Bin,

       

      I think i understand what you mean by only having AWB set in the function that opens the camera and not the function that takes the snapshot.

      Please see output from the camera, still a bit red from the AWB but also very much upside down.  I have the camera module UC506 so that the ribbon cables are going down and into the UC625 module (the letters B and A on the camera module are reading the correctly (i.e. not upside down).upside down image

    • #22626
      sahil
      Participant

      Hi Bin,

      Ok so from what I read in your response I need to find the function that opens the camera, not the function that takes the photo “def get_frame (camera):”. ok I will do that.

      The image from the cameras are upside down. So for example can of cola is upside down in the image.

      physically the dual camera modul UC506 is positioned so that the cables are pointing down to the ground and the letters identifying the two cameras are correct side up, i.e. they read like [B] for the left camera and [A] for the right camera where right and left are as you look at the module UC506. upside down camera output

    • #22628
      sahil
      Participant

      upside down

      @Bin, Hi Bin, see upside down image.

    • #22690
      bin
      Keymaster

      Hello, OK, I have got your message. I will try to help you rotate the image  next week.

      Waitting  me good news.

    • #22712
      bin
      Keymaster

      Hello,

      I have added imx219 hflip and vflip control. Please download our new lib

      Then you can control the both hflip and vflip to rotate the direction.

      Let me know if you need more help.

       

    • #22722
      sahil
      Participant

      Hi Bin,

      Fantastic, thank you. What programs/libraries are the hflip and vflip commands in?

      Thank you again.

    • #22723
      sahil
      Participant

      Hi again Bin, I just deleted and re-downloaded the github repository and compiled everything and the images are still upside down.

    • #22765
      bin
      Keymaster

      Hello,

      Just like setting the auto awb function, you just need to add arducam_set_control(camera_instance, V4L2_CID_HFLIP, 1)

      and

      arducam_set_control(camera_instance, V4L2_CID_VFLIP, 1)

      after you have init the camera.

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