Closed tyouritsugun closed 2 years ago
@tyouritsugun What is the PATH that you have provided for resized_cat.bmp ? Is an image available at that PATH ?
Hi
Thank you for your reply.
The line below
std::ifstream file(filename, std::ios::binary);
succeeded.
When I debug the filename
, it is correct file name located in the directory I placed it to.
The problem might be the BMP info header parsing, the program says that the width of resized_cat.bmp
is -32 but not 224 which is unexpected.
Zhang
@tyouritsugun Did you try with any other image as well ?
Here is my system information: OS: Ubuntu 20.04 IDE: VS code 1.61.1 CPU: X64 TPU: Coral USB Accelerator
Zhang
C
@tyouritsugun Did you try with any other image as well ? Yes, I've tried several ones including the BMP from MAC and Windows.
BTW, can you please give a image link to make sure it works in your side? Regards Zhang
Can you try with https://github.com/google-coral/edgetpu/blob/master/test_data/parrot.jpg OR https://raw.githubusercontent.com/google-coral/edgetpu/master/test_data/cat.bmp ?
the former one, jpg guy:
it returns from line 41:
return {}; // Invalid file type.
the latter one, bmp guy:
const uint32_t offset = ToInt32(&file_header[10]);
says that the offset is 4294967178.
int width = ToInt32(&info_header[4]);
says that the width is 512
int height = ToInt32(&info_header[8]);
says that the height is 341
then, it returns from line 67:
return {}; // Read failed.
Hope those information are helpful.
Regards Zhang
@tyouritsugun can you please share the binary file for classify.cc.
Please try the classsify_image.cc also from libcoral repo.
Please try this command if you are using linux machine to resize image:
convert cat.bmp -resize 224x224! resize_cat.bmp
Feel free to reopen if you still having any issues. Thanks!
I'm experiencing the same. Ubuntu 21.04
Tried resizing using the command above. didn't work.
Hi,
I was trying classify.cc, I am using resized_cat.bmp from
https://github.com/google-coral/edgetpu/tree/master/test_data
However, I got the error below:
When I trace to the source, I found in line 54 of classify.cc
The debugger says that the width is -32.
Please tell me where can I get the correct BMP file or is there any bug in
ReadBmpImage
?Thank you in advance Zhang