https://github.com/vikram-ma/OCR
when I try to run main.cpp from this code i got the following error
In file included from /home/akash/Desktop/OCR-master/main.cpp:9:0:
/home/akash/Desktop/OCR-master/OCR.h:43:3: error: ‘CvKNearest’ does not name a type
CvKNearest *knn;
^
CMakeFiles/OCR.dir/build.make:62: recipe for target 'CMakeFiles/OCR.dir/main.o' failed
please help
At first glance it seems you don't have OpenCV installed/downloaded.
The code you are poining to uses OpenCV library and it assumes you already have it.
You should go to OpenCV releases and download the version you need.
Edit:
I looked into it more closely and as suspected the code was using an old OpencCV version. Right now you are using 3.2.0 so you need to make some updates to the code itself.
Either you should go with an older version of the library (which I'm not suggesting but will be probably less effort) like 2.3-2.4 or update the code to the version you've already installed.
If you wish to do the latter, you can start by looking here: Transition guide
Among others, it is shown there that what used to be CvKNearest is now moved to cv::ml::KNearest. Updating accordingly should fix your first error.
Related
I was trying to set up Haxe, but this error faces me whenever I try to import a Library, whether it be js.Lib, cpp.Lib, etc. It always comes up with this error:
Error: You cannot access the cpp package while targeting cross (for cpp.Lib)
I've been searching for hours now, with nobody seeming to get the same problem and no fixes. Please help!
"cross" means that the compiler is being invoked without any target (-cpp, -js...) specified.
I'm not sure which one you selected, but if I remember correctly, the project setup with some of HaxeDevelop's templates is a bit unusual. Normally you would use a HXML file where you can specify the arguments directly. A build.hxml that looks like this should work here:
-cp src
-main Main
-cpp bin
Then just run haxe build.hxml.
I'm learning the v4l2 API for configuring video devices through v4l2-ctl. The code samples from ages ago are really out of date and some of the defines don't work anymore. There is a new method of requesting everything for the API from the kerhel which is shown in v4l2-utils. I'm trying to incorporate some of the code from v4l2-utils into my code. However, I'm getting an error from the compiler:
camera.hpp:1038:8: error: 'struct v4l2_ext_controls' has no member named 'which'
ctrls.which = V4L2_CTRL_ID2WHICH(qctrl.id);
And:
camera.hpp:1038:43: error: 'V4L2_CTRL_ID2WHICH' was not declared in this scope
ctrls.which = V4L2_CTRL_ID2WHICH(qctrl.id);
The field and define are in a file located in the linux source tree: /usr/src/linux-4.6.3-gentoo/include/uapi/linux/videodev2.h, but that file is not included when I specify:
#include <linux/videodev2.h>
What is the voodoo to get the compiler to include the correct file?
I've been studying the v4l2-utils source but can't figure it out.
Thanks much.
The file located in /usr/include was out of date. I had the headers installed for kernel 4.3 and needed the ones from a later version. The solution for my gentoo install was to add a keyword for sys-kernel/linux-headers and install the latest headers (4.7).
It turns out that the UAPI file becomes the headers when installed into /usr/include. I could probably have accomplished this with make headers_install in my /usr/src/linux directory as well, but I'm not sure whether that is more "correct" than installing the linux-headers ebuild. I worry about conflicts.
Hope this helps someone else...
I encountered a strange error- whenever I'm including #include <dlib/gui_widgets.h>
to my projects and declaring a variable (for example dlib::image_window win) following errors appear:
'DLIB_NO_GUI_SUPPORT is defined so you can't use the GUI code. Turn DLIB_NO_GUI_SUPPORT off if you want to use it.' and 'Also make sure you have libx11-dev installed on your system' (from guy_core_kernel_2.h). I was searching and found some suggestions that the cmake of dlib could fail- but I really doubt so, I'm already doing a detection of landmarks.
The reason why I'm trying to include and declare one of the widgets is displaying values on the screen (there is no equivalent of opencv putText(), is there?.
I would be very grateful for any help. :)
At the end I decided to use covertion from dlib::array2d to cv::Matrix (dlib::toMat(dlib::array2d) function) and use cv::putText() (as mentioned previousely). It turned out the Xcode didn't properly linked libraries from openCV- helpful were the following links: How can I create OpenCV framework?
and
http://blogs.wcode.org/2014/11/howto-setup-xcode-6-1-to-work-with-opencv-libraries/
Also if someone can't find Frameworks in Library:
https://discussions.apple.com/thread/4195808?tstart=0
I'm trying to write unit tests using miniDFSCluster and it's throwing the error below
java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
any pointers to resolve this issue?
With errors like this, I use three steps
Find out what it is looking for
In this case, *org.apache.hadoop.io.nativeio.NativeIO$Windows.access0*
Find out what jar/lib it is in.
I don't use the Windows version, but I believe it is in hadoop.dll -
you'll have to check this.
Find out where I'm telling it to use that jar/lib
Update: See also this Answer.
I was able to resolve this error by following these steps:
Download hadoop.dll and winutils.exe in the same version that I'm using in the sbt/maven configuration, you can find these files in all versions of hadoop here: link
Put these 2 files in your %hadoop directory%\bin folder
make sure that %hadoop directory%\bin is listed under PATH in your device's environmental path(if using windows)
then the code should work just fine.
Context
I am working on a klee (http://klee.llvm.org) fork and want to clean up our repository to separate our stuff from the "canonical" klee code. Anyway, I'm having trouble understanding/extending the build system.
Problem
The directory structure in /lib/ looks like this
Basic/
Core/
Support/
Expr/
Solver/
Module/
Mine/
Mine was just added by me, so far we threw everything in Core and I am moving it to Mine. How do I tell the build system to do this properly?
My attempt
Being unable to figure this out on my own, I edited /lib/Makefile:
LEVEL=..
PARALLEL_DIRS=Basic Support Expr Solver Module Core Mine
include $(LEVEL)/Makefile.common
and copied the /lib/Core/Makefile to /lib/Mine/Makefile while changing LIBRARYNAME=kleeCore to LIBRARYNAME=kleeMine.
Caveat
I have a feeling that this is not the proper way to do it, and I should rather modify some configure script or something. Also it does not link (it compiles, though).
A colleague just told me how to get it to link, which is by modifying /tools/klee/Makefile
USEDLIBS = kleeCore.a kleeModule.a kleaverSolver.a kleaverExpr.a kleeSupport.a kleeBasic.a kleeMine.a