블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
  • total
  • today
  • yesterday

Category

'photometric stereo'에 해당되는 글 4건

  1. 2009.06.10 photometric stereo 2009-06-10
  2. 2009.06.08 Photometric stereo 2009-06-07
  3. 2009.06.05 Photometric stereo 2009-06-05
  4. 2009.05.15 photometric stereo 2009-05-15
2009. 6. 10. 17:07 Computer Vision

To do: to calculate depths for the surface reconstruction

ref.
P. D. Kovesi.   MATLAB and Octave Functions for Computer Vision and Image Processing.
School of Computer Science & Software Engineering,
The University of Western Australia.   Available from:
<http://www.csse.uwa.edu.au/~pk/research/matlabfns/>.

 

 

'Computer Vision' 카테고리의 다른 글

Linear Least Squares  (0) 2009.07.03
Reinhard Diestel <Graph Theory>  (0) 2009.06.16
Photometric stereo 2009-06-07  (0) 2009.06.08
Photometric stereo 2009-06-05  (0) 2009.06.05
photometric stereo 2009-05-15  (0) 2009.05.15
posted by maetel
2009. 6. 8. 15:17 Computer Vision
To do: Surface shape reconstruction
: Least squares surface fitting




- path integration
- least squares optimization
- Lucas-Kanade algorithm

http://mathworld.wolfram.com/LeastSquaresFitting.html


 /* We want to solve Mz = v in a least squares sense.  The
    solution is M^T M z = M^T v.  We denote M^T M as A and
    M^T v as b, so A z = b. */

 CMatrixSparse<double> A(M.mTm());
    assert(A.isSymmetric());
    CVector<double> r = A*z;  /* r is the "residual error" */
    CVector<double> b(v*M);

 // solve the equation A z = b
    solveQuadratic<double>(A,b,z,300,CGEPSILON);

 // copy the depths back from the vector z into the image depths
    copyDepths(z,zind,depths);


 

template <class T>
double solveQuadratic(const CMatrixSparse<T> & A, const CVector<T> & b,
       CVector<T> & x,int i_max, double epsilon)
{
  //my conjugate gradient solver for .5*x'*A*x -b'*x, based on the
  // tutorial by Jonathan Shewchuk  (or is it +b'*x?)
 
  printf("Performing conjugate gradient optimization\n");

  int numvars = x.Length();
  assert(b.Length() == numvars && A.rows() == numvars &&
  A.columns() == numvars);

  int i =0;

  CVector<T> r = b-A*x;
  CVector<T> d= r;
  double delta_new = r.dot(r);
  double delta_0 = delta_new;

  int numrecompute = (int)floor(sqrt(float(numvars)));
  //int numrecompute = 1;
  printf("numrecompute = %d\n",numrecompute);

  printf("delta_new = %f\n", delta_new);
  while (i < i_max && delta_new > epsilon)//epsilon*epsilon*delta_0)
    {
      printf("Step %d, delta_new = %f      \r",i,delta_new);
     
      CVector<T> q = A*d;
      double alpha = delta_new/d.dot(q);
      x.daxpy(d,alpha); //      x += d*alpha;
      if (i % numrecompute == 0)
 {
   //   printf(" ** recompute\n");
   r = b-A*x;
 }
      else
 r.daxpy(q,-alpha); //  r = r-q*alpha;
      double delta_old = delta_new;
      delta_new = r.dot(r);
      double beta = delta_new/delta_old;
      d = r+d*beta;
      i++;
    }

  return delta_new;
  //  return delta_new <= epsilon;
  //  return !(delta_new > epsilon*epsilon*delta_0);
}










 

'Computer Vision' 카테고리의 다른 글

Reinhard Diestel <Graph Theory>  (0) 2009.06.16
photometric stereo 2009-06-10  (0) 2009.06.10
Photometric stereo 2009-06-05  (0) 2009.06.05
photometric stereo 2009-05-15  (0) 2009.05.15
Criminisi, Reid, Zisserman <Single View Metrology>  (0) 2009.05.06
posted by maetel
2009. 6. 5. 15:49 Computer Vision

To do: draw a needle map

ref. Washington University's source code:  


http://opencv.willowgarage.com/wiki/CxCore#CurvesandShapes

Line

Draws a line segment connecting two points

void cvLine( CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color,
             int thickness=1, int line_type=8, int shift=0 );
img
The image.
pt1
First point of the line segment.
pt2
Second point of the line segment.
color
Line color.
thickness
Line thickness.
line_type
Type of the line:
  • 8 (or omitted) - 8-connected line.

  • 4 - 4-connected line.

  • CV_AA - antialiased line.

shift
Number of fractional bits in the point coordinates.

The function cvLine draws the line segment between pt1 and pt2 points in the image. The line is clipped by the image or ROI rectangle. For non-antialiased lines with integer coordinates the 8-connected or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased lines are drawn using Gaussian filtering. To specify the line color, the user may use the macro CV_RGB( r, g, b ).



'Computer Vision' 카테고리의 다른 글

photometric stereo 2009-06-10  (0) 2009.06.10
Photometric stereo 2009-06-07  (0) 2009.06.08
photometric stereo 2009-05-15  (0) 2009.05.15
Criminisi, Reid, Zisserman <Single View Metrology>  (0) 2009.05.06
Photometric stereo 2009-05-01  (0) 2009.05.01
posted by maetel
2009. 5. 15. 21:10 Computer Vision
to do: compute surface normal vectors

TGA file format
Targa = Truevision Advanced Raster Graphics Adapter
http://en.wikipedia.org/wiki/Truevision_TGA

http://www.fileformat.info/format/tga/egff.htm

http://people.sc.fsu.edu/~burkardt/cpp_src/tga_io/tga_io.html


RLE = Run-length encoding
http://en.wikipedia.org/wiki/Run-length_encoding


openCV
http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html
lecture note
http://dasan.sejong.ac.kr/~sipark/class2008/mm/



Albedo
http://en.wikipedia.org/wiki/Albedo
In general, the albedo depends on the direction and directional distribution of incoming radiation. Exceptions are Lambertian surfaces, which scatter radiation in all directions in a cosine function, so their albedo does not depend on the incoming distribution.


typedef struct _IplImage
{
    int  nSize;             /* sizeof(IplImage) */
    int  ID;                /* version (=0)*/
    int  nChannels;         /* Most of OpenCV functions support 1,2,3 or 4 channels */
    int  alphaChannel;      /* Ignored by OpenCV */
    int  depth;             /* Pixel depth in bits: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16S,
                               IPL_DEPTH_32S, IPL_DEPTH_32F and IPL_DEPTH_64F are supported.  */
    char colorModel[4];     /* Ignored by OpenCV */
    char channelSeq[4];     /* ditto */
    int  dataOrder;         /* 0 - interleaved color channels, 1 - separate color channels.
                               cvCreateImage can only create interleaved images */
    int  origin;            /* 0 - top-left origin,
                               1 - bottom-left origin (Windows bitmaps style).  */
    int  align;             /* Alignment of image rows (4 or 8).
                               OpenCV ignores it and uses widthStep instead.    */
    int  width;             /* Image width in pixels.                           */
    int  height;            /* Image height in pixels.                          */
    struct _IplROI *roi;    /* Image ROI. If NULL, the whole image is selected. */
    struct _IplImage *maskROI;      /* Must be NULL. */
    void  *imageId;                 /* "           " */
    struct _IplTileInfo *tileInfo;  /* "           " */
    int  imageSize;         /* Image data size in bytes
                               (==image->height*image->widthStep
                               in case of interleaved data)*/
    char *imageData;        /* Pointer to aligned image data.         */
    int  widthStep;         /* Size of aligned image row in bytes.    */
    int  BorderMode[4];     /* Ignored by OpenCV.                     */
    int  BorderConst[4];    /* Ditto.                                 */
    char *imageDataOrigin;  /* Pointer to very origin of image data
                               (not necessarily aligned) -
                               needed for correct deallocation */
}
IplImage;







'Computer Vision' 카테고리의 다른 글

Photometric stereo 2009-06-07  (0) 2009.06.08
Photometric stereo 2009-06-05  (0) 2009.06.05
Criminisi, Reid, Zisserman <Single View Metrology>  (0) 2009.05.06
Photometric stereo 2009-05-01  (0) 2009.05.01
camera calibration 09-04-24  (0) 2009.04.24
posted by maetel