Ask Your Question

mreff555's profile - activity

2014-03-27 07:18:57 -0600 asked a question non-linear transformation

Hello, I'm still relatively new to Opencv. I am trying to produce what is turning out to be a rather difficult transformation.

I have a 4096x4096 black and white image. The area of interest is a circular ring which has a width of 756 pixels, making it occupy the majority of the image. What I need to do is to cut through the ring at a certain radius and stretch the image straight. stretching everything inside the ring. The end result would be an image that was 756 pixels high and 2PI( outer radius of ring).

Can this be done with an affine transformation? Or do I need to use something else.

Thanks, Dan

2014-03-16 11:39:34 -0600 received badge  Editor (source)
2014-03-16 11:37:16 -0600 asked a question function trouble upgrading from c to c++

I have a very small simple function using opencv libraries which takes a source image and stamps it to a location on a destination image. No matter what I try I am getting nowhere trying to update it to a c++ format. Here is the original.

void coriolus::stamp(IplImage * src, IplImage *dst, CvRect r)
{
      IplImage * mask = cvCloneImage(src);
      cvNot(mask,mask);
      cvSetImageROI(dst, r);
      cvCopy(src,dst,mask); 
      cvResetImageROI(dst); 
      cvReleaseImage(&mask);    
}

I actually thought it would be something simple like

void stamp(Mat src, Mat dst, Rect r)
{
    Mat mask = src.clone();
    bitwise_not(mask,mask);
    dst.adjustROI( Rect(r) );
    src.copyTo(dst,mask);
}

what am I missing?