VPF libray HowTo only for IU233

We strongly recommend Google Traslate function from Chrome browser to touch the latest information of our Japanese community site. Click Japan flag above and traslate it by the browser!

サイト内検索

2018/08/21 16:00 Updated.

Introduction

This is the explanation how to display the image from IU233 connected to RaspberryPi 3.

It is necessary to install following programs. Raspbian(OS), SSP Library, and VisionProcessingFramework(VPF).
SSP library is the API to control the camera connected to CSI interface of RaspberryPi.
VPF is the GUI program to execute image processing and display the iamge from camera.(Shown below diagram)

       
Confirmed to work with the combination of each verson number by 16th/Nov/2017

detail procedure

Install Raspbian

(1) Download the latest version of Rasbian from Raspberry Pi Foundation.
If you want to print with SSP library only, see How to use the SSP library.

(2) Write the image file to MicroSD card with the tool like Win32DiskImager for eaxmple.

(3) Connect HDMI cable, keyboard, mouse, and LAN cable to RaspberryPi and configure the following items from the terminal window opened by clicking the terminal icon in the top menu bar.

In case already connected to the network, no need to set proxy configuration, go to (8).

(4) In case cannot connect to internet directly because of the lack of configuration of proxy server, set folloing proxy configuration. The proxy server requires individual configuration, please replace the "red" characters properly. For example, proxy.server.path:8080

pi@raspberrypi:~ $ sudo nano /etc/profile

Add the following configuration to the end of the /etc/profile by editor.Type the commands after "$" mark.

export ftp_proxy=http://[proxy server]/
export http_proxy=http://[proxy server]/
export https_proxy=http://[proxy server]/
export FTP_PROXY=http://[proxy server]/
export HTTP_PROXY=http://[proxy server]/
export HTTPS_PROXY=http://[proxy server]/

Save the configuraition. CTL+x key, press "y" key, then press "enter" key in case of using "nano" editor.

(5) set the proxy server to execute apt-get

pi@raspberrypi:~ $ sudo nano /etc/apt/apt.conf

It is necessary to create a new file.

Acquire::ftp::proxy "ftp://[proxy server]/";
Acquire::http::proxy "http://[proxy server]/";
Acquire::https::proxy "https://[proxy server]/";

Save the file.

(6) Set the proxy server for curl accessed by rpi-update

pi@raspberrypi:~ $ sudo nano /root/.curlrc

It is necessary to create a new file.

-k
proxy = "http:// [proxy server]"

save the file.
 
(7) Set the proxy server for wget to get wxWidgets souce

pi@raspberrypi:~ $ sudo nano /etc/wgetrc

Modify the file.

# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
https_proxy = http://[proxy server]/
http_proxy = http://[proxy server]/
ftp_proxy = http://[proxy server]/

# If you do not want to use proxy at all, set this to off.
use_proxy = on

save the file.

Restart the RaspberryPi.

pi@raspberrypi:~ $ sudo reboot

 
(8) There is no ntp in Stretch, so set the clock with the date command.
To enter at the Coordinated Universal Time,

pi@raspberrypi:~ $ sudo date -s "2017/11/17 00:30:00 UTC"
Fri 17 Nov 00:30:00 UTC 2017

To enter in Japan Standard Time,

pi@raspberrypi:~ $ sudo date -s "2017/11/17 09:30:00 JST"
Fri 17 Nov 00:30:00 UTC 2017

Regardless of which you enter, it is internally the same.
Since the display is done with the timezone setting, here is the UTC notation.

 
(9)Update the package and firmware by below commands.

pi@raspberrypi:~ $ sudo apt-get update
pi@raspberrypi:~ $ sudo apt-get upgrade
pi@raspberrypi:~ $ sudo rpi-update
pi@raspberrypi:~ $ sudo reboot

Type the commands after "$" mark. We recommend to use "Cut & Paste" from web browser.

 
(10) Enable i2c channel by raspi-config command.

pi@raspberrypi:~ $ sudo raspi-config

 
Select "I2C" from "Interfacing Options".

 
(11) Enable "Camera" by raspi-config command.
Select "Camera" and enable it from "Interfacing Options". "Restart" is requested at the last stage of configuration, then reboot the RaspberryPi.

SSP Library

(1)Edit the Configuration file "/boot/config.txt"

Open "/boot/config.txt" by text editor

pi@raspberrypi:~ $ sudo nano /boot/config.txt

Add the following description at the last line of the file.

dtoverlay=i2c1-bcm2708,sda1_pin=44,scl1_pin=45,pin_func=6

Warning! Please use the SD card with this modification Only on "RaspberryPi 3".

Note) In the case of Raspberry Pi 1, 2 and Zero, instead of the changes above, write the foloiwing line;

dtparam=i2c_vc=on

 
Restart the RaspberryPi to reflect the modification.

pi@raspberrypi:~ $ sudo reboot

 
(2) Down load the library package of the HexaVisionControl from the down load site. Expand it by "tar" command shown below.

pi@raspberrypi:~ $ mkdir HexaVision
pi@raspberrypi:~ $ tar zxvf ~/Downloads/HexaVisionControl-0.92.tar.gz -C HexaVision

 
(3) Create hexavion_ctl.conf file by the command shown below.

pi@raspberrypi:~ $ sudo nano /etc/ld.so.conf.d/libhexavision_ctl.conf

Create a new file.

/home/pi/HexaVision/HexaVisionControl/0.92/lib

Save it.

(4) Down load the library package of the SSP library from the down load site. Expand it by "tar" command shown below.

pi@raspberrypi:~ $ tar zxvf ~/Downloads/libssp-1.30.tar.gz

 
(5) Create libssp.conf by the command shown below.

pi@raspberrypi:~ $ sudo nano /etc/ld.so.conf.d/libssp.conf

Create a new file.

/home/pi/libssp/1.30/lib

Save it.

(6) after setting the library path above,

pi@raspberrypi:~ $ sudo ldconfig

Execute the command above.

Vision Processing Framework (VPF)

Installation
VPF uses OpenCV and wxWidgets in addition to SSP library.

(1)Install OpenCV

pi@raspberrypi:~ $ sudo apt-get install libopencv-dev

 
(2)Install wxWidgets

pi@raspberrypi:~ $ wget https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxWidgets-2.8.12.tar.gz
pi@raspberrypi:~ $ tar -xvzof wxWidgets-2.8.12.tar.gz
pi@raspberrypi:~ $ cd wxWidgets-2.8.12
pi@raspberrypi:~/wxWidgets-2.8.12 $ ./configure --with-gtk
pi@raspberrypi:~/wxWidgets-2.8.12 $ make -j3
pi@raspberrypi:~/wxWidgets-2.8.12 $ sudo make install
pi@raspberrypi:~/wxWidgets-2.8.12 $ sudo cp wx-config /usr/local/bin
pi@raspberrypi:~/wxWidgets-2.8.12 $ sudo chmod 755 /usr/local/bin/wx-config

 
(3)Install VPF
Download the source file of VPF ver. 1.0.5 from the down down load site. Expand it by unzip.

pi@raspberrypi:~ $ cd
pi@raspberrypi:~ $ unzip ~/Downloads/VisionProcessingFramework1.05.zip

 
Try it anyway...
(1)Launch VPF

pi@raspberrypi:~ $ cd VisionProcessingFramework/src
pi@raspberrypi:~/VisionProcessingFramework/src $ sudo ./VisionProcessingFramework

 
(2)Open "plugin manager"

 
(3)Load the process flow by clicking the right-bottom button.

 
Click the "src" in the left pane.

 
Click the "VisionProcessingFramework" showing the path in the menu bar on top

 
Select IU233.flow. Click "Open" button.

 
The signal process flow by connecting "Plugin"s is read in.

 
(4)Configure the image sensor
Select Menu > Sensor config > Sensor config.

 
IU233(1280x720@60Hz).xml should be read in.
Confirm the Bit count is set to 10bit.
Click "Apply" button to set the configuration.

 
Click "Sensor setting".

 
Sensor setting window appears.

 
(5)Display the image from camera.
Return to VPF main menu window and click playback button shown below.

 
(6)Analog gain and Exposure time in Sensor setting
window opened at step (4) can change the brightness of the image shown by the OutputDispOpenCV-1 plugin.

 
(7)Stop streaming
Click Stop button in VPF main menu window shown below and close the display window.

 
(8)Terminate VPF
Click the "x" button on top-left to terminate VPF.

 
Switch to the other sensor profile.
This example assumes that the sensor profile files are stored in /home/pi/IU233 folder.

(1)Click the button at right side of the path pane shown below.

 
(2)Open the folder where you store the sensor profiles.

 
Select sensor profile and click Open button.

 
(3)Bit count is initialized, set 10bit again.

 
Click Apply button.

 
(4)Sensor setting also initialized. Re-load it.

 
Select the IU233.csv in /home/pi/VisionProcessingFramework/config/sensor/register_setteings/
And click "Open" button.

 
(5)Click "Playback" button.

 
Video movies showing the operation
Video movies showing the operation are below. Sorry operator speaks only in Japanese.

- Display image


- Recording video and playback


- Combined above two movies