60 pInputImage->
type != pOutputImage->
type)
66 cvFlip(pIplInputImage, pIplOutputImage);
68 cvReleaseImageHeader(&pIplInputImage);
69 cvReleaseImageHeader(&pIplOutputImage);
75 pInputImage->
type != pOutputImage->
type)
81 cvSmooth(pIplInputImage, pIplOutputImage, CV_GAUSSIAN, 3, 3);
83 cvReleaseImageHeader(&pIplInputImage);
84 cvReleaseImageHeader(&pIplOutputImage);
90 pInputImage->
type != pOutputImage->
type)
96 cvSmooth(pIplInputImage, pIplOutputImage, CV_GAUSSIAN, 5, 5);
98 cvReleaseImageHeader(&pIplInputImage);
99 cvReleaseImageHeader(&pIplOutputImage);
105 pInputImage->
type != pOutputImage->
type)
111 cvSmooth(pIplInputImage, pIplOutputImage, CV_BILATERAL, param1, param2);
113 cvReleaseImageHeader(&pIplInputImage);
114 cvReleaseImageHeader(&pIplOutputImage);
121 pInputImage->
type != pOutputImage->
type)
126 IplImage *pIplTempImage = cvCreateImage(cvSize(pInputImage->
width, pInputImage->
height), IPL_DEPTH_16S, 1);
128 cvLaplace(pIplInputImage, pIplTempImage, 1);
129 cvConvertScaleAbs(pIplTempImage, pIplOutputImage);
131 cvReleaseImage(&pIplTempImage);
132 cvReleaseImageHeader(&pIplInputImage);
133 cvReleaseImageHeader(&pIplOutputImage);
144 IplImage *pIplTempImage = cvCreateImage(cvSize(pInputImage->
width, pInputImage->
height), IPL_DEPTH_16S, 1);
146 cvLaplace(pIplInputImage, pIplTempImage, 5);
147 cvConvertScaleAbs(pIplTempImage, pIplOutputImage);
149 cvReleaseImage(&pIplTempImage);
150 cvReleaseImageHeader(&pIplInputImage);
151 cvReleaseImageHeader(&pIplOutputImage);
156 if (pInputImage->
type != pOutputImage->
type)
163 cvSetImageROI(pIplInputImage, cvRect(x, y, width, height));
165 cvResize(pIplInputImage, pIplOutputImage);
167 cvReleaseImageHeader(&pIplInputImage);
168 cvReleaseImageHeader(&pIplOutputImage);
182 IplImage *diff = cvCreateImage(cvSize(pInputImage->
width, pInputImage->
height), IPL_DEPTH_16S, 1);
183 IplImage *abs = cvCreateImage(cvSize(pInputImage->
width, pInputImage->
height), IPL_DEPTH_8U, 1);
185 cvSmooth(pIplInputImage, abs, CV_GAUSSIAN, 3, 3);
186 cvSobel(abs, diff, 1, 0, 3);
187 cvConvertScaleAbs(diff, pIplOutputImage);
188 cvSobel(abs, diff, 0, 1, 3);
189 cvConvertScaleAbs(diff, abs);
190 cvAdd(abs, pIplOutputImage, pIplOutputImage, 0);
192 cvReleaseImage(&diff);
193 cvReleaseImage(&abs);
199 IplImage *singleChannel0 = cvCreateImage(cvSize(pInputImage->
width,pInputImage->
height), IPL_DEPTH_8U, 1);
200 IplImage *singleChannel1 = cvCreateImage(cvSize(pInputImage->
width,pInputImage->
height), IPL_DEPTH_8U, 1);
201 IplImage *singleChannel2 = cvCreateImage(cvSize(pInputImage->
width,pInputImage->
height), IPL_DEPTH_8U, 1);
202 IplImage *diff = cvCreateImage(cvSize(pInputImage->
width, pInputImage->
height), IPL_DEPTH_16S, 1);
203 IplImage *abs = cvCreateImage(cvSize(pInputImage->
width, pInputImage->
height), IPL_DEPTH_8U, 1);
205 cvCvtPixToPlane(pIplInputImage, singleChannel0, singleChannel1, singleChannel2, NULL);
207 cvSmooth(singleChannel0, singleChannel0, CV_GAUSSIAN, 3, 3);
208 cvSobel(singleChannel0, diff, 1, 0, 3);
209 cvConvertScaleAbs(diff, abs);
210 cvSobel(singleChannel0, diff, 0, 1, 3);
211 cvConvertScaleAbs(diff, singleChannel0);
212 cvAdd(abs, singleChannel0, pIplOutputImage, 0);
214 cvSmooth(singleChannel1, singleChannel1, CV_GAUSSIAN, 3, 3);
215 cvSobel(singleChannel1, diff, 1, 0, 3);
216 cvConvertScaleAbs(diff, abs);
217 cvSobel(singleChannel1, diff, 0, 1, 3);
218 cvConvertScaleAbs(diff, singleChannel1);
219 cvAdd(abs, singleChannel1, singleChannel1, 0);
220 cvMax(pIplOutputImage, singleChannel1, pIplOutputImage);
222 cvSmooth(singleChannel2, singleChannel2, CV_GAUSSIAN, 3, 3);
223 cvSobel(singleChannel2, diff, 1, 0, 3);
224 cvConvertScaleAbs(diff, abs);
225 cvSobel(singleChannel2, diff, 0, 1, 3);
226 cvConvertScaleAbs(diff, singleChannel2);
227 cvAdd(abs, singleChannel2, singleChannel2, 0);
228 cvMax(pIplOutputImage, singleChannel2, pIplOutputImage);
230 cvReleaseImage(&singleChannel0);
231 cvReleaseImage(&singleChannel1);
232 cvReleaseImage(&singleChannel2);
233 cvReleaseImage(&diff);
234 cvReleaseImage(&abs);
237 cvReleaseImageHeader(&pIplInputImage);
238 cvReleaseImageHeader(&pIplOutputImage);
252 IplImage *singleChannel0 = cvCreateImage(cvSize(pInputImage->
width,pInputImage->
height), IPL_DEPTH_8U, 1);
253 IplImage *singleChannel1 = cvCreateImage(cvSize(pInputImage->
width,pInputImage->
height), IPL_DEPTH_8U, 1);
254 IplImage *singleChannel2 = cvCreateImage(cvSize(pInputImage->
width,pInputImage->
height), IPL_DEPTH_8U, 1);
255 IplImage *diff = cvCreateImage(cvSize(pInputImage->
width, pInputImage->
height), IPL_DEPTH_16S, 1);
256 IplImage *abs = cvCreateImage(cvSize(pInputImage->
width, pInputImage->
height), IPL_DEPTH_8U, 1);
258 cvCvtPixToPlane(pIplInputImage, singleChannel0, singleChannel1, singleChannel2, NULL);
262 cvSobel(singleChannel1, diff, 1, 0, 3);
263 cvConvertScaleAbs(diff, abs);
264 cvSobel(singleChannel1, diff, 0, 1, 3);
265 cvConvertScaleAbs(diff, pIplOutputImage);
266 cvAdd(abs, pIplOutputImage, pIplOutputImage, 0);
269 cvThreshold(singleChannel1, singleChannel1, 60, 255, CV_THRESH_BINARY);
270 cvDilate(singleChannel1, singleChannel1);
274 cvSobel(singleChannel0, diff, 1, 0, 3);
275 cvConvertScaleAbs(diff, abs);
276 cvSobel(singleChannel0, diff, 0, 1, 3);
277 cvConvertScaleAbs(diff, singleChannel0);
278 cvAdd(abs, singleChannel0, singleChannel0, 0);
281 cvAnd(singleChannel0, singleChannel1, singleChannel0);
284 cvMax(pIplOutputImage, singleChannel0, pIplOutputImage);
287 cvReleaseImage(&singleChannel0);
288 cvReleaseImage(&singleChannel1);
289 cvReleaseImage(&singleChannel2);
290 cvReleaseImage(&diff);
291 cvReleaseImage(&abs);
293 cvReleaseImageHeader(&pIplInputImage);
294 cvReleaseImageHeader(&pIplOutputImage);
306 cvCanny(pIplInputImage, pIplOutputImage, nLowThreshold, nHighThreshold);
308 cvReleaseImageHeader(&pIplInputImage);
309 cvReleaseImageHeader(&pIplOutputImage);
321 cvDilate(pIplInputImage, pIplOutputImage);
323 cvReleaseImageHeader(&pIplInputImage);
324 cvReleaseImageHeader(&pIplOutputImage);
336 cvErode(pIplInputImage, pIplOutputImage);
338 cvReleaseImageHeader(&pIplInputImage);
339 cvReleaseImageHeader(&pIplOutputImage);
351 double dRet = cvMean(pIplImage1, pIplImage2);
353 cvReleaseImageHeader(&pIplImage1);
354 cvReleaseImageHeader(&pIplImage2);
364 printf(
"error: input and output image do not match for ImageProcessorCV::CalculateHSVImage\n");
371 cvCvtColor(pIplInputImage, pIplOutputImage, CV_RGB2HSV);
373 cvReleaseImageHeader(&pIplInputImage);
374 cvReleaseImageHeader(&pIplOutputImage);
382 printf(
"error: input and output image do not match for ImageProcessorCV::ConvertBayerPattern\n");
391 case eBG2BGR: cvCvtColor(pIplInputImage, pIplOutputImage, CV_BayerBG2BGR);
break;
392 case eGB2BGR: cvCvtColor(pIplInputImage, pIplOutputImage, CV_BayerGB2BGR);
break;
393 case eRG2BGR: cvCvtColor(pIplInputImage, pIplOutputImage, CV_BayerRG2BGR);
break;
394 case eGR2BGR: cvCvtColor(pIplInputImage, pIplOutputImage, CV_BayerGR2BGR);
break;
395 case eBG2RGB: cvCvtColor(pIplInputImage, pIplOutputImage, CV_BayerBG2RGB);
break;
396 case eGB2RGB: cvCvtColor(pIplInputImage, pIplOutputImage, CV_BayerGB2RGB);
break;
397 case eRG2RGB: cvCvtColor(pIplInputImage, pIplOutputImage, CV_BayerRG2RGB);
break;
398 case eGR2RGB: cvCvtColor(pIplInputImage, pIplOutputImage, CV_BayerGR2RGB);
break;
401 cvReleaseImageHeader(&pIplInputImage);
402 cvReleaseImageHeader(&pIplOutputImage);
409 printf(
"error: input image is not grayscale in ImageProcessorCV::CalculateFeaturePoints\n");
414 IplImage *pEigenvalueImage = cvCreateImage(cvSize(pImage->
width, pImage->
height), IPL_DEPTH_32F, 1);
415 IplImage *pTempImage = cvCreateImage(cvSize(pImage->
width, pImage->
height), IPL_DEPTH_32F, 1);
417 CvPoint2D32f *pCorners =
new CvPoint2D32f[nMaxPoints];
418 int nCorners = nMaxPoints;
421 cvGoodFeaturesToTrack(pIplImage, pEigenvalueImage, pTempImage, pCorners, &nCorners, fQualityLevel, fMinDistance, 0, 3, 1, 0.04);
423 cvGoodFeaturesToTrack(pIplImage, pEigenvalueImage, pTempImage, pCorners, &nCorners, fQualityLevel, fMinDistance, 0, 3);
425 for (
int i = 0; i < nCorners; i++)
427 pFeaturePoints[i].
x = pCorners[i].x;
428 pFeaturePoints[i].
y = pCorners[i].y;
433 cvReleaseImageHeader(&pIplImage);
434 cvReleaseImage(&pTempImage);
435 cvReleaseImage(&pEigenvalueImage);
443 pInputImage->
type == pOutputImage->
type)
445 printf(
"error: input and output image do not match for ImageProcessorCV::ConvertImage\n");
453 cvCvtColor(pIplInputImage, pIplOutputImage, CV_RGB2GRAY);
455 cvCvtColor(pIplInputImage, pIplOutputImage, CV_GRAY2RGB);
457 cvReleaseImageHeader(&pIplInputImage);
458 cvReleaseImageHeader(&pIplOutputImage);
void FlipY(CByteImage *pInputImage, CByteImage *pOutputImage)
Deprecated.
void GaussianSmooth3x3(CByteImage *pInputImage, CByteImage *pOutputImage)
Deprecated.
int width
The width of the image in pixels.
void Canny(CByteImage *pInputImage, CByteImage *pOutputImage, int nLowThreshold, int nHighThreshold)
Deprecated.
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
GLuint GLuint GLsizei GLenum type
void ConvertBayerPattern(CByteImage *pInputImage, CByteImage *pOutputImage, BayerPatternType type=eRG2BGR)
Deprecated.
int CalculateFeaturePoints(const CByteImage *pImage, Vec2d *pFeaturePoints, int nMaxPoints, float fQualityLevel=0.01f, float fMinDistance=5.0f, bool bUseHarris=false)
Deprecated.
void Resize(const CByteImage *pInputImage, CByteImage *pOutputImage, int x=-1, int y=-1, int width=-1, int height=-1)
Deprecated.
void CalculateGradientImage(CByteImage *pInputImage, CByteImage *pOutputImage)
Deprecated.
void Laplacian5x5(CByteImage *pInputImage, CByteImage *pOutputImage)
Calls cvLaplace with size 5x5.
void GaussianSmooth5x5(CByteImage *pInputImage, CByteImage *pOutputImage)
Deprecated.
int height
The height of the image in pixels.
void BilateralSmooth(CByteImage *pInputImage, CByteImage *pOutputImage, int param1, int param2)
Calls cvSmooth with the parameter CV_BILATERAL.
GLenum GLsizei GLsizei height
ImageType type
The type of the image.
void Dilate(CByteImage *pInputImage, CByteImage *pOutputImage)
Deprecated.
Data structure for the representation of a 2D vector.
IplImage * Adapt(const CByteImage *pImage, bool bAllocateMemory=false)
Converts a CByteImage to an IplImage.
void Erode(CByteImage *pInputImage, CByteImage *pOutputImage)
Deprecated.
void Laplacian3x3(CByteImage *pInputImage, CByteImage *pOutputImage)
Deprecated.
double Mean(CByteImage *pImage1, CByteImage *pImage2)
Deprecated.
void CalculateGradientImageHSV(CByteImage *pInputImage, CByteImage *pOutputImage)
Deprecated.
void CalculateHSVImage(CByteImage *pInputImage, CByteImage *pOutputImage)
Deprecated.
void ConvertImage(CByteImage *pInputImage, CByteImage *pOutputImage)
Image processing functions using OpenCV.