LAB 4_instruction

.pdf

School

Drexel University *

*We aren’t endorsed by this school

Course

455

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

5

Uploaded by Ostree

LAB 4 _ 2D pose detection Professor: Euisun Kim Fall 2021 Lab Objectives - Learn the basics of template based 2D Object Pose detection Part A. Introduction Knowing the object pose (i.e., position and orientation) is important in manipulation tasks. It could be used in closed-loop control in robotic tasks. In most applications, vision-based pose detection is used. In this lab, we cover the basics of the 2D pose estimation. In practice this can be done with QR code, AR code templates. Before getting into the pose estimation, there are a few concepts you need to understand. Please search online to get further explanation. 1) Template Matching : A technique in digital image processing that identifies the parts on an image that match a predefined template image. Figure 1. Template Matching Example(https://docs.adaptive- vision.com/4.7/studio/machine_vision_guide/TemplateMatching.html) 2) Rotation Matrix : A matrix that performs a rotation in Euclidean Space. Refer to ‘Homogenous Transformation Matrix’ lecture for more detail. Figure 2. Image Rotation using Rotation Matrix(https://www.sharetechnote.com/html/EngMath_Matrix_AffineMapping.html)
3) Fiducial Marker : An object placed in the field of view of an imaging system which appears in the image produced, for use as a point of reference or a measure. Figure 3. Fiducial Marker Examples(https://en.wikipedia.org/wiki/Fiducial_marker) Part B. Pose Estimation Basics As shown in Figure 4, imagine a robot (Rectangular box with square, triangle, and circle shapes on) moves from the reference pose to two distinctive locations with different orientations (we call both combined as the pose of the robot. Pose1 and Pose 2 in Figure 4). In this scenario, we have placed a camera to get the top view of the robot. The goal is to calculate the location and orientation of the robot in Pose 1 and Pose 2 in reference to the ‘reference pose’. Here we use the reference pose as the base template. Figure 4. 2D Robot Pose Detection Scenario. Top view image. PartB-1. Retrieving Robot position. In the previous component of the lab (i.e., LAB3), you made yourself familiar to detect an object shape, circle. We will use a similar method to retrieve the centroid of robot and the centroid of the distinctive shapes for both Pose 1 and Pose 2. You can use regionsprops() function from the Image Processing Toolbox for this. The skeleton for the code is given to you in fiducialxyz.m . Please read the comments in the code for a better understanding of the input and output types.
Image Name in Lab 4 folder Pose base.png Reference Pose base_1.png Pose 1 base_2.png Pose 2 Using the code below to test your fiducialxyz.m function on base_1.PNG and base_2.PNG. MATLAB CODE to test your fiducialxyz.m function %% MEM455 LAB4-2D POSE DETECTION %% Detection % convert the image to grayscale image = 'base_1.png' ; img_rbg = imread(image); img_gray = rgb2gray(img_rbg); img_binary = imbinarize(img_gray); img_binary = imcomplement(img_binary); % xyz detection xyz = fiducial_xyz(img_binary); Record the xyz matrix from fiducialxyz.m function for both base_1.PNG and base_2.PNG in google spreadsheet (link is shown on the last page of this instruction) % Note: Image Coordinate Systems in Matlab In MATLAB, pixel indices are integer values and range from 1 to the length of the row or column. The indices are ordered from top to bottom, and from left to right. ( https://www.mathworks.com/help/images/image-coordinate-systems.html ) Show your code & output to your instructor for a checkout before moving to the next!
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help