Ask Your Question
0

tformarray matlab function equivalent in opencv

asked 2015-03-16 19:08:29 -0600

theodore gravatar image
tmap_B = cat(3,u,v);

resamp = makeresampler('linear','fill');
J2 = tformarray(I,[],resamp,[2 1],[1 2],[],tmap_B,.3);

I want to port the above matlab code to corresponding opencv, where u and v are two 2D matrices. The cat() function corresponds to the concatenate procedure, from a short research I came up with the hconcat() and vconcat() but these are for horizontal and vertical concatenation respectively. Is merge() what I should use instead or there is something else?

As for the tformarray() corresponds to a spatial transformation to an array A in order to produce an array B. I am trying to figure out which is the equivalent from the opencv transformation functions. Any idea?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-03-16 20:09:13 -0600

theodore gravatar image

updated 2015-03-16 20:31:21 -0600

ok the following code is the equivalent in opencv:

std::vector<cv::Mat> channels;

channels.push_back(u);
channels.push_back(v);

Mat tmap_B;
merge(channels, tmap_B);
Mat output;
remap(I, output, tmap_B, Mat(), CV_INTER_LINEAR, BORDER_CONSTANT);

I guess is quite late, and apparently I need some sleep :-p....

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-03-16 19:08:29 -0600

Seen: 1,395 times

Last updated: Mar 16 '15