how to check if the image is deformed or not
<p>I am using OpenCV4Android version 2.4.11. I am trying to change the prespective of any rectangular shape detected in the frame retrieved from the camera. Sometimes, when i change the prespective of the detected rectangular object i get a deformed/incomplete image as the one shown below.</p>

<p>the code posted below is to show how i change the prespective of a setected object.</p>

<p>is there any way using opeCV to check if the image is deformed/incomplete? because if the image is deformed/incomplete i would not display it.</p>

<p>please let me know how to do so.</p>

<p><strong>code</strong>:</p>

<pre><code> MatOfPoint2f src2f = new MatOfPoint2f();
 MatOfPoint2f dst2f = new MatOfPoint2f();

                    src2f.fromArray(new Point(pointsBoundingRect.x, pointsBoundingRect.y), new Point(pointsBoundingRect.x, pointsBoundingRect.y + pointsBoundingRect.height),
                            new Point(pointsBoundingRect.x + pointsBoundingRect.width, pointsBoundingRect.y + pointsBoundingRect.height), new Point(pointsBoundingRect.x + pointsBoundingRect.width, pointsBoundingRect.y));
                    dst2f.fromArray(new Point(0, 0), new Point(0, 0 + mMatInputFrame.height()),
                            new Point(0 + mMatInputFrame.width(), 0 + mMatInputFrame.height()), new Point(0 + mMatInputFrame.width(), 0));

                    Mat transmtx = Imgproc.getPerspectiveTransform(src2f, dst2f);
                    Mat rotated = new Mat();
                    Imgproc.warpPerspective(mMatInputFrame, rotated, transmtx, mMatInputFrame.size(), Imgproc.INTER_LINEAR, Imgproc.BORDER_REFLECT, new Scalar(255, 255, 255));

                    if (rotated.width() &gt; rotated.height()) {
                        Bitmap bitmap = Bitmap.createBitmap(rotated.cols(), rotated.rows(), Bitmap.Config.ARGB_8888);
                        Utils.matToBitmap(rotated, bitmap);
                        final Bitmap finalBitmap = bitmap;
                        getActivity().runOnUiThread(new Runnable() {
                            @Override
                            public void run() {
                                mIVCapture.setImageBitmap(finalBitmap);
                            }
                        });
                    }
</code></pre>

<p><strong>image</strong>:</p>

<p><a href="https://i.stack.imgur.com/Nuipg.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/Nuipg.jpg" alt="enter image description here"></a></p>

<p><strong>update</strong></p>

<p>after setting a bigger destination size and after setting the borders type to BORDER_CONSTANT i gor the following results. please realize the while horizontal strip in the image</p>

<p><a href="https://i.stack.imgur.com/lAFwy.png" rel="nofollow"><img src="https://i.stack.imgur.com/lAFwy.png" alt="enter image description here"></a></p>