For running an ROS image recognition node, you should install the following dependencies. The first is cv-bridge, which helps us to convert an ROS image message into OpenCV image data type and vice versa. The second is cv-camera, which is one of the ROS camera drivers. Here's how to install them:
$ sudo apt-get install ros-melodic-cv-bridge ros-melodic-cv-camera
The next section will cover the ROS image recognition node.