Repository: opencv
Issue: `initInverseRectificationMap`'s documentation confuses `newCameraMatrix` with `cameraMatrix`.
Labels: bug,category: documentation

<!--
If you have a question rather than reporting a bug please go to https://forum.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
<!-- Example
- OpenCV => 4.5.5
- Operating System / Platform => Ubuntu 20.04
- Compiler => gcc
-->

- OpenCV => 4.5.5
- Operating System / Platform => Ubuntu 20.04
- Compiler => :grey_question:

##### Detailed description

The [documentation](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#ga0ee548cb0101533abba06cd89c75b53e) for `initInverseRectificationMap` confuses the `newCameraMatrix` argument with the `cameraMatrix` argument in the description of the mathematics. This can be verified by checking [the implementation](https://github.com/opencv/opencv/blob/master/modules/calib3d/src/undistort.dispatch.cpp#L168) where the `A` matrix (`cameraMatrix`) is applied to the transformed points prior to the `Ar` matrix (`newCameraMatrix`) which is the opposite of what is described in the documentation.

##### Steps to reproduce

<!-- to add code example fence it with triple backticks and optional file extension
    ```.cpp
    // C++ code example
    ```
 or attach as .txt or .zip file
-->

```python
import cv2
import numpy as np

width = 1280
height = 720

K = np.array(((1., 0, 0),
              (0, 1, 0),
              (0, 0, 1)))

new_width = int(width/2)
new_height = int(height/2)
new_K = np.array(((.5, 0, 0),
                  ( 0,.5, 0),
                  ( 0, 0, 1)))

map1, map2 = cv2.initInverseRectificationMap(
                            cameraMatrix=K,                     
                            distCoeffs=np.array([0, 0, 0, 0]),
                            R=np.eye(3),
                            newCameraMatrix=new_K,
                            size=(new_width, new_height),
                            m1type=cv2.CV_32FC1)

# Passes because this is what the implementation does
assert map1[new_height-1, new_width-1] == ((new_width-1) * 0.5)

# Should pass according to documentation but fails
assert map1[new_height-1, new_width-1] == ((new_width-1) / 0.5)
```

##### Issue submission checklist

 - [x] I report the issue, it's not a question
   <!--
   OpenCV team works with forum.opencv.org, Stack Overflow and other communities
   to discuss problems. Tickets with questions without a real issue statement will be
   closed.
   -->
 - [x] I checked the problem with documentation, FAQ, open issues,
       forum.opencv.org, Stack Overflow, etc and have not found any solution
   <!--
   Places to check:
   * OpenCV documentation: https://docs.opencv.org
   * FAQ page: https://github.com/opencv/opencv/wiki/FAQ
   * OpenCV forum: https://forum.opencv.org
   * OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
   * Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
   -->
 - [x] I updated to the latest OpenCV version and the issue is still there
   <!--
   master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
   OpenCV team supports only the latest release for each branch.
   The ticket is closed if the problem is not reproduced with the modern version.
   -->
 - [x] There is reproducer code and related data files: videos, images, onnx, etc
   <!--
   The best reproducer -- test case for OpenCV that we can add to the library.
   Recommendations for media files and binary files:
   * Try to reproduce the issue with images and videos in opencv_extra repository
     to reduce attachment size
   * Use PNG for images, if you report some CV related bug, but not image reader
     issue
   * Attach the image as an archive to the ticket, if you report some reader issue.
     Image hosting services compress images and it breaks the repro code.
   * Provide ONNX file for some public model or ONNX file with random weights,
     if you report ONNX parsing or handling issue. Architecture details diagram
     from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
   -->