don joe
don joe

Reputation: 41

Optimizing the code using raspberry pi

I am running an image processing program on raspberry pi b+ which has only 300MB usable ram

This program basically follows a black line (line follower) and also detects traffic symbol using the same camera. This requires huge amount of ram and our raspberry pi is processing it slowly.

due to this i am facing problem in line following

What can i do to speed up the processing in the raspberry pi ???

Upvotes: 1

Views: 266

Answers (2)

Van Tr
Van Tr

Reputation: 6121

Speed up an image processing program is a long story because there is a lot of way to do.

In your case that using Raspberry Pi B+, I have some recommends:

Software:

Convert all the image to binary before processing.

Cut all the not-need-to-process parts of image before processing (example: if you detect lane, just remove the upper part of image.

Using C++ is faster than Python (in case you are using OpenCV python library)

Camera:

Using CSI Camera (raspi-cam) will get you better image tranfer speed than USB webcam.

Hardware:

Overclock the CPU

If Raspberry Pi B+ is not mandatory, Raspberry Pi 2 is a better solution with more Ram.

Upvotes: 1

Josh Spademan
Josh Spademan

Reputation: 113

One option would be to overclock your pi. To do this you would open the terminal (ctrl + t), then typing sudo raspi-config. Then press down until you have selected 'overclock', then press ENTER. press ENTER again to accept, and choose how much you would like to over clock. To exit menu, press ENTER to select the overclock, ENTER to confirm, then RIGHT, then RIGHT then ENTER to select 'Finish'

Upvotes: 1

Related Questions