Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to compile the Raw Haskell bindings to OpenCV aka GitHub member arjuncomar's OpenCV-Raw repo

Arjuncomar states in the OpenCV-Raw readme.md at this link https://github.com/arjuncomar/opencv-raw/blob/master/README.md "Compilation / Installation

Compiling this package might be a little tricky at the moment since I've only had the chance to test it on my machine so far. First, you need to generate C wrappers for the version of OpenCV on your machine -- this repo holds the wrappers for OpenCV 3.0 (HEAD) only. You can generate these wrappers (and the corresponding Haskell bindings) via:

./setup.sh <path to="" opencv="" headers="">

e.g.

./setup.sh /usr/local/include"

I ran './setup.sh /usr/local/include', in the root directory of Opencv-Raw, btw I have OpenCV 2.4.7 installed on Ubuntu Saucy 64-bit and i get this error

Traceback (most recent call last): File "cbits/genhsc.py", line 161, in <module> cgen.gen(header_dir, headers, dstdir) File "/home/w/Documents/opencv-raw-master/cbits/genc.py", line 367, in gen self.readHeaders(header_dir, srcfiles) File "/home/w/Documents/opencv-raw-master/cbits/genc.py", line 350, in readHeaders decls = parser.parse(header_dir + hdr) File "/home/w/Documents/opencv-raw-master/cbits/hdr_parser.py", line 732, in parse f = open(hname, "rt") IOError: [Errno 2] No such file or directory: '/usr/local/include/opencv2/core.hpp'

Arjuncomar states "this repo holds the wrappers for OpenCV 3.0 (HEAD) only." so i tried to find an OpenCV 3.0 download but no luck and I've never seen a core.hpp file in /usr/local/include so dont really understand error. Im trying to incoroporate the code arjuncomar wrote in his haskell bindings into my own OpenCV wrapper and I felt this might be a good first step but if I can just make a make file for this code i/e

the cpp file

void cv_imshow(String* winname, Mat* mat) { cv::imshow(*winname, *mat); }

the hpp file

void cv_imshow(String* winname, Mat* mat);

and expect it to be a perfect C wrapper for C++ OpenCV code pls let me know...and if posible a link regarding how to make such a make file posted here would aid greatly....Im used to C but new to C++/ C++ MakeFiles and would rather do this perfect on my first try so I can output volume more quickly without worrying about making an error...

....Any help is appreciated...A good day=) to you All...

How to compile the Raw Haskell bindings to OpenCV aka GitHub member arjuncomar's OpenCV-Raw repo

Arjuncomar states in the OpenCV-Raw readme.md at this link https://github.com/arjuncomar/opencv-raw/blob/master/README.md "Compilation / Installation

Compiling this package might be a little tricky at the moment since I've only had the chance to test it on my machine so far. First, you need to generate C wrappers for the version of OpenCV on your machine -- this repo holds the wrappers for OpenCV 3.0 (HEAD) only. You can generate these wrappers (and the corresponding Haskell bindings) via:

./setup.sh <path to="" opencv="" headers="">

to opencv headers>

e.g.

./setup.sh /usr/local/include"

/usr/local/include"

I ran './setup.sh /usr/local/include', in the root directory of Opencv-Raw, btw I have OpenCV 2.4.7 installed on Ubuntu Saucy 64-bit and i get this error

 Traceback (most recent call last):
  File "cbits/genhsc.py", line 161, in <module>
  cgen.gen(header_dir, headers, dstdir)
  File "/home/w/Documents/opencv-raw-master/cbits/genc.py", line 367, in gen
  self.readHeaders(header_dir, srcfiles)
  File "/home/w/Documents/opencv-raw-master/cbits/genc.py", line 350, in readHeaders
  decls = parser.parse(header_dir + hdr)
  File "/home/w/Documents/opencv-raw-master/cbits/hdr_parser.py", "/home/w/Documents/opencv-raw-master/cbits/hdr_parser.py",
   line 732, in parse
      parse f = open(hname, "rt")
  IOError: [Errno 2] No such file or directory: '/usr/local/include/opencv2/core.hpp'

'/usr/local/include/opencv2/core.hpp'

Arjuncomar states "this repo holds the wrappers for OpenCV 3.0 (HEAD) only." so i tried to find an OpenCV 3.0 download but no luck and I've never seen a core.hpp file in /usr/local/include so dont really understand error. Im trying to incoroporate the code arjuncomar wrote in his haskell bindings into my own OpenCV wrapper and I felt this might be a good first step but if I can just make a make file for this code i/e

the cpp file

void cv_imshow(String* winname, Mat* mat) {
    cv::imshow(*winname, *mat);
}

}

the hpp file

 void cv_imshow(String* winname, Mat* mat);

mat);

and expect it to be a perfect C wrapper for C++ OpenCV code pls let me know...and if posible a link regarding how to make such a make file posted here would aid greatly....Im used to C but new to C++/ C++ MakeFiles and would rather do this perfect on my first try so I can output volume more quickly without worrying about making an error...

....Any help is appreciated...A good day=) to you All...