Ask Your Question

muhammet_Ali's profile - activity

2020-11-03 02:39:49 -0600 received badge  Notable Question (source)
2016-02-04 04:43:34 -0600 received badge  Popular Question (source)
2012-11-30 10:25:37 -0600 received badge  Student (source)
2012-11-01 12:22:05 -0600 answered a question Problems following the Windows installation tutorial with 2.4.2

There is no executable file in package.You need to move unpacked files to C:/OpenCV ( or wherever you want ). After that if you want to use VS C++ , you need same make arrangements.When it is needed you can show path of include files like this : WhereYouSaved/opencv/include/bin etc.

2012-10-31 21:17:52 -0600 answered a question Opencv: cut image from the other image

I ve tried this way and it has worked.I ve used rough arrangments but you can put it into the form you want by using same thinking.

IplImage * img = cvLoadImage("c:/lena.jpg");
IplImage * out =cvCreateImage(cvSize(50,50),img->depth,img->nChannels);
cvZero(out);

out->origin=img->origin;
out->imageData=img->imageData;
out->widthStep=img->widthStep;

uchar * Iptr=(uchar*) (img->imageData+rec.y*img->widthStep+rec.x*img->nChannels);
for(int y=0;y<50;y++)
{
    uchar * Optr=(uchar*) (out->imageData+y*out->widthStep);
    uchar * Iptr=(uchar*) (img->imageData+(y+100)*img->widthStep);
    for( int x=0;x<50;x++)
    {
        Optr[3*x+0]=Iptr[(x+100)*3+0];
        Optr[3*x+1]=Iptr[(x+100)*3+1];
        Optr[3*x+2]=Iptr[(x+100)*3+2];
    }

}
2012-10-31 20:29:16 -0600 answered a question Opencv: cut image from the other image

how can we do same thing by this way.I don t know where I am missing.

IplImage * img = cvLoadImage("c:/buk.jpg");
    IplImage * out =cvCreateImage(cvSize(50,50),img->depth,img->nChannels);
    cvZero(out);
    CvRect rec=cvRect(img->width/2-25,img->height/2-25,50,50);

    cvSetImageROI(img,rec);

    cvAdd(img,out,out);
2012-10-26 20:14:21 -0600 asked a question cvPyrsegmentation

Hello I am using VS 12 C++,and did OK all operations of my book so far.But in a point cvPyrsegmentation() function is appearing in the book but Intellisense is not recognizing cvPyrsegmentation() function.I ve included cv.h and highgui.h . I dont know what to do because all functions except this is working correctly.

2012-10-24 21:23:43 -0600 received badge  Supporter (source)
2012-10-24 21:23:39 -0600 received badge  Scholar (source)
2012-10-23 15:51:34 -0600 commented answer can not draw rectangle simultaneously

yes it worked.Thank you very much.

2012-10-22 23:17:13 -0600 received badge  Editor (source)
2012-10-22 23:01:28 -0600 asked a question can not draw rectangle simultaneously

When ı executed code program is not working correctly.I want to start to draw a rectangle when mouse lButton is clicked and finish drawing when lbutton is up. when moving the mouse ,nothing will happen but it have to increase width and height of box.The problem is exactly that: image appearing and first time ( sometimes 2 times ) I am drawing rectangle.but it doesn t seem on screen when I close image window it automatically appears with rectangle. So after restarting image window I can only have one or two rectangles.

Why are there only rectangles?

Why are they occuring when image window restarts?

#include<opencv\cv.h>
#include<opencv\highgui.h>

using namespace cv;
bool drawing=false;
CvRect box;

void drawbox(IplImage * img,CvRect rect )
{
    cvRectangle(img,cvPoint(box.x,box.y),cvPoint(box.x+box.width,box.y+box.height),cvScalar(0,0,200));
}

void mouse( int even,int x,int y,int flag,void * param)
{
    IplImage* out = ( IplImage * ) param;

    switch (even)
    {
    case CV_EVENT_LBUTTONDOWN:
        drawing=true;
        box=cvRect(x,y,0,0);
        break;
    case CV_EVENT_MOUSEMOVE:
        if (drawing)
        {
            if( x>box.x )
                box.width=x-box.x;
            else
                box.width=box.x-x;
            if(y>box.y)
                box.height=y-box.y;
            else
                box.height=box.y-y;
        }
        break;
    case EVENT_LBUTTONUP:
        drawing = false;
        drawbox(out,box);
        break;
    }
}

void main()
{
    IplImage * img= cvLoadImage("c:/lena.jpg");
    box=cvRect(-1,-1,0,0);
    cvNamedWindow("pencere");
    cvSetMouseCallback("pencere",mouse,(void*) img);
    while (true)
    {
        cvShowImage("pencere",img);
        if(drawing) drawbox(img,box); // what changes if I delete this line
        cvWaitKey();
    }
}
2012-10-06 05:39:45 -0600 asked a question CvScalar to CvArr* confliction

Hi I am new OpenCv learner and I ve got problem coding this example on VS2012 C++

void main() { IplImage * src =cvLoadImage("c:/lena.jpg");

int x=50;
int y=50;
int width= 100;
int height = 100;
int add =150;


cvSetImageROI(src,cvRect(x,y,width,height));

cvAdd(src,cvScalar(add),src); // in books here seems to be true but I am getting error
// no conversion suits to convert from CvScalar to const CvArr* 

cvResetImageROI(src);

cvShowImage("wind",src);


    cvWaitKey();

system("pause");

}

if anyone help I will be very appreciate,Thanks

2012-09-30 05:42:27 -0600 answered a question msvcr100d.dll is missing (OpenCV 2.4.2, VisualStudio 2012)

I think the problem is not special issue for openCV.it is some kind of general problem of VS. maybe this can be helpful http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/trying-to-open-computer-management-the-program/5c9d301a-2191-4edb-916e-5e4958558090