<commit_before># netcam_stream

Use the package to stream network cameras to the ROS network as well as their rectified streams. 
Additionally give ability to find homography to the plane defined by a calibration pattern.

# Usage

To start a stream on an individual camera call the
```
roslaunch netcam_stream netcam.launch id:=X
```
where 'X' is the ID of the camera you want to launch. Additionally you can specify launch_user and launch_pass if they are not set in the paramter server.

To launch all cameras, run
```
roslaunch netcam_stream all_netcams.launch
```

# Details

Each camera is associated with a calibration file ('calibration/cam{id}.yaml'), which needs to be located at the base of the file tree for the package.

In order to calibrate the camera with id X, after starting the stream, run
```
rosrun camera_calibration cameracalibrator.py --size 7x6 --square 0.108 image:=/netcam_stream_X/image_raw camera:=/netcam_stream_X
```
Remember to move the resulting calibration file to the right place.

To convert it, rename the ost.txt found after uncompressing to ost.ini and parse it

```
tar -zxvf /tmp/calibrationdata.tar.gz
mv ost.txt ost.ini
rosrun camera_calibration_parsers convert ost.ini camX.yaml
mv camX.yaml ~/catkin_ws/src/netcam_stream/calibration
```

# Homography

Homography can be estimated by launching the associated launch file:
<commit_msg>Updated README with frame_rate param option.<commit_after># netcam_stream

Use the package to stream network cameras to the ROS network as well as their rectified streams. 
Additionally give ability to find homography to the plane defined by a calibration pattern.

# Usage

To start a stream on an individual camera call the
```
roslaunch netcam_stream netcam.launch id:=X
```
where 'X' is the ID of the camera you want to launch. Additionally you can specify launch_user and launch_pass if they are not set in the paramter server.

The created topic will stream at the highest frame rate given by the camera. To manually specify the publisher frame rate (e.g. 15 Hz), use the parameter as follows (the camera will be read at 30 Hz to avoid caching of images)

```
roslaunch netcam_stream netcam.launch id:=X frame_rate:=15
```

To launch all cameras, run
```
roslaunch netcam_stream all_netcams.launch
```

# Details

Each camera is associated with a calibration file ('calibration/cam{id}.yaml'), which needs to be located at the base of the file tree for the package.

In order to calibrate the camera with id X, after starting the stream, run
```
rosrun camera_calibration cameracalibrator.py --size 7x6 --square 0.108 image:=/netcam_stream_X/image_raw camera:=/netcam_stream_X
```
Remember to move the resulting calibration file to the right place.

To convert it, rename the ost.txt found after uncompressing to ost.ini and parse it

```
tar -zxvf /tmp/calibrationdata.tar.gz
mv ost.txt ost.ini
rosrun camera_calibration_parsers convert ost.ini camX.yaml
mv camX.yaml ~/catkin_ws/src/netcam_stream/calibration
```

# Homography

Homography can be estimated by launching the associated launch file:

{'fraction_non_alphanumeric': 0.06292572169964321, 'fraction_numerical': 0.005838469023678235, 'mean_word_length': 4.6900369003690034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4343029', 'n_tokens_mistral': 932, 'n_tokens_neox': 852, 'n_words': 416}