mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
removed some unused codes, and uniformed code format
This commit is contained in:
parent
42c6f5cc37
commit
14659f0f90
39 changed files with 119 additions and 172 deletions
|
@ -312,8 +312,6 @@ void define_ruby_class()
|
|||
rb_define_singleton_method(rb_klass, "rotation_matrix2D", RUBY_METHOD_FUNC(rb_rotation_matrix2D), 3);
|
||||
rb_define_method(rb_klass, "warp_perspective", RUBY_METHOD_FUNC(rb_warp_perspective), -1);
|
||||
rb_define_singleton_method(rb_klass, "find_homography", RUBY_METHOD_FUNC(rb_find_homograpy), -1);
|
||||
//rb_define_method(rb_klass, "get_perspective_transform", RUBY_METHOD_FUNC(rb_get_perspective_transform), -1);
|
||||
//rb_define_alias(rb_klass, "warp_perspective_q_matrix", "get_perspective_transform");
|
||||
rb_define_method(rb_klass, "remap", RUBY_METHOD_FUNC(rb_remap), -1);
|
||||
//rb_define_method(rb_klass, "log_polar", RUBY_METHOD_FUNC(rb_log_polar), -1);
|
||||
|
||||
|
@ -447,29 +445,12 @@ rb_load_imageM(int argc, VALUE *argv, VALUE self)
|
|||
return OPENCV_OBJECT(rb_klass, mat);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nodoc
|
||||
*/
|
||||
VALUE
|
||||
rb_method_missing(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
/*
|
||||
const char *to_str = "\\Ato_(\\w+)";
|
||||
VALUE name, args, str[3], method;
|
||||
rb_scan_args(argc, argv, "1*", &name, &args);
|
||||
if (RARRAY_LEN(args) != 0)
|
||||
return rb_call_super(argc, argv);
|
||||
if (rb_reg_match(rb_reg_new(to_str, strlen(to_str), 0), rb_funcall(name, rb_intern("to_s"), 0)) == Qnil)
|
||||
return rb_call_super(argc, argv);
|
||||
str[0] = rb_str_new2("%s2%s");
|
||||
str[1] = rb_color_model(self);
|
||||
str[2] = rb_reg_nth_match(1, rb_backref_get());
|
||||
method = rb_f_sprintf(3, str);
|
||||
if (rb_respond_to(rb_module_opencv(), rb_intern(StringValuePtr(method))))
|
||||
return rb_funcall(rb_module_opencv(), rb_intern(StringValuePtr(method)), 1, self);
|
||||
return rb_call_super(argc, argv);
|
||||
*/
|
||||
VALUE name, args, method;
|
||||
rb_scan_args(argc, argv, "1*", &name, &args);
|
||||
method = rb_funcall(name, rb_intern("to_s"), 0);
|
||||
|
@ -877,7 +858,7 @@ rb_square_q(VALUE self)
|
|||
VALUE
|
||||
rb_to_CvMat(VALUE self)
|
||||
{
|
||||
// CvMat#to_CvMat aborts when self's class is CvMat. (I don't know why...)
|
||||
// CvMat#to_CvMat aborts when self's class is CvMat.
|
||||
if (CLASS_OF(self) == rb_klass)
|
||||
return self;
|
||||
|
||||
|
@ -1113,12 +1094,6 @@ rb_size(VALUE self)
|
|||
return cCvSize::new_object(size);
|
||||
}
|
||||
|
||||
/*
|
||||
VALUE rb_elem_type(VALUE self) {
|
||||
return INT2FIX(cvGetElemType(CVARR(self)));
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* dims -> array(int, int, ...)
|
||||
|
|
|
@ -136,8 +136,6 @@ VALUE rb_calc_covar_matrix(int argc, VALUE *argv, VALUE self);
|
|||
VALUE rb_mahalonobis(int argc, VALUE *argv, VALUE self);
|
||||
|
||||
VALUE rb_dft(int argc, VALUE *argv, VALUE self);
|
||||
//VALUE rb_optimal_dft_size(VALUE self);
|
||||
//VALUE rb_mul_spectrums(int argc, VALUE *argv, VALUE self);
|
||||
VALUE rb_dct(int argc, VALUE *argv, VALUE self);
|
||||
|
||||
/* drawing function*/
|
||||
|
@ -179,7 +177,6 @@ VALUE rb_warp_affine(int argc, VALUE *argv, VALUE self);
|
|||
VALUE rb_rotation_matrix2D(VALUE self, VALUE center, VALUE angle, VALUE scale);
|
||||
VALUE rb_warp_perspective(int argc, VALUE *argv, VALUE self);
|
||||
VALUE rb_find_homograpy(int argc, VALUE *argv, VALUE self);
|
||||
//VALUE rb_perspective_transform();
|
||||
VALUE rb_remap(int argc, VALUE *argv, VALUE self);
|
||||
VALUE rb_log_polar(int argc, VALUE *argv);
|
||||
|
||||
|
@ -218,7 +215,6 @@ VALUE rb_equalize_hist(VALUE self);
|
|||
/* Matching*/
|
||||
VALUE rb_match_template(int argc, VALUE *argv, VALUE self);
|
||||
VALUE rb_match_shapes(int argc, VALUE *argv, VALUE self);
|
||||
// VALUE rb_calc_emd(int argc, VALUE *argv, VALUE self);
|
||||
/* Object Tracking */
|
||||
VALUE rb_mean_shift(VALUE self, VALUE window, VALUE criteria);
|
||||
VALUE rb_cam_shift(VALUE self, VALUE window, VALUE criteria);
|
||||
|
|
|
@ -595,15 +595,5 @@ new_sequence(VALUE klass, CvSeq *seq, VALUE element_klass, VALUE storage)
|
|||
return Data_Wrap_Struct(klass, mark_root_object, unregister_elem_class, seq);
|
||||
}
|
||||
|
||||
VALUE
|
||||
auto_extend(VALUE object)
|
||||
{
|
||||
CvSeq *seq = CVSEQ(object);
|
||||
if (CV_IS_SEQ_POINT_SET(seq)) {
|
||||
rb_extend_object(object, mPointSet::rb_module());
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
||||
__NAMESPACE_END_CVSEQ
|
||||
__NAMESPACE_END_OPENCV
|
||||
|
|
|
@ -48,7 +48,6 @@ VALUE rb_clear(VALUE self);
|
|||
VALUE new_object(CvSeq *seq, VALUE klass);
|
||||
VALUE new_object(CvSeq *seq, VALUE klass, VALUE storage);
|
||||
VALUE new_sequence(VALUE klass, CvSeq *seq, VALUE element_klass, VALUE storage);
|
||||
VALUE auto_extend(VALUE object);
|
||||
|
||||
__NAMESPACE_END_CVSEQ
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ rb_smoothness(int argc, VALUE *argv, VALUE self)
|
|||
pFourierImage = create_fourier_image(p64DepthImage);
|
||||
}
|
||||
|
||||
Smoothness result = compute_smoothness(pFourierImage, f_lowFreqRatio, f_blankDensity, f_messyDnsity,
|
||||
Smoothness result = compute_smoothness(pFourierImage, f_lowFreqRatio, f_blankDensity, f_messyDensity,
|
||||
f_highFreqRatio, outLowDensity, outHighDensity);
|
||||
|
||||
cvReleaseImage(&pFourierImage);
|
||||
|
@ -339,7 +339,7 @@ rb_smoothness(int argc, VALUE *argv, VALUE self)
|
|||
*/
|
||||
Smoothness
|
||||
compute_smoothness(const IplImage *pFourierImage, const double lowFreqRatio, const double blankDensity,
|
||||
const double messyDensity, const double highFreqRatio, double &outLowDensity
|
||||
const double messyDensity, const double highFreqRatio, double &outLowDensity,
|
||||
double &outHighDensity)
|
||||
{
|
||||
int low, high;
|
||||
|
|
|
@ -46,18 +46,6 @@ define_ruby_module()
|
|||
rb_define_method(module, "min_enclosing_circle", RUBY_METHOD_FUNC(rb_min_enclosing_circle), 0);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_extend_object(VALUE self, VALUE object)
|
||||
{
|
||||
CvSeq *seq = 0;
|
||||
if (!rb_obj_is_kind_of(object, cCvSeq::rb_class()))
|
||||
rb_raise(rb_eTypeError, "object is not %s.\n", rb_class2name(cCvSeq::rb_class()));
|
||||
|
||||
if (!CV_IS_SEQ(seq))
|
||||
rb_raise(rb_eTypeError, "object is not sequence.");
|
||||
return rb_call_super(1, &object);
|
||||
}
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* contour_area -> float
|
||||
|
|
|
@ -28,7 +28,6 @@ VALUE rb_allocate(VALUE klass);
|
|||
|
||||
void mark(void *ptr);
|
||||
VALUE each_protect(VALUE key, VALUE value);
|
||||
//VALUE each_protect(void *key, VALUE value);
|
||||
void free(void *ptr);
|
||||
|
||||
VALUE rb_aref(VALUE klass, VALUE name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue