| | |
| | | } |
| | | } |
| | | free_image(copy); |
| | | if(disp->height < 500 || disp->width < 500 || disp->height > 1000){ |
| | | int w = 500; |
| | | if(disp->height < 448 || disp->width < 448 || disp->height > 1000){ |
| | | int w = 448; |
| | | int h = w*p.h/p.w; |
| | | if(h > 1000){ |
| | | h = 1000; |
| | |
| | | } |
| | | IplImage *buffer = disp; |
| | | disp = cvCreateImage(cvSize(w, h), buffer->depth, buffer->nChannels); |
| | | cvResize(buffer, disp, CV_INTER_NN); |
| | | cvResize(buffer, disp, CV_INTER_LINEAR); |
| | | cvReleaseImage(&buffer); |
| | | } |
| | | cvShowImage(buff, disp); |
| | |
| | | exit(0); |
| | | } |
| | | image out = ipl_to_image(src); |
| | | cvReleaseImage(&src); |
| | | if((h && w) && (h != out.h || w != out.w)){ |
| | | //printf("resize\n"); |
| | | image resized = resize_image(out, w, h); |
| | | free_image(out); |
| | | out = resized; |
| | | } |
| | | cvReleaseImage(&src); |
| | | return out; |
| | | } |
| | | |