This repository was archived by the owner on May 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
PixelObjectList implementation - Duplicates by visual identification #79
Open
chrishajduk84
wants to merge
26
commits into
UWARG:master
Choose a base branch
from
chrishajduk84:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
25b5eba
New PixelObjectList Class. Used to store all pixelobjects in a sequen…
6b2ce3f
Added haversine formula for calculating GPS coordinates
030044c
Finished GPS corner function
94566f0
Possibly finished the GPS coordinate implementation
c15c80a
Add GPS coordinates to Pixel Objects, uniqueness is observed and anal…
5725401
Reformatted targetanalysis code to use objectlist rather than pixelob…
02473c7
Redefined TargetAnalysis code flow
b0e2c06
Added a compareAndAdd function. For now it uses statistics and a bit …
2996458
Doesn't need to be a class, because it would be a singleton... Simply…
0b09a23
Code compiles. Whether it works or not is another question. Next step…
2d1caa6
Started building uniqueness test for pixel objects
6a7b80d
Added test images where duplicates are present. Preliminary duplicate…
dfda04b
Object comparison code works now. Optimizations still need to be comp…
9cc79aa
Removed unecessary file for testdata specific to targetanalysis. Chan…
1f504f0
Documented the PixelObjectList Class
d1ace28
Added final comments and documentation to target_analyzer. Also remov…
c82d14d
Merge Conflict resolved
2dbb76e
Beginning integration of GPS analysis. Next step, Unit tests for GPS …
3a7bbe4
Added ability for contours to be GPS located (based on the centroid).…
63b6663
Finished GPS integration. Added tests to test functionality.
9c05359
Colour Comparison Working. The fuzzy logic which groups duplicate obj…
bc1b157
TargetAnalyzer is the settings singleton. It now contains threshold a…
3e8bc64
Optimized addition of nodes, fixed issues with private/public members
33df7f8
compareContour changed to be super efficient. It is an order of magni…
99271e8
Merged Conflicts
0fe008e
Fixed to incorporate new constructor for Frame.h
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,39 +2,37 @@ | |
| * @file object.h | ||
| * @author WARG | ||
| * | ||
| * @brief Container class for storing information about | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This describes a class not a file. I'm not really sure why this needed to be moved. |
||
| * identified targets in real-world measurements | ||
| * Adding PixelObjects consolidates their information | ||
| * into the Object | ||
| * | ||
| * @section LICENSE | ||
| * | ||
| * Copyright (c) 2015, Waterloo Aerial Robotics Group (WARG) | ||
| * Copyright (c) 2015-2017, Waterloo Aerial Robotics Group (WARG) | ||
| * All rights reserved. | ||
| * | ||
| * This software is licensed under a modified version of the BSD 3 clause license | ||
| * that should have been included with this software in a file called COPYING.txt | ||
| * This software is licensed under a modified version of the BSD 3 | ||
| * clause license | ||
| * that should have been included with this software in a file called | ||
| * COPYING.txt | ||
| * Otherwise it is available at: | ||
| * https://raw.githubusercontent.com/UWARG/computer-vision/master/COPYING.txt | ||
| */ | ||
|
|
||
|
|
||
|
|
||
| #ifndef OBJECT_H_INCLUDED | ||
| #define OBJECT_H_INCLUDED | ||
|
|
||
| /** | ||
| * @class Object | ||
| * | ||
| * @brief Container class for storing information about | ||
| * identified targets in real-world measurements | ||
| * Adding PixelObjects consolidates their information | ||
| * into the Object | ||
| * | ||
| */ | ||
|
|
||
| #include <opencv2/core/core.hpp> | ||
| #include <vector> | ||
|
|
||
| class PixelObject; | ||
|
|
||
| class Object { | ||
| public: | ||
| Object(std::string type); | ||
| Object(); | ||
|
|
||
| /** | ||
| * @brief Getter for Object image | ||
|
|
@@ -55,7 +53,7 @@ class Object { | |
| * | ||
| * @return GPS co-ordinates of the Object | ||
| */ | ||
| cv::Point2f get_centroid(); | ||
| cv::Point2d get_centroid(); | ||
|
|
||
| /** | ||
| * @brief Getter for area | ||
|
|
@@ -83,7 +81,7 @@ class Object { | |
| * | ||
| * @return 2D error magnitude of the Object's location in metres | ||
| */ | ||
| cv::Point2f get_error(); | ||
| cv::Point2d get_error(); | ||
|
|
||
| /** | ||
| * @brief Getter for error angle | ||
|
|
@@ -96,17 +94,27 @@ class Object { | |
| * @brief Adds given PixelObject to Object's storage | ||
| * and recalculate target information | ||
| * | ||
| * @param o PixelObject to be added | ||
| * @param po PixelObject to be added | ||
| */ | ||
| void add_object(Object * o); | ||
| void add_pobject(PixelObject * po); | ||
|
|
||
| /** | ||
| * @brief Getter for pixel Objects | ||
| * | ||
| * @return Array containing all of the PixelObjects that were used to | ||
| * create this instance of Object | ||
| */ | ||
| const std::vector<Object *> & get_objects(); | ||
| const std::vector<PixelObject *> & get_pobjects(); | ||
|
|
||
|
|
||
| /** | ||
| * @brief Updates Object parameters based on the PixelObjects contained | ||
| * within it. For now this includes calculating the average | ||
| * positions/colours/areas with potential error | ||
| * | ||
| */ | ||
| void update(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I note that you only use this in conjunction with add_pobject (and vice versa). Why not combine the two methods? |
||
|
|
||
| private: | ||
|
|
||
| /** | ||
|
|
@@ -127,7 +135,7 @@ class Object { | |
| /** | ||
| * @brief GPS co-ordinates of the centre of the Object | ||
| */ | ||
| cv::Point2f centroid; | ||
| cv::Point2d centroid; | ||
|
|
||
| /** | ||
| * @brief area of the target in square metres | ||
|
|
@@ -147,7 +155,7 @@ class Object { | |
| /** | ||
| * @brief Calculated location error of the target as a 2D rectangle in metres | ||
| */ | ||
| cv::Point2f error; | ||
| cv::Point2d error; | ||
|
|
||
| /** | ||
| * @brief Angle of the error as degrees clockwise from North | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In all honesty, why do editors even allow you to create lines like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops. Any vim extension suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See http://vim.wikia.com/wiki/Remove_unwanted_spaces
What I use:
The BufWrite glob can be modified depending on the files you use. Note that it isn't actually good to do this for all files. Try programming with Whitespace when doing so for example (why you would actually use Whitespace is an entirely different question).
It also means that everything you touch gets whitespace stripped, and depending on what codebase you're working on, people can get annoyed if you start checking in changes where every file that you touch has loads of whitespace changes. I generally just use
git add -pand avoid other people's whitespace issues.