Opencv Create Samples .vec file was not created - c++

I'm trying to make a .vec file for using to create my cascade training XML file. While trying to run the code, I see an error and I couldn't find any answer about this.
May you help me, please?
The error is like that:
Unable to open image: pozitif1.jpg OpenCV Error: Unknown error code -9
() in cvSetImageROI, file
C:\build\master_winpack-build-win64-vc14\opencv\modules\core\src\array.cpp,
line 3021

Related

C++ and xercesc: Cannot load message domain

I'm trying to read a a XML file with C++ using xercesc. It compiles OK, but when I try to excecute the app (and read the XML), I get this error:
Could not open catalog:
XercesMessages_en_US.cat or
XercesMessages_en_US.cat
Cannot load message domain
Someone knows what this means?
I answer myself:
As the error says, xerces is unable to find XercesMessages_en_US.cat, wich is a file located in /usr/share/xerces-c/msg/ (in my case, gentoo linux).
To solve it, just need to write in a bash:
export XERCESC_NLS_HOME=/usr/share/xerces-c/msg/
Then, it will find it.
In my case, I wrote this in .bashrc so it is exceuted in every start.

rmarkdown error: "myfile.tex"' had status 1

I am trying to compile an RMarkdown document from an R script. This is the code I am running:
setwd("C:/Users/me/me_VN02_5676/myfolder")
rmarkdown::render("myrmd.Rmd",
output_file = "mypdf.pdf")
This results in the error:
Error: Failed to compile mypdf.tex.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "mypdf.tex"' had status 1
Does anyone know what is happening?
Additional Notes
The PDF file is created when I use the Knit button in RStudio
This code does produce the .Tex file and when I run that it produces the pdf but render() does not produce the pdf
When I run the .R file via the command line it works! The PDF is created but why doesn't it work in R studio?
It would help to provide a Minimal Working Example so that we can attempt to replicate the problem. However, there may be two potential causes:
File Paths Look Incorrect
In R, they should be specified with a single forward slash: https://stat.ethz.ch/R-manual/R-devel/library/base/html/file.path.html
setwd("C:/Users/me/me_VN02_5676/myfolder")
rmarkdown::render("myrmd.Rmd",
output_file = paste0("mypdf.pdf")
)
PDF Output File May be Open
Another potential cause of this is that the PDF file is open, and therefore pandoc cannot save the output PDF. Try closing the PDF and render the document again.
Link to previous issue in Knitr which relates to this: https://github.com/yihui/knitr/issues/1209

OpenCV error when loading Fisher face recognizer in Xcode 8

I've imported opencv and opencv_contrib frameworks in an Xcode project, and in my Objective-C++ file, I load a face classifier and then a Fisher face recognizer:
// set up classifier, recognizer, and webcam
-(void) setupAnalyzer:(NSString *)faceCascadeName :(NSString *)fisherDatasetName
{
// load face classifier
cout << "loading face classifier..." << endl;
String faceCascadeNameString = string([faceCascadeName UTF8String]);
faceCascade.load(faceCascadeNameString);
// load face recognizer
cout << "loading face recognizer..." << endl;
fishface = createFisherFaceRecognizer();
String fisherDatasetNameString = string([fisherDatasetName UTF8String]);
fishface->load(fisherDatasetNameString);
}
When I call this function from Swift, it seems the face classifier loads just fine with an xml file I have in my project. But when I try to load the Fisher face recognizer using another xml file in my project, Xcode shows this error:
OpenCV Error: Unspecified error (File can’t be opened for reading!) in load, file ~/opencv/modules/face/src/facerec.cpp, line 61
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: ~/opencv/modules/face/src/facerec.cpp:61: error: (-2) File can’t be opened for reading! in function load
I've tried rebuilding the OpenCV frameworks in different ways and I keep getting the same error!
First of all, I'm confused why the program is looking to source code that isn't contained in the project (it's looking for facerec.cpp in another directory on my computer). Also, why does the cascade classifier load just fine? This makes me think it's an issue with the way I built the opencv_contrib modules, because the face classifier comes from opencv_contrib. But I tried rebuilding opencv_contrib, and I still get this OpenCV error.
Any help would be greatly appreciated!
[UPDATE]
It is not an issue with building the contrib module. I manually included the module in Xcode, so it's now looking within the project for the facerec.cpp, but it still can't open the xml file for reading.
First of all, I'm confused why the program is looking to source code that isn't contained in the project (it's looking for facerec.cpp in another directory on my computer).
It doesn't search for file. It shows you where error was happen. Since your library was build on your machine and has debug information it can point you source file and line number where error happen.
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: ~/opencv/modules/face/src/facerec.cpp:61: error: (-2) File can’t be opened for reading! in function load
This message means that exception was generated at line 61 in file facerec.cpp. You need to check if your data is available for reading.
Figured it out! This answer helped me realize that I needed to get the app bundle's path to the xml files: OpenCV Cascade Classifier load error iOS

Some error about calling a .mexw64 file in Matlab code

Recently,I used Mex to compile some .cpp file into .mexw64.
The following is the specific process:
1)I put mexResize.cpp MxArray.cpp and MxArray.h into a folder;
2)Then I run a make.m and get a mexResize.mexw64 in the folder above:
Command window of matlab
3)Finally I use mexResize.mexw64 in my matlab code:
img1 = mexResize(img,[100,100]);
However,I met the error like the following:
Error information
There are some Chinese sentences above,I try to translate them as following:
"MEX The file appears unexpected standard exceptions"
"Error test (line 3)"
Apologize for my limited English.

PCL: Creating a real-time visualization from kinect point clouds

Im trying to follow this tutorial: http://pointclouds.org/documentation/tutorials/openni_grabber.php#openni-grabber but I'm not being able to complete it. The tutorial seems simple enough, but nothing seems to be working.
When I try to compile it I get the following error: point_cloud_geometry_handlers.h:48:29: fatal error: vtkSmartPointer.h: No such file or directory compilation terminated.
I've tried to find out what this vtkSmartPointer.h is about but with no luck, probably it has something to do with that ConstPtr type?
Thanks in advance