Skip to content
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

SE-2715 #28

Merged
merged 4 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions disparity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ The Python script shows how to programmatically

## Setup

Change the following demo parameters to your desired settings in the ```demo.py``` file.

| ***Parameter*** | ***Description*** |
|-----------------|------------------------------------------------------------------------------------------------|
| ```mac``` | (optional) The MAC address of the camera. Assumes the first available camera if not specified. |
| ```offsety1``` | (optional) The Y offset of the right image. Default 440. |
| ```image``` | (optional) Decide whether to stream the left image with disparity. |
| ```cost_path``` | (optional) Sets disparity cost path |
| ```crosscheck``` | (optional) Sets crosscheck value |
| ```subpixel``` | (optional) Set sub-pixel value |
| ```blockwidth``` | (optional) block size width |
| ```blockheight``` | (optional) block size height |
| ```mindisparity``` | (optional) minimum disparity |
| ```numdisparity``` | (optional) number of disparity |
| ```vsearch``` | (optional) Set vertical search |
| ```threshold``` | (optional) set threshold |
| ```uniqueness``` | (optional) set uniqueness ratio |
| ```penalty1``` | (optional) set penalty1 |
| ```penalty2``` | (optional) set penalty2 |
Set the following arguments to the ```demo.py``` file to change demo behavior.

| ***Parameter*** | ***Description*** |
|----------------------|------------------------------------------------------------------------------------------------|
| ```--mac``` | (optional) The MAC address of the camera. Assumes the first available camera if not specified. |
| ```--offsety1``` | (optional) The Y offset of the right image. Default 440. |
| ```--image``` | (optional) Decide whether to stream the left image with disparity. |
| ```--cost_path``` | (optional) Sets disparity cost path |
| ```--crosscheck``` | (optional) Sets crosscheck value |
| ```--subpixel``` | (optional) Set sub-pixel value |
| ```--blockwidth``` | (optional) block size width |
| ```--blockheight``` | (optional) block size height |
| ```--mindisparity``` | (optional) minimum disparity |
| ```--numdisparity``` | (optional) number of disparity |
| ```--vsearch``` | (optional) Set vertical search |
| ```--threshold``` | (optional) set threshold |
| ```--uniqueness``` | (optional) set uniqueness ratio |
| ```--penalty1``` | (optional) set penalty1 |
| ```--penalty2``` | (optional) set penalty2 |
## Usage

```bash
Expand Down
14 changes: 14 additions & 0 deletions disparity/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ def check_stereo(device: eb.PvDeviceGEV, image: bool):
multipart = device_params.Get('GevSCCFGMultiPartEnabled')
multipart.SetValue(image)


def enable_undistort_rectify(device: eb.PvDeviceGEV):
"""
Enables undistortion and rectification
:param device: The device
"""
if not is_stereo(device):
raise RuntimeError('Sparse3D supported only on Bottlenose stereo.')

# Get device parameters
device_params = device.GetParameters()

# Turn on rectification
rectify = device_params.Get("Rectification")
rectify.SetValue(True)
Expand Down Expand Up @@ -316,6 +328,8 @@ def acquire_data(device, stream, invalid):
if bn_device is not None:
check_stereo(device=bn_device, image=args.image)
set_y1_offset(device=bn_device, value=args.offsety1)

enable_undistort_rectify(device=bn_device)
enable_disparity(device=bn_device)
configure_disparity(device=bn_device, params=args)

Expand Down
27 changes: 16 additions & 11 deletions keypoints/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
# Simple Keypoint Sample

This is a modified version of the streaming demo that shows how to transmit the key points from Bottlenose.
This demo shows how to stream keypoints from a Bottlenose camera.

Please use ```eBusPlayer``` first to configure the image quality, gain, and exposure settings.
This example assumes that any other settings related to image quality such as `exposure`, `gain`, and `CCM` is properly set. Please use `Stereo Viewer` or `eBusPlayer` to configure the image quality to your like.

The Python script shows how to programmatically enable chunk data transmission for
[Fast9](https://en.wikipedia.org/wiki/Features_from_accelerated_segment_test) key points.
[FAST](https://en.wikipedia.org/wiki/Features_from_accelerated_segment_test) and GFTT key points.

## Setup

Change the following demo parameters to your desired settings in the ```demo.py``` file.
Change the following demo parameters to your desired settings.

| ***Parameter*** | ***Description*** |
|-------------------------------|-------------------------------------------------|
| ```max_fast_features``` | Maximum number of keypoints to transmit. |
| ```fast_threshold``` | Threshold for the Fast9 algorithm. |
| ```use_non_max_suppression``` | Whether to use non-maximum suppression. |
| ***Parameter*** | ***Description*** |
|----------------------|------------------------------------------------------------------------------------------------|
| ```--mac``` | (optional) The MAC address of the camera. Assumes the first available camera if not specified. |
| `--corner_type` | (optional) One of the feature point detector [FAST, GFTT]. Default=FAST |
| `--gftt_detector` | (optional) Underlying detector for GFTT. One of [Harris, MinEigenValue]. Default=Harris |
| ```--max_features``` | (optional) Maximum number of keypoints to transmit. Default = 1000 |
| `--quality_level` | (optional) Quality level for GFTT. Default = 500 |
| `--min_distance` | (optional) Minimum distance between detected points with GFTT. Default = 15 |
| `--paramk` | (optional) Free parameter `k` for GFTT. Default = 0 |
| ```--threshold``` | (optional) Threshold for the FAST algorithm. Default=20 |
| ```--nms``` | (optional) Set to use non-maximum suppression with FAST. Default=false |

## Usage

```bash
python demo.py ?MAC
# MAC - (optional) mac address of Bottlenose to connect to or first one
python demo.py <parameters>
```

----
Expand Down
Loading
Loading