CSE 8A Chapter Notes - Chapter 6.2-6.3: Edge Detection

37 views2 pages

Document Summary

Edge detection makes the whole picture look like a pencil sketch. High contrast difference between two colors: calculate by averaging rgb values in top pixel - average rgb values in the bottom pixel. If the absolute value of the difference is greater than some amount, make top pixel black; if less, make top pixel white operator negates conditions if (!false) { The code block above will run because the expression is true (putting ! before anything reverses the condition) Use if-else statements to run a particular code block if one condition is met, and another if another condition is met int x = 50; if (x < 20) { System. out. println(cid:894)(cid:862)x is g(cid:396)eate(cid:396) tha(cid:374) o(cid:396) e(cid:395)ual to 20(cid:863)(cid:895); I(cid:374) the (cid:272)ode a(cid:271)o(cid:448)e, the se(cid:272)o(cid:374)d (cid:271)lo(cid:272)k gets ru(cid:374) si(cid:374)(cid:272)e the first o(cid:374)e"s (cid:272)o(cid:374)ditio(cid:374) is false. We want to compare the current pixel with the pixel below it.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents