Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Converting stereo_match.py sample to javascript

Hello there,

I am using the Nodejs port of Opencv for a 3D reconstruction project. So im trying to convert the sample stereo_match.py given in OpenCV source code to javascript. The problem is that, I am stuck at a step where the mask is found, and the out_points and out_colors are calculated. The code related to that is given below:

mask = disp > disp.min()
out_points = points[mask]
out_colors = colors[mask]

Im just not able to understand what is going on when calculating the out_points and out_colors and how to convert the code or achieve the same functionality in javascript using node-opencv. Here is my code that I was able to do uptill now given here : http://pastebin.com/0JELgFZg

Converting Understanding stereo_match.py sample to javascriptsample

Hello there,

I am using the Nodejs port of Opencv for a 3D reconstruction project. So im trying to convert the sample stereo_match.py given in OpenCV source code to javascript. The First, I am trying to understand the code and the problem is that, I am stuck at a step where the mask is found, and the out_points and out_colors are calculated. The code related to that is given below:

mask = disp > disp.min()
out_points = points[mask]
out_colors = colors[mask]

Im just not able to understand what is going on when calculating the out_points and out_colors. I know that the mask, points and colors are numpy arrays of size 555x641. But when the above operation is done, the out_points and out_colors obtained are 3000000x3 arrays. Now the question is, what is logic behind the above code, and how to convert the code or do you achieve the same functionality this in javascript pure python?(that is, lets say we have mask, points and colors as normal arrays, and we need to do the above operation without using node-opencv. numpy and calculate out_points and out_colors).

Thank you

P.S : Here is my JS code that I was able to do uptill now given here : http://pastebin.com/0JELgFZg