Showing posts with label work. Show all posts
Showing posts with label work. Show all posts

Tuesday, December 23, 2008

Serious problem

[vnl_quaterion]

I made a mistake when coding with quaterion related sections!!

the paper format [R X Y Z]

vnl coding format [X Y Z R]

damn!!!

That means I have to compare the version between vnl_quaterion and VW::QUATERION

[vnl_matrix_fixed] "fill" member related

The source of the problem is that VXL uses explicit instantiation of Templates as opposed to ITK that uses implicit instatiation. This means that in vnl you can only use types that have already been explicity instantiated in the library. If you need to use a new combination, then

you have to add the corresponding explicit instantiation. The vnl_fixed_matrix is only instantiated for a

certain number of template parameters. You will find them under: Insight/Utilities/vxl/core/vnl/Templates They are

vnl_matrix_fixed+double.1.1-.cxx
vnl_matrix_fixed+double.1.2-.cxx
vnl_matrix_fixed+double.1.3-.cxx
vnl_matrix_fixed+double.2.1-.cxx
vnl_matrix_fixed+double.2.2-.cxx
vnl_matrix_fixed+double.2.3-.cxx
vnl_matrix_fixed+double.2.4-.cxx
vnl_matrix_fixed+double.2.6-.cxx
vnl_matrix_fixed+double.3.1-.cxx
vnl_matrix_fixed+double.3.2-.cxx
vnl_matrix_fixed+double.3.3-.cxx
vnl_matrix_fixed+double.3.4-.cxx
vnl_matrix_fixed+double.3.5-.cxx
vnl_matrix_fixed+double.4.1-.cxx
vnl_matrix_fixed+double.4.2-.cxx
vnl_matrix_fixed+double.4.3-.cxx
vnl_matrix_fixed+double.4.4-.cxx
vnl_matrix_fixed+double.6.6-.cxx
vnl_matrix_fixed+float.1.2-.cxx
vnl_matrix_fixed+float.1.3-.cxx
vnl_matrix_fixed+float.2.1-.cxx
vnl_matrix_fixed+float.2.2-.cxx
vnl_matrix_fixed+float.3.1-.cxx
vnl_matrix_fixed+float.3.3-.cxx
vnl_matrix_fixed+float.3.4-.cxx
vnl_matrix_fixed+float.3.5-.cxx
vnl_matrix_fixed+float.4.3-.cxx
vnl_matrix_fixed+float.4.4-.cxx
vnl_matrix_fixed+int.2.2-.cxx
vnl_matrix_fixed+int.3.4-.cxx
vnl_matrix_fixed+vnl_bignum.3.3-.cxx
vnl_matrix_fixed+vnl_rational.3.3-.cxx
vnl_matrix_fixed_pairwise_ops.cxx
vnl_matrix_fixed_ref+double.3.3-.cxx
vnl_matrix_fixed_ref+double.3.4-.cxx
vnl_matrix_fixed_ref+float.3.3-.cxx
vnl_matrix_fixed_ref+float.3.4-.cxx

As you can see, there is no instantiation for a matrix of size over 6 x 6 which is what you seems to be trying to instantiate.

Read More...

Monday, December 8, 2008

Few problems u might possibly encounter when deriving class from base class

1. undefined reference to `vtable for XXXXXXX'

vtable means virtual table, all errors about undefined reference to vtable are caused due to virtual function in class!
This error might raised due to you declare the virtual functions which are inherited from base class in derived class without implementation.

e.g.

class Base
{
public:


Base();
virtual ~Base();

virtual void foo() = 0;
};

class Dclass : Base
{
public:

Dclass();

~Dclass();


void foo();

};

Dclass::Dclass() : Base()
{}

Dclass::~Dclass()
{}

void Dclass::foo() // will cause error if not be implemented!!!
{}

e.g


if you declare some virtual functions in xxx.h file, you must implement them(those virtual functions) after ctor implementation. or it will cause undefined reference to `vtable for XXXXXX'

Read More...

Wednesday, September 24, 2008

Coding Log

2008 08/27

  • Prymidal down sampling using Class method
    performance: ~1.8 ms @ Pentium M 1.73GHz 

2008 08/29

  • Lucas-Kanade Optical Flow tracker ( tracking 1 feature point ) 
    performance: ~0.13 0.7 ms @ Pentium M 1.73GHz

2008 09/11

  • demo:


    Drift problem is still not solved.

2008 09/14

  • when coding matrix operation in the way like matlab, must add library "libvcl.a, libvnl.a, libvnl_algo, libvnl_io.a, libvnl_xio.a" into library setting and include every header file you need.
    [ download project in C::B ]

2008 09/20 ( sequential build Log )

  • LKTracker.h & LKTracker.cpp
    • class LKTracker ( completed
      .
  • Feature_Init.h & Feature_Init.cpp
    • class Particle ( completed )
    • class FeatureInitInfo ( todo )
      .
  • identifier.h & identifier.cpp
    • class Extradata ( completed )
      .
  • ThreeDbase.h & ThreeDbase.cpp
    • class Point3D ( completed ) ( need test! )
    • namespace THREED
      .
  • function.h & function.cpp
    • some functions like Jocobian calculator and quaterion transformation ( need indentified )
      .

2008 09/21~24

  • Settings.h & Settings.cpp ( read and write control in file ) ( need? ) ( suspended )
    • class Settings
      • class Section
        .
  • Model_base.h & Model_base.cpp ( need indentification
    • class Motion_Model
    • class ThreeD_Motion_model : public Motion_Model
    • class Motion_Model_Creator
    • class Feature_Measurement_Model
    • class Fully_Initialized_Feature_Measurement_Model : public Feature_Measurement_Model
    • class Partially_Initialized_feature_measurement_Model : public Feature_Measurement_Model
    • class Feature_Measurement_Model_Creator
    • class Internal_Measure_Model
    • class Internal_Measure_Model_Creator

Read More...

Wednesday, May 23, 2007

Day record - 2007 May 23



Finally, I made it. I found out a little GOD DAMN BUG!!
That is the type of IplImage image data format is "char".That means if it is bigger than 128, while changed to "int", it will appear as a negative one. In computer vision, the range of each pixel's value is 0 ~ 255. In order to process correctly, each pixel value must be converted from (char*) to (unsigned char*) by cast for IplImage format( openCV ). Ex. unsigned char* im = (unsigned char*) IplImage->imageData;

Read More...

Tuesday, May 15, 2007

Day record - 2007 May 15



convert wxImage to IplImage by "WxImageToIplImage(const wxImage* wx_Image)"
Image processing(as the picture show above)
convert IplImage to wxImage by "IplImageToWxImage(const IplImage* cv_Image)"
Load the wxImage(processed) into my test application and show it.


/*********************************
Convert wxImage to IplImage format.
*********************************/
IplImage* GUIFrame::WxImageToIplImage(const wxImage* wx_Image)
{
if (wx_Image == NULL) return NULL ;
int nWidth = wx_Image->GetWidth () ;
int nHeight = wx_Image->GetHeight () ;
IplImage* cv_Image = NULL ;
cv_Image = cvCreateImage(cvSize(nWidth, nHeight), IPL_DEPTH_8U, 3);
char* pcvImgData = cv_Image->imageData ;
memcpy((void*)pcvImgData, (void*)wx_Image->GetData(), nWidth*nHeight*3) ;
cvCvtColor(cv_Image, cv_Image, CV_BGR2RGB); //the 2nd argument return CvArr* type
return (IplImage*)cv_Image; //must cast to IplImage* type for executing correctly.
}

/*********************************
Convert IplImage to wxImage format.
*********************************/
wxImage* GUIFrame::IplImageToWxImage(const IplImage* cv_Image)
{
if (cv_Image == NULL) return NULL ;
int nWidth = cv_Image->width ;
int nHeight = cv_Image->height;
wxImage* wx_Image = new wxImage() ;
IplImage* cv_ImageBuf = cvCreateImage (cvSize(nWidth, nHeight), IPL_DEPTH_8U, 3) ;
cvCvtColor((CvArr*)cv_Image, cv_ImageBuf, CV_BGR2RGB);
wx_Image->SetData((unsigned char*)cv_ImageBuf->imageData, nWidth, nHeight, false) ;
return wx_Image ;
}

Read More...

Monday, May 14, 2007

Day record - 2007 May 14



Build GUI interface for a really poor webcam.

  • Camera selection dialog.
  • Camera resource, format and control menu.
A simple callback function to paint 10 by 10(pixels) grid lines on each single frame.
  • callback(IplImage* image)

Read More...