Skip to content

Create BridJ Mapping for method with IplImage* parameter #35

@ochafik

Description

@ochafik

From @apiening on September 16, 2012 22:11

Hi nativelibs4java team,

I have a library written in C++ using OpenCV 2.4.2 doing image analys and manipulation. I want to leave the chained processing in the C++ unit as much as possible (for performance and decoupling).

Basically I want to call the library from Java (Mac OS X 10.8.1) with the image-data and display the manipulated image on a swing JScrollPane canvas.

=> I have JavaCV running and I can create IplImage Objects and use them. Now I would like to pass a IplImage to my C++ library.
=> I have added a method signature in my header file with a IplImage* parameter
=> I use JNAerator to create the mapping code, but it fails:

java -Xmx1g -jar jnaerator-0.10-shaded.jar -I/opt/local/include/ BridJTest_so_Cpp/dist/Debug/GNU-MacOSX/libBridJTest_so_Cpp.dylib BridJTest_so_Cpp/Test.h -mode Jar

Warning: no -library option for file 'Test.h', using "Test".
Auto-configuring parser...
Parsing native headers...
/usr/include/sys/cdefs.h:74:25: warning: #warning "Unsupported compiler detected"
/opt/local/include/opencv2/core/operations.hpp:55:0: error: File not found: bits/atomicity.h in /opt/local/include /opt . /usr/include /usr/include/c++/4.2.1 /usr/include/c++/4.2.1/tr1

Looking into /opt/local/include/opencv2/core/operations.hpp it looks like bits/atomicity.h should not be included for my plattorm if i red the preprocessor directives correctly. But JNAerator tries it anyway and fails (wrong defines?).
I had success creating working mappings if I removed the OpenCV header includes and the IplImage parameter.

Please can you give me a hint how I get in the right direction? Is there a chance to use the JavaCP BridJ mapping and "extend" in that way that I can call my method with the IplImage* parameter?

Any help on this topic would be greatly appreciated!

Thank you!

Andreas Piening

Copied from original issue: nativelibs4java/nativelibs4java#337

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions