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 16 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 |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| * | ||
| * @section LICENSE | ||
| * | ||
| * Copyright (c) 2015, Waterloo Aerial Robotics Group (WARG) | ||
| * Copyright (c) 2015-2016, Waterloo Aerial Robotics Group (WARG) | ||
| * All rights reserved. | ||
| * | ||
| * This software is licensed under a modified version of the BSD 3 clause license | ||
|
|
@@ -33,7 +33,7 @@ class Object; | |
|
|
||
| class Target{ | ||
| public: | ||
| Target(std::string type); | ||
| Target(); | ||
|
|
||
| /** | ||
| * @brief Getter for Target image | ||
|
|
@@ -54,7 +54,16 @@ class Target{ | |
| * | ||
| * @return GPS co-ordinates of the Target | ||
| */ | ||
| cv::Point2f get_centroid(); | ||
| cv::Point2d get_centroid(); | ||
|
|
||
| /** | ||
| * @brief Getter for the pixel distance | ||
| * | ||
| * @return The distance covered by each pixel of the image in the X and Y | ||
| * directions. | ||
| */ | ||
| cv::Point2d get_pixel_distance(); | ||
|
|
||
|
|
||
| /** | ||
| * @brief Getter for area | ||
|
|
@@ -106,6 +115,16 @@ class Target{ | |
| * create this instance of Target | ||
| */ | ||
| const std::vector<Object *> & get_objects(); | ||
|
|
||
| /** | ||
| * @brief Setter for the pixel distance. | ||
| * | ||
| * @param x The distance covered by each pixel of the image in the X. | ||
| * @param y The distance covered by each pixel of the image in the Y. | ||
| */ | ||
| void set_pixel_distance(double x, double y); | ||
| void set_pixel_distance(cv::Point2d); | ||
|
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. Same as the comment on Object, Target likewise isn't tied to a single frame |
||
|
|
||
| private: | ||
|
|
||
| /** | ||
|
|
@@ -126,8 +145,15 @@ class Target{ | |
| /** | ||
| * @brief GPS co-ordinates of the centre of the Target | ||
| */ | ||
| cv::Point2f centroid; | ||
| cv::Point2d centroid; | ||
|
|
||
| /** | ||
| * @brief Distance covered by each pixel in the original target image | ||
| * (non-cropped). Each pixel is measured in terms of meters. | ||
| */ | ||
| cv::Point2d pixelDistance; | ||
|
|
||
|
|
||
| /** | ||
| * @brief area of the target in square metres | ||
| */ | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -29,4 +29,19 @@ | |
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| */ | ||
|
|
||
| #include "object.h" | ||
| #include "pixel_object.h" | ||
|
|
||
| Object::Object(){ | ||
|
|
||
| } | ||
|
|
||
| void Object::add_pobject(PixelObject * po){ | ||
| pixelObjects.push_back(po); | ||
|
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. Note that there's a bunch of other things that need to be done here. For now just averaging the data from the PixelObjects in the Object should be fine, we can do more later. |
||
| } | ||
|
|
||
| const std::vector<PixelObject*>& Object::get_pobjects(){ | ||
| return pixelObjects; | ||
| } | ||
|
|
||
|
|
||
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 |
|---|---|---|
| @@ -1,32 +1,16 @@ | ||
| /* | ||
| This file is part of WARG's computer-vision | ||
|
|
||
| Copyright (c) 2015, Waterloo Aerial Robotics Group (WARG) | ||
| All rights reserved. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are met: | ||
| 1. Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in the | ||
| documentation and/or other materials provided with the distribution. | ||
| 3. Usage of this code MUST be explicitly referenced to WARG and this code | ||
| cannot be used in any competition against WARG. | ||
| 4. Neither the name of the WARG nor the names of its contributors may be used | ||
| to endorse or promote products derived from this software without specific | ||
| prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY WARG ''AS IS'' AND ANY | ||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| DISCLAIMED. IN NO EVENT SHALL WARG BE LIABLE FOR ANY | ||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| */ | ||
| /** | ||
| * @file target.cpp | ||
| * @author WARG | ||
| * | ||
| * @section LICENSE | ||
| * | ||
| * Copyright (c) 2015-2016, 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 | ||
| * Otherwise it is available at: | ||
| * https://raw.githubusercontent.com/UWARG/computer-vision/master/COPYING.txt | ||
| */ | ||
|
|
||
|
|
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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| include_directories(include ../core/include) | ||
| include_directories(include ../core/include ../targetid/include) | ||
| ADD_DEFINITIONS("-DBOOST_LOG_DYN_LINK") | ||
| add_library(TargetAnalysis src/area_analyzer.cpp src/target_analyzer.cpp src/target_loader.cpp) | ||
| target_link_libraries(TargetAnalysis ${Boost_LIBRARIES} Core) | ||
| add_library(TargetAnalysis src/area_analyzer.cpp src/target_analyzer.cpp src/target_loader.cpp src/pixel_object_list.cpp) | ||
| target_link_libraries(TargetAnalysis ${Boost_LIBRARIES} Core TargetIdentification) | ||
| target_compile_features(TargetAnalysis PRIVATE) | ||
| add_subdirectory("test") |
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 |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| /* | ||
| This file is part of WARG's computer-vision | ||
|
|
||
| Copyright (c) 2015, Waterloo Aerial Robotics Group (WARG) | ||
| All rights reserved. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are met: | ||
| 1. Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in the | ||
| documentation and/or other materials provided with the distribution. | ||
| 3. Usage of this code MUST be explicitly referenced to WARG and this code | ||
| cannot be used in any competition against WARG. | ||
| 4. Neither the name of the WARG nor the names of its contributors may be used | ||
| to endorse or promote products derived from this software without specific | ||
| prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY WARG ''AS IS'' AND ANY | ||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| DISCLAIMED. IN NO EVENT SHALL WARG BE LIABLE FOR ANY | ||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| */ | ||
|
|
||
| #ifndef OBJECT_LIST_H_INCLUDED | ||
| #define OBJECT_LIST_H_INCLUDED | ||
|
|
||
| /** | ||
| * @file object_list.h | ||
| * | ||
| * @brief Class which describes a structure for storing pixel targets and then | ||
| * later finding a matching set of targets. | ||
| * | ||
| * Module geolocates targets using their pixel locations | ||
| * and photo metadata, determines target type and calculates | ||
| * possible error. As targets are processed unique targets will | ||
| * be identified and the data combined into a single object. | ||
| * | ||
| * | ||
| **/ | ||
|
|
||
| #include "frame.h" | ||
| #include "object.h" | ||
|
|
||
| struct oNode{ | ||
| Object* o; | ||
| struct oNode* next; | ||
|
|
||
| }; | ||
|
|
||
| class ObjectList | ||
| { | ||
| private: | ||
| oNode* head; | ||
| oNode* tail; | ||
| int listLength; | ||
| public: | ||
| //Constructor | ||
| ObjectList(); | ||
| //Destructor | ||
| ~ObjectList(); | ||
|
|
||
| bool addNode(Object* o); | ||
| bool getGPSDuplicates(); | ||
| bool getVisualDuplicates(); | ||
| }; | ||
|
|
||
| #endif // OBJECT_LIST_H_INCLUDED |
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.
Objects wouldn't have a single distance since they are composed of multiple frames. If anything you might want to include this sort of information in a frame.