Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ROI.cpp
Package: ROI.zip [view]
Upload User: bjtznx
Upload Date: 2022-07-26
Package Size: 1k
Code Size: 1k
Category:
OpenCV
Development Platform:
Visual C++
- #include <stdio.h>
- #include <cv.h>
- #include <highgui.h>
- #include <math.h>
- int main(void)
- {
- /* load image */
- long current_frame = 0;
- while(true)
- {
- CvCapture *input_video = cvCaptureFromFile("SAM_0826.AVI");
- cvSetCaptureProperty( input_video, CV_CAP_PROP_POS_FRAMES, current_frame );
- IplImage *img1 = cvQueryFrame( input_video );
- //cvNamedWindow( "SRC", 0 );
- //cvShowImage( "SRC", img1 );
- /* sets the Region of Interest
- Note that the rectangle area has to be __INSIDE__ the image */
- cvSetImageROI(img1, cvRect(0, 0, 640, 187));
- /* create destination image
- Note that cvGetSize will return the width and the height of ROI */
- IplImage *img2 = cvCreateImage(cvGetSize(img1),img1->depth,img1->nChannels);
- /* copy subimage */
- cvCopy(img1, img2, NULL);
- IplImage *img3 = cvCreateImage(cvGetSize(img1),img1->depth,img1->nChannels );
- cvConvertImage(img2, img3, CV_CVTIMG_FLIP);
- /* Show the output */
- cvNamedWindow( "ROI", 0 );
- cvShowImage( "ROI", img3 );
- cvWaitKey(10);
- /* always reset the Region of Interest */
- cvResetImageROI(img1);
- current_frame++;
- }
- }