| 352 | \****************************************************************************************/ |
| 353 | |
| 354 | void magnitude( InputArray src1, InputArray src2, OutputArray dst ) |
| 355 | { |
| 356 | Mat X = src1.getMat(), Y = src2.getMat(); |
| 357 | int type = X.type(), depth = X.depth(), cn = X.channels(); |
| 358 | CV_Assert( X.size == Y.size && type == Y.type() && (depth == CV_32F || depth == CV_64F)); |
| 359 | dst.create(X.dims, X.size, X.type()); |
| 360 | Mat Mag = dst.getMat(); |
| 361 | |
| 362 | const Mat* arrays[] = {&X, &Y, &Mag, 0}; |
| 363 | uchar* ptrs[3]; |
| 364 | NAryMatIterator it(arrays, ptrs); |
| 365 | int len = (int)it.size*cn; |
| 366 | |
| 367 | for( size_t i = 0; i < it.nplanes; i++, ++it ) |
| 368 | { |
| 369 | if( depth == CV_32F ) |
| 370 | { |
| 371 | const float *x = (const float*)ptrs[0], *y = (const float*)ptrs[1]; |
| 372 | float *mag = (float*)ptrs[2]; |
| 373 | Magnitude_32f( x, y, mag, len ); |
| 374 | } |
| 375 | else |
| 376 | { |
| 377 | const double *x = (const double*)ptrs[0], *y = (const double*)ptrs[1]; |
| 378 | double *mag = (double*)ptrs[2]; |
| 379 | Magnitude_64f( x, y, mag, len ); |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | |
| 385 | void phase( InputArray src1, InputArray src2, OutputArray dst, bool angleInDegrees ) |
no test coverage detected