Hey all,
I just started programming C++, (only formiliar with matlab/mathematica for image processing) . I like to find the min of my grayscale image. My image is a part of frame token from a webcam. But I don't even know what type of object my image is. Is it an array, or do I need to convert it first to a 2D array? So I can use a min loop over the pixels?
int main( int argc, char** argv )
{
CvCapture *capture;
int key;
/* initialize camera */
capture = cvCaptureFromCAM( 0 );
/* always check */
if( !capture ) return 1;
/* get video properties, needed by template image */
frame = cvQueryFrame( capture );
if ( !frame ) return 1;
/* create template image */
tplLeft = cvCreateImage( cvSize( TPL_WIDTH, TPL_HEIGHT ),
frame->depth, frame->nChannels );
//load color image specified by first argument
source = tplLeft;
// create new image structure
// for the grayscale output image
destination = cvCreateImage(cvSize( source->width, source->height ), IPL_DEPTH_8U, 1 );
// set type CV_RGB2GRAY to convert
// RGB image to grayscale
cvCvtColor( source, destination, CV_RGB2GRAY );
So if you look at my code, destination is my 12 by 12 grayscale image (because tplLeft is 12 by 12). I like to find the min of this image. I'm ussing openCV by the way. Don't know if there any nice functions that will do the trick for me?
thx for looking at my question,
Stefan