VisualHMI Camera Controls: CVBS/DVP/UVC Camera Access, Controlled Playback, and Color Filtering

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

Camera controls allow the HMI to directly display camera footage: The M series and DH series support two-channel AV input, and the DH series also supports USB cameras. Note:Physical screen testing is required.

1. Camera parameter requirements

ItemCVBS (M series)DVP (DH series)UVC (DH series)
Maximum resolution≤1280×720≤1280×720≤1280×720
Signal formatPAL / NTSCCVBS_NTSC/PAL, HDA720P_25/30FPS, HDA1080P_25/30FPS, TVI720P_30FPS, TVI1080P_30FPSYUY2 / MJPEG

VisualHMI Camera Controls: CVBS/DVP/UVC Camera Access, Controlled Playback, and Color Filtering插图

2. Attribute Introduction

2.1 Function Settings

AttributesDescription
Playback ModeAutomatic (display upon connection, turn off upon disconnection) / Controlled (controlled by control address)
Control Address (Controlled)Addr+0: 0-Stop, 1-Play, 2-Pause; Addr+1: 0-Channel 1, 1-Channel 2
Rotation0°/90°/180°/270° (only for DH series)
Flip horizontally/verticallyMirror flip (only for DH series)
Stable signalCheck and display after signal stabilization
Camera typeCVBS / DVP / UVC. M series only supports CVBS; for DH series with AV interface, select DVP, and for USB, select UVC

VisualHMI Camera Controls: CVBS/DVP/UVC Camera Access, Controlled Playback, and Color Filtering插图1

2.2 Filter color (exclusive for M series)

AV image of M seriesalways displayed on top, overlay controls will be covered. When you need the controls to display on top of the image, use the underlying API:

function on_init()
  -- 过滤 0x00BFBFBF~0x00C8C8C8 范围的灰白色(24位RGB)
  -- Match 6位比较规则: 101010(0x2A), 10-R/10-G/10-B
  set_color_key(0x00BFBFBF, 0x00C8C8C8, 0x0000002A)
end

It must be placed in on_init(). DH series camera controls support layer hierarchy, so you can simply place the controls directly above each other without needing a filter color.

VisualHMI Camera Controls: CVBS/DVP/UVC Camera Access, Controlled Playback, and Color Filtering插图2

M series overlay controls must use set_color_key filter color to "hollow out" the area close to a certain color in the image to reveal the underlying controls. The color range is tricky: use a pure color background (such as gray and white) for the camera area to filter out this color. DH series does not have this issue.

3. Application Cases

Camera Controls: Playback mode is controlled, control addressLW1000, rotate 0°, check the stable signal, type CVBS. Equipped with a setting button (write LW1000=1 to play) + 2 bit status indicator lights (LW1001 to switch channels 1/2) + image controls (permission control LW1000==1 to display selected effect).

VisualHMI Camera Controls: CVBS/DVP/UVC Camera Access, Controlled Playback, and Color Filtering插图3

VisualHMI Camera Controls: CVBS/DVP/UVC Camera Access, Controlled Playback, and Color Filtering插图4

VisualHMI Camera Controls: CVBS/DVP/UVC Camera Access, Controlled Playback, and Color Filtering插图5

Operation: Compile and download to the physical screen, connect to an AV camera, click play, switch channels, and display the image in real time.

VisualHMI Camera Controls: CVBS/DVP/UVC Camera Access, Controlled Playback, and Color Filtering插图6

Remember the controlled mode address:Addr+0 controls playback (0 for stop/1 for play/2 for pause), Addr+1 switches channels (0/1). The write address of the control button must be consistent with the camera control address, otherwise there will be no response when pressed.

Compiled from the VisualHMI development document of Guangzhou Dacai Technology (hmi-doc.gz-dc.com) configuration control tutorial "Camera", copyright owned by Dacai Technology.

Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.