Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Quicklook for Mat on iOS and macOS#20457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@komakai
Copy link
Contributor

Pull Request Readiness Checklist

See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch

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 type CV_8U and 1 channel - show Xcode Quicklook as grayscale image
  • if the Mat has 2 dimensions and type CV_8U and 3 or 4 channel - show Xcode Quicklook as color image

ImageView

* 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

MatrixView

* if the Mat has 2 dimensions and 1 channel and type other than CV_8U - show Xcode Quicklook as a heat map

HeatMapView

alalek reacted with thumbs up emojiasmorkalov and pzoltowski reacted with rocket emoji
Copy link
Member

@alalekalalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Well done! Thank you for contribution 👍

@opencv-pushbotopencv-pushbot merged commit5e7f063 intoopencv:masterAug 9, 2021
@alalek
Copy link
Member

@komakai Hi! Could you please suggest how to handle a problem from here:#20816 ?

@komakai
Copy link
ContributorAuthor

komakai commentedOct 6, 2021
edited
Loading

@komakai Hi! Could you please suggest how to handle a problem from here:#20816 ?

@alalek Will take a look

@komakai
Copy link
ContributorAuthor

So we have already run-time checks like:

if (@available(iOS 13.0, *)) {     // runtime check   return [UIFont fontWithDescriptor:[[UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleBody] fontDescriptorWithDesign:UIFontDescriptorSystemDesignSerif] size:SIZE];} else {    return nil;}

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.
According tohttps://developer.apple.com/forums/thread/124278 it should be possible to do something like:

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000

Will try to prepare a fix.

alalek reacted with thumbs up emoji

@alalekalalek mentioned this pull requestOct 15, 2021
@komakai
Copy link
ContributorAuthor

Equivalent functionality for Android/Java now also available:https://medium.com/@gilespayne/android-java-get-opencv-mat-visualization-plugin-8d1281047773

alalek reacted with thumbs up emoji

@wwwwwlllllllllll
Copy link

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.
I find from your pictures where you directly use OpenCV in Swift but not via Object-C or C Wrapper interface.
I want to know how to do it?

@komakai
Copy link
ContributorAuthor

@wwwwwlllllllllll

I find from your pictures where you directly use OpenCV in Swift but not via Object-C or C Wrapper interface.

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++

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@alalekalalekalalek approved these changes

@vpisarevvpisarevAwaiting requested review from vpisarev

Assignees

@alalekalalek

Projects

None yet

Milestone

4.5.4

Development

Successfully merging this pull request may close these issues.

4 participants

@komakai@alalek@wwwwwlllllllllll@opencv-pushbot

[8]ページ先頭

©2009-2025 Movatter.jp