I have an image (cv::Mat) with size of 92x112 I want to surround the object in this image with a ellipse then get only this pixels to create another image containing only the object.
I mean, cropping the original image with a ellipse.
It's possible?
I am trying drawing a ellipse, but the ellipse don't draw complete, with that:
ellipse(escalada, Point(92/2,112/2), Size(92/2*0.95,112/2*0.85), 0.0, 90.0, 0.0, Scalar(255,0,0), 3, 8);
and made some test with cvSetImageROI to crop the image, but this method works only with cvRect.
Some idea?
解决方案
I solve using this:
imagen = imread(nombre_imagen,0); //read image (grayscale)
//Use old C interface
IplImage *res,*roi;
IplImage src(imagen);
res = cvCreateImage(Size(imagen.rows,imagen.cols),8,1);
roi = cvCreateImage(Size(im