Closed jdog816 closed 1 year ago
The images are gray scale, because you use the v4l2src. It does not do any debayerring, but the DFM 22BUC03-ML provides bayer raw data only. Better to go with tcambin instead of v4l2src. I do not remember, why we use v4l2src. tcambin provides debayered color data.
tcambin name=camera ! video/x-raw,format=BGRx,width=640,height=480,framerate=15/1 ! videocrop top=0 left=80 right=80 bottom=0 ! videoconvert ! jpegenc name=jpegencoder quality=" INITIALJPEGQUALITY ! appsink name=jpegframe"
Should do the job.
I changed the pipeline to what you wrote but it still produces gray images.
Please try with tcam-capture and check, whether it shows a colored image.
When I run tcam-capture I get a "device not opened" error:
2022-11-14T17:10:17 - unknown:0: warning QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
2022-11-14T17:10:19 - unknown:0: info New device: 46410017-v4l2
2022-11-14T17:10:22 - unknown:0: info device selected: DFM 22BUC03-MLA-46410017-v4l2
2022-11-14T17:10:22 - unknown:0: debug Setting 'conversion-element' property to 'tcamconvert'
2022-11-14T17:10:42 - unknown:0: info settings caps to : video/x-raw, format=(string)GRAY8, width=(int)640, height=(int)480, framerate=(fraction)15/1, binning=(string)1x1, skipping=(string)1x1
2022-11-14T17:10:43 - unknown:0: info Error while retrieving property names: Error: Device not opened
** (tcam-capture:19215): CRITICAL **: 17:10:43.446: tcam_property_enumeration_get_value: assertion 'self != NULL' failed
I went back through previous threads and found your solution to the devices not opened error. Had to edit the file /root/.config/the_imaging_source/tcam-capture.conf and add the line video-sink-element=ximagesink
So now when I run tcam-capture it displays the image, but it's still gray.
Hello Please open your DFK 22 in tcam-capture as follows: Make sure "Open Format Dialog" is marked. (You can change the format later) Choose the gbrg format. The gbrg format is a Bayer raw format, which which automatically converted into RGB or BGRx by tiscamera's tcambin for a colored image. You should get a result like this: If the image stays gray, please click on "Format" and chose "GRAY8": You may need to restart tcam-capture and choose GRAY8 from beginning. tcam-capture should show an image like this: You see a faint checker board pattern, generated by the color sensor of the camera. If you see a nice gray image without this checkerboard pattern, then your camera has a monochrome sensor.
Which firmware file did you write in your camera? Its serial number 46410017 shows me, that is is an older model. The firmware in your camera should be version 3017 from dfk22uc03_3017.euvc file. Please refer to https://github.com/TheImagingSource/tcam-firmware-update The camera I use is one year older than yours.
Hi Stefan
My camera was running a much older version than 3017, so I updated the firmware per the link and it got me a little further. When I opened tcam-capture before, it only gave me the GRAY8 option. Now it lists the gbrg option.
However, when I select gbrg it automatically goes back to GRAY8 in the format dropdown menu, after it starts taking pictures. I see the checkerboard pattern when tcam-capture starts out in GRAY8, and I don't see it when switching to gbrg. But the tcam-capture screen is still gray after switching to gbrg.
When running my program, the first few images appear somewhat colorized but then the rest are all gray.
I know this camera has a color sensor because it's taken color pictures before, but that was with an older version of tiscamera software that's obsolete.
Hi
The camera should behave exactly, as it does on the photos. I made the same steps you should have done. If the gbrg format is set, please check the "Saturation" property under "Properties". It should not be 0. Do you have the tiscamera-dutils installed?
Stefan
I don't see a Saturation property there.
I followed your steps, but as I mentioned, when I select grbg it doesn't stay selected, it jumps back to GRAY8 by itself.
One thing I noticed is in the Info tab in tcam-capture, it says all the listed packages are not installed. But I cloned tiscamera from the github page and followed the instructions to install: https://github.com/TheImagingSource/tiscamera
I'll see if I can attach screenshots.
I can't find "tiscamera-dutils" anywhere, but I found this "tcamdutils" package: https://www.theimagingsource.com/support/downloads-for-linux/install/tiscameradutilsarmhfpi/ Since my OS is 32 bit, I tried to install it but it says it depends on "tiscamera-tcamproperty" which it's unable to locate. According to this page: https://www.theimagingsource.com/documentation/tiscamera/packaging.html the "tiscamera" package is a drop-in replacement for "tiscamera-tcamproperty" but I as I said, I already cloned/installed tiscamera, so I'm not sure what's going on.
Hello
I followed your steps, but as I mentioned, when I select grbg it doesn't stay selected, it jumps back to GRAY8 by itself.
Weird. The very same works perfectly on my computer. OK, we checked, you have a color camera.
Please run in a terminal window
export GST_DEBUG=tcam*:5
export GST_DEBUG_NO_COLOR=1
expor tGST_DEBUG_FILE=/tmp/tcam-gst.log
gst-launch-1.0 tcambin ! video/x-raw,format=BGRx,width=640,height=480,framerate=15/1 ! videoconvert ! ximagesink
After a video is shown, end gst-launch-1.0 and attach the file "/tmp/tcam-gst.log" here.
See also https://www.theimagingsource.com/documentation/tiscamera/environment.html?highlight=debug#gst-debug
It won't let me attach anything. Let me paste the log file contents
0:00:00.161318933 4060 0x602160 INFO tcambin gsttcambin.cpp:364:select_transform_element: Auto selected transform element: tcamconvert
0:00:00.167714857 4060 0x602160 INFO tcam-libtcam libtcam_base.cpp:69:print_setup_to_logger:
The following library versions are used:
Tcam: 1.0.0_master/d9ada738_rev_4011
Aravis: 0.8_version_d9ada738
Modules: gst_aravis_arvu3v_v4l2_libusb_tools_doc
0:00:00.188717918 4060 0x6026c0 INFO tcam-libtcam aravis_utils.cpp:187:fetch_gige_daemon_device_list: Failed to create shmkey. Not using gige-daemon to enumerate devices.
0:00:02.228425143 4060 0x602160 DEBUG tcammainsrc mainsrc_device_state.cpp:207:open_camera:
I have to ask my expert. The pipeline is correct, the caps are set correctly, but you still see a gray scale image.
In the meantime, you may install the tcam-dutils from https://www.theimagingsource.com/support/downloads-for-linux/ for your platform. It has a different debayering. (And saturation). Try the pipeline with gst-launch-1.0 after installation and see, what happens.
Stefan
I tried installing tcam-dutils for 32 bit OS from here: https://www.theimagingsource.com/support/downloads-for-linux/install/tiscameradutilsarmhfpi/ but it won't install: Error: Dependency is not satisfiable: tiscamera-tcamproperty (>= 1.0)
I can't find tiscamera-tcamproperty anywhere, but this link: https://www.theimagingsource.com/documentation/tiscamera/packaging.html says the tiscamera package (which I have installed) is a drop-in replacement for it, so I'm not sure why it's not working.
Have to check.
Hello
One thing I noticed is in the Info tab in tcam-capture, it says all the listed packages are not installed. But I cloned tiscamera from the github page and followed the instructions to install: https://github.com/TheImagingSource/tiscamera
That is the reason, why tcam-dutils do not find the tcamprop package. Well, lets ignore that.
Please change into the your firmware updater directory and let us see the output of
cam-firmware-update -id 46410017
Also please show the output of:
tcam-ctrl --all-info
At least, please make ls /dev/v4l/by-id/
and show he output of
v4l2-ctl --list-formats-ext -d /dev/v4l/by-id/usb-The_Imaging_Source_Europe_GmbH_DFK22BUC03......-index0
Replace "......" with the data shown from the ls command.
We checked on a second computer and also got a nicely colored image. Thus, we are puzzled.
Stefan
output of ./tcam-firmware-update -id 46410017
Device manufacturer: The Imaging Source Europe GmbH Product name: DFM 22BUC03-MLA Serial number: 46410017 VendorID:ProductID: 199e:8302 Firmware version: 3017 UVC mode is: on Camera EEPROM size: 16384
output of tcam-ctrl --all-info
======= lsb_release -a
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.3 LTS Release: 18.04 Codename: bionic
======= uname -a
Linux odroid 4.14.141-169 #1 SMP PREEMPT Sat Aug 31 23:19:59 -03 2019 armv7l armv7l armv7l GNU/Linux
======= lscpu
Architecture: armv7l Byte Order: Little Endian CPU(s): 8 On-line CPU(s) list: 0-7 Thread(s) per core: 1 Core(s) per socket: 4 Socket(s): 2 Vendor ID: ARM Model: 3 Model name: Cortex-A7 Stepping: r0p3 CPU max MHz: 2000.0000 CPU min MHz: 200.0000 BogoMIPS: 90.00 Flags: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae
======= lsusb
Bus 006 Device 002: ID 0bda:8153 Realtek Semiconductor Corp. Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 002: ID 05e3:0616 Genesys Logic, Inc. hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 004: ID 046d:c018 Logitech, Inc. Optical Wheel Mouse Bus 003 Device 003: ID 0461:3f41 Primax Electronics, Ltd Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 005: ID 199e:8302 The Imaging Source Europe GmbH Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
======= lsusb -t
/: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M | Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M /: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M /: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M | Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 5000M /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M | Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M | Port 1: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M | Port 1: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M | Port 2: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=exynos-ehci/3p, 480M | Port 1: Dev 5, If 0, Class=Video, Driver=uvcvideo, 480M | Port 1: Dev 5, If 1, Class=Video, Driver=uvcvideo, 480M
tiscamera is not installed. tiscamera-tcamproperty is not installed. tcamdutils is not installed. tcampimipisrc is not installed. tcamtegrasrc is not installed. tcamdutils-cuda is not installed. theimagingsource-drivers is not installed. ic_barcode is not installed.
output of ls /dev/v4l/by-id/
usb-The_Imaging_Source_Europe_GmbH_DFM_22BUC03-MLA_46410017-video-index0
output of v4l2-ctl --list-formats-ext -d /dev/v4l/by-id/usb-The_Imaging_Source_Europe_GmbH_DFM_22BUC03-MLA_46410017-video-index0
ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'GREY' Name : 8-bit Greyscale Size: Discrete 744x480 Interval: Discrete 0.013s (76.046 fps) Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.067s (15.000 fps) Interval: Discrete 0.133s (7.500 fps) Interval: Discrete 0.200s (5.000 fps) Size: Discrete 640x480 Interval: Discrete 0.011s (87.000 fps) Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.067s (15.000 fps) Interval: Discrete 0.133s (7.500 fps) Interval: Discrete 0.200s (5.000 fps) Size: Discrete 320x240 Interval: Discrete 0.006s (161.290 fps) Interval: Discrete 0.008s (120.000 fps) Interval: Discrete 0.013s (80.000 fps) Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.067s (15.000 fps)
Index : 1
Type : Video Capture
Pixel Format: 'GBRG'
Name : 8-bit Bayer GBGB/RGRG
Size: Discrete 744x480
Interval: Discrete 0.013s (76.046 fps)
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.133s (7.500 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.011s (87.000 fps)
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.133s (7.500 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.006s (161.290 fps)
Interval: Discrete 0.008s (120.000 fps)
Interval: Discrete 0.013s (80.000 fps)
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.067s (15.000 fps)
I mentioned that I cloned and installed tiscamera from your github page, and you said that is the reason why tcam-dutils doesn't find the tcamprop package. I don't understand. Is there a different way I should install tiscamera on my device?
I will answer to your last question right now: Building and sudo make install do not make any entries in Linux packet lists. Therefore, the installation of tcam-dutils can not find the tiscamera package and wont install. Tiscamera packets can be found at https://www.theimagingsource.com/support/downloads-for-linux/
However, that is no reason, why the GBRG is not colored on your computer. I must discuss with my Linux expert tomorrow. I am totally lost, why this does not work correctly on your odroid .
Can you send a screen shot?
Do you have another Linux for testing, e.g on a PI4 or desktop computer?
Stefan
Ah, ok. I tried installing the 32 bit packet from here: https://www.theimagingsource.com/support/downloads-for-linux/install/tiscameraarm6432/ but I run into dependency issues that I can't resolve (believe me, I've tried). I had a feeling that I might need to change platforms. Will see if I can get a raspberry pi to try installing on.
I'll have to email you screenshots.
I had unplugged the camera and plugged it back in, and now it throws this error when running tcam-capture:
unknown:0: info New device: 46410017-v4l2 tcam-capture: relocation error: tcam-capture: symbol _ZN11QMetaObject16invokeMethodImplEP7QObjectPN9QtPrivate15QSlotObjectBaseEN2Qt14ConnectionTypeEPv version Qt_5 not defined in file libQt5Core.so.5 with link time reference
I tried rebooting but no luck. I was able to get a screenshot of the gst-launch-1.0 tcambin pipeline so I'll send you that.
Please disregard my last comment - I re-cloned and re-installed tiscamera from github and now I can use tcam-capture again. I tested it out on another camera (same model) but the images are still gray. It sounds like it's because I'm using the github clone and not the downloadable package, and thus is not on the linux package list, like you said. So I think I'll need to switch to a different platform. But I'm curious what your linux expert has to say.
I switched from the XU4 to the C4 odroid running ubuntu 22, and was able to install the tiscamera and tcamdutils arm64 packages from the website. But when I try to run tcam-capture, it won't launch and I get this error:
2022-11-17T20:56:05 - unknown:0: warning could not connect to display
2022-11-17T20:56:05 - unknown:0: info Could not load the Qt platform plugin "xcb" in "" even though it was found.
2022-11-17T20:56:05 - unknown:0: fatal This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Aborted (core dumped)
My code runs on this machine and takes pictures, but they are gray here too. The gst-launch-1.0 pipeline isn't working and there isn't a /root/.config
I plan to try installing tiscamera on a pi 2b when I get a chance, and see if that works.
I am a little bit lost. So lets start with:
gst-launch-1.0 v4l2src ! bayer2rgb ! videoconvert ! ximagesink
That should provide a green, but colored image. You can detect other colors in the image. If that works use
gst-launch-1.0 tcamsrc ! bayer2rgb ! videoconvert ! ximagesink
That gives the same result. If that works, then do
gst-launch-1.0 tcambin ! bayer2rgb ! videoconvert ! ximagesink
That should give a white balanced image with correct colors.
Got it working! I got a second camera (same model) and it didn't work at first, but then I pushed the same firmware update to it, and now it works with the pipelines you just posted, as well as with the pipeline I originally posted at the top of this thread. I guess the other camera went bad somehow. So it was the firmware update that did the trick, along with porting to the latest software. I was able to get it to work on the Odroid XU4 in Ubuntu 18.
Thank you for all your help with this, Stefan!
My program is saving images the way I want to, except they are gray. This is the pipeline:
v4l2src name=camera ! video/x-raw,width=640,height=480,framerate=15/1 ! videocrop top=0 left=80 right=80 bottom=0 ! videoconvert ! jpegenc name=jpegencoder quality=" INITIALJPEGQUALITY ! appsink name=jpegframe
Camera is DFM 22BUC03-ML