2012年2月21日星期二

Linux:如何在Eclipse中使用post build

 

以前写过“自动将Visual Studio编译生成的dll和lib文件放置到不同的路径中”这篇文章(其实就是使用了Visual Studio的post build),今天我想简单介绍一下如何在Linux下在Eclipse中使用post build的方法。

首先如下图所示,设置post build。

eclipse_post_build_configurations_1

eclipse_post_build_configurations_2

在post build 中我们使用script,以下是我使用的Bash script 例子:

#!/bin/bash

# copy the exe file, if exists
# find $1 -name '*.exe'

YOUR_BIN_PATH=$YOUR_BIN_PATH
YOUR_LIB_PATH=$YOUR_LIB_PATH

# Get the file extension to decide the target folder to copy.
file_ext=${filename##*.}

filename=$1

# Based on the file extension, we copy the file to different the target folder.
if [ $file_ext = "so" ]
then
    echo "Copying dynamic library file $contain_so"
    cp -v $filename $YOUR_LIB_PATH
elif [ $file_ext = "a" ]
then
    echo "Copying static library file $contain_sa"
    cp -v $filename $YOUR_LIB_PATH
else
    echo "Copying executable file $1"
    cp -v $filename $YOUR_BIN_PATH
fi

 

延伸阅读:

1. 如何编写bash script:http://linuxconfig.org/Bash_scripting_Tutorial

2. 也许你还有兴趣知道,如何设置Eclipse的Debug configurations中的Environment,如下图所示:

eclipse_debug_configurations

2012年2月14日星期二

图像Preprocessing使用FPGA, CPU, GPU

很久没有写“数字图像处理”系列的文章,今天非常简单的介绍一下Preprocessing使用FPGA, CPU, GPU的效能。

几乎所有的标准的Preprocessing函数都可以归入以下5个主要的类别中:

  • Pixel operations: (in)homogeneous
  • Histogram or LUT based functions
  • Neighbor operations
  • Random access operations
  • Geometrical transformations

Performance(效能)是我们这里所关心的,不同的architectures(架构)适用于不同的operations(运算),例如下表所示:

Operation CPU GPU FPGA
Pixel + ++ ++
Histogram / LUT ++ - ++
Neighbor / Kernel - ++ ++
Random Access ++ - -
Geometrical Transformations + ++ -
Architecture SISD SIMD SIMD MISD