2013년 12월 19일 목요일

PCA in PCL


/////////////////////////////////////////////////////////////////////////////////////////
template bool
pcl::PCA::initCompute ()
{
  if(!Base::initCompute ())
  {
    PCL_THROW_EXCEPTION (InitFailedException, "[pcl::PCA::initCompute] failed");
    return (false);
  }
  if(indices_->size () < 3)
  {
    PCL_THROW_EXCEPTION (InitFailedException, "[pcl::PCA::initCompute] number of points < 3");
    return (false);
  }

  // Compute mean
  mean_ = Eigen::Vector4f::Zero ();
  compute3DCentroid (*input_, *indices_, mean_);
  // Compute demeanished cloud
  Eigen::MatrixXf cloud_demean;
  demeanPointCloud (*input_, *indices_, mean_, cloud_demean);
  assert (cloud_demean.cols () == int (indices_->size ()));
  // Compute the product cloud_demean * cloud_demean^T
  Eigen::Matrix3f alpha = cloud_demean.topRows<3> () * cloud_demean.topRows<3> ().transpose ();

  // Compute eigen vectors and values
  Eigen::SelfAdjointEigenSolver evd (alpha);
  // Organize eigenvectors and eigenvalues in ascendent order
  for (int i = 0; i < 3; ++i)
  {
    eigenvalues_[i] = evd.eigenvalues () [2-i];
    eigenvectors_.col (i) = evd.eigenvectors ().col (2-i);
  }
  // If not basis only then compute the coefficients

  if (!basis_only_)
    coefficients_ = eigenvectors_.transpose() * cloud_demean.topRows<3> ();
  compute_done_ = true;
  return (true);
}



from /opt/ros/fuerte/include/pcl-1.5/pcl/common/impl/pca.hpp


2013년 12월 16일 월요일

생각대로



저렇게 긍정적으로 생각해야겠지? 

2013년 12월 12일 목요일

Z-Y-X Euler Angles

Z-Y-X Euler Angles
Z-Y-X Euler Angles (or X-Y-Z fixed angles)
Rx'y'z' (a,b,c) =

[ cos(a)*cos(b), cos(a)*sin(b)*sin(c) - cos(c)*sin(a), sin(a)*sin(c) + cos(a)*cos(c)*sin(b)]
[ cos(b)*sin(a), cos(a)*cos(c) + sin(a)*sin(b)*sin(c), cos(c)*sin(a)*sin(b) - cos(a)*sin(c)]
[       -sin(b),                        cos(b)*sin(c),                        cos(b)*cos(c)]



X-Y-Z Euler Angles
Rz'y'x' (a,b,c) =

[                        cos(b)*cos(c),                       -cos(b)*sin(c),         sin(b)]
[ cos(a)*sin(c) + cos(c)*sin(a)*sin(b), cos(a)*cos(c) - sin(a)*sin(b)*sin(c), -cos(b)*sin(a)]
[ sin(a)*sin(c) - cos(a)*cos(c)*sin(b), cos(c)*sin(a) + cos(a)*sin(b)*sin(c),  cos(a)*cos(b)]



Rz'y'x' (c,b,a) =
[                        cos(a)*cos(b),                       -cos(b)*sin(a),         sin(b)]
[ cos(c)*sin(a) + cos(a)*sin(b)*sin(c), cos(a)*cos(c) - sin(a)*sin(b)*sin(c), -cos(b)*sin(c)]
[ sin(a)*sin(c) - cos(a)*cos(c)*sin(b), cos(a)*sin(c) + cos(c)*sin(a)*sin(b),  cos(b)*cos(c)]




2013년 10월 31일 목요일

Nikola Tesla

“If you want to find the secrets of the universe, think in terms of energy, frequency and vibration.”


― Nikola Tesla

2013년 10월 27일 일요일

ARCBALL




회전축과 회전각도를 결정하여 회전 Quaternion 을 구해냄.
마우스 입력으로 3차원 회전축과 각도를 어떻게 결정하는지 알면 끝.
현재점과 anchor 점을 결정할 때 2D 입력을 spherical mapping을 사용하여 3D Vector로 mapping.

본 논문 : 
ARCBALL: a user interface for specifying three-dimensional orientation using a mouse
http://dl.acm.org/citation.cfm?id=155312

2013년 10월 25일 금요일

예쁜 구름

지난 10월초 유럽의 어느 하늘 위. 

2013년 10월 24일 목요일

#pragma warning(disable : 4244)


#if (_MSC_VER)      
// make microsoft visual studio complain less about double / float conversion.
#pragma warning(disable : 4244)
#endif


ofQuaternion.h 에서 참고


2013년 10월 20일 일요일

Take Screenshot After Some Delay: gnome-screenshot


$ gnome-screenshot -w -d 2

 -d 2 is used for delaying the screenshot for 2 seconds. So within the 2 seconds, we can make the window which we want to take screenshot as active.

2013년 9월 1일 일요일

Lifelines



Lifelines of referenced historical figures

꼭지점 필터

솔리드 웍스 작업중에 자꾸 켜지는 꼭지점 필터.


Curvature

Geometry perception 과 관련하여:
Larger curves explored by touching multiple points, whether statically or dynamically, appear to be judged by the difference in local slope at different points of contact (Pont, 1997; Pont, Kappers, & Koenderink, 1999).
from Lederman, Susan J., and Roberta L. Klatzky. "Haptic perception: A tutorial." Attention, Perception, & Psychophysics 71.7 (2009): 1439-1459.


Pont, S. C. (1997). Haptic curvature comparison. Unpublished doctoral
dissertation, Helmholz Instituut, Utrecht.

Pont, S. C., Kappers, A. M. L., & Koenderink, J. J. (1999). Similar mechanisms underlie curvature comparison by static and dynamic touch. Perception & Psychophysics, 61, 874-894.


2013년 8월 27일 화요일

수요일 알리미

"매번 벌써 수요일인가?" 라는 생각을 하게하는 수요일 알리미. 



myDAQ

좋은 세상이구나~

2013년 8월 26일 월요일

Eigenvalues of rotation matrix : 0~180 degrees

Eigenvalue의 의미를 보여주는 그래프. y축은 imaginary axis.


추가 1)
When an n×n rotation matrix, Q, does not include −1 as an eigenvalue, so that none of the planar rotations of which it is composed are 180° rotations, then Q+I is an invertible matrix. Most rotation matrices fit this description.




천불동 계곡

사진기로는 담기 힘들었던 천불동 계곡. 
우리나라를 다시보게 만든다.



잘 보면 사람 얼굴같은 바위


2013년 8월 13일 화요일

Leap motion

Leap Motion 설치 완료. 두둥

2013년 8월 8일 목요일

sensor_msgs/JointState - ROS


Raw message definition:

string[] name
float64[] position
float64[] velocity
float64[] effort

# This is a message that holds data to describe the state of a set of torque controlled joints. 
#
# The state of each joint (revolute or prismatic) is defined by:
#  * the position of the joint (rad or m),
#  * the velocity of the joint (rad/s or m/s) and 
#  * the effort that is applied in the joint (Nm or N).
#
# Each joint is uniquely identified by its name
# The header specifies the time at which the joint states were recorded. All the joint states
# in one message have to be recorded at the same time.
#
# This message consists of a multiple arrays, one for each part of the joint state. 
# The goal is to make each of the fields optional. When e.g. your joints have no
# effort associated with them, you can leave the effort array empty. 
#
# All arrays in this message should have the same size, or be empty.
# This is the only way to uniquely associate the joint name with the correct
# states.

from http://www.ros.org/doc/api/sensor_msgs/html/msg/JointState.html

2013년 7월 31일 수요일

금산

하늘과 너무 잘 어울리는 간판

몇몇 집은 열었지만
 
찾아간 날은 정기휴일 !
 

삼계탕집에서 인삼주가 신기한 도로시




2013년 7월 15일 월요일

jebns

처음에 jebns가 뭔가 했다.




.....sugar

2013년 7월 14일 일요일

getGaussianKernel

getGaussianKernel : Returns Gaussian filter coefficients.
getGaussianKernel(int ksize, double sigma, int ktype=CV_64F )

ksize – Aperture size. It should be odd ( \texttt{ksize} \mod 2 = 1 ) and positive.
sigma – Gaussian standard deviation. If it is non-positive, it is computed from ksize as sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8 .
ktype – Type of filter coefficients. It can be CV_32f or CV_64F .



int M = 101;
double sigma = 10;
Mat_ g = getGaussianKernel(M, sigma, CV_64F);

for(int i=0; i
{
double g1 = g(i,0);
Dbg("%f", g1);
}

Mat_ 접근
// more convenient forms of row and element access operators 
    _Tp* operator [](int y);
    const _Tp* operator [](int y) const;

    _Tp& operator ()(int row, int col);
    const _Tp& operator ()(int row, int col) const;
    _Tp& operator ()(Point pt);
    const _Tp& operator ()(Point pt) const;


아래는 http://bytefish.de/blog/opencv/code_snippets/ 에서 가져옴

template
void printMat(const cv::Mat_<_tp>& mat) {
    typedef typename DataType<_tp>::work_type _wTp;
    for(int i = 0; i < mat.rows; i++)
        for(int j=0; j < mat.cols; j++)
            cout << (_wTp) mat(i,j) << " ";
    cout << endl;
}



2013년 6월 20일 목요일

Typical orbits

회전체 모드해석 수업때 이종원 교수님 강의 중 나온 내용.
Matlab으로 그려본 것.
그림만 봐도 spectrum 해석하기 이전에 분석할 수 있음.


Hypocycloid

Hypotrochoid

Epitrochoid

Epitrochoid 와 Hypotrochoid에 대한 추가 문서 : http://www.durangobill.com/Trochoids.html


2013년 6월 18일 화요일

귀여운 이모티콘



누가 그렸는지 볼때마다 참 잘했다는 생각이드는 카카오톡 이모티콘

2013년 6월 15일 토요일

iOS에서 OpenCV 2.4.5 linking


iOS에서 OpenCV 2.4.5 linking 할때 생기는 에러.

std::__1::__vector_base_common::__throw_length_error() const", referenced from:

libc++ .dylib 넣으면 됨.

---------------------------------------------------------------
from http://libcxx.llvm.org/

libc++ is a new implementation of the C++ standard library, targeting C++11.
All of the code in libc++ is dual licensed under the MIT license and the UIUC License (a BSD-like license).

Features and Goals
  • Correctness as defined by the C++11 standard.
  • Fast execution.
  • Minimal memory use.
  • Fast compile times.
  • ABI compatibility with gcc's libstdc++ for some low-level features such as exception objects, rtti and memory allocation.
  • Extensive unit tests.





2013년 6월 14일 금요일

물수제비..
쿠시야 이 호수 이름이 뭐였지?

2013년 5월 11일 토요일

Moka Express

뮌헨의 어느 백화점에서 쿠시의 추천으로 구매한 40 유로짜리 Moka Express
색다른 맛의 커피를 느낄수 있을까? ㅎㅎ



2013년 1월 16일 수요일

나트륨



많이도 먹는구나 ㅎㅎ