Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

i have trouble with handling mouse event in opencv

i want to write a program with this feature: 1:when a user click left button of mouse on windows a circle is constructed with 15 radius at first i make a black image 500500 and i use setMouseCallback for my_mouse_callback and in function my_mouse_callback i write my circle code ,when run the program there arent any errors but only there is a black image 500500 i know my program has trouble but where? please help me my program is like this:

include <cv.h>

include <highgui.h>

include <iostream>

using namespace std; using namespace cv; Mat image; void my_mouse_callback( int event, int x, int y, int flags, void* param ); int main() { int i,j,k; Mat image; image.create(500,500,CV_8UC3); namedWindow("amin"); for(i=0;i<500;i++){ for(j=0;j<500;j++){ for(k=0;k<3;k++){ Vec3b &intensity = image.at<vec3b>(j, i); intensity.val[k]=0; } } } setMouseCallback( "amin", my_mouse_callback, &image );

imshow("amin",image);
waitKey(0);
return(0);

} void my_mouse_callback( int event, int x, int y, int flags, void* param ) { Mat &image= ¶m; if(event==CV_EVENT_LBUTTONDOWN){ circle( image, Point(x,y), 20, Scalar(0xff,0xff,0xff)

         );
}

}

i have trouble problems with handling mouse event in opencv

i want to write a program with this feature: 1:when a user click left button of mouse on windows a circle is constructed with 15 radius at first i make a black image 500500 and i use setMouseCallback for my_mouse_callback and in function my_mouse_callback i write my circle code ,when run the program there arent any errors but only there is a black image 500500 i know my program has trouble but where? please help me my program is like this:

include <cv.h>

include <highgui.h>

include <iostream>

using namespace std; using namespace cv; Mat image; void my_mouse_callback( int event, int x, int y, int flags, void* param ); int main() { int i,j,k; {

int i,j,k;

Mat image; image.create(500,500,CV_8UC3); namedWindow("amin"); for(i=0;i<500;i++){ for(j=0;j<500;j++){ for(k=0;k<3;k++){ image;

image.create(500,500,CV_8UC3);

namedWindow("amin");

for(i=0;i<500;i++){

for(j=0;j<500;j++){

for(k=0;k<3;k++){

Vec3b &intensity = image.at<vec3b>(j, i); i);

intensity.val[k]=0; } } } setMouseCallback( "amin", my_mouse_callback, &image } } } setMouseCallback(

"amin",

my_mouse_callback,

&image

);

imshow("amin",image);
waitKey(0);

imshow("amin",image);

waitKey(0);

return(0);

} void my_mouse_callback( int event, int x, int y, int flags, void* param ) { Mat &image= ¶m; if(event==CV_EVENT_LBUTTONDOWN){ circle( image, Point(x,y), 20, {

if(event==CV_EVENT_LBUTTONDOWN){

circle(

image,

Point(x,y),

20,

Scalar(0xff,0xff,0xff)

         );
}

}

i have problems with handling mouse event in opencv

i want to write a program with this feature: 1:when a user click left button of mouse on windows a circle is constructed with 15 radius at first i make a black image 500500 and i use setMouseCallback for my_mouse_callback and in function my_mouse_callback i write my circle code ,when run the program there arent any errors but only there is a black image 500500 i know my program has trouble but where? please help me my program is like this:

include <cv.h>

include <highgui.h>

include <iostream>

using namespace std; using namespace cv; cv;

Mat image; image;

void my_mouse_callback( my_mouse_callback(

int event, int x, int y, int flags, void* param param

); int main() {

int i,j,k;

Mat image;

image.create(500,500,CV_8UC3);

namedWindow("amin");

for(i=0;i<500;i++){

for(j=0;j<500;j++){

for(k=0;k<3;k++){

Vec3b &intensity = image.at<vec3b>(j, i);

intensity.val[k]=0; } } } setMouseCallback(

"amin",

my_mouse_callback,

&image

);

imshow("amin",image);

waitKey(0);

return(0); } void my_mouse_callback( int event, int x, int y, int flags, void* param ) {

if(event==CV_EVENT_LBUTTONDOWN){

circle(

image,

Point(x,y),

20,

Scalar(0xff,0xff,0xff)

         );
}

}

i have problems with handling mouse event in opencv

i want to write a program with this feature: feature:

1:when a user click left button of mouse on windows a circle is constructed with 15 radius radius

at first i make a black image 500500 500*500

and i use setMouseCallback for my_mouse_callback and in function my_mouse_callback i write my

circle code ,when run the program there arent any errors but only there is a black image 500500 500*500 , i know my program has trouble but where? please help me my program is like this:

include <cv.h>

include <highgui.h>

include <iostream>

using namespace std; using namespace cv;

Mat image;

void my_mouse_callback(

int event, int x, int y, int flags, void* param

); int main() {

int i,j,k;

Mat image;

image.create(500,500,CV_8UC3);

namedWindow("amin");

for(i=0;i<500;i++){

for(j=0;j<500;j++){

for(k=0;k<3;k++){

Vec3b &intensity = image.at<vec3b>(j, i);

intensity.val[k]=0; } } } setMouseCallback(

"amin",

my_mouse_callback,

&image

);

imshow("amin",image);

waitKey(0);

return(0); } void my_mouse_callback( int event, int x, int y, int flags, void* param ) {

if(event==CV_EVENT_LBUTTONDOWN){

circle(

image,

Point(x,y),

20,

Scalar(0xff,0xff,0xff)

         );
}

}

i have problems with handling mouse event in opencv

i want to write a program with this feature:

1:when a user click left button of mouse on windows a circle is constructed with 15 radius

at first i make a black image 500*500

and i use setMouseCallback for my_mouse_callback and in function my_mouse_callback i write my my

circle code ,when run the program there arent any errors but only there is a black image 500*500 , , i know my program has trouble but where? where? please help me my program is like this:

include <cv.h>

include <highgui.h>

include <iostream>

using namespace std; using namespace cv;

Mat image;

image; void my_mouse_callback(

int my_mouse_callback(int event, int x, int y, int flags, void* param

); int main() {

int i,j,k;

param); int main() { int i,j,k; Mat image;

image.create(500,500,CV_8UC3);

namedWindow("amin");

for(i=0;i<500;i++){

for(j=0;j<500;j++){

for(k=0;k<3;k++){

image; image.create(500,500,CV_8UC3); namedWindow("amin"); for(i=0;i<500;i++){ for(j=0;j<500;j++){ for(k=0;k<3;k++){ Vec3b &intensity = image.at<vec3b>(j, i);

intensity.val[k]=0; i); intensity.val[k]=0; } } } setMouseCallback(

"amin",

my_mouse_callback,

&image

);

imshow("amin",image);

waitKey(0);

return(0); } void my_mouse_callback( int event, int x, int y, int flags, void* param ) {

if(event==CV_EVENT_LBUTTONDOWN){

circle(

image,

Point(x,y),

20,

Scalar(0xff,0xff,0xff)

         );
 }

}

  setMouseCallback(

      "amin",

      my_mouse_callback,

      &image

  );

      imshow("amin",image);

       waitKey(0);

       return(0); 
   } 

   void my_mouse_callback( int event, int x, int y, int flags, void* param ) {

    if(event==CV_EVENT_LBUTTONDOWN){

    circle(

    image,

    Point(x,y),

    20,

    Scalar(0xff,0xff,0xff)

     );

} }

i have problems with handling mouse event in opencv

i want to write a program with this feature:

1:when a user click left button of mouse on windows a circle is constructed with 15 radiusfor ex radius (15)

at first i make a black image 500*500

and i use setMouseCallback for my_mouse_callback and in function my_mouse_callback i write my

circle code ,when run the program there arent any errors but only there is a black image 500*500 , i know my program has trouble but where? please help me my program is like this:

Mat image;

void my_mouse_callback(int event, int x, int y, int flags, void* param);

int main() {

int i,j,k;

Mat image;

image.create(500,500,CV_8UC3);

namedWindow("amin");

 for(i=0;i<500;i++){

 for(j=0;j<500;j++){

   for(k=0;k<3;k++){

   Vec3b &intensity = image.at<vec3b>(j, i);

   intensity.val[k]=0; 
   }
 }

}

  setMouseCallback(

      "amin",

      my_mouse_callback,

      &image

  );

      imshow("amin",image);

       waitKey(0);

       return(0); 
   } 

   void my_mouse_callback( int event, int x, int y, int flags, void* param ) {

    if(event==CV_EVENT_LBUTTONDOWN){

    circle(

    image,

    Point(x,y),

    20,

    Scalar(0xff,0xff,0xff)

     );

} }

i have problems with handling mouse event in opencv

i want to write a program with this feature:

1:when a user click left button of mouse on windows a circle is constructed with for ex radius (15)

at first i make a black image 500*500

and i use setMouseCallback for my_mouse_callback and in function my_mouse_callback i write my

circle code ,when run the program there arent any errors but only there is a black image 500*500 , i know my program has trouble but where? please help me my program is like this:

void my_mouse_callback(int event, int x, int y, int flags, void* param);

int main() { int i,j,k;

Mat image;

void my_mouse_callback(int event, int x, int y, int flags, void* param);

int main() {

int i,j,k;

Mat image;

image.create(500,500,CV_8UC3);

namedWindow("amin");

 for(i=0;i<500;i++){
   for(j=0;j<500;j++){
     for(k=0;k<3;k++){
     Vec3b &intensity = image.at<vec3b>(j, i);
     intensity.val[k]=0; 
    }
 }
   } 
} 

setMouseCallback( "amin", my_mouse_callback, &image );

imshow("amin",image);
waitKey(0);

return(0);

}

  setMouseCallback(

      "amin",

      my_mouse_callback,

      &image

  );

      imshow("amin",image);

       waitKey(0);

       return(0); 
   } 

   

void my_mouse_callback( int event, int x, int y, int flags, void* param ) { if(event==CV_EVENT_LBUTTONDOWN){ circle( image, Point(x,y), 20, Scalar(0xff,0xff,0xff) circle( image, Point(x,y), 20, Scalar(0xff,0xff,0xff) );

} }

i have problems with handling mouse event in opencv

i want to write a program with this feature:

1:when a user click left button of mouse on windows a circle is constructed with for ex radius (15)

at first i make a black image 500*500

and i use setMouseCallback for my_mouse_callback and in function my_mouse_callback i write my

circle code ,when run the program there arent any errors but only there is a black image 500*500 , i know my program has trouble but where? please help me my program is like this:

void my_mouse_callback(int event, int x, int y, int flags, void* param);

int main() { int i,j,k;

Mat image;
image.create(500,500,CV_8UC3);

namedWindow("amin");

for(i=0;i<500;i++){
    for(j=0;j<500;j++){
        for(k=0;k<3;k++){
            Vec3b &intensity = image.at<vec3b>(j, i);
            intensity.val[k]=0; 
        }
    } 
} 

setMouseCallback( "amin", my_mouse_callback, &image );

imshow("amin",image);
waitKey(0);

return(0);

}

void my_mouse_callback( int event, int x, int y, int flags, void* param ) {
 if(event==CV_EVENT_LBUTTONDOWN){
     circle( image, Point(x,y), 20, Scalar(0xff,0xff,0xff) );
 }

}

i have problems with handling mouse event in opencv

i want to write a program with this feature:

1:when a user click left button of mouse on windows a circle is constructed with for ex radius (15)

at first i make a black image 500*500

and i use setMouseCallback for my_mouse_callback and in function my_mouse_callback i write my

circle code ,when run the program there arent any errors but only there is a black image 500*500 , that when i click left button of mouse nothing happens, i know my program has trouble but where? please help me my program is like this:

void my_mouse_callback(int event, int x, int y, int flags, void* param);

int main() { int i,j,k;

Mat image;
image.create(500,500,CV_8UC3);

namedWindow("amin");

for(i=0;i<500;i++){
    for(j=0;j<500;j++){
        for(k=0;k<3;k++){
            Vec3b &intensity = image.at<vec3b>(j, i);
            intensity.val[k]=0; 
        }
    } 
} 

setMouseCallback( "amin", my_mouse_callback, &image );

imshow("amin",image);
waitKey(0);

return(0);

}

void my_mouse_callback( int event, int x, int y, int flags, void* param ) {
if(event==CV_EVENT_LBUTTONDOWN){
    circle( image, Point(x,y), 20, Scalar(0xff,0xff,0xff) );
}

}