Fix unit test build - looks like cv::resize doesn't work with 64 bit floats

re - http://stackoverflow.com/questions/7385465/resize-an-image-and-changing-its-depth
This commit is contained in:
Peter Braden 2012-05-31 17:00:04 -04:00
parent d154496199
commit 5f4ef5af30

View File

@ -66,7 +66,7 @@ Matrix::Matrix(): ObjectWrap() {
}
Matrix::Matrix(int w, int h): ObjectWrap() {
mat = cv::Mat(w, h, CV_64FC1);
mat = cv::Mat(w, h, CV_32FC1);
}
Handle<Value>
@ -225,7 +225,7 @@ Matrix::Eye(const v8::Arguments& args){
Local<Object> im_h = Matrix::constructor->GetFunction()->NewInstance();
Matrix *img = ObjectWrap::Unwrap<Matrix>(im_h);
cv::Mat mat = cv::Mat::eye(w, h, CV_64FC1);
cv::Mat mat = cv::Mat::eye(w, h, CV_32FC1);
img->mat = mat;
return scope.Close(im_h);
@ -241,7 +241,7 @@ Matrix::Resize(const v8::Arguments& args){
int y = args[1]->Uint32Value();
Matrix *self = ObjectWrap::Unwrap<Matrix>(args.This());
cv::Mat res;
cv::Mat res = cv::Mat(x, y, CV_32FC1);
cv::resize(self->mat, res, cv::Size(x, y), 0, 0, cv::INTER_LINEAR);
~self->mat;
self->mat = res;