• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Can Someone Please Explain Proper Set-up Of OpenCV in C

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,


I am new to C and testing the waters this is a language I'm really interested in for a lot of reasons... I am attempting to play around with openCV and want to put it in my C project in Netbeans, Can someone please explain how to put openCV in my project folder so it will function. Thanks
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad to. OpenCV build and installation are rather OS dependent. If it's Linux or Windows, I can help. What OS are you on and what have you tried so far?
 
travis Haycock
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. I have actually solved the issue after a few hours of searching. I found the tutorial on openCv community on Youtube which demonstrated how to install it on mac osx This seems to functioning fine now, although if you don't mind i'd like to ask something in direct relation to openCV /C ... I found the documentation is mostly in C++ the OpenCV syntax on these demo pages it states C/ C++ Does this mean the syntax and structure are the same for C and C++ thanks, this is essentially what is holding me back at the moment, just searching for correct documentation thats all.
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The C API hasn't got much love from a couple of years now, actually.


Some of the modules that have been around a while still support the C API and they work fine. These C functions and types are usually prefixed with a "cv...".
For example, the C equivalent of C++ imread() is cvLoadImage().
If the C++ module documentation - such as the imgcodecs module for image file reading and writing - has a C API URL at top, use that as the documentation. Otherwise, you're out of luck.

Not all features available in C++ API may be available for C programs, which is why you're better off using C++ for OpenCV.
If you want to stick to C constructs, just don't use any C++ features in your own code.
Mat objects can be directly assigned to C IplImage or CvMat structs; so using the C++ API should not be much of a problem.
 
travis Haycock
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ive switched to C ++ a bit more organized with the OOP ;) just getting familiar with the opencv library etc. But i do find myself slow and going in circles in context of GUI... I realize the highgui is suppose to create a functioning gui but am having problems with simply creating these? I am using Xcode and am getting errors. Is there any clear documentation on constructing GUI I should note that I'm new to C++ so if I'm asking questions that seem simplistic its due to my lack of familiarity with C ++
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately, I have not come across any one single comprehensive tutorial that covers all of highgui. But since highgui API is small and quite limited in what it can do, it's not that hard to pick it up from here and there.
See if these tutorials and links help:
- Basic tutorial that shows creating window and trackbar controls.
Highgui can be built to use either the GTK framework or QT framework. This tutorial will work regardless of which framework was used at build time.
API documentation's here

- Tutorial that shows some more controls like push buttons, checkboxes, radio buttons and status bars
This works only if Highgui was built to use the QT framework. It doesn't work if GTK was used.

While highgui is fine for quick prototyping, eventually you'd want to build full fledged GUIs for production apps. For that, you should learn the QT GUI framework and then display OpenCV outputs in QT controls like QLabel. See what QT is capable of here and have a look at this beginner's tutorial.

What errors are you seeing with highgui?
 
travis Haycock
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello thanks for your effort I have cleared this up essentially following some of your advice and researching and have saved myself some headaches although I am met with more questions which are confusing considering I'm using a new IDE for C++ and newish to the language, again thanks for your help.
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When things are getting increasingly confusing, I try to reduce the number of unfamiliar things by using something I know, and solve just 1 unknown at a time before taking up the next.
Here, it looks to me like C++, IDE, opencv, and QT are all relative unfamiliar to you.
I don't know anything about xcode, but googling says it's capable of building C++ projects. So if you're familiar with Xcode, I suggest building a simple procedural C++ hello world level highgui application using Xcode itself.
You don't need to switch to a new IDE like QT creator to use highgui or QT; QT can be used like any other library in any project and IDE.
In fact you don't even need to know anything about QT at this point, since highgui only uses it internally. Highgui APIs are enough to start off a simple GUI application that shows images and videos.
 
I didn't like the taste of tongue and it didn't like the taste of me. I will now try this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic