Add Quicklook for Mat on iOS and macOS#20457
Conversation
alalek
left a comment
There was a problem hiding this comment.
Well done! Thank you for contribution 👍
|
So we have already run-time checks like: but if you are building with a version of Xcode that doesn't know about iOS 13 then I guess these checks are not enough.
Will try to prepare a fix. |
|
Equivalent functionality for Android/Java now also available: https://medium.com/@gilespayne/android-java-get-opencv-mat-visualization-plugin-8d1281047773 |
Hi, thanks for your contribution. |
Quicklook works exactly the same in Objective-C as in Swift. Just move the mouse cursor over a variable of type Mat and click the eye icon. Quicklook is not available in C/C++ |
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Sometime you want to see quickly the contents of a Mat object. This PR takes advantage of the Xcode Quicklook function to give a debug view of a Mat object as follows:

* if the Mat has 2 dimensions and 1 channel and number of rows and number of columns is less than 10 - display Xcode Quicklook as LaTeX style matrix
* if the Mat has 2 dimensions and 1 channel and type other than CV_8U - show Xcode Quicklook as a heat map