Ask Your Question

Vishalkumbhar's profile - activity

2014-04-09 01:20:56 -0600 asked a question Find close button icon in screenshot

I want to find close button icon of window in the screenshot. I am using template matching, but not getting good result. Is there any other way to do this task.

2014-03-21 08:19:25 -0600 asked a question JavaCV Template matching improper if region set using cvSetImageROI

I am trying to do match template using javacv. Problem is that, if i set region using cvSetImageROI then output is not proper, it shows rectangle anywhere in the resulted output area, but if cvSetImageROI is not used then results are proper, means no rectangle shown in the output image. Following is the code

public static void main(String c[]) {  
    IplImage src = cvLoadImage("D:\\opencvtest\\1.jpg", 0);  
    IplImage tmp = cvLoadImage("D:\\opencvtest\\close.png", 0);  
    IplImage result = cvCreateImage(cvSize(src.width() -tmp.width()+1,src.height()-tmp.height() + 1),IPL_DEPTH_32F,1);
    cvZero(result);

   // cvSetImageROI(src, new CvRect(370, 175, 624, 398));
    //cvSetImageROI(result, new CvRect(370, 175, 624 - tmp.width() + 1, 398 - tmp.height() + 1));

    cvMatchTemplate(src, tmp, result, CV_TM_CCORR_NORMED);

    double[] min_val = new double[2];
    double[] max_val = new double[2];
    CvPoint minLoc = new CvPoint();
    CvPoint maxLoc = new CvPoint();

    cvMinMaxLoc(result, min_val, max_val, minLoc, maxLoc,null);
    CvPoint point = new CvPoint();
    point.x(maxLoc.x() + tmp.width());
    point.y(maxLoc.y() + tmp.height());
    cvRectangle(src, maxLoc, point, CvScalar.GREEN, 2, 8, 0);
    cvShowImage("Lena Image", src);
    cvWaitKey(0);
    cvReleaseImage(src);
    cvReleaseImage(tmp);
    cvReleaseImage(result);
}
2014-03-14 00:44:24 -0600 asked a question Get Active window from screenshot

I am using windows platform and JAVA. My requirement is get the active window from screenshot.
Please help me on this issue.