In many practical applications, implementation of algorithms is required into low-cost and low-power hardware, proper processing power, simplicity in algorithm development and maximum flexibility. Proper implementation of these methods and real-time operations for defense systems has particular importance. Studies have shown that Raspberry Pi 2 has sufficient computational power to implement an infrared target detection algorithm. Therefore, in this paper, Raspberry Pi 2 is considered as low-cost, low-weight, and low-power hardware for optimum implementing infrared target detection methods and to optimize and reduce runtime, it with the overclocking technique is used. Finally, their performance is compared with other hardware with different software development environment. These comparisons include the Qt software development environment based on the OpenCV image processing library in the Raspberry Pi 2 hardware with Qt software development environment based on the OpenCV library functions in the PC hardware, as well as the high-level MATLAB software. The results show that implementation on the Raspberry Pi 2 in comparison with MATLAB speeds up implementation of the algorithm 6. 5 times. As well as, implementation time of the infrared target detection algorithm (C ++) using the OpenCV library on the PC is approximately eight times that of Raspberry Pi 2. Also, comparing Raspberry Pi 2 and PC in terms of power consumption, weight and cost is observed that Raspberry Pi 2 has a much better performance in terms of power consumption, weight and cost than PCs. The results show that although the use of high-level software such as MATLAB has background suppression factor (SCR) and signal to clutter ratio (BSF) higher than use of the OpenCV library, the results of runtime indicate that the proposed hardware improves the runtime of high-level software like MATLAB. The results of optimization on the Raspberry Pi 2 show that speed of the algorithm is improved by more than 40%.