├── src └── Modules │ └── SampleModule │ ├── icon.png │ ├── screenshot1.png │ ├── postinstall │ └── SampleModule.C ├── rebuild-host.sh ├── rebuild-pro-host.sh ├── rebuild-platform.sh ├── rebuild-pro-platform.sh ├── rebuild-pro-platform-pdeb.sh ├── README ├── INSTALL ├── CMakeLists.txt └── COPYING /src/Modules/SampleModule/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevois/samplemodule/HEAD/src/Modules/SampleModule/icon.png -------------------------------------------------------------------------------- /src/Modules/SampleModule/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevois/samplemodule/HEAD/src/Modules/SampleModule/screenshot1.png -------------------------------------------------------------------------------- /rebuild-host.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /bin/rm -rf hbuild \ 4 | && mkdir hbuild \ 5 | && cd hbuild \ 6 | && cmake "$@" .. \ 7 | && make -j \ 8 | && sudo make install 9 | -------------------------------------------------------------------------------- /rebuild-pro-host.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Build everything: 4 | sudo /bin/rm -rf phbuild \ 5 | && mkdir phbuild \ 6 | && cd phbuild \ 7 | && cmake "$@" -DJEVOIS_HARDWARE=PRO .. \ 8 | && make -j \ 9 | && sudo make install 10 | -------------------------------------------------------------------------------- /rebuild-platform.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # USAGE: rebuild-platform.sh [cmake opts] 3 | 4 | set -e 5 | 6 | # Let's build it: 7 | sudo /bin/rm -rf pbuild 8 | mkdir pbuild 9 | cd pbuild 10 | cmake "$@" -DJEVOIS_PLATFORM=ON .. 11 | make -j 12 | sudo make install 13 | cd .. 14 | 15 | jevois-jvpkg `cat pbuild/jvpkg-args` 16 | -------------------------------------------------------------------------------- /rebuild-pro-platform.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # USAGE: rebuild-pro-platform-pdeb.sh [cmake opts] 3 | 4 | # Let's build it: 5 | sudo /bin/rm -rf ppdbuild \ 6 | && mkdir ppdbuild \ 7 | && cd ppdbuild \ 8 | && cmake -DJEVOIS_HARDWARE=PRO -DJEVOIS_PLATFORM=ON $@ .. \ 9 | && make -j \ 10 | && sudo make install \ 11 | && sudo cpack 12 | 13 | -------------------------------------------------------------------------------- /rebuild-pro-platform-pdeb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # USAGE: rebuild-pro-platform-pdeb.sh [cmake opts] 3 | 4 | # Let's build it: 5 | sudo /bin/rm -rf ppdbuild \ 6 | && mkdir ppdbuild \ 7 | && cd ppdbuild \ 8 | && cmake -DJEVOIS_HARDWARE=PRO -DJEVOIS_PLATFORM=ON -DJEVOISPRO_PLATFORM_DEB=ON $@ .. \ 9 | && make -j \ 10 | && sudo make install \ 11 | && sudo cpack 12 | 13 | -------------------------------------------------------------------------------- /src/Modules/SampleModule/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This script is executed once after the module is installed by JeVois if it was added to the jevois/packages/ directory 3 | # of the microSD card as a .jvpkg file. The script is deleted from the microSD card after execution. 4 | # 5 | # The caller script will set the current directory to the location of this script before launching the script. 6 | 7 | # Add our video mappings to the main mappings file: 8 | jevois-add-videomapping YUYV 640 480 28.5 YUYV 640 480 28.5 SampleVendor SampleModule 9 | 10 | # Example of a simple message: 11 | echo "SampleModule is now installed" 12 | 13 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ###################################################################################################################### 2 | # 3 | # JeVois Smart Embedded Machine Vision Toolkit - Copyright (C) 2016 by Laurent Itti, the University of Southern 4 | # California (USC), and iLab at USC. See http://iLab.usc.edu and http://jevois.org for information about this project. 5 | # 6 | # This file is part of the JeVois Smart Embedded Machine Vision Toolkit. This program is free software; you can 7 | # redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software 8 | # Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 9 | # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 10 | # License for more details. You should have received a copy of the GNU General Public License along with this program; 11 | # if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 12 | # 13 | # Contact information: Laurent Itti - 3641 Watt Way, HNB-07A - Los Angeles, CA 90089-2520 - USA. 14 | # Tel: +1 213 740 3527 - itti@pollux.usc.edu - http://iLab.usc.edu - http://jevois.org 15 | ###################################################################################################################### 16 | 17 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | ###################################################################################################################### 2 | # 3 | # JeVois Smart Embedded Machine Vision Toolkit - Copyright (C) 2016 by Laurent Itti, the University of Southern 4 | # California (USC), and iLab at USC. See http://iLab.usc.edu and http://jevois.org for information about this project. 5 | # 6 | # This file is part of the JeVois Smart Embedded Machine Vision Toolkit. This program is free software; you can 7 | # redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software 8 | # Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 9 | # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 10 | # License for more details. You should have received a copy of the GNU General Public License along with this program; 11 | # if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 12 | # 13 | # Contact information: Laurent Itti - 3641 Watt Way, HNB-07A - Los Angeles, CA 90089-2520 - USA. 14 | # Tel: +1 213 740 3527 - itti@pollux.usc.edu - http://iLab.usc.edu - http://jevois.org 15 | ###################################################################################################################### 16 | 17 | INSTALLATION INSTRUCTIONS 18 | ========================= 19 | 20 | JeVois-A33: To compile and install for host: 21 | -------------------------------------------- 22 | 23 | ./rebuild-host.sh 24 | 25 | 26 | JeVois-A33: To cross-compile for platform hardware and install to staging area: 27 | ------------------------------------------------------------------------------- 28 | 29 | ./rebuild-platform.sh --staging 30 | 31 | The package will be included next time you flash a custom microSD card using jevois-build.sh in jevois-sdk. 32 | 33 | JeVois-A33: To cross-compile for platform hardware and install to jvpkg package: 34 | -------------------------------------------------------------------------------- 35 | 36 | ./rebuild-platform.sh 37 | cd pbuild 38 | make jvpkg 39 | cd .. 40 | 41 | Then just copy the resulting .jvpkg file to the JEVOIS:/packages/ folder on your microSD card. The JeVois smart camera 42 | will unpack and install it next time it starts up. 43 | 44 | 45 | JeVois-Pro: To compile and install for host: 46 | -------------------------------------------- 47 | 48 | ./rebuild-pro-host.sh 49 | 50 | 51 | JeVois-Pro: To cross-compile for platform hardware and pack into a .deb package: 52 | -------------------------------------------------------------------------------- 53 | 54 | ./rebuild-pro-platform-pdeb.sh 55 | 56 | this will create a .deb file for arm64 architecture (the processor of JeVois-Pro) that you can then copy to the 57 | microSD of your JeVois-Pro and install on your running camera using the following command in the JeVois-Pro console: 58 | 59 | !dpkg -i /location/of/debfile.deb 60 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ###################################################################################################################### 2 | # 3 | # JeVois Smart Embedded Machine Vision Toolkit - Copyright (C) 2016 by Laurent Itti, the University of Southern 4 | # California (USC), and iLab at USC. See http://iLab.usc.edu and http://jevois.org for information about this project. 5 | # 6 | # This file is part of the JeVois Smart Embedded Machine Vision Toolkit. This program is free software; you can 7 | # redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software 8 | # Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 9 | # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 10 | # License for more details. You should have received a copy of the GNU General Public License along with this program; 11 | # if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 12 | # 13 | # Contact information: Laurent Itti - 3641 Watt Way, HNB-07A - Los Angeles, BA 90089-2520 - USA. 14 | # Tel: +1 213 740 3527 - itti@pollux.usc.edu - http://iLab.usc.edu - http://jevois.org 15 | ###################################################################################################################### 16 | 17 | ## CMake build rules for JeVois Base library and executables 18 | 19 | ## You may provide the installed JeVois config root as: 20 | # cmake -DJEVOIS_CONFIG=/jevois/config .. 21 | 22 | cmake_minimum_required(VERSION 3.6) 23 | 24 | ## Set vendor names, our modules will be placed in a directory by that name under /jevois/modules: 25 | set(JEVOIS_VENDOR "SampleVendor") 26 | if (JEVOIS_HARDWARE STREQUAL "PRO") 27 | set(JEVOIS_CONFIG "/jevoispro/config" CACHE STRING "Path to JeVois config to use") 28 | else() 29 | set(JEVOIS_CONFIG "/jevois/config" CACHE STRING "Path to JeVois config to use") 30 | endif() 31 | 32 | ## Set a version for your module, used to create the .deb package for platform: 33 | set(MOD_VERSION_MAJOR 1) 34 | set(MOD_VERSION_MINOR 0) 35 | set(MOD_VERSION_PATCH 0) 36 | 37 | ## Include helper functions, config, etc from the JeVois install: 38 | set(CMAKE_MODULE_PATH ${JEVOIS_CONFIG}) 39 | include(jevois_config) 40 | include(JeVois) 41 | 42 | ## Set project name, detects compiler (which has been set by our helper module). Then set some complation flags: 43 | project(samplemodule) 44 | jevois_project_set_flags() 45 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 46 | 47 | file(MAKE_DIRECTORY share-jevois share-jevoispro) 48 | 49 | ## Find any include files installed by JeVois into /${JEVOIS}/include, e.g., imgui: 50 | file(GLOB JVINCLUDES "/${JEVOIS}/include/*" "/${JEVOIS}/include/*/include") 51 | FOREACH(child ${JVINCLUDES}) 52 | IF (IS_DIRECTORY "${child}") 53 | include_directories("${child}") 54 | ENDIF() 55 | ENDFOREACH() 56 | 57 | if (JEVOIS_PLATFORM) 58 | include_directories(${JEVOIS_PLATFORM_INSTALL_PREFIX}/include) 59 | include_directories(${JEVOIS_PLATFORM_MODULES_ROOT}/include) 60 | include_directories(${JEVOIS_BUILD_BASE}/${JEVOIS_MODULES_ROOT}/include) 61 | link_directories(${JEVOIS_PLATFORM_MODULES_ROOT}/lib) # in case we need libjevois[pro]base.so 62 | link_directories(${JEVOIS_PLATFORM_INSTALL_PREFIX}/lib) # for libjevois[pro].so, etc 63 | else () 64 | include_directories(${JEVOIS_MODULES_ROOT}/include) 65 | endif () 66 | 67 | ## If your module will use components provided by jevoisbase, uncomment the lines below: 68 | #if (JEVOIS_PLATFORM) 69 | # link_directories("/var/lib/${JEVOIS}-microsd/lib") # find libjevoisbase.so for platform 70 | #endif (JEVOIS_PLATFORM) 71 | include_directories("/var/lib/${JEVOIS}-build/usr/include") # find includes for jevois contrib and jevoisbase 72 | 73 | ## If you also want to use some of the jevoisbase contribs, just add the appropriate include paths here. You will also 74 | ## need to set JEVOIS_SRC_ROOT environment variable in your shell to the parent of the jevoisbase directory, e.g., type: 75 | # export JEVOIS_SRC_ROOT=/home/myname 76 | ## in your shell. 77 | #include_directories("$ENV{JEVOIS_SRC_ROOT}/jevoisbase/Contrib/darknet-nnpack/include") 78 | #include_directories("$ENV{JEVOIS_SRC_ROOT}/jevoisbase/Contrib/NNPACK/include") 79 | #include_directories("$ENV{JEVOIS_SRC_ROOT}/jevoisbase/Contrib/pthreadpool/include") 80 | 81 | ## Setup our modules that are in src/Modules. First arg: source directory for modules; 2nd arg: target build 82 | ## dependencies (i.e., cmake targets which must be built here before we build the modules), usually empty for a single 83 | ## module. See the CMakeLists.txt in jevoisbase for an example where we first build a shared library for all shared 84 | ## components, and then each module gets this library as a target dependency: 85 | jevois_setup_modules(src/Modules "") 86 | 87 | ## Add any link libraries for each module. Add '${JEVOIS}base' here if you want to link against it: 88 | target_link_libraries(SampleModule ${JEVOIS_OPENCV_LIBS}) 89 | 90 | ## Install any shared resources (cascade classifiers, neural network weights, etc) in the share/ sub-directory: 91 | install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/share-${JEVOIS}/" 92 | DESTINATION "${JEVOIS_MODULES_ROOT}/share" COMPONENT bin) 93 | 94 | ######################################################################################################################## 95 | # Debian packaging: 96 | 97 | # To list the files created in a package, run: dpkg -c 98 | set(CPACK_PACKAGE_DESCRIPTION "JeVois SampleModule") 99 | set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "JeVois SampleModule") 100 | set(CPACK_PACKAGE_CONTACT "Laurent Itti ") 101 | set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT}) 102 | set(CPACK_DEBIAN_PACKAGE_SECTION "universe") 103 | set(CPACK_PACKAGE_VENDOR "SampleVendor") 104 | set(CPACK_PACKAGE_VERSION_MAJOR "${MOD_VERSION_MAJOR}") 105 | set(CPACK_PACKAGE_VERSION_MINOR "${MOD_VERSION_MINOR}") 106 | set(CPACK_PACKAGE_VERSION_PATCH "${MOD_VERSION_PATCH}") 107 | set(JEVOIS_PACKAGE_RELEASE "1") # packager revision number 108 | 109 | if (JEVOIS_PLATFORM) 110 | set(JEVOIS_DEPEND "${JEVOIS}-platform (>=${JEVOIS_VERSION_MAJOR}.${JEVOIS_VERSION_MINOR}.${JEVOIS_VERSION_PATCH})") 111 | else (JEVOIS_PLATFORM) 112 | set(JEVOIS_DEPEND "${JEVOIS}-host (>=${JEVOIS_VERSION_MAJOR}.${JEVOIS_VERSION_MINOR}.${JEVOIS_VERSION_PATCH})") 113 | endif (JEVOIS_PLATFORM) 114 | 115 | # Add any other dependencies here for the package, separated by commas: 116 | set(CPACK_DEBIAN_PACKAGE_DEPENDS "${JEVOIS_DEPEND}") 117 | 118 | # Use helper from JeVois.cmake for all other settings: 119 | jevois_setup_cpack(samplemodule) 120 | -------------------------------------------------------------------------------- /src/Modules/SampleModule/SampleModule.C: -------------------------------------------------------------------------------- 1 | // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // JeVois Smart Embedded Machine Vision Toolkit - Copyright (C) 2016 by Laurent Itti, the University of Southern 4 | // California (USC), and iLab at USC. See http://iLab.usc.edu and http://jevois.org for information about this project. 5 | // 6 | // This file is part of the JeVois Smart Embedded Machine Vision Toolkit. This program is free software; you can 7 | // redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software 8 | // Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 9 | // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 10 | // License for more details. You should have received a copy of the GNU General Public License along with this program; 11 | // if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 12 | // 13 | // Contact information: Laurent Itti - 3641 Watt Way, HNB-07A - Los Angeles, CA 90089-2520 - USA. 14 | // Tel: +1 213 740 3527 - itti@pollux.usc.edu - http://iLab.usc.edu - http://jevois.org 15 | // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 16 | /*! \file */ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | // icon by Catalin Fertu in cinema at flaticon 23 | 24 | //! JeVois sample module 25 | /*! This module is provided as an example of how to create a new standalone module. 26 | 27 | JeVois provides helper scripts and files to assist you in programming new modules, following two basic formats: 28 | 29 | - if you wish to only create a single module that will execute a specific function, or a collection of such modules 30 | where there is no shared code between the modules (i.e., each module does things that do not relate to the other 31 | modules), use the skeleton provided by this sample module. Here, all the code for the sample module is compiled 32 | into a single shared object (.so) file that is loaded by the JeVois engine when the corresponding video output 33 | format is selected by the host computer. 34 | 35 | - if you are planning to write a collection of modules with some shared algorithms among several of the modules, it 36 | is better to first create machine vision Components that implement the algorithms that are shared among several of 37 | your modules. You would then compile all your components into a first shared library (.so) file, and then compile 38 | each module into its own shared object (.so) file that depends on and automatically loads your shared library file 39 | when it is selected by the host computer. The jevoisbase library and collection of components and modules is an 40 | example for how to achieve that, where libjevoisbase.so contains code for Saliency, ObjectRecognition, etc 41 | components that are used in several modules, and each module's .so file contains only the code specific to that 42 | module. 43 | 44 | @author Sample Author 45 | 46 | @videomapping YUYV 640 480 28.5 YUYV 640 480 28.5 SampleVendor SampleModule 47 | @email sampleemail\@samplecompany.com 48 | @address 123 First Street, Los Angeles, CA 90012 49 | @copyright Copyright (C) 2017 by Sample Author 50 | @mainurl http://samplecompany.com 51 | @supporturl http://samplecompany.com/support 52 | @otherurl http://samplecompany.com/about 53 | @license GPL v3 54 | @distribution Unrestricted 55 | @restrictions None */ 56 | class SampleModule : public jevois::Module 57 | { 58 | public: 59 | //! Default base class constructor ok 60 | using jevois::Module::Module; 61 | 62 | //! Virtual destructor for safe inheritance 63 | virtual ~SampleModule() { } 64 | 65 | // #################################################################################################### 66 | //! Processing function 67 | // #################################################################################################### 68 | virtual void process(jevois::InputFrame && inframe, jevois::OutputFrame && outframe) override 69 | { 70 | // Wait for next available camera image: 71 | jevois::RawImage const inimg = inframe.get(true); 72 | 73 | // We only support YUYV pixels in this example, any resolution: 74 | inimg.require("input", inimg.width, inimg.height, V4L2_PIX_FMT_YUYV); 75 | 76 | // Wait for an image from our gadget driver into which we will put our results: 77 | jevois::RawImage outimg = outframe.get(); 78 | 79 | // Enforce that the input and output formats and image sizes match: 80 | outimg.require("output", inimg.width, inimg.height, inimg.fmt); 81 | 82 | // Just copy the pixel data over: 83 | memcpy(outimg.pixelsw(), inimg.pixels(), std::min(inimg.buf->length(), outimg.buf->length())); 84 | 85 | // Print a text message: 86 | jevois::rawimage::writeText(outimg, "Hello JeVois!", 100, 230, jevois::yuyv::White, jevois::rawimage::Font20x38); 87 | 88 | // Let camera know we are done processing the input image: 89 | inframe.done(); // NOTE: optional here, inframe destructor would call it anyway 90 | 91 | // Send the output image with our processing results to the host over USB: 92 | outframe.send(); // NOTE: optional here, outframe destructor would call it anyway 93 | } 94 | 95 | // #################################################################################################### 96 | //! Processing function with no USB output (headless) 97 | // #################################################################################################### 98 | virtual void process(jevois::InputFrame && inframe) override 99 | { 100 | // Wait for next available camera image: 101 | jevois::RawImage const inimg = inframe.get(true); 102 | 103 | // Do something with the frame... 104 | 105 | // ... 106 | 107 | // Let camera know we are done processing the input image: 108 | inframe.done(); // NOTE: optional here, inframe destructor would call it anyway 109 | 110 | // Send some results to serial port: 111 | sendSerial("This is an example -- fixme"); 112 | } 113 | 114 | #ifdef JEVOIS_PRO 115 | // #################################################################################################### 116 | //! Processing function with zero-copy and GUI on JeVois-Pro 117 | // #################################################################################################### 118 | virtual void process(jevois::InputFrame && inframe, jevois::GUIhelper & helper) override 119 | { 120 | static jevois::Timer timer("processing", 100, LOG_DEBUG); 121 | 122 | // Start the GUI frame: will return display size in winw, winh, and whether mouse/keyboard are idle 123 | unsigned short winw, winh; 124 | bool idle = helper.startFrame(winw, winh); 125 | 126 | // Draw the camera frame: will return its location (x,y) and size (iw,ih) on screen 127 | int x = 0, y = 0; unsigned short iw = 0, ih = 0; 128 | helper.drawInputFrame("camera", inframe, x, y, iw, ih); 129 | 130 | // Wait for next available camera image to be used for processing (possibly at a lower resolution): 131 | jevois::RawImage const inimg = inframe.getp(); 132 | helper.itext("JeVois-Pro Sample module"); 133 | 134 | timer.start(); 135 | 136 | // Process inimg and draw some results in the GUI, possibly send some serial messages too... 137 | 138 | // ... 139 | 140 | // Show processing fps: 141 | std::string const & fpscpu = timer.stop(); 142 | helper.iinfo(inframe, fpscpu, winw, winh); 143 | 144 | // Render the image and GUI: 145 | helper.endFrame(); 146 | 147 | (void)idle; // avoid compiler warning since we did not use idle in this example 148 | } 149 | 150 | #endif // JEVOIS_PRO 151 | }; 152 | 153 | // Allow the module to be loaded as a shared object (.so) file: 154 | JEVOIS_REGISTER_MODULE(SampleModule); 155 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | 3 | JeVois Smart Embedded Machine Vision Toolkit - Copyright (C) 2016 by Laurent Itti, the University of Southern California 4 | (USC), and iLab at USC. See http://iLab.usc.edu and http://jevois.org for information about this project. 5 | 6 | This file is part of the JeVois Smart Embedded Machine Vision Toolkit. This program is free software; you can 7 | redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software 8 | Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 9 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 10 | License for more details. You should have received a copy of the GNU General Public License along with this program; if 11 | not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 12 | 13 | Contact information: Laurent Itti - 3641 Watt Way, HNB-07A - Los Angeles, CA 90089-2520 - USA. 14 | Tel: +1 213 740 3527 - itti@pollux.usc.edu - http://iLab.usc.edu - http://jevois.org 15 | 16 | ################################################################################ 17 | 18 | GNU GENERAL PUBLIC LICENSE 19 | Version 2, June 1991 20 | 21 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 23 | 24 | Preamble 25 | 26 | The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU 27 | General Public License is intended to guarantee your freedom to share and change free software--to make sure the 28 | software is free for all its users. This General Public License applies to most of the Free Software Foundation's 29 | software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is 30 | covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. 31 | 32 | When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to 33 | make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), 34 | that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new 35 | free programs; and that you know you can do these things. 36 | 37 | To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to 38 | surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the 39 | software, or if you modify it. 40 | 41 | For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all 42 | the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show 43 | them these terms so they know their rights. 44 | 45 | We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you 46 | legal permission to copy, distribute and/or modify the software. 47 | 48 | Also, for each author's protection and ours, we want to make certain that everyone understands that there is no 49 | warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to 50 | know that what they have is not the original, so that any problems introduced by others will not reflect on the original 51 | authors' reputations. 52 | 53 | Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that 54 | redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To 55 | prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. 56 | 57 | The precise terms and conditions for copying, distribution and modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it 63 | may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or 64 | work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to 65 | say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into 66 | another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee 67 | is addressed as "you". 68 | 69 | Activities other than copying, distribution and modification are not covered by this License; they are outside its 70 | scope. The act of running the Program is not restricted, and the output from the Program is covered only if its 71 | contents constitute a work based on the Program (independent of having been made by running the Program). Whether that 72 | is true depends on what the Program does. 73 | 74 | 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided 75 | that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of 76 | warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other 77 | recipients of the Program a copy of this License along with the Program. 78 | 79 | You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection 80 | in exchange for a fee. 81 | 82 | 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, 83 | and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all 84 | of these conditions: 85 | 86 | a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of 87 | any change. 88 | 89 | b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the 90 | Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this 91 | License. 92 | 93 | c) If the modified program normally reads commands interactively when run, you must cause it, when started running 94 | for such interactive use in the most ordinary way, to print or display an announcement including an appropriate 95 | copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users 96 | may redistribute the program under these conditions, and telling the user how to view a copy of this License. 97 | (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based 98 | on the Program is not required to print an announcement.) 99 | 100 | These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from 101 | the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its 102 | terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same 103 | sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of 104 | this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part 105 | regardless of who wrote it. 106 | 107 | Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; 108 | rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the 109 | Program. 110 | 111 | In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the 112 | Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 113 | 114 | 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form 115 | under the terms of Sections 1 and 2 above provided that you also do one of the following: 116 | 117 | a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the 118 | terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 119 | 120 | b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more 121 | than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding 122 | source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software 123 | interchange; or, 124 | 125 | c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This 126 | alternative is allowed only for noncommercial distribution and only if you received the program in object code or 127 | executable form with such an offer, in accord with Subsection b above.) 128 | 129 | The source code for a work means the preferred form of the work for making modifications to it. For an executable work, 130 | complete source code means all the source code for all modules it contains, plus any associated interface definition 131 | files, plus the scripts used to control compilation and installation of the executable. However, as a special 132 | exception, the source code distributed need not include anything that is normally distributed (in either source or 133 | binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable 134 | runs, unless that component itself accompanies the executable. 135 | 136 | If distribution of executable or object code is made by offering access to copy from a designated place, then offering 137 | equivalent access to copy the source code from the same place counts as distribution of the source code, even though 138 | third parties are not compelled to copy the source along with the object code. 139 | 140 | 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. 141 | Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate 142 | your rights under this License. However, parties who have received copies, or rights, from you under this License will 143 | not have their licenses terminated so long as such parties remain in full compliance. 144 | 145 | 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you 146 | permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do 147 | not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you 148 | indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or 149 | modifying the Program or works based on it. 150 | 151 | 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a 152 | license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You 153 | may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not 154 | responsible for enforcing compliance by third parties to this License. 155 | 156 | 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited 157 | to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the 158 | conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as 159 | to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence 160 | you may not distribute the Program at all. For example, if a patent license would not permit royalty-free 161 | redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you 162 | could satisfy both it and this License would be to refrain entirely from distribution of the Program. 163 | 164 | If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the 165 | section is intended to apply and the section as a whole is intended to apply in other circumstances. 166 | 167 | It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest 168 | validity of any such claims; this section has the sole purpose of protecting the integrity of the free software 169 | distribution system, which is implemented by public license practices. Many people have made generous contributions to 170 | the wide range of software distributed through that system in reliance on consistent application of that system; it is 171 | up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee 172 | cannot impose that choice. 173 | 174 | This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 175 | 176 | 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by 177 | copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit 178 | geographical distribution limitation excluding those countries, so that distribution is permitted only in or among 179 | countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this 180 | License. 181 | 182 | 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to 183 | time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new 184 | problems or concerns. 185 | 186 | Each version is given a distinguishing version number. If the Program specifies a version number of this License which 187 | applies to it and "any later version", you have the option of following the terms and conditions either of that version 188 | or of any later version published by the Free Software Foundation. If the Program does not specify a version number of 189 | this License, you may choose any version ever published by the Free Software Foundation. 190 | 191 | 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are 192 | different, write to the author to ask for permission. For software which is copyrighted by the Free Software 193 | Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided 194 | by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and 195 | reuse of software generally. 196 | 197 | NO WARRANTY 198 | 199 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 200 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM 201 | "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 202 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 203 | PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR 204 | CORRECTION. 205 | 206 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER 207 | PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 208 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING 209 | BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 210 | FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 211 | POSSIBILITY OF SUCH DAMAGES. 212 | 213 | END OF TERMS AND CONDITIONS 214 | 215 | How to Apply These Terms to Your New Programs 216 | 217 | If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to 218 | achieve this is to make it free software which everyone can redistribute and change under these terms. 219 | 220 | To do so, attach the following notices to the program. It is safest to attach them to the start of each source file 221 | to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a 222 | pointer to where the full notice is found. 223 | 224 | Copyright (C) 225 | 226 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 227 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 228 | version. 229 | 230 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 231 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 232 | details. 233 | 234 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 235 | Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 236 | 237 | Also add information on how to contact you by electronic and paper mail. 238 | 239 | If the program is interactive, make it output a short notice like this when it starts in an interactive mode: 240 | 241 | Gnomovision version 69, Copyright (C) year name of author 242 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 243 | This is free software, and you are welcome to redistribute it 244 | under certain conditions; type `show c' for details. 245 | 246 | The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of 247 | course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks 248 | or menu items--whatever suits your program. 249 | 250 | You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" 251 | for the program, if necessary. Here is a sample; alter the names: 252 | 253 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 254 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 255 | 256 | , 1 April 1989 257 | Ty Coon, President of Vice 258 | 259 | This General Public License does not permit incorporating your program into proprietary programs. If your program is a 260 | subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If 261 | this is what you want to do, use the GNU Lesser General Public License instead of this License. 262 | --------------------------------------------------------------------------------