TAILIEUCHUNG - OpenCVTutorial - Part II

The first step after tablishing a working environment is to begin manipulating images .This tutorial will give an introduction to the usage of some bacsic functions | OpenCV Tutorial Part II Loading Images and Using Histograms 29 November 2005 Gavin S Page gsp8334@ Tasks The first step after establishing a working environment is to begin manipulating images. This tutorial will give an introduction to the usage of some basic functions. Steps Performed Load an Image Calculate Histogram Values Calculate Basic Statistics Using Histogram Information For explanations on any functions used here see the OpenCV documentat. Gavin S Page gsp8334@ Loading the Image //the name of the image being loaded char* imageName = ""; //Load the image and make sure that it loads correctly IplImage* im = cvLoadImage(imageName, -1); if( im == 0 ) { //Drop out if the image isn't found std::cerr Gavin S Page gsp8334@ Tasks The first step after establishing a working environment is to begin manipulating images. This tutorial will give an introduction to the usage of some basic functions. Steps Performed Load an Image Calculate Histogram Values Calculate Basic Statistics Using Histogram Information For explanations on any functions used here see the OpenCV documentat. Gavin S Page gsp8334@ Loading the Image //the name of the image being loaded char* imageName = ""; //Load the image and make sure that it loads correctly IplImage* im = cvLoadImage(imageName, -1); if( im == 0 ) { //Drop out if the image isn't found std::cerr Gavin S Page gsp8334@ Specifying a Working Region In order to work with a histogram the image will have to converted to a single plane. //Create a single planed image of the same size as the original IplImage* grayImage = cvCreateImage(cvSize(im->width,im->height), IPL_DEPTH_8U, 1); //convert the original image to gray cvCvtColor(im, grayImage, CV_BGR2GRAY); //create a rectangular area to evaluate CvRect rect = cvRect(0, 0, 500, 600 ); //apply the rectangle to the image and establish a region of interest cvSetImageROI(grayImage, rect); Create an Image of a Single Plane Create the Grayscale Image Convert the Image to Gray Specify a Rectangular Region of Interest (ROI) and apply it to the image The cvCvtColor function can be used to convert images to one of several color spaces. To restore the region of interest to the whole image the .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.