Opening an url in opencv 3.0 with VS 12 C++

asked 2016-02-25 11:20:26 -0600

txrxmo gravatar image

updated 2016-02-25 11:26:15 -0600

berak gravatar image

I want to put a mouse click event when I click on the picture a pop up a window and open an internet URL (not an image from the net and not for IP camera). My code for the mouseclick event for left button is as shown.

  if  ( event == EVENT_LBUTTONDOWN )
      {          import urllib;
           cout << "Left button of the mouse is clicked - position (" << x << ", " << y << ")" << endl;
          //Create a window
          namedWindow("My Browser", 1);
          stream=urllib.urlopen('http://google.com')
          imshow("My Browser", stream); 
      }

I thought of using the urlopen function but I am not sure if it is only for opening images from an url. I would like to ask, can i use this method? I hope someone can help me. Thank you.

edit retag flag offensive close merge delete

Comments

dear, urllib is a python library, you can't use that from c++ ;(

(also, imshow() does not render webpages)

berak gravatar imageberak ( 2016-02-25 11:27:11 -0600 )edit

@berak oh my, i didnt know.. thank you for telling me. Is there a possible way to do it in C++ of VS 12?? =(

txrxmo gravatar imagetxrxmo ( 2016-02-25 11:30:09 -0600 )edit

the short answer is: NO.

the long answer is: ofc. there are libraries like libcurl to retrieve internet content from c++, but please, how is this related to opencv (which is a computer-vision library) ?

i somehow think, you're on the wrong path alltogether.

what are you trying to achieve ?

berak gravatar imageberak ( 2016-02-25 11:34:54 -0600 )edit

@berak as i would later consolidate this mouse click with eye tracking program which controls the cursor and with a click on an image, i would need to link it to the internet by going to a url.

txrxmo gravatar imagetxrxmo ( 2016-02-25 11:40:35 -0600 )edit

@berak I added opencv so reduce the delay to the program

txrxmo gravatar imagetxrxmo ( 2016-02-25 11:41:44 -0600 )edit

lol, i see. good luck ;)

berak gravatar imageberak ( 2016-02-25 11:45:53 -0600 )edit