Skip to content

Garlic grabber

krzysiekdzi edited this page Nov 4, 2019 · 2 revisions

Grabs garlic object.

Chooses place to grab from the list delivered by GarlicDetector function, based on it’s position and orientation. Computes real distance from grab point in 3 axes by comparing 2D camera image and pre-input object size and then grabs object.

Runs by using run() function.

Parameters to set: self.dest_location = np.array([0, 0]) - desired grab point location towards camera (x, y) [mm] self.dest_orientation = 90 - desired object orientation [degrees] self.element_size_real = 0.245 - real object size [mm] self.dest_distance = 0 - desired grab point distance towards camera (z) [mm] self.size_distance_factor = 4.05 - normalized element image size [px/px] * element distance [mm] OR element size [mm] * camera focal length [mm]

In the moment (10.2019) the only code handling object grabbing. Solution can be used to grab other objects as well.

Xavier_ROV4/tasks/torpedoes/locator/cv_solution/heart_detector/holes_detector.py

Returns normalized coordinates of the middle point of heart-shaped hole.

Runs by using get_heart_cordinates(self, image) function.

Parameters to set: Colours to threshold (in HSV scale) in thresholdImage(self, frame) function: lower_h lower_s lower_v upper_h upper_s upper_v Steps: threshold image detect contours filter contours having inner contour compare inner contours with template (image file), choose contour closest do template compute and return normalized coordinates of the middle point of hole

Comparison solution is forced by comparing contours of objects seen from an angle - MatchShape function returned smaller values for correct hole than for incorrect hole, but seen up front. Setting absolute qualifying value is impossible.

Clone this wiki locally