What to include for cv::meanShift function? - c++

I've included the following and it doesn't work :
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
What to include for cv::meanShift function ?

it's in the video module, so:
#include <opencv2/video/video.hpp>

2 hours later I found the answer :)
For some reason #include can't be included directly so the following code will include the video module indirectly.
#include "opencv2/video/tracking.hpp"
#include "opencv2/video/background_segm.hpp"
Answer here : http://fossies.org/dox/opencv-2.4.9/video_8hpp.html

Related

identifier "ParseNetworkString" is undefined although I included the header files

MSVC keeps telling me that ParseNetworkString is undefined.
But I've done:
#include <Winsock2.h>
#include <Ws2tcpip.h>
#include <iphlpapi.h>
as expressed in the remark part of the docs
Thank you.
I've had a look inside "iphlapi.h" and it states (line 1287)
// app must include winsock2.h, ws2ipdef.h, and windns.h to use this API
So when I use
#include <WinSock2.h>
#include <ws2ipdef.h>
#include <WinDNS.h>
#include <iphlpapi.h>
ParseNetworkString becomes available.
So it seems you were on the right track, just missing the include of <WinDNS.h>

Syntax highlighting for llvm c++ api in clion

Right now I'm quite extensively using the C++-Api for LLVM IR. I'm using CLion as my IDE and im building and linking the project via a Makefile.
The includes look like the following
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
The problem now is that I don't have any syntax highlighting for the things coming from the llvm headers. How do I enable that.

C++ program compiling without functional header

As per CPP Doc, std::greater is defined in <functional> header but my C++ program using std::greater is compiling with TDM-GCC-64 5.1.0 and running with only the following includes :
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <unordered_map>
It could be because <algorithm> automatically includes <functional> but since this is not mentioned in the doc, I was wondering is there a way to know this before hand ?
Just to close the topic, the conclusion is that this is implementation dependent and all the necessary headers should be included for portability.

error: putText is not a member of CV?

I can not use the function putText. I get the compilation error "putText is not member of CV" or "putText is not declared in this scope".
These are the libraries I am including:
#include <iostream>
#include "core.hpp"
#include "highgui.hpp"
#include "imgcodecs.hpp"
#include "cv.h"
and that's how I am calling it:
cv::putText(frame,"REC",Point(0,60),2,2,Scalar(0,0,255));
what am I doing wrong?
putText has been moved to imgproc module in OpenCV 3 (previously it was in core module).
So you need to:
#include "imgproc.hpp"
You can include opencv.hpp to avoid this kind of problems, since it will include all headers for you.

build error with c++ - ‘find_if’ is not a member of ‘std'

While building a project, I get this cryptic error:
‘find_if’ is not a member of ‘std'
find_if() is used this way: std::find_if(...).
Any idea where it could come from ?
add the inclusion:
#include <algorithm>
to your implementation file.
Did you include the header
#include <algorithm>
You need #include <algorithm>
Include the <algorithm> header file:
#include <algorithm>