V4L2 / Beaglebone Black / Radiumboard HD Camera / Controls - beagleboneblack

I am trying to take snapshots with a Beaglebone Black paired with a RadiumBoards HD Camera Cape. I've noticed that using the built-in application (like cheese) will auto-adjust exposure. However, if I write custom C/C++ code on top of the v4l2 libraries to take a snapshot, the exposure is off (too bright or too dark, rarely correct). I would like to be able to either manually adjust exposure or allow the camera to auto-adjust. How can I do this in C/C++ source code?
Resources online indicate that I can change exposure settings through v4l2-ctl. This doesn't work for me. When I issue v4l2-ctl -l to list available controls, I get none.
The driver is reported as cssp_camera version 3.8.13.

I am not really sure if this is the issue, but you may try to specify the device that you want to control.
Assuming that is /dev/video0, you may do that by:
$ v4l2-ctl -d /dev/video0 -l
I am also assuming that you have granted permissions to the device.
Hope that I have helped.
Cheers

Related

How are Protected Media Path and similar systems implemented?

Windows provides DRM functionality to applications that require it.
Some of them, however, have more protection than others.
As an example, take Edge (both Legacy and Chromium) or IE that use Protected Media Path. They get to display >720p Netflix content. Other browsers don't use PMP and are capped at 720p.
The difference in the protections is noticeable when you try to capture the screen: while you have no problems on Firefox/Chrome, in Edge/IE a fixed black image takes the place of the media you are playing, but you still see media control buttons (play/pause/etc) that are normally overlaid (alpha blended) on the media content.
Example (not enough rep yet to post directly)
The question here is mainly conceptual, and in fact also could apply to systems that have identical behavior, like iOS that also replaces the picutre when you screenshot or capture the screen on Netflix.
How does it get to display two different images on two different outputs (Capture APIs with no DRM content and attached phisical monitor screen with DRM content)?
I'll make a guess and I'll start by excluding HW overlays. The reason is that play/pause buttons are still visible on the captured output. Since they are overlaid (alpha blended) on the media on the screen, and alpha blending on HW overlays is not possible in DirectX 9 or later nor it is using legacy DirectDraw, hardware overlays have to be discarded. And by the way, neither d3d9.dll or ddraw.dll are loaded by mfpmp.exe or iexplore.exe (version 11). Plus, I think hardware overlays are now considered a legacy feature, while Media Foundation (which Protected Media Path is a part of) is totally alive and maintained.
So my guess is that DWM, that is in charge for the screen composition, is actually doing two compositions. Either by forking the composition process at the point when it encounters a DRM area and feeds one output to the screen (with DRM protected content) and the other to the various screen capturing methods and APIs, or by entirely doing two different compositions in the first place.
Is my guess correct? And could you please provide evidence to support your answer?
My interest is understanding how composition software and DRM are implemented, primarily in Windows. But how many other ways could there be to do it in different OSes?
Thanks in advance.
According to this document, both the options are available.
The modern PlayReady DRM that Netflix uses for its playback in IE, Edge, and the UWP app uses the DWM method, which can be noticed by the video area showing only a black screen when DWM is forcibly killed. It seems that this is because the modern PlayReady is supported since Windows 8.1, which does not let users disable DWM easily.
I think both methods were used in Windows Vista-7, but I have no samples to test it. As HW overlays don't look that good with window previews, animations, and transparencies, they would have switched each method depending on the DWM status.
For iOS, it seems that a mechanism that is similar to the DWM method is done in the display server(SpringBoard?) level to present the protected content which is processed in the Secure Enclave Processor.

Set WebCamera focus with OpenCv in Raspberry Pi

I have a logitech C920 Web camera.
I was able to follow this https://stackoverflow.com/a/42819965 to get the autofocus turned off and manually set the desired focus while I ran the python code on My Windows 10 pc. Also, I could see the changes in focus when adjusting value.
But when I tried to connect the same camera to Raspberry Pi (3 B+ ) and run the same code, for whatever the value of focus I set, it just doesn't respond. Same blurry images always.
What could be the possible reason for this?
Depends on the driver and/or video backend used by cv::VideoCapture.
You can try setting the focus directly with v4l2-ctl:
https://www.christitus.com/logitech-c920-linux-driver/

Is it possible to use beaglebone (black) analog pins as GPIOs?

Analog pins of arduino boards can be used as GPIO but is it also possible for the beaglebone boards ? Especially the black model.
And if it is possible, how to do it ?
Please refer to e.g. the BBB SRM (System Reference Manual), specifically: 7.1.2 Connector P9 or "Table 13. Expansion Header P9 Pinout" in the PDF version.
tl;dr: no
Please also note that those pins only tolerate up to 1.8V. Applying any higher voltage will destroy the ADC and possibly affect the whole chip.

Mitov VideoLab camera controls

I am using Delphi and Mitov VideoLab 7.0.
I have a CMOS camera that is hooked to a microscope. When I take pictures I need to go to a white spot and correct the white balance. For that I need to use the cameras own control panel. This panel also comes with some other stuff like setting resolution.
Using Delphi XE3 and Videolab 7.
How can I show the camera controls in my Delphi app?
For that I need to use the cameras own control panel.
You don't explain if that control panel is camera's or Videlab's.
I will assume you refer that CP is generated by camera's software (driver).
So, here is the answer:
If you are lucky and the producer offers also an OCX you can import it in Delphi as then easily access the camera.
Check driver's folder. See if there are any OCX files there
Check producer's the web site
Ask the producer (and hope it will answer)
If there are no OCX files you might still be able to access the camera BUT won't be easy. You can use the camera's driver (DLL) files. But that involves some hacking.
Hi everybody I have solved my issue the following way:
Instead of using Mitov videoLab (btw its a great plug in) I used Vframes found here on StackOverflow:
Delphi Webcam Simple Program
I used this to show my camera controls
Cam.ShowProperty;
where Cam: TVideoImage
Moreover the Vframes lets me show the camera directly into TImage canvas so its very easy to capture and save to disk or database.
adotable1.FieldByName('pic').Assign(Image1.Picture.Bitmap);
Where pic is defined as image (im using MSSql Express).
To show the image back I use DBImage linked to the pic field..works like a charm.

How to disable automatic white balance from Webcam?

I got a webcam and I'm running some algorithm on the received images to find movements in it.
But, the automatic auto white balance is changing the excepted result of the pixels color variance.
That's why I'm trying to disable it.
Some one knows a way to get the web can image with out this automatic color balance or disable it ?
Tks
If you are on Linux, you can test disabling automatic white balance using the uvcdynctrl command line utility. This is not a permanent solution, since these settings are reset every time the webcam is disconnected from the computer. As of OpenCV 2.1, configuring white balance is not supported using cv::VideoCapture::set(). Assuming this is still the case in OpenCV 2.2, you will need to use another library to configure your webcam and capture frames.
If you on Linux, you can see an example of using direct Video4Linux (V4L) syscalls to do this in one of my Github projects.
In my case I found on driver two options that must be disabled, auto white exposure and auto white balance, I disable both of them and the image got as I needed.

Resources