tailieunhanh - OpenCVTutorial - Part IV

Tham khảo tài liệu 'opencvtutorial - part iv', khoa học xã hội, thư viện thông tin phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | OpenCV Tutorial Part IV A Brief Guide to Memory Management (and other Miscellaneous Functions) 02 December 2005 Gavin S Page gsp8334@ Introduction Video, 30 frames per second Each frame is an image Images are arrays of pixels A 640x480 image is 307,200 pixels These must be represented in memory How much memory does your machine have? Why is Managing OpenCV Objects Important? IplImage: Structure from Intel Image Processing Library In addition to representing the image data IplImage holds utilizes a subset of IPL data useful in IP/CV: nSize : Size of Image nChannels : Number of Image Channels (1-4) width, height ROI : Region of Interest (used in Tutorial II) and others (see documentation) How Does OpenCV Represent Images? CvArr* is a function parameter for several OpenCV functions which accept arrays of more than one type. These are often IplImage*, CvMat*, or CvSeq*. A Top-Level OpenCV Type Gavin S Page gsp8334@ Handling IplImage cvCreateImage( CvSize size, | OpenCV Tutorial Part IV A Brief Guide to Memory Management (and other Miscellaneous Functions) 02 December 2005 Gavin S Page gsp8334@ Introduction Video, 30 frames per second Each frame is an image Images are arrays of pixels A 640x480 image is 307,200 pixels These must be represented in memory How much memory does your machine have? Why is Managing OpenCV Objects Important? IplImage: Structure from Intel Image Processing Library In addition to representing the image data IplImage holds utilizes a subset of IPL data useful in IP/CV: nSize : Size of Image nChannels : Number of Image Channels (1-4) width, height ROI : Region of Interest (used in Tutorial II) and others (see documentation) How Does OpenCV Represent Images? CvArr* is a function parameter for several OpenCV functions which accept arrays of more than one type. These are often IplImage*, CvMat*, or CvSeq*. A Top-Level OpenCV Type Gavin S Page gsp8334@ Handling IplImage cvCreateImage( CvSize size, int depth, int channels ); header = cvCreateImageHeader(size,depth,channels); cvCreateData(header); cvCloneImage( const IplImage* image ); cvLoadImage( const char* filename, int iscolor=1 ); Creating an IplImage The first two functions are useful for creating a blank image of the specified parameters. A possible use is in functions that require a pointer to a result. The clone function performs an exact copy of the IplImage* parameter. The load function loads an image from a file. cvReleaseImage( IplImage** image ); cvReleaseData( *image ); cvReleaseImageHeader( image ); Destroying an IplImage cvReleaseImage will work for the 3 single step creation functions The cvReleaseData/cvReleaseImageHeader combination is used when there is separate data and header information An image header is initialized using cvInitImageHeader. When allocating IplImage in a loop be sure to deallocate in the loop as well Gavin S Page gsp8334@ Utilizing IplImage cvSetImageROI( IplImage* image, .

TÀI LIỆU LIÊN QUAN
TỪ KHÓA LIÊN QUAN