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

Pipeline fitting #3

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Pipeline fitting #3

wants to merge 15 commits into from

Conversation

Jekta1
Copy link

@Jekta1 Jekta1 commented Jan 31, 2025

Fitting pipelinelines

@Jekta1 Jekta1 requested a review from jorgenfj January 31, 2025 17:18
@Jekta1 Jekta1 linked an issue Jan 31, 2025 that may be closed by this pull request
3 tasks
@jorgenfj jorgenfj requested a review from Andeshog January 31, 2025 18:43
pipeline-filtering/README.md Show resolved Hide resolved
pipeline-filtering/launch/pipeline_filtering_launch.py Outdated Show resolved Hide resolved
pipeline-filtering/src/pipeline_filtering_ros.cpp Outdated Show resolved Hide resolved
pipeline-filtering/src/pipeline_processing.cpp Outdated Show resolved Hide resolved
pipeline-line-fitting/src/randsac.cpp Outdated Show resolved Hide resolved
pipeline-line-fitting/src/randsac.cpp Outdated Show resolved Hide resolved
pipeline-line-fitting/src/randsac.cpp Outdated Show resolved Hide resolved
pipeline-line-fitting/src/randsac.cpp Outdated Show resolved Hide resolved
pipeline-line-fitting/src/randsac.cpp Outdated Show resolved Hide resolved
@vortexuser vortexuser self-requested a review February 1, 2025 13:51
minTurnAngle: minimum angle difference between lines, radians (ofc)
size: what size of square the image will be resized to during preprocessing
*/
randsac = RANDSAC(n, k, t, 2, removeT, finalScorethresh, minTurnAngle);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be made into a setter function?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? seems like unnecessary bloat?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the constructor in the ros node you call a constructor that calls another constructor. Since both have a lot of parameters it is hard to keep track of what goes where.

float finalScorethresh;
float minTurnAngle;
int size;
cv::Mat orgImg; // Original image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does image have to be a member variable? We should not have to store it here since we are always just working with the most recent frame.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it does, it is used later to extract the pixel values for start/endpoints for the lines, as the other image will have been greatly altered

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you pass it down the functions calls?

}

vector<Line> LinedetectorPipe::operator()(const cv::Mat &img, const int maxLines=3){
orgImg = img.clone();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two copies seems redundant. Can it be rewritten to not require this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

se above. one is processed and used and one needs to be intact for later

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If one is processed and one is kept for later then you should only need one copy

processedImg = img.clone();
_preprocess(processedImg);

// Find points where img > 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be combined into loop block?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was supposed to be for line 177-191

cout << "Found line " << i+1 << " with score: " << randsac.bestScore << endl;

return 0;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use bool for success/fail or use negative numbers (-1) for errors

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this not the system that is there? a bool for sucess and fail?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I would prefer to explicitly set the function return type as bool and not int

* ci: added industrial ci workflow

* commented out install script

* renamed opencv dep

* feat: added config files for clang and ruff

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Andreas Kluge Svendsrud <[email protected]>
Co-authored-by: Andreas Kluge Svendsrud <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

[TASK] Pipeline Detection
7 participants