joheras / CLoDSA

123 stars 33 forks source link

OpenCV 4.0.1 pointSetBoundingRect error #5

Closed Erik-Koning closed 5 years ago

Erik-Koning commented 5 years ago

Im augmenting a dataset for object detection in YOLO, using the CLODSA_Plants.ipynb During the the first attempted transformation to do a vertical flip, I am getting an error on the line containing: vFlipImg,vFlipBoxes = vFlipGenerator.transform(img,boxes)

error:

OpenCV(4.0.1-dev) /home/erik/work/opencv/modules/imgproc/src/shapedescr.cpp:741: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'pointSetBoundingRect'

I have not changed the notebook very much, only changed the paths to my local dataset. Here is a copy of my ipynb CLODSA_Plants_yolo.zip

joheras commented 5 years ago

Hi Erik,

I have uploaded to pip a new version of CLoDSA with support for OpenCV 4.0. You can install it by running !pip install clodsa==1.2.27

It should work properly now. Let me know if you have further problems. Best, Jónathan

Erik-Koning commented 5 years ago

Solved. Thanks!

zimenglan-sysu-512 commented 5 years ago

hi @joheras i use pip2 to install clodsa, it does not work.

joheras commented 5 years ago

Hi @zimenglan-sysu-512 Could you be more specific about the problem? Does pip show an error when you installed Clodsa? Or does the problem arise when using it?

zimenglan-sysu-512 commented 5 years ago

the error as below of using cv2.seamlessClone:

cv2.error: OpenCV(4.1.0) /io/opencv/modules/imgproc/src/shapedescr.cpp:743: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'pointSetBoundingRect'
joheras commented 5 years ago

It seems that you have not installed correctly OpenCV. You can install the last version using: pip install opencv-python

Or if you want to install a previous version, you can use: pip install opencv-python==3.4.2.16

zimenglan-sysu-512 commented 5 years ago

hi @joheras i try opencv 4.1, 3.3, 3.4.2.16 or 3.4.3.18, it does not work.

joheras commented 5 years ago

Could you send me an example of what you are trying to do to joheras@gmail.com? I can try to reproduce the error and see what it is happening

zimenglan-sysu-512 commented 5 years ago

hi @joheras it's my mistake, that the function seamlessClone need a mask whose values are 255 instead of binary mask. after muliply the binary mask by 255, it fixes the problem. thanks

joheras commented 5 years ago

Great. Let me know if you need further help. Best, Jónathan

El jue., 13 jun. 2019 6:08, zimenglan notifications@github.com escribió:

hi @joheras https://github.com/joheras it's my mistake, that the function seamlessClone need a mask whose values are 255 instead of binary mask. after muliply the binary mask by 255, it fixes the problem. thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/joheras/CLoDSA/issues/5?email_source=notifications&email_token=ABJRAG26JCDKMWYVLCQHKM3P2HB3XA5CNFSM4GUBPHO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXSOP7Y#issuecomment-501540863, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJRAG42MX6TNU5H7C7KROTP2HB3XANCNFSM4GUBPHOQ .