[openrtm-commit:01330] r106 - in branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine: . cmake idl include/Affine src

openrtm @ openrtm.org openrtm @ openrtm.org
2014年 3月 12日 (水) 16:49:18 JST


Author: kawauchi
Date: 2014-03-12 16:49:18 +0900 (Wed, 12 Mar 2014)
New Revision: 106

Removed:
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/RTC.xml20130606112448
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/src/CMakeFiles/
Modified:
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/CMakeLists.txt
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/README.Affine
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/RTC.xml
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/cmake/CMakeLists.txt
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/cmake/cpack_options.cmake.in
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/idl/CMakeLists.txt
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/include/Affine/Affine.h
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/include/Affine/CMakeLists.txt
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/src/Affine.cpp
   branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/src/CMakeLists.txt
Log:
Adjusted cmake files for the package, and converted to the UTF-8 character code. refs #2704

Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/CMakeLists.txt
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/CMakeLists.txt	2013-11-29 06:25:56 UTC (rev 105)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/CMakeLists.txt	2014-03-12 07:49:18 UTC (rev 106)
@@ -4,13 +4,18 @@
 project(Affine)
 string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
 include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")
-set(PROJECT_VERSION 1.0.0 CACHE STRING "Affine version")
+set(PROJECT_VERSION 1.1.0 CACHE STRING "Affine version")
 DISSECT_VERSION()
 set(PROJECT_DESCRIPTION "Affine image component")
 set(PROJECT_VENDOR "AIST")
 set(PROJECT_AUTHOR "AIST")
 set(PROJECT_AUTHOR_SHORT "AIST")
 
+set(LINUX_PACKAGE_GENERATOR "DEB")
+#set(LINUX_PACKAGE_GENERATOR "RPM")
+set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
+set(PROJECT_TYPE "c++/opencv-rtcs")
+
 # Add an "uninstall" target
 CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/cmake/uninstall_target.cmake.in"
     "${PROJECT_BINARY_DIR}/uninstall_target.cmake" IMMEDIATE @ONLY)
@@ -18,7 +23,7 @@
     "${PROJECT_BINARY_DIR}/uninstall_target.cmake")
 
 #option(BUILD_EXAMPLES "Build and install examples" OFF)
-option(BUILD_DOCUMENTATION "Build the documentation" ON)
+option(BUILD_DOCUMENTATION "Build the documentation" OFF)
 #option(BUILD_TESTS "Build the tests" OFF)
 #option(BUILD_TOOLS "Build the tools" OFF)
 option(BUILD_IDL "Build and install idl" ON)
@@ -38,13 +43,20 @@
 
 
 # Set up installation directories
-set(BIN_INSTALL_DIR "components/bin")
-set(LIB_INSTALL_DIR "components/lib")
-set(INC_INSTALL_DIR
-    "components/include/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}")
-set(SHARE_INSTALL_DIR
-    "components/share/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}")
+if(WIN32)
+#  set(BIN_INSTALL_DIR "components/bin")
+#  set(LIB_INSTALL_DIR "components/lib")
+  set(INSTALL_PREFIX "components/${PROJECT_TYPE}")
+else(WIN32)
+  set(OPENRTM_SHARE_PREFIX "share/openrtm-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
+  set(INSTALL_PREFIX "${OPENRTM_SHARE_PREFIX}/components/${PROJECT_TYPE}")
+endif(WIN32)
 
+#set(INC_INSTALL_DIR
+#    "components/include/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}")
+#set(SHARE_INSTALL_DIR
+#    "components/share/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}")
+
 # Get necessary dependency information
 find_package(OpenRTM)
 if(${OpenRTM_FOUND})

Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/README.Affine
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/README.Affine	2013-11-29 06:25:56 UTC (rev 105)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/README.Affine	2014-03-12 07:49:18 UTC (rev 106)
@@ -1,144 +1,144 @@
-======================================================================
-  RTComponent: Affine specificatioin
-
-  OpenRTM-aist-1.0.0
-  Date: $Date$
-
-  This file is generated by rtc-template with the following argments.
-
-#   rtc-template -bcxx --module-name=Affine 
-#   --module-desc='Affine image component' --module-version=1.0.0 --module-vendor=AIST 
-#   --module-category=Category --module-comp-type=STATIC 
-#   --module-act-type=PERIODIC --module-max-inst=1 
-#   --config=affine_matrix:double:0.825,-0.167,40;-0.1,0.83,30 
-#   --inport=original_image:RTC::CameraImage --outport=affined_image:RTC::CameraImage 
-
-
-======================================================================
-    Basic Information
-======================================================================
-# <rtc-template block="module">
-Module Name: Affine
-Description: Affine image component
-Version:     1.0.0
-Vendor:      AIST
-Category:    Category
-Kind:        DataFlowComponent
-Comp. Type:  STATIC
-Act. Type:   PERIODIC
-MAX Inst.:   1
-Lang:        C++
-Lang Type:   
-
-# </rtc-template>
-
-
-======================================================================
-    Activity definition
-======================================================================
-
-[on_initialize]    implemented
-
-[on_finalize]
-
-[on_startup]
-
-[on_shutdown]
-
-[on_activated]     implemented
-
-[on_deactivated]   implemented
-
-[on_execute]       implemented
-
-[on_aborting]
-
-[on_error]
-
-[on_reset]
-
-[on_state_update]
-
-[on_rate_changed]
-
-======================================================================
-    InPorts definition
-======================================================================
-# <rtc-template block="inport">
-
-	Name:        original_image
-	PortNumber:  0
-	Description: 
-	PortType: 
-	DataType:    RTC::CameraImage
-	MaxOut: 
-	[Data Elements]
-		Name:
-		Type:            
-		Number:          
-		Semantics:       
-		Unit:            
-		Frequency:       
-		Operation Cycle: 
-		RangeLow:
-		RangeHigh:
-		DefaultValue:
-
-
-# </rtc-template>
-
-======================================================================
-    OutPorts definition
-======================================================================
-# <rtc-template block="outport">
-
-	Name:        affined_image
-	PortNumber:  0
-	Description: 
-	PortType: 
-	DataType:    RTC::CameraImage
-	MaxOut: 
-	[Data Elements]
-		Name:
-		Type:            
-		Number:          
-		Semantics:       
-		Unit:            
-		Frequency:       
-		Operation Cycle: 
-		RangeLow:
-		RangeHigh:
-		DefaultValue:
-
-
-# </rtc-template>
-
-
-======================================================================
-    Service Port definition
-======================================================================
-# <rtc-template block="serviceport">
-# </rtc-template> 
-
-======================================================================
-    Configuration definition
-======================================================================
-# <rtc-template block="configuration">
-	Configuration:
-		Name:             affine_matrix
-		Description:     
-		Type:            double
-		DefaultValue:     0.825,-0.167,40;-0.1,0.83,30
-		Unit:            
-		Range:           
-		Constraint:      
-
-# </rtc-template> 
-
-This software is developed at the National Institute of Advanced
-Industrial Science and Technology. Approval number H23PRO-????. This
-software is licensed under the Lesser General Public License. See
-COPYING.LESSER.
-
-This area is reserved for future OpenRTM.
-
+======================================================================
+  RTComponent: Affine specificatioin
+
+  OpenRTM-aist-1.0.0
+  Date: $Date$
+
+  This file is generated by rtc-template with the following argments.
+
+#   rtc-template -bcxx --module-name=Affine 
+#   --module-desc='Affine image component' --module-version=1.0.0 --module-vendor=AIST 
+#   --module-category=Category --module-comp-type=STATIC 
+#   --module-act-type=PERIODIC --module-max-inst=1 
+#   --config=affine_matrix:double:0.825,-0.167,40;-0.1,0.83,30 
+#   --inport=original_image:RTC::CameraImage --outport=affined_image:RTC::CameraImage 
+
+
+======================================================================
+    Basic Information
+======================================================================
+# <rtc-template block="module">
+Module Name: Affine
+Description: Affine image component
+Version:     1.1.0
+Vendor:      AIST
+Category:    Category
+Kind:        DataFlowComponent
+Comp. Type:  STATIC
+Act. Type:   PERIODIC
+MAX Inst.:   1
+Lang:        C++
+Lang Type:   
+
+# </rtc-template>
+
+
+======================================================================
+    Activity definition
+======================================================================
+
+[on_initialize]    implemented
+
+[on_finalize]
+
+[on_startup]
+
+[on_shutdown]
+
+[on_activated]     implemented
+
+[on_deactivated]   implemented
+
+[on_execute]       implemented
+
+[on_aborting]
+
+[on_error]
+
+[on_reset]
+
+[on_state_update]
+
+[on_rate_changed]
+
+======================================================================
+    InPorts definition
+======================================================================
+# <rtc-template block="inport">
+
+	Name:        original_image
+	PortNumber:  0
+	Description: 
+	PortType: 
+	DataType:    RTC::CameraImage
+	MaxOut: 
+	[Data Elements]
+		Name:
+		Type:            
+		Number:          
+		Semantics:       
+		Unit:            
+		Frequency:       
+		Operation Cycle: 
+		RangeLow:
+		RangeHigh:
+		DefaultValue:
+
+
+# </rtc-template>
+
+======================================================================
+    OutPorts definition
+======================================================================
+# <rtc-template block="outport">
+
+	Name:        affined_image
+	PortNumber:  0
+	Description: 
+	PortType: 
+	DataType:    RTC::CameraImage
+	MaxOut: 
+	[Data Elements]
+		Name:
+		Type:            
+		Number:          
+		Semantics:       
+		Unit:            
+		Frequency:       
+		Operation Cycle: 
+		RangeLow:
+		RangeHigh:
+		DefaultValue:
+
+
+# </rtc-template>
+
+
+======================================================================
+    Service Port definition
+======================================================================
+# <rtc-template block="serviceport">
+# </rtc-template> 
+
+======================================================================
+    Configuration definition
+======================================================================
+# <rtc-template block="configuration">
+	Configuration:
+		Name:             affine_matrix
+		Description:     
+		Type:            double
+		DefaultValue:     0.825,-0.167,40;-0.1,0.83,30
+		Unit:            
+		Range:           
+		Constraint:      
+
+# </rtc-template> 
+
+This software is developed at the National Institute of Advanced
+Industrial Science and Technology. Approval number H23PRO-????. This
+software is licensed under the Lesser General Public License. See
+COPYING.LESSER.
+
+This area is reserved for future OpenRTM.
+

Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/RTC.xml
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/RTC.xml	2013-11-29 06:25:56 UTC (rev 105)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/RTC.xml	2014-03-12 07:49:18 UTC (rev 106)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<rtc:RtcProfile rtc:version="0.2" rtc:id="RTC:AIST:Category:Affine:1.0.0" xmlns:rtcExt="http://www.openrtp.org/namespaces/rtc_ext" xmlns:rtcDoc="http://www.openrtp.org/namespaces/rtc_doc" xmlns:rtc="http://www.openrtp.org/namespaces/rtc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <rtc:BasicInfo xsi:type="rtcExt:basic_info_ext" rtcExt:saveProject="Affine" rtc:updateDate="2013-06-06T10:46:58+09:00" rtc:creationDate="2013-06-06T10:46:58+09:00" rtc:version="1.0.0" rtc:vendor="AIST" rtc:maxInstances="1" rtc:executionType="PeriodicExecutionContext" rtc:executionRate="1000.0" rtc:description="Affine image component" rtc:category="Category" rtc:componentKind="DataFlowComponent" rtc:activityType="PERIODIC" rtc:componentType="STATIC" rtc:name="Affine"/>
+<rtc:RtcProfile rtc:version="0.2" rtc:id="RTC:AIST:Category:Affine:1.1.0" xmlns:rtcExt="http://www.openrtp.org/namespaces/rtc_ext" xmlns:rtcDoc="http://www.openrtp.org/namespaces/rtc_doc" xmlns:rtc="http://www.openrtp.org/namespaces/rtc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <rtc:BasicInfo xsi:type="rtcExt:basic_info_ext" rtcExt:saveProject="Affine" rtc:updateDate="2013-06-06T10:46:58+09:00" rtc:creationDate="2013-06-06T10:46:58+09:00" rtc:version="1.1.0" rtc:vendor="AIST" rtc:maxInstances="1" rtc:executionType="PeriodicExecutionContext" rtc:executionRate="1000.0" rtc:description="Affine image component" rtc:category="Category" rtc:componentKind="DataFlowComponent" rtc:activityType="PERIODIC" rtc:componentType="STATIC" rtc:name="Affine"/>
     <rtc:Actions>
         <rtc:OnInitialize xsi:type="rtcDoc:action_status_doc" rtc:implemented="true"/>
         <rtc:OnFinalize xsi:type="rtcDoc:action_status_doc" rtc:implemented="false"/>

Deleted: branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/RTC.xml20130606112448
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/RTC.xml20130606112448	2013-11-29 06:25:56 UTC (rev 105)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/RTC.xml20130606112448	2014-03-12 07:49:18 UTC (rev 106)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<rtc:RtcProfile rtc:version="0.2" rtc:id="RTC:VenderName:Category:ModuleName:1.0.0" xmlns:rtcExt="http://www.openrtp.org/namespaces/rtc_ext" xmlns:rtcDoc="http://www.openrtp.org/namespaces/rtc_doc" xmlns:rtc="http://www.openrtp.org/namespaces/rtc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <rtc:BasicInfo xsi:type="rtcExt:basic_info_ext" rtc:updateDate="2013-06-06T10:46:58+09:00" rtc:creationDate="2013-06-06T10:46:58+09:00" rtc:version="1.0.0" rtc:vendor="VenderName" rtc:maxInstances="1" rtc:executionType="PeriodicExecutionContext" rtc:executionRate="1000.0" rtc:description="ModuleDescription" rtc:category="Category" rtc:componentKind="DataFlowComponent" rtc:activityType="PERIODIC" rtc:componentType="STATIC" rtc:name="ModuleName">
-        <rtcDoc:Doc rtcDoc:license="" rtcDoc:creator=""/>
-    </rtc:BasicInfo>
-    <rtc:Actions/>
-</rtc:RtcProfile>

Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/cmake/CMakeLists.txt
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/cmake/CMakeLists.txt	2013-11-29 06:25:56 UTC (rev 105)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/cmake/CMakeLists.txt	2014-03-12 07:49:18 UTC (rev 106)
@@ -2,8 +2,8 @@
 set(PKG_LIBS -l${PROJECT_NAME_LOWER})
 set(pkg_conf_file ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc)
 configure_file(${PROJECT_NAME_LOWER}.pc.in ${pkg_conf_file} @ONLY)
-install(FILES ${pkg_conf_file}
-    DESTINATION ${LIB_INSTALL_DIR}/pkgconfig/ COMPONENT component)
+#install(FILES ${pkg_conf_file}
+#    DESTINATION ${LIB_INSTALL_DIR}/pkgconfig/ COMPONENT component)
 
 # Install CMake modules
 set(cmake_config ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake)
@@ -14,5 +14,5 @@
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake.in
     ${cmake_version_config} @ONLY)
 set(cmake_mods ${cmake_config} ${cmake_version_config})
-install(FILES ${cmake_mods} DESTINATION ${SHARE_INSTALL_DIR} COMPONENT library)
+#install(FILES ${cmake_mods} DESTINATION ${SHARE_INSTALL_DIR} COMPONENT library)
 

Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/cmake/cpack_options.cmake.in
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/cmake/cpack_options.cmake.in	2013-11-29 06:25:56 UTC (rev 105)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/cmake/cpack_options.cmake.in	2014-03-12 07:49:18 UTC (rev 106)
@@ -68,9 +68,9 @@
     #
     #
     #
-    set(CPACK_NSIS_MUI_ICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.ico")
-    set(CPACK_NSIS_MUI_UNIICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.ico")
-    set(CPACK_PACKAGE_ICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.bmp")
+#    set(CPACK_NSIS_MUI_ICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.ico")
+#    set(CPACK_NSIS_MUI_UNIICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.ico")
+#    set(CPACK_PACKAGE_ICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.bmp")
     set(CPACK_NSIS_HELP_LINK "http://www.openrtm.org")
     set(CPACK_NSIS_URL_INFO_ABOUT "http://www.openrtm.org")
     set(CPACK_NSIS_MODIFY_PATH ON)
@@ -90,5 +90,9 @@
     set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
         "  Delete \"$INSTDIR\\@PROJECT_NAME_LOWER at -config.cmake\"
   Delete \"$INSTDIR\\@PROJECT_NAME_LOWER at -config-version.cmake\"")
+
+ELSE(WIN32)
+  set(CPACK_GENERATOR @LINUX_PACKAGE_GENERATOR@)
+  set(CPACK_PACKAGE_CONTACT @PROJECT_MAINTAINER@) 
 ENDIF (WIN32)
 

Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/idl/CMakeLists.txt
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/idl/CMakeLists.txt	2013-11-29 06:25:56 UTC (rev 105)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/idl/CMakeLists.txt	2014-03-12 07:49:18 UTC (rev 106)
@@ -1,7 +1,7 @@
 set(idls )
 
-install(FILES ${idls} DESTINATION ${INC_INSTALL_DIR}/idl
-    COMPONENT idl)
+#install(FILES ${idls} DESTINATION ${INC_INSTALL_DIR}/idl
+#    COMPONENT idl)
 
 macro(_IDL_OUTPUTS _idl _dir _result)
     set(${_result} ${_dir}/${_idl}SK.cc ${_dir}/${_idl}.hh
@@ -50,7 +50,7 @@
 OPENRTM_COMPILE_IDL_FILES(${idls})
 set(ALL_IDL_SRCS ${ALL_IDL_SRCS} PARENT_SCOPE)
 FILTER_LIST("${ALL_IDL_SRCS}" "hh$" idl_headers)
-install(FILES ${idl_headers}
-    DESTINATION ${INC_INSTALL_DIR}/${PROJECT_NAME_LOWER}/idl
-    COMPONENT headers)
+#install(FILES ${idl_headers}
+#    DESTINATION ${INC_INSTALL_DIR}/${PROJECT_NAME_LOWER}/idl
+#    COMPONENT headers)
 

Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/include/Affine/Affine.h
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/include/Affine/Affine.h	2013-11-29 06:25:56 UTC (rev 105)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/include/Affine/Affine.h	2014-03-12 07:49:18 UTC (rev 106)
@@ -1,301 +1,301 @@
-// -*- C++ -*-
-/*!
- * @file  Affine.h
- * @brief Affine image component
- * @date  $Date$
- *
- * $Id$
- */
-
-#ifndef AFFINE_H
-#define AFFINE_H
-
-#include <rtm/Manager.h>
-#include <rtm/DataFlowComponentBase.h>
-#include <rtm/CorbaPort.h>
-#include <rtm/DataInPort.h>
-#include <rtm/DataOutPort.h>
-#include <rtm/idl/BasicDataTypeSkel.h>
-#include <rtm/idl/ExtendedDataTypesSkel.h>
-#include <rtm/idl/InterfaceDataTypesSkel.h>
-
-//OpenCV—pƒCƒ“ƒNƒ‹[ƒhƒtƒ@ƒCƒ‹‚̃Cƒ“ƒNƒ‹[ƒh
-#include<cv.h>
-#include<cxcore.h>
-#include<highgui.h>
-
-// Service implementation headers
-// <rtc-template block="service_impl_h">
-
-// </rtc-template>
-
-// Service Consumer stub headers
-// <rtc-template block="consumer_stub_h">
-
-// </rtc-template>
-
-using namespace RTC;
-
-/*!
- * @class Affine
- * @brief Affine image component
- *
- */
-class Affine
-  : public RTC::DataFlowComponentBase
-{
- public:
-  /*!
-   * @brief constructor
-   * @param manager Maneger Object
-   */
-  Affine(RTC::Manager* manager);
-
-  /*!
-   * @brief destructor
-   */
-  ~Affine();
-
-  // <rtc-template block="public_attribute">
-  
-  // </rtc-template>
-
-  // <rtc-template block="public_operation">
-  
-  // </rtc-template>
-
-  /***
-   *
-   * The initialize action (on CREATED->ALIVE transition)
-   * formaer rtc_init_entry() 
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-   virtual RTC::ReturnCode_t onInitialize();
-
-  /***
-   *
-   * The finalize action (on ALIVE->END transition)
-   * formaer rtc_exiting_entry()
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-  // virtual RTC::ReturnCode_t onFinalize();
-
-  /***
-   *
-   * The startup action when ExecutionContext startup
-   * former rtc_starting_entry()
-   *
-   * @param ec_id target ExecutionContext Id
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
-
-  /***
-   *
-   * The shutdown action when ExecutionContext stop
-   * former rtc_stopping_entry()
-   *
-   * @param ec_id target ExecutionContext Id
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
-
-  /***
-   *
-   * The activated action (Active state entry action)
-   * former rtc_active_entry()
-   *
-   * @param ec_id target ExecutionContext Id
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-   virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
-
-  /***
-   *
-   * The deactivated action (Active state exit action)
-   * former rtc_active_exit()
-   *
-   * @param ec_id target ExecutionContext Id
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-   virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
-
-  /***
-   *
-   * The execution action that is invoked periodically
-   * former rtc_active_do()
-   *
-   * @param ec_id target ExecutionContext Id
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-   virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
-
-  /***
-   *
-   * The aborting action when main logic error occurred.
-   * former rtc_aborting_entry()
-   *
-   * @param ec_id target ExecutionContext Id
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
-
-  /***
-   *
-   * The error action in ERROR state
-   * former rtc_error_do()
-   *
-   * @param ec_id target ExecutionContext Id
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
-
-  /***
-   *
-   * The reset action that is invoked resetting
-   * This is same but different the former rtc_init_entry()
-   *
-   * @param ec_id target ExecutionContext Id
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
-  
-  /***
-   *
-   * The state update action that is invoked after onExecute() action
-   * no corresponding operation exists in OpenRTm-aist-0.2.0
-   *
-   * @param ec_id target ExecutionContext Id
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
-
-  /***
-   *
-   * The action that is invoked when execution context's rate is changed
-   * no corresponding operation exists in OpenRTm-aist-0.2.0
-   *
-   * @param ec_id target ExecutionContext Id
-   *
-   * @return RTC::ReturnCode_t
-   * 
-   * 
-   */
-  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
-
-
- protected:
-  // <rtc-template block="protected_attribute">
-  
-  // </rtc-template>
-
-  // <rtc-template block="protected_operation">
-  
-  // </rtc-template>
-
-  // Configuration variable declaration
-  // <rtc-template block="config_declare">
-  /*!
-   * 
-   * - Name:  ve2dbMatrix
-   * - DefaultValue: 0.825,-0.167,40;-0.1,0.83,30
-   */
+// -*- C++ -*-
+/*!
+ * @file  Affine.h
+ * @brief Affine image component
+ * @date  $Date$
+ *
+ * $Id$
+ */
+
+#ifndef AFFINE_H
+#define AFFINE_H
+
+#include <rtm/Manager.h>
+#include <rtm/DataFlowComponentBase.h>
+#include <rtm/CorbaPort.h>
+#include <rtm/DataInPort.h>
+#include <rtm/DataOutPort.h>
+#include <rtm/idl/BasicDataTypeSkel.h>
+#include <rtm/idl/ExtendedDataTypesSkel.h>
+#include <rtm/idl/InterfaceDataTypesSkel.h>
+
+/* OpenCV用インクルードファイルのインクルード */
+#include<cv.h>
+#include<cxcore.h>
+#include<highgui.h>
+
+// Service implementation headers
+// <rtc-template block="service_impl_h">
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="consumer_stub_h">
+
+// </rtc-template>
+
+using namespace RTC;
+
+/*!
+ * @class Affine
+ * @brief Affine image component
+ *
+ */
+class Affine
+  : public RTC::DataFlowComponentBase
+{
+ public:
+  /*!
+   * @brief constructor
+   * @param manager Maneger Object
+   */
+  Affine(RTC::Manager* manager);
+
+  /*!
+   * @brief destructor
+   */
+  ~Affine();
+
+  // <rtc-template block="public_attribute">
+  
+  // </rtc-template>
+
+  // <rtc-template block="public_operation">
+  
+  // </rtc-template>
+
+  /***
+   *
+   * The initialize action (on CREATED->ALIVE transition)
+   * formaer rtc_init_entry() 
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+   virtual RTC::ReturnCode_t onInitialize();
+
+  /***
+   *
+   * The finalize action (on ALIVE->END transition)
+   * formaer rtc_exiting_entry()
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onFinalize();
+
+  /***
+   *
+   * The startup action when ExecutionContext startup
+   * former rtc_starting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The shutdown action when ExecutionContext stop
+   * former rtc_stopping_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The activated action (Active state entry action)
+   * former rtc_active_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+   virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The deactivated action (Active state exit action)
+   * former rtc_active_exit()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+   virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The execution action that is invoked periodically
+   * former rtc_active_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+   virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The aborting action when main logic error occurred.
+   * former rtc_aborting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The error action in ERROR state
+   * former rtc_error_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The reset action that is invoked resetting
+   * This is same but different the former rtc_init_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
+  
+  /***
+   *
+   * The state update action that is invoked after onExecute() action
+   * no corresponding operation exists in OpenRTm-aist-0.2.0
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The action that is invoked when execution context's rate is changed
+   * no corresponding operation exists in OpenRTm-aist-0.2.0
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
+
+
+ protected:
+  // <rtc-template block="protected_attribute">
+  
+  // </rtc-template>
+
+  // <rtc-template block="protected_operation">
+  
+  // </rtc-template>
+
+  // Configuration variable declaration
+  // <rtc-template block="config_declare">
+  /*!
+   * 
+   * - Name:  ve2dbMatrix
+   * - DefaultValue: 0.825,-0.167,40;-0.1,0.83,30
+   */
   std::vector<std::vector<double> > m_ve2dbMatrix;
-
-  // </rtc-template>
-
-  // DataInPort declaration
-  // <rtc-template block="inport_declare">
-  RTC::CameraImage m_image_orig;
-  /*!
-   */
-  InPort<RTC::CameraImage> m_image_origIn;
-  
-  // </rtc-template>
-
-
-  // DataOutPort declaration
-  // <rtc-template block="outport_declare">
-  RTC::CameraImage m_image_affine;
-  /*!
-   */
-  OutPort<RTC::CameraImage> m_image_affineOut;
-  
-  // </rtc-template>
-
-  // CORBA Port declaration
-  // <rtc-template block="corbaport_declare">
-  
-  // </rtc-template>
-
-  // Service declaration
-  // <rtc-template block="service_declare">
-  
-  // </rtc-template>
-
-  // Consumer declaration
-  // <rtc-template block="consumer_declare">
-  
-  // </rtc-template>
-
- private:
-  // <rtc-template block="private_attribute">
-  
-  // </rtc-template>
-
-  // <rtc-template block="private_operation">
-  
-  // </rtc-template>
-
-    CvMat *m_affineMatrix;
-
-    IplImage* m_image_buff;			// Original Image
-    IplImage* m_image_dest;         // Œ‹‰Êo—Í—pIplImage
-
-    int m_in_height;                // “ü—̓Cƒ[ƒW‚ÌHeight
-    int m_in_width;                 // “ü—̓Cƒ[ƒW‚ÌWidth
-
-    // Configuration’l‚ª—LŒø‚©‚ðƒ`ƒFƒbƒN
-    bool isConfigurationValidated();
-};
-
-
-extern "C"
-{
-  DLL_EXPORT void AffineInit(RTC::Manager* manager);
-};
-
-#endif // AFFINE_H
+
+  // </rtc-template>
+
+  // DataInPort declaration
+  // <rtc-template block="inport_declare">
+  RTC::CameraImage m_image_orig;
+  /*!
+   */
+  InPort<RTC::CameraImage> m_image_origIn;
+  
+  // </rtc-template>
+
+
+  // DataOutPort declaration
+  // <rtc-template block="outport_declare">
+  RTC::CameraImage m_image_affine;
+  /*!
+   */
+  OutPort<RTC::CameraImage> m_image_affineOut;
+  
+  // </rtc-template>
+
+  // CORBA Port declaration
+  // <rtc-template block="corbaport_declare">
+  
+  // </rtc-template>
+
+  // Service declaration
+  // <rtc-template block="service_declare">
+  
+  // </rtc-template>
+
+  // Consumer declaration
+  // <rtc-template block="consumer_declare">
+  
+  // </rtc-template>
+
+ private:
+  // <rtc-template block="private_attribute">
+  
+  // </rtc-template>
+
+  // <rtc-template block="private_operation">
+  
+  // </rtc-template>
+
+  CvMat *m_affineMatrix;
+
+  IplImage* m_image_buff;         // Original Image
+  IplImage* m_image_dest;         // 結果出力用IplImage
+
+  int m_in_height;                // 入力イメージのHeight
+  int m_in_width;                 // 入力イメージのWidth
+
+  /* Configuration値が有効かをチェック */
+  bool isConfigurationValidated();
+};
+
+
+extern "C"
+{
+  DLL_EXPORT void AffineInit(RTC::Manager* manager);
+};
+
+#endif // AFFINE_H

Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/include/Affine/CMakeLists.txt
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/include/Affine/CMakeLists.txt	2013-11-29 06:25:56 UTC (rev 105)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/include/Affine/CMakeLists.txt	2014-03-12 07:49:18 UTC (rev 106)
@@ -1,7 +1,7 @@
 set(hdrs Affine.h
-    PARENT_SCOPE
+#    PARENT_SCOPE
     )
 
-install(FILES ${hdrs} DESTINATION ${INC_INSTALL_DIR}/${PROJECT_NAME_LOWER}
-    COMPONENT library)
+#install(FILES ${hdrs} DESTINATION ${INC_INSTALL_DIR}/${PROJECT_NAME_LOWER}
+#    COMPONENT library)
 

Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/src/Affine.cpp
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/src/Affine.cpp	2013-11-29 06:25:56 UTC (rev 105)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/src/Affine.cpp	2014-03-12 07:49:18 UTC (rev 106)
@@ -1,309 +1,308 @@
-// -*- C++ -*-
-/*!
- * @file  Affine.cpp
- * @brief Affine image component
- * @date $Date$
- *
- * $Id$
- */
-
-#include "Affine.h"
-#include <iostream>
-
-using namespace std;
-
-
-// Module specification
-// <rtc-template block="module_spec">
-static const char* affine_spec[] =
-  {
-    "implementation_id", "Affine",
-    "type_name",         "Affine",
-    "description",       "Affine image component",
-    "version",           "1.0.0",
-    "vendor",            "AIST",
-    "category",          "Category",
-    "activity_type",     "PERIODIC",
-    "kind",              "DataFlowComponent",
-    "max_instance",      "1",
-    "language",          "C++",
-    "lang_type",         "compile",
-    // Configuration variables
-    "conf.default.affine_matrix",  "0.825,-0.167,40;-0.1,0.83,30",
-
-    ""
-  };
-// </rtc-template>
-
-std::istream& operator>>(std::istream& is, std::vector<std::vector<double> >& v)
-{
-    size_t nRow, nCol;
-    std::string strOrig;
-    std::vector<std::string> strRow;
-    std::vector<std::string> strCol;
-
-    is >> strOrig;
-
-    strRow = coil::split(strOrig ,";");
-    nRow = strRow.size();
-    v.resize(nRow);
-    
-    for(size_t i = 0; i < nRow; ++i)
-    {
-
-        strCol = coil::split(strRow[i] ,",");
-        nCol = strCol.size();
-        v[i].resize(nCol);
-
-        for(size_t j = 0; j < nCol; ++j)
-        {
-            double tv;
-
-            if (coil::stringTo(tv, strCol[j].c_str()))
-            {
-                v[i][j] = tv;
-            }
-        }
-    }
-  
-    return is;
-}
-
-/*!
- * @brief constructor
- * @param manager Maneger Object
- */
-Affine::Affine(RTC::Manager* manager)
-    // <rtc-template block="initializer">
-  : RTC::DataFlowComponentBase(manager),
-    m_image_origIn("original_image", m_image_orig),
-    m_image_affineOut("affined_image", m_image_affine),
-    m_in_height(0),
-    m_in_width(0)
-
-    // </rtc-template>
-{
-}
-
-/*!
- * @brief destructor
- */
-Affine::~Affine()
-{
-}
-
-
-
-RTC::ReturnCode_t Affine::onInitialize()
-{
-  // Registration: InPort/OutPort/Service
-  // <rtc-template block="registration">
-  // Set InPort buffers
-  addInPort("original_image", m_image_origIn);
-  
-  // Set OutPort buffer
-  addOutPort("affined_image", m_image_affineOut);
-  
-  // Set service provider to Ports
-  
-  // Set service consumers to Ports
-  
-  // Set CORBA Service Ports
-  
-  // </rtc-template>
-
-  // <rtc-template block="bind_config">
-  // Bind variables and configuration variable
-  bindParameter("affine_matrix", m_ve2dbMatrix, "0.825,-0.167,40;-0.1,0.83,30");
-  // </rtc-template>
-  
-  return RTC::RTC_OK;
-}
-
-/*
-RTC::ReturnCode_t Affine::onFinalize()
-{
-  return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t Affine::onStartup(RTC::UniqueId ec_id)
-{
-  return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t Affine::onShutdown(RTC::UniqueId ec_id)
-{
-  return RTC::RTC_OK;
-}
-*/
-
-
-RTC::ReturnCode_t Affine::onActivated(RTC::UniqueId ec_id)
-{
-    // ƒCƒ[ƒW—pƒƒ‚ƒŠ‚ÌŠm•Û
-    m_affineMatrix     = cvCreateMat( 2, 3, CV_32FC1);
-
-    m_in_height  = 0;
-    m_in_width   = 0;
-
-    m_image_buff = NULL;
-    m_image_dest = NULL; 
-
-    return RTC::RTC_OK;
-}
-
-
-RTC::ReturnCode_t Affine::onDeactivated(RTC::UniqueId ec_id)
-{
-    if(m_image_buff       != NULL)
-        cvReleaseImage(&m_image_buff);
-    if(m_image_dest         != NULL)
-        cvReleaseImage(&m_image_dest);
-
-    cvReleaseMat(&m_affineMatrix);
-
-    return RTC::RTC_OK;
-}
-
-
-RTC::ReturnCode_t Affine::onExecute(RTC::UniqueId ec_id)
-{    
-    // Common CV actions
-    // V‚µ‚¢ƒf[ƒ^‚̃`ƒFƒbƒN
-    if (m_image_origIn.isNew()) 
-    {
-        // InPortƒf[ƒ^‚̓ǂݍž‚Ý
-        m_image_origIn.read();
-
-        // ƒTƒCƒY‚ª•Ï‚í‚Á‚½‚Æ‚«‚¾‚¯Ä¶¬‚·‚é
-        if(m_in_height != m_image_orig.height || m_in_width != m_image_orig.width)
-        {
-            printf("[onExecute] Size of input image is not match!\n");
-
-            m_in_height = m_image_orig.height;
-            m_in_width  = m_image_orig.width;
-            
-            if(m_image_buff       != NULL)
-                cvReleaseImage(&m_image_buff);
-            if(m_image_dest         != NULL)
-                cvReleaseImage(&m_image_dest);
-
-
-            // ƒTƒCƒY•ÏŠ·‚Ì‚½‚ßTempƒƒ‚ƒŠ[‚ð‚æ‚¢‚·‚é
-	        m_image_buff = cvCreateImage(cvSize(m_in_width, m_in_height), IPL_DEPTH_8U, 3);
-	        m_image_dest = cvCreateImage(cvSize(m_in_width, m_in_height), IPL_DEPTH_8U, 3);
-        }
-
-        // InPort‚̉摜ƒf[ƒ^‚ðIplImage‚ÌimageData‚ɃRƒs[
-        memcpy(m_image_buff->imageData,(void *)&(m_image_orig.pixels[0]),m_image_orig.pixels.length());
-
-        // Anternative actions
-
-    	//	•ÏŠ·Œã‚̍À•W‚ðÝ’è‚·‚é
-        // Check configuration validations
-        if(isConfigurationValidated())
-        {
-            cvmSet(m_affineMatrix, 0, 0, m_ve2dbMatrix[0][0]);
-            cvmSet(m_affineMatrix, 0, 1, m_ve2dbMatrix[0][1]);
-            cvmSet(m_affineMatrix, 0, 2, m_ve2dbMatrix[0][2]);
-            cvmSet(m_affineMatrix, 1, 0, m_ve2dbMatrix[1][0]);
-            cvmSet(m_affineMatrix, 1, 1, m_ve2dbMatrix[1][1]);
-            cvmSet(m_affineMatrix, 1, 2, m_ve2dbMatrix[1][2]);            
-        }else
-        {
-            cout<<"ƒRƒ“ƒtƒBƒOƒŒ[ƒVƒ‡ƒ“î•ñ‚ª³‚µ‚­‚ ‚è‚Ü‚¹‚ñB"<<endl;
-
-            return RTC::RTC_ERROR;
-        }
-        
-        //	•ÏŠ·s—ñ‚𔽉f‚³‚¹‚é
-	    cvWarpAffine( m_image_buff, m_image_dest, m_affineMatrix, CV_INTER_LINEAR | CV_WARP_FILL_OUTLIERS, cvScalarAll(0));
-
-        // ‰æ‘œƒf[ƒ^‚̃TƒCƒYŽæ“¾
-        int len = m_image_dest->nChannels * m_image_dest->width * m_image_dest->height;
-
-        // ‰æ–ʂ̃TƒCƒYî•ñ‚ð“ü‚ê‚é
-        m_image_affine.pixels.length(len);        
-        m_image_affine.width  = m_image_dest->width;
-        m_image_affine.height = m_image_dest->height;
-
-        // ”½“]‚µ‚½‰æ‘œƒf[ƒ^‚ðOutPort‚ɃRƒs[
-        memcpy((void *)&(m_image_affine.pixels[0]), m_image_dest->imageData,len);
-
-        // ”½“]‚µ‚½‰æ‘œƒf[ƒ^‚ðOutPort‚©‚ço—Í‚·‚éB
-        m_image_affineOut.write();
-    }
-
-    return RTC::RTC_OK;
-}
-
-/*
-RTC::ReturnCode_t Affine::onAborting(RTC::UniqueId ec_id)
-{
-  return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t Affine::onError(RTC::UniqueId ec_id)
-{
-  return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t Affine::onReset(RTC::UniqueId ec_id)
-{
-  return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t Affine::onStateUpdate(RTC::UniqueId ec_id)
-{
-  return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t Affine::onRateChanged(RTC::UniqueId ec_id)
-{
-  return RTC::RTC_OK;
-}
-*/
-
-// Martix‚̃TƒCƒY‚¾‚¯ƒ`ƒFƒbƒN‚·‚é
-bool Affine::isConfigurationValidated()
-{
-    // Affine‚ÌMartix‚̃TƒCƒY‚Í2*3
-    if(m_ve2dbMatrix.size() < 2)
-        return false;
-
-    if(m_ve2dbMatrix[0].size() < 3)
-        return false;
-    if(m_ve2dbMatrix[1].size() < 3)
-        return false;
-
-    return true;
-}
-
-
-
-extern "C"
-{
- 
-  void AffineInit(RTC::Manager* manager)
-  {
-    coil::Properties profile(affine_spec);
-    manager->registerFactory(profile,
-                             RTC::Create<Affine>,
-                             RTC::Delete<Affine>);
-  }
-  
-};
-
-
+// -*- C++ -*-
+/*!
+ * @file  Affine.cpp
+ * @brief Affine image component
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#include "Affine.h"
+#include <iostream>
+
+using namespace std;
+
+
+// Module specification
+// <rtc-template block="module_spec">
+static const char* affine_spec[] =
+  {
+    "implementation_id", "Affine",
+    "type_name",         "Affine",
+    "description",       "Affine image component",
+    "version",           "1.1.0",
+    "vendor",            "AIST",
+    "category",          "Category",
+    "activity_type",     "PERIODIC",
+    "kind",              "DataFlowComponent",
+    "max_instance",      "1",
+    "language",          "C++",
+    "lang_type",         "compile",
+    // Configuration variables
+    "conf.default.affine_matrix", "0.825,-0.167,40;-0.1,0.83,30",
+    // Widget
+    "conf.__widget__.affine_matrix", "text",
+    // Constraints
+    ""
+  };
+// </rtc-template>
+
+std::istream& operator>>(std::istream& is, std::vector<std::vector<double> >& v)
+{
+    size_t nRow, nCol;
+    std::string strOrig;
+    std::vector<std::string> strRow;
+    std::vector<std::string> strCol;
+
+    is >> strOrig;
+
+    strRow = coil::split(strOrig ,";");
+    nRow = strRow.size();
+    v.resize(nRow);
+    
+    for(size_t i = 0; i < nRow; ++i)
+    {
+
+        strCol = coil::split(strRow[i] ,",");
+        nCol = strCol.size();
+        v[i].resize(nCol);
+
+        for(size_t j = 0; j < nCol; ++j)
+        {
+            double tv;
+
+            if (coil::stringTo(tv, strCol[j].c_str()))
+            {
+                v[i][j] = tv;
+            }
+        }
+    }
+  
+    return is;
+}
+
+/*!
+ * @brief constructor
+ * @param manager Maneger Object
+ */
+Affine::Affine(RTC::Manager* manager)
+    // <rtc-template block="initializer">
+  : RTC::DataFlowComponentBase(manager),
+    m_image_origIn("original_image", m_image_orig),
+    m_image_affineOut("affined_image", m_image_affine),
+    m_in_height(0),
+    m_in_width(0)
+
+    // </rtc-template>
+{
+}
+
+/*!
+ * @brief destructor
+ */
+Affine::~Affine()
+{
+}
+
+
+
+RTC::ReturnCode_t Affine::onInitialize()
+{
+  // Registration: InPort/OutPort/Service
+  // <rtc-template block="registration">
+  // Set InPort buffers
+  addInPort("original_image", m_image_origIn);
+  
+  // Set OutPort buffer
+  addOutPort("affined_image", m_image_affineOut);
+  
+  // Set service provider to Ports
+  
+  // Set service consumers to Ports
+  
+  // Set CORBA Service Ports
+  
+  // </rtc-template>
+
+  // <rtc-template block="bind_config">
+  // Bind variables and configuration variable
+  bindParameter("affine_matrix", m_ve2dbMatrix, "0.825,-0.167,40;-0.1,0.83,30");
+  // </rtc-template>
+  
+  return RTC::RTC_OK;
+}
+
+/*
+RTC::ReturnCode_t Affine::onFinalize()
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t Affine::onStartup(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t Affine::onShutdown(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+
+RTC::ReturnCode_t Affine::onActivated(RTC::UniqueId ec_id)
+{
+  /* イメージ用メモリの確保 */
+  m_affineMatrix     = cvCreateMat( 2, 3, CV_32FC1);
+
+  m_in_height  = 0;
+  m_in_width   = 0;
+
+  m_image_buff = NULL;
+  m_image_dest = NULL; 
+
+  return RTC::RTC_OK;
+}
+
+
+RTC::ReturnCode_t Affine::onDeactivated(RTC::UniqueId ec_id)
+{
+  if(m_image_buff != NULL)
+      cvReleaseImage(&m_image_buff);
+  if(m_image_dest != NULL)
+      cvReleaseImage(&m_image_dest);
+
+  cvReleaseMat(&m_affineMatrix);
+
+  return RTC::RTC_OK;
+}
+
+
+RTC::ReturnCode_t Affine::onExecute(RTC::UniqueId ec_id)
+{    
+  /* Common CV actions */
+  /* 新しいデータのチェック */
+  if (m_image_origIn.isNew()) 
+  {
+    /* InPortデータの読み込み */
+    m_image_origIn.read();
+
+    /* サイズが変わったときだけ再生成する */
+    if(m_in_height != m_image_orig.height || m_in_width != m_image_orig.width)
+    {
+      printf("[onExecute] Size of input image is not match!\n");
+
+      m_in_height = m_image_orig.height;
+      m_in_width  = m_image_orig.width;
+
+      if(m_image_buff != NULL)
+        cvReleaseImage(&m_image_buff);
+      if(m_image_dest != NULL)
+        cvReleaseImage(&m_image_dest);
+
+      /* サイズ変換のためTempメモリーを用意する */
+      m_image_buff = cvCreateImage(cvSize(m_in_width, m_in_height), IPL_DEPTH_8U, 3);
+      m_image_dest = cvCreateImage(cvSize(m_in_width, m_in_height), IPL_DEPTH_8U, 3);
+    }
+
+    /* InPortの画像データをIplImageのimageDataにコピー */
+    memcpy(m_image_buff->imageData,(void *)&(m_image_orig.pixels[0]),m_image_orig.pixels.length());
+
+   	/* 変換後の座標を設定する */
+    // Check configuration validations
+    if(isConfigurationValidated())
+    {
+      cvmSet(m_affineMatrix, 0, 0, m_ve2dbMatrix[0][0]);
+      cvmSet(m_affineMatrix, 0, 1, m_ve2dbMatrix[0][1]);
+      cvmSet(m_affineMatrix, 0, 2, m_ve2dbMatrix[0][2]);
+      cvmSet(m_affineMatrix, 1, 0, m_ve2dbMatrix[1][0]);
+      cvmSet(m_affineMatrix, 1, 1, m_ve2dbMatrix[1][1]);
+      cvmSet(m_affineMatrix, 1, 2, m_ve2dbMatrix[1][2]);            
+    }else
+    {
+      cout<<"コンフィグレーション情報が正しくありません。"<<endl;
+
+      return RTC::RTC_ERROR;
+    }
+        
+    /* 変換行列を反映させる */
+    cvWarpAffine( m_image_buff, m_image_dest, m_affineMatrix, CV_INTER_LINEAR | CV_WARP_FILL_OUTLIERS, cvScalarAll(0));
+
+    /* 画像データのサイズ取得 */
+    int len = m_image_dest->nChannels * m_image_dest->width * m_image_dest->height;
+
+    /* 画面のサイズ情報を入れる */
+    m_image_affine.pixels.length(len);        
+    m_image_affine.width  = m_image_dest->width;
+    m_image_affine.height = m_image_dest->height;
+
+    /* 反転した画像データをOutPortにコピー */
+    memcpy((void *)&(m_image_affine.pixels[0]), m_image_dest->imageData,len);
+
+    /* 反転した画像データをOutPortから出力する */
+    m_image_affineOut.write();
+  }
+
+  return RTC::RTC_OK;
+}
+
+/*
+RTC::ReturnCode_t Affine::onAborting(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t Affine::onError(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t Affine::onReset(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t Affine::onStateUpdate(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t Affine::onRateChanged(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/* Martixのサイズだけチェックする */
+bool Affine::isConfigurationValidated()
+{
+  /* AffineのMartixのサイズは2*3 */
+  if(m_ve2dbMatrix.size() < 2)
+    return false;
+
+  if(m_ve2dbMatrix[0].size() < 3)
+    return false;
+  if(m_ve2dbMatrix[1].size() < 3)
+    return false;
+
+  return true;
+}
+
+
+
+extern "C"
+{
+ 
+  void AffineInit(RTC::Manager* manager)
+  {
+    coil::Properties profile(affine_spec);
+    manager->registerFactory(profile,
+                             RTC::Create<Affine>,
+                             RTC::Delete<Affine>);
+  }
+  
+};
+
+

Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/src/CMakeLists.txt
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/src/CMakeLists.txt	2013-11-29 06:25:56 UTC (rev 105)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/Affine/src/CMakeLists.txt	2014-03-12 07:49:18 UTC (rev 106)
@@ -49,14 +49,20 @@
   ${comp_srcs} ${comp_headers} ${ALL_IDL_SRCS})
 target_link_libraries(${PROJECT_NAME}Comp ${OPENRTM_LIBRARIES} ${OpenCV_LIBS})
 
+#install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}Comp
+#    EXPORT ${PROJECT_NAME}
+#    RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT component
+#    LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT component
+#    ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT component)
+#install(EXPORT ${PROJECT_NAME}
+#    DESTINATION ${LIB_INSTALL_DIR}/${PROJECT_NAME}
+#    FILE ${PROJECT_NAME}Depends.cmake)
 install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}Comp
     EXPORT ${PROJECT_NAME}
-    RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT component
-    LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT component
-    ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT component)
-install(EXPORT ${PROJECT_NAME}
-    DESTINATION ${LIB_INSTALL_DIR}/${PROJECT_NAME}
-    FILE ${PROJECT_NAME}Depends.cmake)
+    RUNTIME DESTINATION ${INSTALL_PREFIX} COMPONENT component
+    LIBRARY DESTINATION ${INSTALL_PREFIX} COMPONENT component
+    ARCHIVE DESTINATION ${INSTALL_PREFIX} COMPONENT component)
+
 
 if (SolutionDir)
   if (MSVC)



More information about the openrtm-commit mailing list