Hi everyone,
I’m learning the new G-Api module, but I’m having some difficulty using it in an OOP structure using classes and Qt.
I took a look at the OpenCV examples and they are not oop but they write all the code in one main.cpp file. In my case I have an object drawing in which I have * .h and * .cpp files. I get the frames from a video camera and process them in a class that I have called processor. I would like to know how to declare the g-api variables in the header file and process the arriving frames in the cpp file.
please show, what you have so far., and explain, what your ui should do.
this sounds like a major design flaw.
you should not need to expose any g-api types or variables to your qt ui (where the header is needed), it’s a matter of “seperation of concern”.
try to do without the member variables.
(if you can’t get away with those, at least use a PIMPL pattern, or interfaces / pure virtual functions on the qt side, and add your variables to the implementation class only)
(also, just saying, … somehow, only noobs think, their current program would have any actual “users”, and that it would need any fancy gui…
if you want to learn about g-api, just do that. don’t overcomplicate it by coupling to some (very special api!) gui design problem)