<span style= "FONT-SIZE:18PX;" > #include "highgui.h" int main (int argc,char** argv) { iplimage* img=cvloadimage (argv[1]); Cvnamedwindow ("Test1", cv_window_autosize); Cvshowimage ("Test1", IMG); Cvwaitkey (0); Cvreleaseimage (&img); Cvdestorywindow ("Test1");} </span>
If is completely opencv beginner's words perhaps argv[1] will let the person be puzzled, actually here also may use the Linux address to replace, remembers uses a "\", because needs to escape. The Cvloadimage () function is a high-level invocation interface that determines the format of the loaded file by its file name, and the function automatically allocates the memory required for the image data structure.
#include <cv.h> #include </pre></p><p></p><p><span style= "FONT-SIZE:18PX;" The function of creating a slider bar in >highgui is as follows, the first 2 parameters specify the name of the slider and the name of the sliding bar's secondary window, respectively. One of the next two parameters is value, which is a shaping pointer, and when the slider is dragged, OpenCV automatically passes the value represented by the current position to the integer to which the pointer is pointing, and the other parameter count is an integer value, which is the maximum value that the slider can represent. The last parameter is a pointer to the back function, and when the slider is dragged, the back function is automatically called. This is similar to the function implementation of mouse events. The rollback function must be in cvtrackbarcallback format. </span></p><span style= "FONT-SIZE:18PX;" ></span><pre class= "cpp" name= "code" >int Cvcreatetrackbar ( const char* trackbar_name, const char* window_name, int* value, int count, cvtrackercallback on_change);
void (*callback) (int position)
int Cvgettrackbarpos ( const char* trackbar_name, const char* window_name), void Cvsettrackbarpos ( const char* trackbar_name, const char* window_name, int pos);
These two functions can be used anywhere in the program to read or set the value of the slider bar.
http://download.csdn.net/detail/u013589223/8191881
http://download.csdn.net/detail/u013589223/8191893
The above is a well-configured OPENCV property sheet, Welcome to download.
[Opencv]1 Experience OpenCV