Gogul09 / image-classification-python

Using global feature descriptors and machine learning to perform image classification
MIT License
78 stars 78 forks source link

Issue related to resizing of the images #1

Open ShalluSharma opened 6 years ago

ShalluSharma commented 6 years ago

Dear gogul,

I am having an error of "C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4044: error: (-215) ssize.width > 0 && ssize.height > 0 in function cv::resize" and " in ()" when I am executing this code.

BiQiWHU commented 6 years ago

So do I. I changed the image size into my own size, but this problem still occurs

BiQiWHU commented 6 years ago

I have found the problem and fixed these two python file. (1) The reason why cv::resize() has problem with images' heights and widths is that the code can not read image files at all, mainly because of the file path and '/'. So, some adaption has to be made in global.py to read image files correctly. Please refer to my update globalfeature.py. (2) If u wanna run the file _traintest.py smoothly, u will find there are still other some problems, e.g., how to import functions from global.py file and the definition of some variables. Please refer to my update train_testnew.py After all these are fixed, I have successfully run this project in Spyder and Jupyter (Win8.1).

BiQiWHU commented 6 years ago

Desktop.zip

BiQiWHU commented 6 years ago

In Desktop.zip, two python files, named global feature.py and _traintestnew.py respectively are packed.

ShalluSharma commented 6 years ago

Thanks for your kind help...

On Sun, Aug 5, 2018 at 9:25 PM, Qi BI notifications@github.com wrote:

In Desktop.zip, two python files, named global feature.py and train_testnew.py respectively are packed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Gogul09/image-classification-python/issues/1#issuecomment-410529334, or mute the thread https://github.com/notifications/unsubscribe-auth/AVy-wtrGV1KTMxLAnx7pOtluNpKQvFrLks5uNxVjgaJpZM4VO7go .

BiQiWHU commented 6 years ago

Note that the image size is 256*256 in my dataset with 21 categories. When u use this code, please change this parameters so that it can fit ur dataset. Welcome

shubhujain-97 commented 5 years ago

it is still giving the same error please help

fngwira14 commented 4 years ago

Dear @Gogul09 , I have this error, mind helping out? @ShalluSharma @BiQiWHU @shubhujain-97 File "", line 18 fv_hu_moments = fd_hu_moments(image) ^ SyntaxError: invalid syntax