Hi
Ptr use in Declare function seems problematic with x-64 bit
const highgui = “/usr/local/lib64/opencv2/libopencv_highgui.dylib” : OK 64-bit library
const core="/usr/local/lib64/opencv2/libopencv_core.dylib": idem
Declare Function cvNamedWindow lib highgui (name As CString, flag As Integer) As Integer : OK running
Declare Function cvCreateImage lib core (w as Integer, h as integer, depth as integer, nChannels as integer) as Ptr : crash and pointer error
Any idea?
When compiling for 64-bit, Integer compiles to 64-bit.
I suspect that depth and nChannels are 32-bit on both 32-bit- and 64-bit platforms. Try it wth Int32 instead of Integer.
Thanks, but not related to int32 or int64
As indicated integer compiles for both int32 or int64 according to architecture
Original opencv function uses int type
In my opinion problem is related to the return value of the declare function that should be a pointer
I’ll test:)
C’s int translates to Int32, for what it’s worth.
It is.
Exactly.
OK Folks, I agree with you : related to int32 for image depth
OpenCV Error: Input image depth is not supported by function (Unsupported format) in cvInitImageHeader, file /tmp/opencv20151027-332-17bks06/opencv-2.4.11/modules/core/src/array.cpp, line 2925
But whatever integer type, get the same error for x86_64 architecture
no problem with x86_32
Probably related to beta status of 64-bit support
Please show the structure you have defined.
Eli,
What do you exactly mean by structure? Do you think about IplImage?
Regards
cvCreateImage(CvSize size, int depth, int channels)
It looks like you need a CvSize structure, for passing in the image size. In 32-Bit you could cheat, but not with 64-Bit.
Declare Function cvCreateImage lib core (imagesize as CvSize, depth as Uint32, nChannels as Uint32) as Ptr
CvSize structure should be.
width as Uint32
height as Uint32
Thanks Sam,
Of course I’m using a CvSize structure: OK when using Int32!
Thanks a lot
Really strange,
img = cvLoadImage (“lena.tiff”, 3) is perfectly running but cvCreateImage not : same error concerning cvInitImageHeader call
May I ask if you two were able to get OpenCV 64 bit declares for Xojo?
Yes, also for me this would be very interesting. (get OpenCV 64 bit declares for Xojo)