Programowanie w systemie UNIX/OpenCV: Różnice pomiędzy wersjami
Usunięta treść Dodana treść
m →c: wersja |
m →otwieranie obrazów w c: nowy kod |
||
Linia 92:
<source lang=c>
/*
gcc i.c `pkg-config --cflags --libs opencv` ▼
▲http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html
*/▼
OpenCV uses BGR as its default colour order for images,
▲*/
////////////////////////////////////////////////////////////////////////
//
// hello-world.cpp
//
// This is a simple, introductory OpenCV program. The program reads an
// image from a file, inverts it, and displays the result.
//
////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
#include <stdio.h>
Linia 117 ⟶ 131:
// load an image
img=cvLoadImage(argv[1],
if(!img){
printf("Could not load image file: %s\n",argv[1]);
Linia 136 ⟶ 150:
// invert the image
// data[i*step+j*channels+k]=255-data[i*step+j*channels+k];
// show the image
Linia 147 ⟶ 161:
// release the image
cvReleaseImage(&img );
printf("OpenCV version = %s\r\n", CV_VERSION);
return 0;
}
</source>
|