-
Notifications
You must be signed in to change notification settings - Fork 12
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
How to emulate this project? #2
Comments
If I understand correctly, you essentially want to run a C Simulation on your computer, yes? In this case, just change the directories in the sprintf statements at lines 87-92 of Topmain.cpp to something local, e.g. "/home/user/directory/of/pictures/filename.pgm". As it is, its coded quite specifically for testing images from the KITTI dataset and using the specific names of the files therein, but modifying that shouldn't be a problem. Keep in mind that the reading and writing of images is implemented manually in Topmain.cpp (limited to .pgm images). The right image size parameters need to be specified in Topmain.h (rows, cols). Also, the header in the PGM images must be contained to the first line of the file and must be, on the subsequent line, immediately followed by the image data (no comments or anything else - if using ffmpeg to convert images to PGM, it may be necessary to ensure that they meet these criteria). Although this is less flexible, it eliminates any dependency on OpenCV to load/store images. Otherwise, this would involve additionally cross-compiling/linking OpenCV which may complicate the process for someone trying to get up and running as easily as possible. If someone wishes to contribute to the repository and fork a version that adds OpenCV support for reading/writing images as well as handling them in the accelerators, that would be tremendously appreciated! I may look at doing this in the future myself, but at the moment, I just don't have the time! |
Many thanks for your kindly reply. I have modified the path of input image in Topmain.cpp, and changed the cols and rows in Topmain.h. however, the fopen() still cannot open the input image correctly. Nevertheless, now I have launched this code in ZCU102 dev. board, which can avoid the above problem, while involve another problem. Let me describe it below. |
This problem is fixed. we instead the allocate method of the FinalResult by conventional malloc(). It works well. So this thread can be closed. Thank you~ |
Hi Wenzhe, Sorry for the delay in getting back to you! I think I've come across this issue myself when testing and I believe it has something to do with the SD Card getting corrupted. Please try the following to see if it does not fix your solution: Before copying the contents of the sd_card folder onto the SD Card (as well as the test images), please reformat the SD card completely (FAT). In essence, wiping the SD card to a fresh state before every use. It is much more advantage to use sds_malloc and not just malloc as the former ensures that the data is stored in a contiguous manner that allows for efficient speedup when being read/written by the DMAs. Using the latter will not allow for the same amount of speedup! |
Thank you seakros~ I will try it later and make feedback after that. |
Hi, guys.
I want to launch this code in emulation of SDx environment. Nevertheless, I met some problems as follows:
In main() function, the program load image from '/mnt/img/*.pgm', which works well when we burn the bitstream to SD card. However, when the program works in emulation method, it cannot find the image location. I do not know how to indicate the proper directory for the program loading image. I tried to add /mnt directory and image file on $prj/Debug/_SD_Card/, also tried to create image file on /mnt of host. neither works.
Any advice about how to indicate the load image directory in emulation environment? Thank you~
The text was updated successfully, but these errors were encountered: