Okay, so, I'm trying to do something like a "Compound Literal" AFAIK, I remember doing this on C while programming for embedded devices, but I'd to move to C++. I know that C++ is not C, I thought they were compatible.
GaussBlurParams *GBPs= &(GaussBlurParams) {Size(5,5), (int)3, (int)3, (int)0};
But compiler complains with: taking address of temporary [-fpermissive] error. I though on using a 'new' constructor but It gets worse.
Here's my Definition of GaussBlurParams
typedef struct gaussBlurParams{
cv::Size ksize;
int stdX;
int stdY;
int borderType;
} GaussBlurParams;
How can I overcome this problem?
Best Regards!
EDIT: Okay, This is what I'm doing:
void ProcessFrames(Mat In, Mat Out, GaussBlurParams GBPs){
GaussianBlur(In, Out, GBPs.ksize, GBPs.stdX, GBPs.stdY);
}
createTrackbar("Kernel Size Height", "Output Stream Viewer", &GBPs->ksize.height, 10, NULL);
createTrackbar("Kernel Size Width", "Output Stream Viewer", &GBPs->ksize.width, 10, NULL);
createTrackbar("STD X Sigma", "Output Stream Viewer", &GBPs->stdX, 10, NULL);
createTrackbar("STD Y Sigma", "Output Stream Viewer", &GBPs->stdX, 10, NULL);
ProcessFrames(*Frame, *OutputFrame, *GBPs);
EDIT: Here's my Code on Github if you want to take a look! (Commit)
GBPstruct? Especially, how long does it need to stay valid?