What is this in this OpenCV code for C, Is it a function or a struct declaration?

asked 2013-10-24 16:03:11 -0500

joeish80829 gravatar image

updated 2013-10-24 16:09:05 -0500

berak gravatar image

Here is what i'm talking about i got the code from here

 CvHistogram* hist;
     int hist_size[] = { h_bins, s_bins };
     float h_ranges[] = { 0, 180 };
     float s_ranges[] = { 0, 255 };
     float* ranges[] = { h_ranges, s_ranges };
     hist = cvCreateHist( 2, hist_size, CV_HIST_ARRAY, ranges, 1 );

After I saw it i researched and from the c struct wiki it doesnt appear to be anything like a struct because struct isnt mentioned any where and it doesn't appear to be a function because it has curly braces and and a semi-colon in the wrong place....still a little new to opencv....so could use advice...Cheers

edit retag flag offensive close merge delete



the brackets just denote a block scope, any declaration inside won't be visible outside, and thus won't clutter the global namespace.

again - not related to opencv at all.

also, if you see a post on opencv dated 2009, man - ignore it !

berak gravatar imageberak ( 2013-10-24 16:14:36 -0500 )edit

@berak +1, don't use those c api again, they are much more harder to read and maintain compare with c++ api.

stereomatching gravatar imagestereomatching ( 2013-10-24 17:01:18 -0500 )edit