Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 5 #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Swift 5 #15

wants to merge 4 commits into from

Conversation

madhavajay
Copy link

Same as here:
#14

Only for Swift 5

- Updated OpenCV submodule to 4.0.1
- Renamed methods detectMultiscaleWith to DetectMultiScaleOnImage
- Removed unused test targets
- Added reference to data folder in opencv for haar cascade files
- Updated Xcode Project to Swift Version 4.2
- Fixed some minor project Code Deprecation changes
- Removed some empty DevelopmentTeam / DEVELOPMENT_TEAM settings
@twairball
Copy link

I tried this branch, sure the errors go away but you broke a couple of methods and simply commented them out?

OCVImageOperation.m line 45:

+ (void)rectangleOnSource:(id<OCVInputOutputArrayable>)source fromPoint:(OCVPoint)point1 toPoint:(OCVPoint)point2 withColor:(OCVScalar)color thickness:(NSInteger)thickness lineType:(NSInteger)lineType shift:(NSInteger)shift {
#warning FIX THIS
    //cv::rectangle(*source.inputOutput._inputOutput, convertPoint(point1), convertPoint(point2), convertScalar(color), (int)thickness, (int)lineType, (int)shift);
}

and line 59:

#warning FIX THIS
    //cv::rectangle(*source.inputOutput._inputOutput, convertPoint(point1), convertPoint(point2), convertScalar(color), (int)thickness, (int)lineType, (int)shift);

@madhavajay
Copy link
Author

@twairball I just forked the main project and didn't touch a single line of the actual LegoCV Wrapper code.

Take a look at my commit history:
https://github.com/madhavajay/LegoCV/commits/swift-5

@twairball
Copy link

Sorry, yes you're right. looks like it was from earlier commits on master.

@madhavajay
Copy link
Author

@Legoless Do you know why the code is commented? Also there seems to be some outstanding issues that prevent usage of this library like the free memory crash with OCVMat etc.

For now I have just been bridging my own c++ code to Obj-c and its working pretty well. Its a pity since this project could really have some potential.

@Legoless
Copy link
Owner

It's incredibly hard to keep this up to date with both Swift and OpenCV changes. Swift 5 partially solves this indeed, so I will have a look at everything and continue developing the project this week. Thanks for the PR, will have a look!

@madhavajay
Copy link
Author

@Legoless well Swift 5 promises ABI compatibility so you shouldn't have to change Swift compat again any time soon. I think the outstanding memory issues are more important as they are stopping me from even using LegoCV. But certainly it makes sense to get this project up to scratch and working. Regarding OpenCV, once the library is functioning correctly without show stopping bugs I think there would be an active community who would help keep the library up to date when things change.

@Legoless
Copy link
Owner

That is correct and I am starting to work on the project more actively again. Will keep my conversion of Swift 5, since I already did it before and will work on those fixes later this week.. Thanks for the PR though, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants