[Robotvision-commit] SF.net SVN: robotvision:[6] robotVision
Brought to you by:
phildavidson
From: <bre...@us...> - 2010-05-16 17:17:38
|
Revision: 6 http://robotvision.svn.sourceforge.net/robotvision/?rev=6&view=rev Author: brendasegal Date: 2010-05-16 17:17:31 +0000 (Sun, 16 May 2010) Log Message: ----------- Added Paths: ----------- robotVision/ robotVision/main.c Added: robotVision/main.c =================================================================== --- robotVision/main.c (rev 0) +++ robotVision/main.c 2010-05-16 17:17:31 UTC (rev 6) @@ -0,0 +1,95 @@ +#ifdef _CH_ +#pragma package <opencv> +#endif + +#define CV_NO_BACKWARD_COMPATIBILITY + +#include <cv.h> +#include <highgui.h> +#include <stdio.h> +#include <math.h> +#include <string.h> + +//not sure if it was supposed to be 8 or 16 bits +int sizeOfBitString = 8; + +//the convert function converts a gStreamer object to an OpenCV image +/* + + IplImage* convert(GSTBuffer gBuffer){ + + + + + } +*/ + + +//For the findBuoy function, the center of mass is returned as (x,y) coordinates +//this is in the form of a bit string (of what size?) where the first half corresponds +//to the x coordinate and the second half to the y coordinate +char* findBuoy(IplImage* img){ + + + char* bitString = (char*)malloc(sizeof(char)*sizeOfBitString); + + + //http://opencv.willowgarage.com/documentation/c/image_filtering.html + //smooth image cvSmooth(src, dest, smoothtype, aperture width (must be positive and odd), + //aperture height (must be positive and odd), gaussian param, another gaussian param?) + cvSmooth(img, img, CV_GAUSSIAN, 3, 3, 0, 0); + + //threshold the image till we get a black and white one + + //find the center of mass (avg pos of the white pixels) + + return bitString; + +} + +//The findPipe function works in quite the same way as findBuoy + +char* findPipe(IplImage* img){ + + + char* bitString = (char*)malloc(sizeof(char)*sizeOfBitString); + + //we smooth img + cvSmooth(img, img, CV_GAUSSIAN, 3, 3, 0, 0); + + //threshold the image till we get a black and white one + + //find the center of mass (avg pos of the white pixels) + + return bitString; + +} + + +//This will return a vector pair in the form of delta x, delta y +//this will be used to find the approximate heading of the pipe +char* findHeading(IplImage* img){ + + char* bitString = (char*)malloc(sizeof(char)*sizeOfBitString); + + //we smooth img + cvSmooth(img, img, CV_GAUSSIAN, 3, 3, 0, 0); + + //threshold the image till we get a black and white one + + //fit a rectangle to the pipeline and find approximate heading + + return bitString; + + +} + + + + + +int main(char** argv, int arg){ + + + return 0; +} Property changes on: robotVision/main.c ___________________________________________________________________ Added: svn:mime-type + text/plain This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |