# openCV and ruby

**URL:** <https://www.ruby-forum.com/t/opencv-and-ruby/186310>\
**Category:** Ruby\
**Created:** [April 4, 2010, 9:49am UTC](https://www.ruby-forum.com/t/opencv-and-ruby/186310 "2010-04-04T09:49:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sepehr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sepehr](https://www.ruby-forum.com/u/sepehr)\
**Post date:** [April 4, 2010, 9:49am UTC](https://www.ruby-forum.com/t/opencv-and-ruby/186310/1 "2010-04-04T09:49:05Z")

</div>

I’ve installed OpenCV image processing library and when I try to install  
opencv gem(using gem install opencv) for ruby I get the following error  
when building the library

iplimage.cpp: In function â€˜VALUE mOpenCV::cIplImage::rb\_initialize(int,  
VALUE\*, VALUE)â€™:  
iplimage.cpp:91: error: â€˜cvCvToIplDepthâ€™ was not declared in this scope  
iplimage.cpp: In function â€˜VALUE mOpenCV::cIplImage::new\_object(int,  
int, int)â€™:  
iplimage.cpp:228: error: â€˜cvCvToIplDepthâ€™ was not declared in this scope  
iplimage.cpp: In function â€˜VALUE mOpenCV::cIplImage::new\_object(CvSize,  
int)â€™:  
iplimage.cpp:234: error: â€˜cvCvToIplDepthâ€™ was not declared in this scope

has anybody managed to use opencv for ruby?

---

<div class="post-metadata">

**Author:** ![sepehr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sepehr](https://www.ruby-forum.com/u/sepehr)\
**Post date:** [April 16, 2010, 10:21am UTC](https://www.ruby-forum.com/t/opencv-and-ruby/186310/2 "2010-04-16T10:21:47Z")

</div>

Mehdi K. wrote:

> iplimage.cpp: In function â€˜VALUE mOpenCV::cIplImage::new\_object(CvSize,  
> int)â€™:  
> iplimage.cpp:234: error: â€˜cvCvToIplDepthâ€™ was not declared in this scope
> 
> has anybody managed to use opencv for ruby?

Try this patch:  
[http://blog.rikiji.it/me/entry/17](http://blog.rikiji.it/me/entry/17)
