viva

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/4

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:19 AM on 6/11/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

5 Terms

1
New cards

Stage 1 – TRANSLATE

What happens the exact moment a camera frame arrives, and what two conversions take place?

  • The frame triggers the image_callback via the subscription.

  • Conversion 1: CvBridge translates the raw ROS message into an OpenCV NumPy array.

  • Conversion 2: The image is converted from standard BGR to HSV to isolate the true color from changing lights and shadows.

2
New cards

Stage 2 – MASK

How does the loop build the binary mask, and what does the final mask look like?

  • The code creates a blank black canvas and loops three times to catch bright parts, shadowy parts, and mid-tones.

  • It stacks these layers together using a Bitwise OR (|=) filter so they don't overwrite each other.

  • The result is a binary mask: a white silhouette of the target on a completely black background.

3
New cards

Stage 3 – CLEAN What two morphological operations are used to clean sensor noise, and what happens right after?

  • MORPH_OPEN (Opening): Sweeps away tiny white "dust spots" (isolated noise).

  • MORPH_CLOSE (Closing): Fills in tiny black holes inside the target shape.

  • Right after: cv2.findContours() runs to draw a clean digital line/trace around the shape.

4
New cards

Stage 4 – CHECK

What are the three strict elimination checkpoints a detected shape must pass before it is accepted?

  1. Size Gate: Is the shape larger than 3,000 pixels? (Proves it is close enough).

  2. Alignment Gate: Is its center ($c_x$) within the middle 30% of the screen? (Proves the robot is facing it dead-on).

  3. Safety Gate (is_wall_in_front): Does the box contain more than 10% beige wall pixels? (Eliminates wall reflections).

5
New cards

📇 CARD 5: Stage 5 – SNAP

Once a shape passes all checks, how is it saved, and how does the node conserve computer power?

  • Saving: The code uses cv2.imwrite() to grab the original crisp, color frame and write it as a .jpg in the snaps folder.

  • Power Saving: The self.image_saved flag flips to True.

  • This triggers an early exit (return) at the very top of the next camera frames, completely freezing further processing so the robot doesn't waste CPU cycles.