mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
uniformed code format
This commit is contained in:
parent
2ac67221f9
commit
42c6f5cc37
30 changed files with 144 additions and 141 deletions
|
@ -7,7 +7,7 @@
|
||||||
Copyright (C) 2005 Masakazu Yonekura
|
Copyright (C) 2005 Masakazu Yonekura
|
||||||
|
|
||||||
************************************************************/
|
************************************************************/
|
||||||
#include"curve.h"
|
#include "curve.h"
|
||||||
/*
|
/*
|
||||||
* Document-class: OpenCV::Curve
|
* Document-class: OpenCV::Curve
|
||||||
*
|
*
|
||||||
|
@ -27,7 +27,7 @@ rb_module()
|
||||||
void
|
void
|
||||||
define_ruby_module()
|
define_ruby_module()
|
||||||
{
|
{
|
||||||
if(module)
|
if (module)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
#ifndef RUBY_OPENCV_CVSEQ_CURVE_H
|
#ifndef RUBY_OPENCV_CVSEQ_CURVE_H
|
||||||
#define RUBY_OPENCV_CVSEQ_CURVE_H
|
#define RUBY_OPENCV_CVSEQ_CURVE_H
|
||||||
|
|
||||||
#include"opencv.h"
|
#include "opencv.h"
|
||||||
|
|
||||||
#define __NAMESPACE_BEGIN_CURVE namespace mCurve{
|
#define __NAMESPACE_BEGIN_CURVE namespace mCurve {
|
||||||
#define __NAMESPACE_END_CURVE }
|
#define __NAMESPACE_END_CURVE }
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
|
|
|
@ -32,7 +32,7 @@ rb_class()
|
||||||
void
|
void
|
||||||
define_ruby_class()
|
define_ruby_class()
|
||||||
{
|
{
|
||||||
if(rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
#ifndef RUBY_OPENCV_CVBOX2D_H
|
#ifndef RUBY_OPENCV_CVBOX2D_H
|
||||||
#define RUBY_OPENCV_CVBOX2D_H
|
#define RUBY_OPENCV_CVBOX2D_H
|
||||||
|
|
||||||
#include"opencv.h"
|
#include "opencv.h"
|
||||||
|
|
||||||
#define __NAMESPACE_BEGIN_CVBOX2D namespace cCvBox2D{
|
#define __NAMESPACE_BEGIN_CVBOX2D namespace cCvBox2D {
|
||||||
#define __NAMESPACE_END_CVBOX2D }
|
#define __NAMESPACE_END_CVBOX2D }
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
|
|
|
@ -26,7 +26,7 @@ rb_class()
|
||||||
void
|
void
|
||||||
define_ruby_class()
|
define_ruby_class()
|
||||||
{
|
{
|
||||||
if(rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
#ifndef RUBY_OPENCV_CVHAARCLASSIFIERCASCADE_H
|
#ifndef RUBY_OPENCV_CVHAARCLASSIFIERCASCADE_H
|
||||||
#define RUBY_OPENCV_CVHAARCLASSIFIERCASCADE_H
|
#define RUBY_OPENCV_CVHAARCLASSIFIERCASCADE_H
|
||||||
|
|
||||||
#define __NAMESPACE_BEGIN_CVHAARCLASSIFERCASCADE namespace cCvHaarClassifierCascade{
|
#define __NAMESPACE_BEGIN_CVHAARCLASSIFERCASCADE namespace cCvHaarClassifierCascade {
|
||||||
#define __NAMESPACE_END_CVHAARCLASSIFERCASCADE }
|
#define __NAMESPACE_END_CVHAARCLASSIFERCASCADE }
|
||||||
|
|
||||||
#include"opencv.h"
|
#include "opencv.h"
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
__NAMESPACE_BEGIN_CVHAARCLASSIFERCASCADE
|
__NAMESPACE_BEGIN_CVHAARCLASSIFERCASCADE
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* CvMat is basic 2D matrix class in OpenCV.
|
* CvMat is basic 2D matrix class in OpenCV.
|
||||||
*
|
*
|
||||||
* C structure is here.
|
* C structure is here.
|
||||||
* typedef struct CvMat{
|
* typedef struct CvMat {
|
||||||
* int type;
|
* int type;
|
||||||
* int step;
|
* int step;
|
||||||
* int *refcount;
|
* int *refcount;
|
||||||
|
@ -460,7 +460,7 @@ rb_method_missing(int argc, VALUE *argv, VALUE self)
|
||||||
rb_scan_args(argc, argv, "1*", &name, &args);
|
rb_scan_args(argc, argv, "1*", &name, &args);
|
||||||
if (RARRAY_LEN(args) != 0)
|
if (RARRAY_LEN(args) != 0)
|
||||||
return rb_call_super(argc, argv);
|
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)
|
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);
|
return rb_call_super(argc, argv);
|
||||||
str[0] = rb_str_new2("%s2%s");
|
str[0] = rb_str_new2("%s2%s");
|
||||||
str[1] = rb_color_model(self);
|
str[1] = rb_color_model(self);
|
||||||
|
@ -1017,7 +1017,7 @@ rb_get_cols(VALUE self, VALUE args)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* each_row{|row| ... } -> self
|
* each_row {|row| ... } -> self
|
||||||
*
|
*
|
||||||
* Calls block once for each row in self, passing that element as a parameter.
|
* Calls block once for each row in self, passing that element as a parameter.
|
||||||
*
|
*
|
||||||
|
@ -3591,7 +3591,7 @@ rb_good_features_to_track(int argc, VALUE *argv, VALUE self)
|
||||||
rb_scan_args(argc, argv, "21", &quality_level, &min_distance, &good_features_to_track_option);
|
rb_scan_args(argc, argv, "21", &quality_level, &min_distance, &good_features_to_track_option);
|
||||||
good_features_to_track_option = GOOD_FEATURES_TO_TRACK_OPTION(good_features_to_track_option);
|
good_features_to_track_option = GOOD_FEATURES_TO_TRACK_OPTION(good_features_to_track_option);
|
||||||
int np = GF_MAX(good_features_to_track_option);
|
int np = GF_MAX(good_features_to_track_option);
|
||||||
if(np <= 0)
|
if (np <= 0)
|
||||||
rb_raise(rb_eArgError, "option :max should be positive value.");
|
rb_raise(rb_eArgError, "option :max should be positive value.");
|
||||||
|
|
||||||
CvMat *self_ptr = CVMAT(self);
|
CvMat *self_ptr = CVMAT(self);
|
||||||
|
|
|
@ -27,7 +27,7 @@ rb_class()
|
||||||
void
|
void
|
||||||
define_ruby_class()
|
define_ruby_class()
|
||||||
{
|
{
|
||||||
if(rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
Copyright (C) 2005 Masakazu Yonekura
|
Copyright (C) 2005 Masakazu Yonekura
|
||||||
|
|
||||||
************************************************************/
|
************************************************************/
|
||||||
#include"cvpoint2d32f.h"
|
#include "cvpoint2d32f.h"
|
||||||
/*
|
/*
|
||||||
* Document-class: OpenCV::CvPoint2D32f
|
* Document-class: OpenCV::CvPoint2D32f
|
||||||
*
|
*
|
||||||
|
@ -34,7 +34,7 @@ rb_class()
|
||||||
void
|
void
|
||||||
define_ruby_class()
|
define_ruby_class()
|
||||||
{
|
{
|
||||||
if(rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
#ifndef RUBY_OPENCV_CVPOINT2D32F_H
|
#ifndef RUBY_OPENCV_CVPOINT2D32F_H
|
||||||
#define RUBY_OPENCV_CVPOINT2D32F_H
|
#define RUBY_OPENCV_CVPOINT2D32F_H
|
||||||
|
|
||||||
#define __NAMESPACE_BEGIN_CVPOINT2D32F namespace cCvPoint2D32f{
|
#define __NAMESPACE_BEGIN_CVPOINT2D32F namespace cCvPoint2D32f {
|
||||||
#define __NAMESPACE_END_CVPOINT2D32F }
|
#define __NAMESPACE_END_CVPOINT2D32F }
|
||||||
|
|
||||||
#include"opencv.h"
|
#include "opencv.h"
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
__NAMESPACE_BEGIN_CVPOINT2D32F
|
__NAMESPACE_BEGIN_CVPOINT2D32F
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
Copyright (C) 2005-2008 Masakazu Yonekura
|
Copyright (C) 2005-2008 Masakazu Yonekura
|
||||||
|
|
||||||
************************************************************/
|
************************************************************/
|
||||||
#include"cvpoint3d32f.h"
|
#include "cvpoint3d32f.h"
|
||||||
/*
|
/*
|
||||||
* Document-class: OpenCV::CvPoint3D32f
|
* Document-class: OpenCV::CvPoint3D32f
|
||||||
*
|
*
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
* X and Y takes the value of the Float. see also CvPoint
|
* X and Y takes the value of the Float. see also CvPoint
|
||||||
*
|
*
|
||||||
* C structure is here, very simple.
|
* C structure is here, very simple.
|
||||||
* typdef struct CvPoint3D32f{
|
* typdef struct CvPoint3D32f {
|
||||||
* float x;
|
* float x;
|
||||||
* float y;
|
* float y;
|
||||||
* float z;
|
* float z;
|
||||||
|
@ -35,7 +35,7 @@ rb_class()
|
||||||
void
|
void
|
||||||
define_ruby_class()
|
define_ruby_class()
|
||||||
{
|
{
|
||||||
if(rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
#ifndef RUBY_OPENCV_CVPOINT3D32F_H
|
#ifndef RUBY_OPENCV_CVPOINT3D32F_H
|
||||||
#define RUBY_OPENCV_CVPOINT3D32F_H
|
#define RUBY_OPENCV_CVPOINT3D32F_H
|
||||||
|
|
||||||
#define __NAMESPACE_BEGIN_CVPOINT3D32F namespace cCvPoint3D32f{
|
#define __NAMESPACE_BEGIN_CVPOINT3D32F namespace cCvPoint3D32f {
|
||||||
#define __NAMESPACE_END_CVPOINT3D32F }
|
#define __NAMESPACE_END_CVPOINT3D32F }
|
||||||
|
|
||||||
#include"opencv.h"
|
#include "opencv.h"
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
__NAMESPACE_BEGIN_CVPOINT3D32F
|
__NAMESPACE_BEGIN_CVPOINT3D32F
|
||||||
|
@ -56,7 +56,7 @@ VALUE_TO_CVPOINT3D32F(VALUE object)
|
||||||
NUM2DBL(rb_funcall(object, rb_intern("y"), 0)),
|
NUM2DBL(rb_funcall(object, rb_intern("y"), 0)),
|
||||||
NUM2DBL(rb_funcall(object, rb_intern("z"), 0)));
|
NUM2DBL(rb_funcall(object, rb_intern("z"), 0)));
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
raise_compatible_typeerror(object, cCvPoint3D32f::rb_class());
|
raise_compatible_typeerror(object, cCvPoint3D32f::rb_class());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ rb_class()
|
||||||
void
|
void
|
||||||
define_ruby_class()
|
define_ruby_class()
|
||||||
{
|
{
|
||||||
if(rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
#ifndef RUBY_OPENCV_CVRECT_H
|
#ifndef RUBY_OPENCV_CVRECT_H
|
||||||
#define RUBY_OPENCV_CVRECT_H
|
#define RUBY_OPENCV_CVRECT_H
|
||||||
|
|
||||||
#include"opencv.h"
|
#include "opencv.h"
|
||||||
|
|
||||||
#define __NAMESPACE_BEGIN_CVRECT namespace cCvRect{
|
#define __NAMESPACE_BEGIN_CVRECT namespace cCvRect {
|
||||||
#define __NAMESPACE_END_CVRECT }
|
#define __NAMESPACE_END_CVRECT }
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
|
|
|
@ -469,7 +469,7 @@ VALUE
|
||||||
rb_shift(VALUE self)
|
rb_shift(VALUE self)
|
||||||
{
|
{
|
||||||
CvSeq *seq = CVSEQ(self);
|
CvSeq *seq = CVSEQ(self);
|
||||||
if(seq->total == 0)
|
if (seq->total == 0)
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
|
||||||
VALUE object = Qnil;
|
VALUE object = Qnil;
|
||||||
|
|
|
@ -27,7 +27,7 @@ rb_class()
|
||||||
void
|
void
|
||||||
define_ruby_class()
|
define_ruby_class()
|
||||||
{
|
{
|
||||||
if(rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -34,7 +34,7 @@ rb_class()
|
||||||
void
|
void
|
||||||
define_ruby_class()
|
define_ruby_class()
|
||||||
{
|
{
|
||||||
if(rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
#ifndef RUBY_OPENCV_CVSIZE_H
|
#ifndef RUBY_OPENCV_CVSIZE_H
|
||||||
#define RUBY_OPENCV_CVSIZE_H
|
#define RUBY_OPENCV_CVSIZE_H
|
||||||
|
|
||||||
#include"opencv.h"
|
#include "opencv.h"
|
||||||
|
|
||||||
#define __NAMESPACE_BEGIN_CVSIZE namespace cCvSize{
|
#define __NAMESPACE_BEGIN_CVSIZE namespace cCvSize {
|
||||||
#define __NAMESPACE_END_CVSIZE }
|
#define __NAMESPACE_END_CVSIZE }
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
|
|
|
@ -15,10 +15,10 @@
|
||||||
* X and Y takes the value of the Float.
|
* X and Y takes the value of the Float.
|
||||||
*
|
*
|
||||||
* C structure is here, very simple.
|
* C structure is here, very simple.
|
||||||
* typdef struct CvSize2D32f{
|
* typdef struct CvSize2D32f {
|
||||||
* float width;
|
* float width;
|
||||||
* float height;
|
* float height;
|
||||||
* }CvSize2D32f;
|
* } CvSize2D32f;
|
||||||
*/
|
*/
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
__NAMESPACE_BEGIN_CVSIZE2D32F
|
__NAMESPACE_BEGIN_CVSIZE2D32F
|
||||||
|
@ -34,7 +34,7 @@ rb_class()
|
||||||
void
|
void
|
||||||
define_ruby_class()
|
define_ruby_class()
|
||||||
{
|
{
|
||||||
if(rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -33,7 +33,7 @@ rb_class()
|
||||||
void
|
void
|
||||||
define_ruby_class()
|
define_ruby_class()
|
||||||
{
|
{
|
||||||
if(rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -38,7 +38,7 @@ rb_class()
|
||||||
void
|
void
|
||||||
define_ruby_class()
|
define_ruby_class()
|
||||||
{
|
{
|
||||||
if(rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
Copyright (C) 2005-2006 Masakazu Yonekura
|
Copyright (C) 2005-2006 Masakazu Yonekura
|
||||||
|
|
||||||
************************************************************/
|
************************************************************/
|
||||||
#include"cvtermcriteria.h"
|
#include "cvtermcriteria.h"
|
||||||
/*
|
/*
|
||||||
* Document-class: OpenCV::CvTermCriteria
|
* Document-class: OpenCV::CvTermCriteria
|
||||||
*
|
*
|
||||||
|
@ -150,7 +150,7 @@ VALUE
|
||||||
rb_eps(VALUE self)
|
rb_eps(VALUE self)
|
||||||
{
|
{
|
||||||
CvTermCriteria *ptr = CVTERMCRITERIA(self);
|
CvTermCriteria *ptr = CVTERMCRITERIA(self);
|
||||||
if(ptr->type & CV_TERMCRIT_EPS)
|
if (ptr->type & CV_TERMCRIT_EPS)
|
||||||
return rb_float_new(ptr->epsilon);
|
return rb_float_new(ptr->epsilon);
|
||||||
else
|
else
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#include "opencv.h"
|
#include "opencv.h"
|
||||||
|
|
||||||
#define __NAMESPACE_BEGIN_CVTERMCRITERIA namespace cCvTermCriteria{
|
#define __NAMESPACE_BEGIN_CVTERMCRITERIA namespace cCvTermCriteria {
|
||||||
#define __NAMESPACE_END_CVTERMCRITERIA }
|
#define __NAMESPACE_END_CVTERMCRITERIA }
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
|
|
|
@ -28,7 +28,7 @@ rb_module_GUI()
|
||||||
void
|
void
|
||||||
define_ruby_module()
|
define_ruby_module()
|
||||||
{
|
{
|
||||||
if(rb_module)
|
if (rb_module)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
|
|
@ -272,25 +272,29 @@ rb_smoothness(int argc, VALUE *argv, VALUE self)
|
||||||
double outLowDensity, outHighDensity;
|
double outLowDensity, outHighDensity;
|
||||||
if (TYPE(lowFreqRatio) == T_NIL) {
|
if (TYPE(lowFreqRatio) == T_NIL) {
|
||||||
f_lowFreqRatio = 10 / 128.0f;
|
f_lowFreqRatio = 10 / 128.0f;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
Check_Type(lowFreqRatio, T_FLOAT);
|
Check_Type(lowFreqRatio, T_FLOAT);
|
||||||
f_lowFreqRatio = NUM2DBL(lowFreqRatio);
|
f_lowFreqRatio = NUM2DBL(lowFreqRatio);
|
||||||
}
|
}
|
||||||
if (TYPE(blankDensity) == T_NIL) {
|
if (TYPE(blankDensity) == T_NIL) {
|
||||||
f_blankDensity = 1.2f;
|
f_blankDensity = 1.2f;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
Check_Type(blankDensity, T_FLOAT);
|
Check_Type(blankDensity, T_FLOAT);
|
||||||
f_blankDensity = NUM2DBL(blankDensity);
|
f_blankDensity = NUM2DBL(blankDensity);
|
||||||
}
|
}
|
||||||
if (TYPE(messyDensity) == T_NIL) {
|
if (TYPE(messyDensity) == T_NIL) {
|
||||||
f_messyDensity = 0.151f;
|
f_messyDensity = 0.151f;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
Check_Type(messyDensity, T_FLOAT);
|
Check_Type(messyDensity, T_FLOAT);
|
||||||
f_messyDensity = NUM2DBL(messyDensity);
|
f_messyDensity = NUM2DBL(messyDensity);
|
||||||
}
|
}
|
||||||
if (TYPE(highFreqRatio) == T_NIL) {
|
if (TYPE(highFreqRatio) == T_NIL) {
|
||||||
f_highFreqRatio = 5 / 128.0f;
|
f_highFreqRatio = 5 / 128.0f;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
Check_Type(highFreqRatio, T_FLOAT);
|
Check_Type(highFreqRatio, T_FLOAT);
|
||||||
f_highFreqRatio = NUM2DBL(highFreqRatio);
|
f_highFreqRatio = NUM2DBL(highFreqRatio);
|
||||||
}
|
}
|
||||||
|
@ -300,30 +304,31 @@ rb_smoothness(int argc, VALUE *argv, VALUE self)
|
||||||
|
|
||||||
// the image is required to be in depth of 64
|
// the image is required to be in depth of 64
|
||||||
if (IPLIMAGE(self)->depth == 64) {
|
if (IPLIMAGE(self)->depth == 64) {
|
||||||
p64DepthImage = NULL;
|
p64DepthImage = NULL;
|
||||||
pFourierImage = create_fourier_image(IPLIMAGE(self));
|
pFourierImage = create_fourier_image(IPLIMAGE(self));
|
||||||
} else {
|
}
|
||||||
p64DepthImage = rb_cvCreateImage(cvGetSize(IPLIMAGE(self)), IPL_DEPTH_64F, 1);
|
else {
|
||||||
cvConvertScale(CVARR(self), p64DepthImage, 1.0, 0.0);
|
p64DepthImage = rb_cvCreateImage(cvGetSize(IPLIMAGE(self)), IPL_DEPTH_64F, 1);
|
||||||
pFourierImage = create_fourier_image(p64DepthImage);
|
cvConvertScale(CVARR(self), p64DepthImage, 1.0, 0.0);
|
||||||
|
pFourierImage = create_fourier_image(p64DepthImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
Smoothness result = compute_smoothness(pFourierImage, f_lowFreqRatio, f_blankDensity, f_messyDensity, f_highFreqRatio, outLowDensity, outHighDensity);
|
Smoothness result = compute_smoothness(pFourierImage, f_lowFreqRatio, f_blankDensity, f_messyDnsity,
|
||||||
|
f_highFreqRatio, outLowDensity, outHighDensity);
|
||||||
|
|
||||||
cvReleaseImage(&pFourierImage);
|
cvReleaseImage(&pFourierImage);
|
||||||
if (p64DepthImage != NULL)
|
if (p64DepthImage != NULL)
|
||||||
cvReleaseImage(&p64DepthImage);
|
cvReleaseImage(&p64DepthImage);
|
||||||
|
|
||||||
switch(result)
|
switch(result) {
|
||||||
{
|
case SMOOTH:
|
||||||
case SMOOTH:
|
return rb_ary_new3(3, ID2SYM(rb_intern("smooth")), rb_float_new(outLowDensity), rb_float_new(outHighDensity));
|
||||||
return rb_ary_new3(3, ID2SYM(rb_intern("smooth")), rb_float_new(outLowDensity), rb_float_new(outHighDensity));
|
case MESSY:
|
||||||
case MESSY:
|
return rb_ary_new3(3, ID2SYM(rb_intern("messy")), rb_float_new(outLowDensity), rb_float_new(outHighDensity));
|
||||||
return rb_ary_new3(3, ID2SYM(rb_intern("messy")), rb_float_new(outLowDensity), rb_float_new(outHighDensity));
|
case BLANK:
|
||||||
case BLANK:
|
return rb_ary_new3(3, ID2SYM(rb_intern("blank")), rb_float_new(outLowDensity), rb_float_new(outHighDensity));
|
||||||
return rb_ary_new3(3, ID2SYM(rb_intern("blank")), rb_float_new(outLowDensity), rb_float_new(outHighDensity));
|
default:
|
||||||
default:
|
return rb_ary_new3(3, NULL, rb_float_new(outLowDensity), rb_float_new(outHighDensity));
|
||||||
return rb_ary_new3(3, NULL, rb_float_new(outLowDensity), rb_float_new(outHighDensity));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,7 +338,9 @@ rb_smoothness(int argc, VALUE *argv, VALUE self)
|
||||||
* else -> good;
|
* else -> good;
|
||||||
*/
|
*/
|
||||||
Smoothness
|
Smoothness
|
||||||
compute_smoothness(const IplImage *pFourierImage, const double lowFreqRatio, const double blankDensity, const double messyDensity, const double highFreqRatio, double &outLowDensity, double &outHighDensity)
|
compute_smoothness(const IplImage *pFourierImage, const double lowFreqRatio, const double blankDensity,
|
||||||
|
const double messyDensity, const double highFreqRatio, double &outLowDensity
|
||||||
|
double &outHighDensity)
|
||||||
{
|
{
|
||||||
int low, high;
|
int low, high;
|
||||||
IplImage *filteredFourierImage;
|
IplImage *filteredFourierImage;
|
||||||
|
@ -341,10 +348,11 @@ compute_smoothness(const IplImage *pFourierImage, const double lowFreqRatio, con
|
||||||
double sum, den, totalArea;
|
double sum, den, totalArea;
|
||||||
CvScalar scalar;
|
CvScalar scalar;
|
||||||
|
|
||||||
if(! (pFourierImage->nChannels == 1 && pFourierImage->depth == 64) ) {
|
if (!(pFourierImage->nChannels == 1 && pFourierImage->depth == 64) ) {
|
||||||
cvError( CV_StsUnmatchedSizes, "compute_smoothness", "input image must contain only 1 channel and a depth of 64", __FILE__, __LINE__ );
|
cvError(CV_StsUnmatchedSizes, "compute_smoothness", "input image must contain only 1 channel and a depth of 64",
|
||||||
|
__FILE__, __LINE__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
high_pass_range(pFourierImage, lowFreqRatio, low, high );
|
high_pass_range(pFourierImage, lowFreqRatio, low, high );
|
||||||
totalArea = M_PI * (high * high - low * low);
|
totalArea = M_PI * (high * high - low * low);
|
||||||
|
|
||||||
|
@ -354,12 +362,11 @@ compute_smoothness(const IplImage *pFourierImage, const double lowFreqRatio, con
|
||||||
cvReleaseImage(&filteredFourierImage);
|
cvReleaseImage(&filteredFourierImage);
|
||||||
outLowDensity = den = totalIntensity / totalArea;
|
outLowDensity = den = totalIntensity / totalArea;
|
||||||
|
|
||||||
if(den <= blankDensity)
|
if (den <= blankDensity) {
|
||||||
{
|
|
||||||
return BLANK;
|
return BLANK;
|
||||||
}
|
}
|
||||||
|
|
||||||
low = (int) (high * (1.0 - highFreqRatio));
|
low = (int)(high * (1.0 - highFreqRatio));
|
||||||
|
|
||||||
filteredFourierImage = create_frequency_filtered_image(pFourierImage, low, high);
|
filteredFourierImage = create_frequency_filtered_image(pFourierImage, low, high);
|
||||||
scalar = cvSum(filteredFourierImage);
|
scalar = cvSum(filteredFourierImage);
|
||||||
|
@ -367,8 +374,7 @@ compute_smoothness(const IplImage *pFourierImage, const double lowFreqRatio, con
|
||||||
cvReleaseImage(&filteredFourierImage);
|
cvReleaseImage(&filteredFourierImage);
|
||||||
outHighDensity = den = totalIntensity / totalArea;
|
outHighDensity = den = totalIntensity / totalArea;
|
||||||
|
|
||||||
if(den >= messyDensity)
|
if (den >= messyDensity) {
|
||||||
{
|
|
||||||
return MESSY;
|
return MESSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,37 +399,39 @@ cvShiftDFT(CvArr *src_arr, CvArr *dst_arr )
|
||||||
CvSize dst_size = cvGetSize(dst_arr);
|
CvSize dst_size = cvGetSize(dst_arr);
|
||||||
int cx, cy;
|
int cx, cy;
|
||||||
|
|
||||||
if(dst_size.width != size.width ||
|
if (dst_size.width != size.width ||
|
||||||
dst_size.height != size.height){
|
dst_size.height != size.height) {
|
||||||
cvError( CV_StsUnmatchedSizes, "cvShiftDFT", "Source and Destination arrays must have equal sizes", __FILE__, __LINE__ );
|
cvError( CV_StsUnmatchedSizes, "cvShiftDFT", "Source and Destination arrays must have equal sizes",
|
||||||
|
__FILE__, __LINE__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
if(src_arr==dst_arr){
|
if (src_arr == dst_arr) {
|
||||||
tmp = rb_cvCreateMat(size.height/2, size.width/2, cvGetElemType(src_arr));
|
tmp = rb_cvCreateMat(size.height / 2, size.width / 2, cvGetElemType(src_arr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cx = size.width / 2;
|
||||||
|
cy = size.height / 2; // image center
|
||||||
|
|
||||||
cx = size.width/2;
|
q1 = cvGetSubRect(src_arr, &q1stub, cvRect(0,0,cx, cy));
|
||||||
cy = size.height/2; // image center
|
q2 = cvGetSubRect(src_arr, &q2stub, cvRect(cx,0,cx,cy));
|
||||||
|
q3 = cvGetSubRect(src_arr, &q3stub, cvRect(cx,cy,cx,cy));
|
||||||
|
q4 = cvGetSubRect(src_arr, &q4stub, cvRect(0,cy,cx,cy));
|
||||||
|
d1 = cvGetSubRect(src_arr, &d1stub, cvRect(0,0,cx,cy));
|
||||||
|
d2 = cvGetSubRect(src_arr, &d2stub, cvRect(cx,0,cx,cy));
|
||||||
|
d3 = cvGetSubRect(src_arr, &d3stub, cvRect(cx,cy,cx,cy));
|
||||||
|
d4 = cvGetSubRect(src_arr, &d4stub, cvRect(0,cy,cx,cy));
|
||||||
|
|
||||||
q1 = cvGetSubRect( src_arr, &q1stub, cvRect(0,0,cx, cy) );
|
if (src_arr != dst_arr) {
|
||||||
q2 = cvGetSubRect( src_arr, &q2stub, cvRect(cx,0,cx,cy) );
|
if (!CV_ARE_TYPES_EQ(q1, d1)) {
|
||||||
q3 = cvGetSubRect( src_arr, &q3stub, cvRect(cx,cy,cx,cy) );
|
cvError(CV_StsUnmatchedFormats, "cvShiftDFT", "Source and Destination arrays must have the same format",
|
||||||
q4 = cvGetSubRect( src_arr, &q4stub, cvRect(0,cy,cx,cy) );
|
__FILE__, __LINE__ );
|
||||||
d1 = cvGetSubRect( src_arr, &d1stub, cvRect(0,0,cx,cy) );
|
|
||||||
d2 = cvGetSubRect( src_arr, &d2stub, cvRect(cx,0,cx,cy) );
|
|
||||||
d3 = cvGetSubRect( src_arr, &d3stub, cvRect(cx,cy,cx,cy) );
|
|
||||||
d4 = cvGetSubRect( src_arr, &d4stub, cvRect(0,cy,cx,cy) );
|
|
||||||
|
|
||||||
if(src_arr!=dst_arr){
|
|
||||||
if( !CV_ARE_TYPES_EQ( q1, d1 )){
|
|
||||||
cvError( CV_StsUnmatchedFormats, "cvShiftDFT", "Source and Destination arrays must have the same format", __FILE__, __LINE__ );
|
|
||||||
}
|
}
|
||||||
cvCopy(q3, d1, 0);
|
cvCopy(q3, d1, 0);
|
||||||
cvCopy(q4, d2, 0);
|
cvCopy(q4, d2, 0);
|
||||||
cvCopy(q1, d3, 0);
|
cvCopy(q1, d3, 0);
|
||||||
cvCopy(q2, d4, 0);
|
cvCopy(q2, d4, 0);
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
cvCopy(q3, tmp, 0);
|
cvCopy(q3, tmp, 0);
|
||||||
cvCopy(q1, q3, 0);
|
cvCopy(q1, q3, 0);
|
||||||
cvCopy(tmp, q1, 0);
|
cvCopy(tmp, q1, 0);
|
||||||
|
@ -432,16 +440,14 @@ cvShiftDFT(CvArr *src_arr, CvArr *dst_arr )
|
||||||
cvCopy(tmp, q2, 0);
|
cvCopy(tmp, q2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp != NULL)
|
if (tmp != NULL) {
|
||||||
{
|
cvReleaseMat(&tmp);
|
||||||
cvReleaseMat(&tmp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IplImage*
|
IplImage*
|
||||||
create_fourier_image(const IplImage *im)
|
create_fourier_image(const IplImage *im)
|
||||||
{
|
{
|
||||||
|
|
||||||
IplImage *realInput;
|
IplImage *realInput;
|
||||||
IplImage *imaginaryInput;
|
IplImage *imaginaryInput;
|
||||||
IplImage *complexInput;
|
IplImage *complexInput;
|
||||||
|
@ -450,51 +456,50 @@ create_fourier_image(const IplImage *im)
|
||||||
IplImage *image_Re;
|
IplImage *image_Re;
|
||||||
IplImage *image_Im;
|
IplImage *image_Im;
|
||||||
|
|
||||||
realInput = rb_cvCreateImage( cvGetSize(im), IPL_DEPTH_64F, 1);
|
realInput = rb_cvCreateImage(cvGetSize(im), IPL_DEPTH_64F, 1);
|
||||||
imaginaryInput = rb_cvCreateImage( cvGetSize(im), IPL_DEPTH_64F, 1);
|
imaginaryInput = rb_cvCreateImage(cvGetSize(im), IPL_DEPTH_64F, 1);
|
||||||
complexInput = rb_cvCreateImage( cvGetSize(im), IPL_DEPTH_64F, 2);
|
complexInput = rb_cvCreateImage(cvGetSize(im), IPL_DEPTH_64F, 2);
|
||||||
|
|
||||||
cvScale(im, realInput, 1.0, 0.0);
|
cvScale(im, realInput, 1.0, 0.0);
|
||||||
cvZero(imaginaryInput);
|
cvZero(imaginaryInput);
|
||||||
cvMerge(realInput, imaginaryInput, NULL, NULL, complexInput);
|
cvMerge(realInput, imaginaryInput, NULL, NULL, complexInput);
|
||||||
|
|
||||||
dft_M = cvGetOptimalDFTSize( im->height - 1 );
|
dft_M = cvGetOptimalDFTSize(im->height - 1);
|
||||||
dft_N = cvGetOptimalDFTSize( im->width - 1 );
|
dft_N = cvGetOptimalDFTSize(im->width - 1);
|
||||||
|
|
||||||
dft_A = rb_cvCreateMat( dft_M, dft_N, CV_64FC2 );
|
dft_A = rb_cvCreateMat(dft_M, dft_N, CV_64FC2);
|
||||||
image_Re = rb_cvCreateImage( cvSize(dft_N, dft_M), IPL_DEPTH_64F, 1);
|
image_Re = rb_cvCreateImage(cvSize(dft_N, dft_M), IPL_DEPTH_64F, 1);
|
||||||
image_Im = rb_cvCreateImage( cvSize(dft_N, dft_M), IPL_DEPTH_64F, 1);
|
image_Im = rb_cvCreateImage(cvSize(dft_N, dft_M), IPL_DEPTH_64F, 1);
|
||||||
|
|
||||||
// copy A to dft_A and pad dft_A with zeros
|
// copy A to dft_A and pad dft_A with zeros
|
||||||
cvGetSubRect( dft_A, &tmp, cvRect(0,0, im->width, im->height));
|
cvGetSubRect(dft_A, &tmp, cvRect(0,0, im->width, im->height));
|
||||||
cvCopy( complexInput, &tmp, NULL );
|
cvCopy(complexInput, &tmp, NULL);
|
||||||
if( dft_A->cols > im->width )
|
if (dft_A->cols > im->width) {
|
||||||
{
|
cvGetSubRect(dft_A, &tmp, cvRect(im->width,0, dft_A->cols - im->width, im->height));
|
||||||
cvGetSubRect( dft_A, &tmp, cvRect(im->width,0, dft_A->cols - im->width, im->height));
|
cvZero(&tmp);
|
||||||
cvZero( &tmp );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// no need to pad bottom part of dft_A with zeros because of
|
// no need to pad bottom part of dft_A with zeros because of
|
||||||
// use nonzero_rows parameter in cvDFT() call below
|
// use nonzero_rows parameter in cvDFT() call below
|
||||||
|
|
||||||
cvDFT( dft_A, dft_A, CV_DXT_FORWARD, complexInput->height );
|
cvDFT(dft_A, dft_A, CV_DXT_FORWARD, complexInput->height);
|
||||||
|
|
||||||
// Split Fourier in real and imaginary parts
|
// Split Fourier in real and imaginary parts
|
||||||
cvSplit( dft_A, image_Re, image_Im, 0, 0 );
|
cvSplit(dft_A, image_Re, image_Im, 0, 0);
|
||||||
|
|
||||||
// Compute the magnitude of the spectrum Mag = sqrt(Re^2 + Im^2)
|
// Compute the magnitude of the spectrum Mag = sqrt(Re^2 + Im^2)
|
||||||
cvPow( image_Re, image_Re, 2.0);
|
cvPow(image_Re, image_Re, 2.0);
|
||||||
cvPow( image_Im, image_Im, 2.0);
|
cvPow(image_Im, image_Im, 2.0);
|
||||||
cvAdd( image_Re, image_Im, image_Re, NULL);
|
cvAdd(image_Re, image_Im, image_Re, NULL);
|
||||||
cvPow( image_Re, image_Re, 0.5 );
|
cvPow(image_Re, image_Re, 0.5);
|
||||||
|
|
||||||
// Compute log(1 + Mag)
|
// Compute log(1 + Mag)
|
||||||
cvAddS( image_Re, cvScalarAll(1.0), image_Re, NULL ); // 1 + Mag
|
cvAddS(image_Re, cvScalarAll(1.0), image_Re, NULL); // 1 + Mag
|
||||||
cvLog( image_Re, image_Re ); // log(1 + Mag)
|
cvLog(image_Re, image_Re); // log(1 + Mag)
|
||||||
|
|
||||||
// Rearrange the quadrants of Fourier image so that the origin is at
|
// Rearrange the quadrants of Fourier image so that the origin is at
|
||||||
// the image center
|
// the image center
|
||||||
cvShiftDFT( image_Re, image_Re );
|
cvShiftDFT(image_Re, image_Re);
|
||||||
|
|
||||||
cvReleaseImage(&realInput);
|
cvReleaseImage(&realInput);
|
||||||
cvReleaseImage(&imaginaryInput);
|
cvReleaseImage(&imaginaryInput);
|
||||||
|
@ -504,7 +509,6 @@ create_fourier_image(const IplImage *im)
|
||||||
cvReleaseMat(&dft_A);
|
cvReleaseMat(&dft_A);
|
||||||
|
|
||||||
return image_Re;
|
return image_Re;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IplImage*
|
IplImage*
|
||||||
|
@ -520,18 +524,18 @@ create_frequency_filtered_image(const IplImage *pImage, int low, int high)
|
||||||
box.size.width = high;
|
box.size.width = high;
|
||||||
box.size.height = high;
|
box.size.height = high;
|
||||||
|
|
||||||
IplImage *pFilterMask = rb_cvCreateImage( cvGetSize(pImage), IPL_DEPTH_64F, 1 );
|
IplImage *pFilterMask = rb_cvCreateImage(cvGetSize(pImage), IPL_DEPTH_64F, 1);
|
||||||
IplImage *pFiltered = rb_cvCreateImage( cvGetSize(pImage), IPL_DEPTH_64F, 1 );
|
IplImage *pFiltered = rb_cvCreateImage(cvGetSize(pImage), IPL_DEPTH_64F, 1);
|
||||||
|
|
||||||
cvZero(pFilterMask);
|
cvZero(pFilterMask);
|
||||||
cvZero(pFiltered);
|
cvZero(pFiltered);
|
||||||
|
|
||||||
if(high > 0)
|
if (high > 0)
|
||||||
cvEllipseBox(pFilterMask, box, cvScalar(255, 255, 255, 255), CV_FILLED, 8, 0);
|
cvEllipseBox(pFilterMask, box, cvScalar(255, 255, 255, 255), CV_FILLED, 8, 0);
|
||||||
|
|
||||||
box.size.width = low;
|
box.size.width = low;
|
||||||
box.size.height = low;
|
box.size.height = low;
|
||||||
if(low > 0)
|
if (low > 0)
|
||||||
cvEllipseBox(pFilterMask, box, cvScalar(0, 0, 0, 0), CV_FILLED, 8, 0);
|
cvEllipseBox(pFilterMask, box, cvScalar(0, 0, 0, 0), CV_FILLED, 8, 0);
|
||||||
|
|
||||||
cvAnd(pImage, pFilterMask, pFiltered, NULL);
|
cvAnd(pImage, pFilterMask, pFiltered, NULL);
|
||||||
|
@ -544,17 +548,15 @@ create_frequency_filtered_image(const IplImage *pImage, int low, int high)
|
||||||
void
|
void
|
||||||
high_pass_range(const IplImage *pImage, float lostPercentage, int &outLow, int &outHigh)
|
high_pass_range(const IplImage *pImage, float lostPercentage, int &outLow, int &outHigh)
|
||||||
{
|
{
|
||||||
if(lostPercentage > 1.0f)
|
if (lostPercentage > 1.0f) {
|
||||||
{
|
|
||||||
lostPercentage = 1;
|
lostPercentage = 1;
|
||||||
}
|
}
|
||||||
else if(lostPercentage < 0.0f )
|
else if (lostPercentage < 0.0f) {
|
||||||
{
|
|
||||||
lostPercentage = 0;
|
lostPercentage = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
outHigh = (int) MIN( pImage->width, pImage->height );
|
outHigh = (int)MIN(pImage->width, pImage->height);
|
||||||
outLow = (int) (lostPercentage * outHigh);
|
outLow = (int)(lostPercentage * outHigh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
Copyright (C) 2005-2006 Masakazu Yonekura
|
Copyright (C) 2005-2006 Masakazu Yonekura
|
||||||
|
|
||||||
************************************************************/
|
************************************************************/
|
||||||
#define __NAMESPACE_BEGIN_MOUSEEVENT namespace cMouseEvent{
|
#define __NAMESPACE_BEGIN_MOUSEEVENT namespace cMouseEvent {
|
||||||
#define __NAMESPACE_END_MOUSEEVENT }
|
#define __NAMESPACE_END_MOUSEEVENT }
|
||||||
|
|
||||||
#ifndef RUBY_OPENCV_GUI_MOUSEEVENT_H
|
#ifndef RUBY_OPENCV_GUI_MOUSEEVENT_H
|
||||||
#define RUBY_OPENCV_GUI_MOUSEEVENT_H
|
#define RUBY_OPENCV_GUI_MOUSEEVENT_H
|
||||||
|
|
||||||
#include"opencv.h"
|
#include "opencv.h"
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
__NAMESPACE_BEGIN_GUI
|
__NAMESPACE_BEGIN_GUI
|
||||||
|
|
|
@ -26,7 +26,7 @@ rb_module()
|
||||||
void
|
void
|
||||||
define_ruby_module()
|
define_ruby_module()
|
||||||
{
|
{
|
||||||
if(module)
|
if (module)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* opencv = rb_define_module("OpenCV");
|
* opencv = rb_define_module("OpenCV");
|
||||||
|
@ -50,10 +50,10 @@ VALUE
|
||||||
rb_extend_object(VALUE self, VALUE object)
|
rb_extend_object(VALUE self, VALUE object)
|
||||||
{
|
{
|
||||||
CvSeq *seq = 0;
|
CvSeq *seq = 0;
|
||||||
if(!rb_obj_is_kind_of(object, cCvSeq::rb_class()))
|
if (!rb_obj_is_kind_of(object, cCvSeq::rb_class()))
|
||||||
rb_raise(rb_eTypeError, "object is not %s.\n", rb_class2name(cCvSeq::rb_class()));
|
rb_raise(rb_eTypeError, "object is not %s.\n", rb_class2name(cCvSeq::rb_class()));
|
||||||
|
|
||||||
if(!CV_IS_SEQ(seq))
|
if (!CV_IS_SEQ(seq))
|
||||||
rb_raise(rb_eTypeError, "object is not sequence.");
|
rb_raise(rb_eTypeError, "object is not sequence.");
|
||||||
return rb_call_super(1, &object);
|
return rb_call_super(1, &object);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#define __NAMESPACE_BEGIN_POINT_SET namespace mPointSet {
|
#define __NAMESPACE_BEGIN_POINT_SET namespace mPointSet {
|
||||||
#define __NAMESPACE_END_POINT_SET }
|
#define __NAMESPACE_END_POINT_SET }
|
||||||
|
|
||||||
#include"opencv.h"
|
#include "opencv.h"
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
__NAMESPACE_BEGIN_POINT_SET
|
__NAMESPACE_BEGIN_POINT_SET
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
#ifndef RUBY_OPENCV_GUI_TRACKBAR_H
|
#ifndef RUBY_OPENCV_GUI_TRACKBAR_H
|
||||||
#define RUBY_OPENCV_GUI_TRACKBAR_H
|
#define RUBY_OPENCV_GUI_TRACKBAR_H
|
||||||
|
|
||||||
#include"opencv.h"
|
#include "opencv.h"
|
||||||
|
|
||||||
#define __NAMESPACE_BEGIN_TRACKBAR namespace cTrackbar{
|
#define __NAMESPACE_BEGIN_TRACKBAR namespace cTrackbar {
|
||||||
#define __NAMESPACE_END_TRACKBAR }
|
#define __NAMESPACE_END_TRACKBAR }
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
|
@ -47,7 +47,8 @@ VALUE rb_set_value(VALUE self, VALUE val);
|
||||||
__NAMESPACE_END_TRACKBAR
|
__NAMESPACE_END_TRACKBAR
|
||||||
|
|
||||||
|
|
||||||
inline Trackbar *TRACKBAR(VALUE object) {
|
inline Trackbar*
|
||||||
|
TRACKBAR(VALUE object) {
|
||||||
Trackbar *ptr;
|
Trackbar *ptr;
|
||||||
Data_Get_Struct(object, Trackbar, ptr);
|
Data_Get_Struct(object, Trackbar, ptr);
|
||||||
return ptr;
|
return ptr;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#define RUBY_OPENCV_GUI_WINDOW_H
|
#define RUBY_OPENCV_GUI_WINDOW_H
|
||||||
|
|
||||||
#include "opencv.h"
|
#include "opencv.h"
|
||||||
#define __NAMESPACE_BEGIN_WINDOW namespace cWindow{
|
#define __NAMESPACE_BEGIN_WINDOW namespace cWindow {
|
||||||
#define __NAMESPACE_END_WINDOW }
|
#define __NAMESPACE_END_WINDOW }
|
||||||
|
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue