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

height_threshold parameter not considered in RegionGrowingAlgorithm #324

Open
hdaan opened this issue Apr 2, 2024 · 0 comments
Open

height_threshold parameter not considered in RegionGrowingAlgorithm #324

hdaan opened this issue Apr 2, 2024 · 0 comments

Comments

@hdaan
Copy link
Contributor

hdaan commented Apr 2, 2024

In the RegionGrowingAlgorithm the parameter height_threshold is exposed but never considered during seed detection in find_seedpoints.

This leads to the detection of a lot of seeds with a low amount of height change. As a result, there are a lot of "unwanted" seeds, and, in some cases, large objects of low amount of change might prevent smaller objects with greater height change to grow, as the potential seed is already incorporated in the larger segment.

To fix this we can add an height_threshold check in line 945:
Changing:

                    # Check whether the volume started decreasing
                    if previous_volume > volume:
                        # Only add seed if larger than the minimum period
                        if target_idx - start_idx >= self.minperiod:
                            corepoint_seeds.append(
                                RegionGrowingSeed(i, start_idx, target_idx)
                            )
                        break
                    else:
                        previous_volume = volume 

to:

                    # Check whether the volume started decreasing
                    if previous_volume > volume:
                        # Only add seed if larger than the minimum period and height of the change form larger than threshold
                        if (target_idx - start_idx >= self.minperiod) and (np.abs(np.max(used_timeseries) - np.min(used_timeseries)) >= self.height_threshold):
                            corepoint_seeds.append(
                                RegionGrowingSeed(i, start_idx, target_idx)
                            )
                        break
                    else:
                        previous_volume = volume
hdaan added a commit to hdaan/py4dgeo that referenced this issue Apr 3, 2024
Add an height_threshold check in seed detection, line 945. Fixes issue 3dgeo-heidelberg#324
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant