/opencv_extra/learning_opencv_v2/ch3_ex3_11.cpp
https://github.com/malcolmreynolds/OpenCV · C++ · 53 lines · 24 code · 5 blank · 24 comment · 2 complexity · 69f46366c71a7e1491af9625912fc53e MD5 · raw file
- /* License:
- Oct. 3, 2008
- Right to use this code in any way you want without warrenty, support or any guarentee of it working.
- BOOK: It would be nice if you cited it:
- Learning OpenCV: Computer Vision with the OpenCV Library
- by Gary Bradski and Adrian Kaehler
- Published by O'Reilly Media, October 3, 2008
-
- AVAILABLE AT:
- http://www.amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134
- Or: http://oreilly.com/catalog/9780596516130/
- ISBN-10: 0596516134 or: ISBN-13: 978-0596516130
- OTHER OPENCV SITES:
- * The source code is on sourceforge at:
- http://sourceforge.net/projects/opencvlibrary/
- * The OpenCV wiki page (As of Oct 1, 2008 this is down for changing over servers, but should come back):
- http://opencvlibrary.sourceforge.net/
- * An active user group is at:
- http://tech.groups.yahoo.com/group/OpenCV/
- * The minutes of weekly OpenCV development meetings are at:
- http://pr.willowgarage.com/wiki/OpenCV
- */
- #include <stdio.h>
- #include <cv.h>
- #include <highgui.h>
- void saturate_sv( IplImage* img ) {
- for( int y=0; y<img->height; y++ ) {
- uchar* ptr = (uchar*) (
- img->imageData + y * img->widthStep
- );
- for( int x=0; x<img->width; x++ ) {
- ptr[3*x+1] = 255;
- ptr[3*x+2] = 255;
- }
- }
- }
- int main( int argc, char** argv )
- {
- IplImage* img = cvLoadImage( argv[1] );
- cvNamedWindow("Example1", CV_WINDOW_AUTOSIZE );
- saturate_sv(img);
- cvShowImage("Example1", img );
- cvWaitKey(0);
- cvReleaseImage( &img );
- cvDestroyWindow("Example1");
- }