OPENCV in grey-scale, another1 know how to convert to a colour output ..
-
#include "stdlib.h" #include "stdio.h" #include "cv.h" #include "highgui.h" char *filename; IplImage *image =0,*image2 =0, *image3=0; uchar* colourpixels; int main(int argc, char** argv) { cvNamedWindow("Source Image",2); cvNamedWindow("test",2); if(argc ==2) { filename=argv[1]; } else exit(0); if((image=cvLoadImage(filename,0))==0) return -1; image2= cvCloneImage(image); image3=cvCreateImage(cvSize(image->width, image->height), IPL_DEPTH_8U, 1); // create pixel by pixel for(int pos_y=0;pos_y<image2->height;pos_y++) { for(int pos_x=0;pos_x<image2->width;pos_x++) { colourpixels = &((uchar*)(image2->imageData+image2->widthStep*pos_y))[pos_x*1]; (image3->imageData+image3->widthStep*pos_y)[image3->width-1+(pos_x*1)]=*colourpixels; } } cvShowImage("Source Image",image); cvShowImage("test",image3); cvWaitKey(0); cvReleaseImage(&image2); cvReleaseImage(&image); return 0; }
-
#include "stdlib.h" #include "stdio.h" #include "cv.h" #include "highgui.h" char *filename; IplImage *image =0,*image2 =0, *image3=0; uchar* colourpixels; int main(int argc, char** argv) { cvNamedWindow("Source Image",2); cvNamedWindow("test",2); if(argc ==2) { filename=argv[1]; } else exit(0); if((image=cvLoadImage(filename,0))==0) return -1; image2= cvCloneImage(image); image3=cvCreateImage(cvSize(image->width, image->height), IPL_DEPTH_8U, 1); // create pixel by pixel for(int pos_y=0;pos_y<image2->height;pos_y++) { for(int pos_x=0;pos_x<image2->width;pos_x++) { colourpixels = &((uchar*)(image2->imageData+image2->widthStep*pos_y))[pos_x*1]; (image3->imageData+image3->widthStep*pos_y)[image3->width-1+(pos_x*1)]=*colourpixels; } } cvShowImage("Source Image",image); cvShowImage("test",image3); cvWaitKey(0); cvReleaseImage(&image2); cvReleaseImage(&image); return 0; }
...and this has what to do with VB.NET??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
...and this has what to do with VB.NET??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008...and there is no question either.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)