-
Notifications
You must be signed in to change notification settings - Fork 23
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
Open CV - SuperPixel - Attribute Error / Complex type mapping #9
Comments
I can't help but notice that this appears to be higher up the chain than you state as the error message you've got says you're missing the attribute 'ximgproc' I'll have a little fiddle as I'm going to be wanting OpenCV2 myself in a while. Your better bet may be @lmbelo though as he writes this stuff in the first place (while I'm blindly working stuff out as I go) |
Well, that was quick... Googling "python cv2 ximgproc" finds the problem instantly at https://stackoverflow.com/questions/57427233/module-cv2-cv2-has-no-attribute-ximgproc It notes that....
So, you've using the wrong OpenCV This can be fixed simply by working out which particular variant of OpenCV you need and creating a Package for it - e.g. cv2_contrib (or whichever one you need) Creating the required package is very easy (and like everything else completely undocumented). Just need to know which package you're after (I'll try working it out - may need it myself). Opencv-contrib-python looks like a likely candidate from that StackOverflow anyway - I'll whip up a quick package. @lmbelo Making the fact there's a Discord public might be a good idea as issues like this are better placed there. I'm sure that more people than the four current members of it would like to know it existed :) |
we are currently working to launch the Discord channel to the community. We expect to get it widely used by the community. |
@kartus42 I will try it and be back with a feedback. |
@peardox found the answer. You can use the current implementation of OpenCV and install it from a different index-url. |
I wrote the requited component after replying to this but messed naming up. I got close but need to alter the component slightly (then I rented a M1 so didn't get a chance to look at this again yet) I do, however, now that he requires an alternate package, preferably PIP, and probably this one - opencv-contrib-python As noted above there are four cv2 packages and all break the others so he needs thee correct package. |
That's a good point. Hmm - selectable sources would be a nice feature for cases like this. I know from experience that PyTorch needs an extra-index-url for GPU support that changes every so often (I've seen three recently - the oldest one hits deprecated when a new one arrives from the look of it) |
Here you go - one working (almost) version of your progette There's an extra component called CV2_Contrib in the folder p4d-extras/packages that you'll need to install Annoyingly cv2 is known as np in this component - not sure why (@lmbelo - I called it cv2 but the thing only responds to np) - could be something to do with opencv-contrib-python or the Delphi interface to it (ain't got a clue and as it works ain't really worried about it) I had to comment out this loop (low/high on Variant)
It now compiles and at least rotates the image. It also has createSuperpixelLSC which is what you were after. Your code back, slightly modified with a new working component... |
Tried it - didn't work, Re-implemented component (which does work) PIP gets upset if you give it the contrib url as it doesn't match the required package - at least in my non-specialist tests (it will be possible, just not the way I tried it...) |
@kartus42 I've now added a PR so hopefully a nice new component will appear fairly soon for you. I also found out why it was wanting to be called np (I copied Numpy - doh...) in my quick component and fixed that (so it's now correctly cv2 again) |
Hi gents,
I am continuing my OpenCV / Python / Delphi journey and found the following:
here is the project code
OpenCV_2.zip
thank you
The text was updated successfully, but these errors were encountered: