1
0
Fork 0
mirror of https://github.com/ruby-opencv/ruby-opencv synced 2023-03-27 23:22:12 -04:00

add some documents of CvMat functions

This commit is contained in:
ser1zw 2013-01-18 04:23:07 +09:00
parent c4c055f7a7
commit fba93f47ad

View file

@ -3643,18 +3643,15 @@ rb_good_features_to_track(int argc, VALUE *argv, VALUE self)
return corners; return corners;
} }
/* /*
* call-seq: * Retrieves a pixel rectangle from an image with sub-pixel accuracy.
* rect_sub_pix(<i>center[, size = self.size]</i>) -> cvmat
* *
* Retrieves pixel rectangle from image with sub-pixel accuracy. * @overload rect_sub_pix(center, size = self.size)
* Extracts pixels from <i>self</i>. * @param center [CvPoint2D32f] Floating point coordinates of the center of the extracted rectangle within
* dst(x,y) = self(x + center.x - (size.width - 1) * 0.5, y + center.y - (size.height - 1) * 0.5) * the source image. The center must be inside the image.
* where the values of pixels at non-integer coordinates are retrived using bilinear iterpolation. * @param size [CvSize] Size of the extracted patch.
* Every channel of multiple-channel images is processed independently. * @return [CvMat] Extracted patch that has the size <tt>size</tt> and the same number of channels as <tt>self</tt>.
* Whereas the rectangle center must be inside the image, the whole rectangle may be partially occludedl. * @opencv_func cvGetRectSubPix
* In this case, the replication border mode is used to get pixel values beyond the image boundaries.
*/ */
VALUE VALUE
rb_rect_sub_pix(int argc, VALUE *argv, VALUE self) rb_rect_sub_pix(int argc, VALUE *argv, VALUE self)
@ -3678,11 +3675,15 @@ rb_rect_sub_pix(int argc, VALUE *argv, VALUE self)
} }
/* /*
* call-seq: * Applies an affine transformation to an image.
* quandrangle_sub_pix(<i>map_matrix[, size = self.size]</i>) -> cvmat
* *
* Retrives pixel quadrangle from image with sub-pixel accuracy. * @overload quadrangle_sub_pix(map_matrix, size = self.size)
* Extracts pixel from <i>self</i> at sub-pixel accuracy and store them: * @param map_matrix [CvMat] 2x3 transformation matrix.
* @param size [CvSize] Size of the output image.
* @return [CvMat] Output image that has the size <tt>size</tt> and the same type as <tt>self</tt>.
* @opencv_func cvGetQuadrangleSubPix
* @note <tt>CvMat#quadrangle_sub_pix</tt> is similar to <tt>CvMat#warp_affine</tt>, but the outliers are
* extrapolated using replication border mode.
*/ */
VALUE VALUE
rb_quadrangle_sub_pix(int argc, VALUE *argv, VALUE self) rb_quadrangle_sub_pix(int argc, VALUE *argv, VALUE self)
@ -3706,21 +3707,20 @@ rb_quadrangle_sub_pix(int argc, VALUE *argv, VALUE self)
} }
/* /*
* call-seq: * Resizes an image.
* resize(<i>size[,interpolation = :linear]</i>) -> cvmat
* *
* Resize image. * @overload resize(size, interpolation = :linear)
* <i>interpolation</i> is interpolation method: * @param size [CvSize] Output image size.
* * CV_INTER_NN * @param interpolation [Symbol] Interpolation method:
* nearest-neighbor interpolation. * * <tt>CV_INTER_NN</tt> - A nearest-neighbor interpolation
* * CV_INTER_LINEAR * * <tt>CV_INTER_LINEAR</tt> - A bilinear interpolation (used by default)
* bilinear interpolation (used by default) * * <tt>CV_INTER_AREA</tt> - Resampling using pixel area relation. It may be a preferred method for
* * CV_INTER_AREA * image decimation, as it gives moire'-free results. But when the image is zoomed,
* resampling using pixel area relation. It is preferred method for image decimation that give moire-free results. * it is similar to the <tt>:nn</tt> method.
* In case of zooming it is similar to NN method. * * <tt>CV_INTER_CUBIC</tt> - A bicubic interpolation over 4x4 pixel neighborhood
* * CV_INTER_CUBIC * * <tt>CV_INTER_LANCZOS4</tt> - A Lanczos interpolation over 8x8 pixel neighborhood
* bicubic interpolation. * @return [CvMat] Output image.
* Return <i>self</i> resized image that it fits exactly to <i>size</i>. If ROI is set, the method consideres the ROI as supported as usual. * @opencv_func cvResize
*/ */
VALUE VALUE
rb_resize(int argc, VALUE *argv, VALUE self) rb_resize(int argc, VALUE *argv, VALUE self)
@ -3740,10 +3740,15 @@ rb_resize(int argc, VALUE *argv, VALUE self)
} }
/* /*
* call-seq: * Applies an affine transformation to an image.
* warp_affine(<i>map_matrix[,flags = CV_INTER_LINEAR | CV_WARP_FILL_OUTLIERS][,fillval = 0]</i>) -> cvmat
* *
* Applies affine transformation to the image. * @overload warp_affine(map_matrix, flags = CV_INTER_LINEAR | CV_WARP_FILL_OUTLIERS, fillval = 0)
* @param map_matrix [CvMat] 2x3 transformation matrix.
* @param flags [Integer] Combination of interpolation methods (#see resize) and the optional
* flag <tt>WARP_INVERSE_MAP</tt> that means that <tt>map_matrix</tt> is the inverse transformation.
* @return [CvMat] Output image that has the size <tt>size</tt> and the same type as <tt>self</tt>.
* @param fillval [Number, CvScalar] Value used in case of a constant border.
* @opencv_func cvWarpAffine
*/ */
VALUE VALUE
rb_warp_affine(int argc, VALUE *argv, VALUE self) rb_warp_affine(int argc, VALUE *argv, VALUE self)