-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
SubjuGator/perception/subjugator_perception/nodes/vision_stack_test.py
This file contains 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,38 @@ | ||
#!/usr/bin/env python3 | ||
import rospy | ||
from image_geometry import PinholeCameraModel | ||
from mil_ros_tools import ( | ||
Image_Subscriber, | ||
) | ||
from vision_stack import ResizeLayer, UnderWaterImageEnhancementLayer, VisionStack | ||
|
||
__author__ = "Daniel Parra" | ||
|
||
|
||
class ObjectDetectionTest: | ||
def __init__(self): | ||
camera = rospy.get_param("~image_topic", "/camera/front/right/image_rect_color") | ||
SIZE = (960, 608) | ||
self.vs = VisionStack( | ||
layers=[ | ||
ResizeLayer((0, 0), 960, 608), | ||
UnderWaterImageEnhancementLayer(SIZE), | ||
], | ||
input_size=SIZE, | ||
) | ||
|
||
self.image_sub = Image_Subscriber(camera, self.detection_callback) | ||
self.camera_info = self.image_sub.wait_for_camera_info() | ||
assert self.camera_info is not None | ||
self.cam = PinholeCameraModel() | ||
self.cam.fromCameraInfo(self.camera_info) | ||
|
||
def detection_callback(self, msg): | ||
# Create Image from array | ||
self.vs.run(msg, True) | ||
|
||
|
||
if __name__ == "__main__": | ||
rospy.init_node("vision_pipeline_test") | ||
ObjectDetectionTest() | ||
rospy.spin() |
Submodule vision_stack
added at
b021d1
This file contains 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 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