Courses‎ > ‎Intro to CS - Half Year‎ > ‎Dyrland-Weaver‎ > ‎Work‎ > ‎

Work 33: 12/18

posted Dec 18, 2018, 11:07 AM by JonAlf Dyrland-Weaver   [ updated Dec 19, 2018, 11:37 AM ]
Implement Edge Detection in NetLogo.
  • You should start with your program from Work 32, so you have a program that loads an image along with grayscale and reset buttons.
  • Write an edge detection procedure. Some things worth trying:
    • Adding another property to patches to keep track of color differences.
    • Separating the edge-checking for the recoloring (like we did in the image flip assignment)
    • Checking for color likeness using differences between nearby patches.
      • If subtracting, remember that color differences may be positive or negative, but we probably don't care about the sign as much as the value.
      • neighbors or neighbors-4 probably will not be as useful as you want, those will return agent sets, but we want to look at specific values.
      • You may want to look into the shade-of? procedure if you want top try something other than numeric difference.
  • once you have 1 edge detection procedure working, here are things to try:
    • instead of using a single color for edges, use the original color (still set all non-edges to white -or your color of choice-)
    • instead of removing the non-edges, keep them, this creates a cartoon-like effect
    • scale the edge color based on the difference calculation (edges that have a greater difference value are darker)
    • use the shade-of? procedure mentioned above to find edges instead of calculating differences
submit this as edge
Comments