How do I compose a rotation matrix with human readable angles from scratch?

So the question really is Understanding 4×4 homogenous transform matrices well without the math behind the only thing that left is geometric representation/meaning which is far better for human abstraction/understanding. So what the 4×4 matrix is? It is representation of some Cartesian coordinate system and it is composed of: 3 basis vectors (one for each … Read more

Android image view matrix scale + translate

There’s a convenient method called Matrix.setRectToRect(RectF, RectF, ScaleToFit) to help you here. Matrix m = imageView.getImageMatrix(); RectF drawableRect = new RectF(0, 0, imageWidth, imageHeight); RectF viewRect = new RectF(0, 0, imageView.getWidth(), imageView.getHeight()); m.setRectToRect(drawableRect, viewRect, Matrix.ScaleToFit.CENTER); imageView.setImageMatrix(m); That should set the matrix m to have combo of scaling and translate values that is needed to show … Read more

Differences of using “const cv::Mat &”, “cv::Mat &”, “cv::Mat” or “const cv::Mat” as function parameters?

It’s all because OpenCV uses Automatic Memory Management. OpenCV handles all the memory automatically. First of all, std::vector, Mat, and other data structures used by the functions and methods have destructors that deallocate the underlying memory buffers when needed. This means that the destructors do not always deallocate the buffers as in case of Mat. … Read more