How to convert 3D point in OpenCV to Eigen representation? - opencv

What is the best way to convert a 3D point (cv::Point3) in OpenCV to Eigen representation?

I think the best representation in Eigen is Vector3d, such as:
cv::Point3d p(1,2,3);
Eigen::Vector3d point(p.x, p.y, p.z);

Related

Rust OpenCV: Convert Vec to Mat?

I'm brand new to rust. I have a vector of vectors (Vec<Vec<f32>>) containing values between 0 and 1, and I need to convert it to an openCV Mat so that I can use the algorithms in opencv::imgproc on it.
Could anyone give me some advice on how to do this?

Eye to Hand Calibration OpenCV

I am new to this Eye to Hand calibration. I have read the opencv documentation. It says that we need to use cv2.calibrateHandEye(R_gripper2base, t_gripper2base, R_target2cam, t_target2cam).
Can somebody help me by clearly explaining what input values we need to provide, from where these input values need to be taken, and how it has to be in matrix format? Particularly for (R_target2cam, t_target2cam).I am using the UFactory Arm robot and Intel Realsense camera. So I need to calibrate both. Kindly guide me.
This is my Robot position coordinates
So, I think I have Rx,Ry,Rz for R_gripper2base. X,Y,Z for t_gripper2base. What and where can I get the values for R_target2cam, t_target2cam?

Compressed Histogram of Gradients (CHoG)

I am trying to understand the implementation of low bitrate descriptor Compressed Histogram of Gradients (CHoG) from Stanford Mobile Visual Search publication. Is there any open-source code available in OpenCV?
Actually I contacted the Authors of CHoG they say its a copyrighted code.
I don't think OpenCV has an implementation of Compressed HOG. However, OpenCV does provide the traditional HOG implementation from the Dalal-Triggs 2005 paper.
Here's how to use OpenCV's HOGDescriptor, with the default parameters from the Dalal-Triggs paper:
cv::HOGDescriptor d();
vector<float> descriptorsValues; //this is the useful output
vector<cv::Point> locations;
d.compute(img, descriptorsValues, cv::Size(0,0), cv::Size(0,0), locations);
If you want to customize the HOG setup, you can use the HOGDescriptor constructor that takes custom parameters:
cv::HOGDescriptor d(win_size, block_size, block_stride, cell_size, nOri, 1, -1, cv::HOGDescriptor::L2Hys, 0.2, gamma_corr, nLevels);
There's also a GPU version of HOGDescriptor in OpenCV.

OpenCV Multilevel B-Spline Approximation

Hi (sorry for my english) .. i'm working in a project for University in this project i need to use the MBA (Multilevel B-Spline Approximation) algorithm to get some points (control points) of a image to use in other operations.
I'm reading a lot of papers about this algorithm, and i think i understand, but i can't writing.
The idea is: Read a image, process a image (OpenCV), then get control points of the image, use this points.
So the problem here is:
The algorithm use a set of points {(x,y,z)} , this set of points are approximated with a surface generated with the control points obtained from MBA. the set of points {(x,y,z)} represents de data we need to approximate (the image)..
So, the image is in a cv::Mat format , how can transform this format to an ordinary array to simply access to the data an manipulate...
Here are one paper with an explanation of the method:
(Paper) REGULARIZED MULTILEVEL B-SPLINE REGISTRATION
(Paper)Scattered Data Interpolation with Multilevel B-splines
(Matlab)MBA
If someone can help, maybe a guideline, idea or anything will be appreciate ..
Thanks in advance.
EDIT: Finally i wrote the algorithm in C++ using armadillo and OpenCV ...
Well i'm using armadillo a C++ linear algebra library to works with matrix for the algorithm

OpenCV CalcPca input data

I am trying to implement a face recognition training function with opencv, using "eigenfaces". I have the sample data, but I can't find any info on CalcPCA function arguments. All I know is that it takes data matrix, reference to average eigenface matrix, reference to eigen vector, and reference to eigen values matrix.
My question is, how should I pass the data from several test image matrices into the first argument of CalcPCA so I can get the average eigenface and vectors?
This seems to be a good example: http://tech.groups.yahoo.com/group/OpenCV/message/47627
You can do in this way:
You have for example 10 Mat where each math represent an image.
Now you can create a new Mat that you can put into this new Mat the previus 10 Mat.
At this point use Mat.pushback(...) to insert the 10 Mat.
Hope this is helpful for you.
Marco

Resources