[Opencv]1 Experience OpenCV

Source: Internet
Author: User

<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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.