In my app I want to use Wikitude and Openalpr. I try to integrate both of them as frameworks in my XCode Project. The problem is that if I integrate OpenCV.framework (It is required by Openalpr) I get the following error when initializing Openalpr:
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /Volumes/Linux/builds/precommit_ios/opencv/modules/imgproc/src/color.cpp, line 7564
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Volumes/Linux/builds/precommit_ios/opencv/modules/imgproc/src/color.cpp:7564: error: (-215) scn == 3 || scn == 4 in function cvtColor
I think that Wikitude is also using openCV (should be included in the framework already) and I assume it uses a different version of it and Openalpr is not compatible with the version of OpenCV which Wikitude requires. So maybe there is a conflict between these two frameworks and their usage of OpenCV.framework
My question is: Is there a way to import the OpenCV.framework so that only Openalpr.framework can use it and Wikitude.framework still uses it´s version of OpenCV?
Thanks very much!
Related
I am trying to run an OpenCV program that opens a USB cam and streams the video.
The program compiles but when I run it I get the following GStreamer exception (which seems unrelated to OpenCV or the C++ source code):
(TLD:5263): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
OpenCV Error: Unspecified error (GStreamer: cannot link elements
) in CvVideoWriter_GStreamer::open, file /home/odroid/Desktop/middleware/CppLibs/opencv-2.4.13.6/modules/highgui/src/cap_gstreamer.cpp, line 1464
terminate called after throwing an instance of 'cv::Exception'
what(): /home/odroid/Desktop/middleware/CppLibs/opencv-2.4.13.6/modules/highgui/src/cap_gstreamer.cpp:1464: error: (-2) GStreamer: cannot link elements
in function CvVideoWriter_GStreamer::open
I am running on odroid.
Have anybody had the same problem?
I was thinking it is a package dependency problem but I have installed xorg libgl-gst libgl1-mesa-* so I am quite lost at the moment.
EDIT
To be precise it is an older version of OpenCV: it is the 2.4.13.6.
The lines initializing VideoCapture are the following (I reported only the relevant ones):
int main(int argc,char** argv){
string devId;
VideoCapture capture;
if(argc>4)
{
int captureNumber;
string deviceId=argv[1];
captureNumber=atoi(argv[1]);
capture.open(captureNumber);
}
EDIT 2
On OSX the same code works without giving this exception (there were only dynamic libraries problem).
This is a problem I got when launching my own project,
OpenCV Error: Unsupported format or combination of formats (Gstreamer
Opencv backend doesn't support this codec acutally.) in
CvVideoWriter_GStreamer::open, file
/home/htf/Downloads/opencv-2.4.9/modules/highgui/src/cap_gstreamer.cpp,
line 505
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.
terminate called after throwing an instance of 'cv::Exception'
what(): /home/htf/Downloads/opencv-2.4.9/modules/highgui/src/cap_gstreamer.cpp:505:
error: (-210) Gstreamer Opencv backend doesn't support this codec
acutally. in function CvVideoWriter_GStreamer::open
Aborted (core dumped)
opencv version: 2.4.9
I am new to OpenCV, does anyone know how to fix this problem? Your clues would be appreciated too.
Looks like you passed an unsupported fourcc argument to the VideoWriter class.
The list of supported values of fourcc for CvVideoWriter_GStreamer in OpenCV 2.4.9 can be found at: https://github.com/opencv/opencv/blob/2.4.9/modules/highgui/src/cap_gstreamer.cpp#L462.
Just out of curiosity, why are you using a self compiled version of OpenCV?
I was using the previous version of PDFTron for iOS (6.5.4a). Now since a new version is available so I decided to upgrade to 6.7.2 . I am using static framework. Now when I open a pdf, go back from it and again try to open the same pdf the app crashes with the following error :
libc++abi.dylib: terminating with uncaught exception of type trn::Common::Exception: Exception:
Message: Bad image dimensions
Conditional expression: inout_size.x>0 && inout_size.y>0
Version : 6.7.1.53210N
Filename : PDFDraw.cpp
Function : CalcDevMtxFromSize
Linenumber : 239
There have been improvements to image reading, and this exception should no longer occur. Please update to the latest version. If the latest version doesn't help, then we would need access to the file in question.
I was able to cross-compile llvm/clang for i386 and i'm trying to use it in my ios app.
Also i was able to add headers and static libs (both libLLVM*.a and libclang*.a) and compile/link the project with no errors.
But when trying to run simple app i'm getting error:
Detected an attempt to call a symbol in system libraries that is not
present on the iPhone: pthread_mutexattr_destroy$UNIX2003 called from
function _ZN4llvm3sys9MutexImplC2Eb in image LibClangUsageDemo3.
What can i do in order to fix it?
Is it llvm/clang issue or i'm doing smth wrong?
Update: i was able to find error line - Mutex.cpp:
// Destroy the attributes
errorcode = pthread_mutexattr_destroy(&attr);
assert(errorcode == 0);
I'm getting errors in XCode attempting to build OSG for iOS 7.0. I've followed these instructions:
http://www.openscenegraph.org/index.php/documentation/platform-specifics/ios/23-configuring-cmake-for-ios
with the additional step of changing the framework version to 7.0 in the CMakeLists.txt file, as using the default of 6.0 caused XCode to complain about an unknown framework. I chose the IPHONE_SIMULATOR option.
When I attempt to build the project after generating it with CMake, I get three errors in osgDB complaining about stat64, and one about a missing header (perhaps related but I get the feeling something else is going on):
/Users/clay2/src/OpenSceneGraph-3.2.0/src/osgDB/FileUtils.cpp:153:9: error: call to unavailable function 'stat64': not available on iOS
if( stat64( path.c_str(), &stbuf ) == 0 )
^~~~~~
In file included from /Users/clay2/src/OpenSceneGraph-3.2.0/src/osgDB/FileUtils.cpp:87:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/stat.h:380:5: note: candidate function has been explicitly made unavailable
int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
^
/Users/clay2/src/OpenSceneGraph-3.2.0/src/osgDB/FileUtils.cpp:176:13: error: call to unavailable function 'stat64': not available on iOS
if( stat64( dir.c_str(), &stbuf ) < 0 )
^~~~~~
In file included from /Users/clay2/src/OpenSceneGraph-3.2.0/src/osgDB/FileUtils.cpp:87:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/stat.h:380:5: note: candidate function has been explicitly made unavailable
int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
^
/Users/clay2/src/OpenSceneGraph-3.2.0/src/osgDB/FileUtils.cpp:301:10: error: call to unavailable function 'stat64': not available on iOS
if ( stat64(filename.c_str(), &fileStat) != 0 )
^~~~~~
In file included from /Users/clay2/src/OpenSceneGraph-3.2.0/src/osgDB/FileUtils.cpp:87:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/stat.h:380:5: note: candidate function has been explicitly made unavailable
int stat64(const char *, struct stat64 *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
^
/Users/clay2/src/OpenSceneGraph-3.2.0/src/osgDB/FileUtils.cpp:881:18: fatal error: 'CoreServices/CoreServices.h' file not found
#include <CoreServices/CoreServices.h>
^
4 errors generated.
CMake version is 2.8-12, OSG 3.2.0, XCode 5.0.2.
Various things I've tried:
iphone instead of iphone_simulator setting; iphone complains about openthreads being a dynamic library, even though I unchecked DYNAMIC_OPENTHREADS in cmake. It does, however, appear to make the other errors go away.
Blowing away the build directory and re-doing the config step, several times
Manually setting the framework settings for ios in xcode after configuration
I did previously get an OSX build of OSG to work without issue, for what it's worth.