LCD (4.3inch) Shield sample. While USER_BUTTON0 is pressed, it will save the image to the USB memory.When you use this program, we judge you have agreed to the following contents. https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

Dependencies:   GR-PEACH_video GraphicsFramework R_BSP USBHost mbed

License

When you use this program, we judge you have agreed to the following contents.

本プログラムを使用する際は、以下の内容に合意した事になります。

https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

Information

Japanese version is available in lower part of this page.

このページの後半に日本語版が用意されています.

What is this ?

This is a sample program that displays the image captured by the camera to the LCD by using the GR-PEACH AUDIO CAMERA Shield and GR-PEACH LCD Shield.
This program displays the NTSC input from NTSC1A on the screen of LCD shield.
When you touch on the screen of LCD Shield, the touch coordinates are displayed on the PC terminal software. You can touch the two points at the same time.
Inaddition, while you press USER_BUTTON0, th image is saved to the USB memory.

Composition

GR-PEACH, AUDIO CAMERA Shield, LCD Shield, Camera and USB memory.

Please refer to following link about Audio/Camera Shield.
https://developer.mbed.org/teams/Renesas/wiki/Audio_Camera-shield

MT9V111 is being used for a camera by this sample program. When using a camera besides MT9V111, please change the setting according to the used camera.

main.cpp (camera input config 1)

/**** User Selection *********/
#define VIDEO_INPUT_METHOD     (VIDEO_CMOS_CAMERA) /* Select  VIDEO_CVBS or VIDEO_CMOS_CAMERA                       */
#define VIDEO_INPUT_FORMAT     (VIDEO_YCBCR422)    /* Select  VIDEO_YCBCR422 or VIDEO_RGB888 or VIDEO_RGB565        */
#define USE_VIDEO_CH           (0)                 /* Select  0 or 1            If selecting VIDEO_CMOS_CAMERA, should be 0.)               */
#define VIDEO_PAL              (0)                 /* Select  0(NTSC) or 1(PAL) If selecting VIDEO_CVBS, this parameter is not referenced.) */

main.cpp (camera input config 2)

    /* MT9V111 camera input config */
    ext_in_config.inp_format     = DisplayBase::VIDEO_EXTIN_FORMAT_BT601; /* BT601 8bit YCbCr format */
    ext_in_config.inp_pxd_edge   = DisplayBase::EDGE_RISING;              /* Clock edge select for capturing data          */
    ext_in_config.inp_vs_edge    = DisplayBase::EDGE_RISING;              /* Clock edge select for capturing Vsync signals */
    ext_in_config.inp_hs_edge    = DisplayBase::EDGE_RISING;              /* Clock edge select for capturing Hsync signals */
    ext_in_config.inp_endian_on  = DisplayBase::OFF;                      /* External input bit endian change on/off       */
    ext_in_config.inp_swap_on    = DisplayBase::OFF;                      /* External input B/R signal swap on/off         */
    ext_in_config.inp_vs_inv     = DisplayBase::SIG_POL_NOT_INVERTED;     /* External input DV_VSYNC inversion control     */
    ext_in_config.inp_hs_inv     = DisplayBase::SIG_POL_INVERTED;         /* External input DV_HSYNC inversion control     */
    ext_in_config.inp_f525_625   = DisplayBase::EXTIN_LINE_525;           /* Number of lines for BT.656 external input */
    ext_in_config.inp_h_pos      = DisplayBase::EXTIN_H_POS_CRYCBY;       /* Y/Cb/Y/Cr data string start timing to Hsync reference */
    ext_in_config.cap_vs_pos     = 6;                                     /* Capture start position from Vsync */
    ext_in_config.cap_hs_pos     = 150;                                   /* Capture start position form Hsync */
    ext_in_config.cap_width      = 640;                                   /* Capture width  */
    ext_in_config.cap_height     = 468u;                                  /* Capture height Max 468[line]
                                                                             Due to CMOS(MT9V111) output signal timing and VDC5 specification */


When you save a camera image to a USB memory, the image is converted along the following conversion method.

Value of "VIDEO_INPUT_FORMAT" in main.cppConversion method
VIDEO_YCBCR422JPEG
VIDEO_RGB888bitmap
VIDEO_RGB565binary (RAW data)


If you use a USB, according to the USB port to use, make the following changes and the jumper short. (define 0:USB0、define 1:USB1)

USBHost\USBHost\TARGET_RENESAS\TARGET_RZ_A1H\usb_host_setting.h

#define USB_HOST_CH                           0
↓
#define USB_HOST_CH                           1


If you use the GR-PEACH's USB connector (USB0), please close GR-PEACH's JP3.
/media/uploads/RyoheiHagimoto/usb.jpg

If you use the GR-PEACH AUDIO CAMERA Shield's USB connector (USB1), please close Audio/Camera Shield's JP1.
/media/uploads/dkato/audiocamerashield_jp1.jpg


概要

GR-PEACH AUDIO CAMERA ShieldとGR-PEACH LCD Shieldを使って、カメラで取り込んだ画像をLCDへ表示するサンプルプログラムです。
このプログラムは、NTSC1AからのNTSC入力をLCDシールドの画面上に表示します。
画面をタッチすると、タッチ座標がPCターミナルソフト上に表示されます。2点まで同時にタッチできます。
また、GR-PEACHのUSER_BOTTON0を押している間、カメラで取り込んだ画像をUSBメモリへ保存することができます。

構成

GR-PEACH、AUDIO CAMERA Shield、LCD Shield、 カメラ、USBメモリ

GR-PEACH AUDIO CAMERA Shieldについては下記を参照ください。
https://developer.mbed.org/teams/Renesas/wiki/Audio_Camera-shield

サンプルプログラムではCameraにMT9V111を使用しています。MT9V111以外のCameraを使用する際は使用するCameraにあわせて設定を変更して下さい。

main.cpp (camera input config 1)

/**** User Selection *********/
#define VIDEO_INPUT_METHOD     (VIDEO_CMOS_CAMERA) /* Select  VIDEO_CVBS or VIDEO_CMOS_CAMERA                       */
#define VIDEO_INPUT_FORMAT     (VIDEO_YCBCR422)    /* Select  VIDEO_YCBCR422 or VIDEO_RGB888 or VIDEO_RGB565        */
#define USE_VIDEO_CH           (0)                 /* Select  0 or 1            If selecting VIDEO_CMOS_CAMERA, should be 0.)               */
#define VIDEO_PAL              (0)                 /* Select  0(NTSC) or 1(PAL) If selecting VIDEO_CVBS, this parameter is not referenced.) */

main.cpp (camera input config 2)

    /* MT9V111 camera input config */
    ext_in_config.inp_format     = DisplayBase::VIDEO_EXTIN_FORMAT_BT601; /* BT601 8bit YCbCr format */
    ext_in_config.inp_pxd_edge   = DisplayBase::EDGE_RISING;              /* Clock edge select for capturing data          */
    ext_in_config.inp_vs_edge    = DisplayBase::EDGE_RISING;              /* Clock edge select for capturing Vsync signals */
    ext_in_config.inp_hs_edge    = DisplayBase::EDGE_RISING;              /* Clock edge select for capturing Hsync signals */
    ext_in_config.inp_endian_on  = DisplayBase::OFF;                      /* External input bit endian change on/off       */
    ext_in_config.inp_swap_on    = DisplayBase::OFF;                      /* External input B/R signal swap on/off         */
    ext_in_config.inp_vs_inv     = DisplayBase::SIG_POL_NOT_INVERTED;     /* External input DV_VSYNC inversion control     */
    ext_in_config.inp_hs_inv     = DisplayBase::SIG_POL_INVERTED;         /* External input DV_HSYNC inversion control     */
    ext_in_config.inp_f525_625   = DisplayBase::EXTIN_LINE_525;           /* Number of lines for BT.656 external input */
    ext_in_config.inp_h_pos      = DisplayBase::EXTIN_H_POS_CRYCBY;       /* Y/Cb/Y/Cr data string start timing to Hsync reference */
    ext_in_config.cap_vs_pos     = 6;                                     /* Capture start position from Vsync */
    ext_in_config.cap_hs_pos     = 150;                                   /* Capture start position form Hsync */
    ext_in_config.cap_width      = 640;                                   /* Capture width  */
    ext_in_config.cap_height     = 468u;                                  /* Capture height Max 468[line]
                                                                             Due to CMOS(MT9V111) output signal timing and VDC5 specification */


カメラ画像をUSBメモリへ保存する際、以下の変換方法に沿って変換を行なって保存します。

main.cpp内の"VIDEO_INPUT_FORMAT"の値変換方法
VIDEO_YCBCR422JPEG
VIDEO_RGB888bitmap
VIDEO_RGB565binary (RAW data)


USBを使用する場合、使用するUSB口に合わせて、以下の変更とジャンパーショートを行なって下さい。
(define 0:USB0、define 1:USB1)

USBHost\USBHost\TARGET_RENESAS\TARGET_RZ_A1H\usb_host_setting.h

#define USB_HOST_CH                           0
↓
#define USB_HOST_CH                           1


GR-PEACH側のUSB0を使用する場合は、JP3をショートして下さい。
/media/uploads/RyoheiHagimoto/usb.jpg

GR-PEACH AUDIO CAMERA Shield側のUSB1を使用する場合は、JP1をショートして以下の変更を行なって下さい。
/media/uploads/dkato/audiocamerashield_jp1.jpg

unknown revision 'shortlog'