Module directory structure

asked 2017-09-12 02:17:49 -0500

mihaibujanca gravatar image

I was wondering why, while most headers are in include/opencv2/<module>/ or include/opencv2/<module>/<hal|utils|detail>, cuda and opencl headers are expected to be in src/cuda and src/opencl respectively. Furthermore both the .cu sources and the .hpp headers for cuda are expected to be in src/cuda, which doesn't necessarily seem like a very good directory structure.

Additionally some of the headers that are cuda related may need to be included by projects using the module, but with those headers being in src/cuda rather than include/opencv2/module/cuda, one would need to add that path explicitly to be able to include those headers (unless I am missing something and src/cuda headers are being added somehow.

edit retag flag offensive close merge delete

Comments

some of the headers that are cuda related may need to be included by projects using the module,

hmm, that's a problem. src/cuda might no more exist after the installation, you cannot rely on that for user-related code.

i guess, you need to wrap the needed functionality into some interface, a public api, (like it is done e.g. in cudastereo), which then has to go into include/opencv2/mymodule

berak gravatar imageberak ( 2017-09-12 02:46:21 -0500 )edit

@berak Good point on src/cuda not necessarily being installed. There are ways around the problems, but it just seemed more straightforward and easier to understand structure-wise if the files were in include/opencv2/<module>/cuda, I was just wondering if there is a good reason behind this

mihaibujanca gravatar imagemihaibujanca ( 2017-09-12 02:57:50 -0500 )edit