It's UWAweek 47

help3001

This forum is provided to promote discussion amongst students enrolled in CITS3001 Advanced Algorithms.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying the 2 articles in this topic
Showing 2 of 202 articles.
Currently 20 other people reading this forum.


 UWA week 40 (2nd semester, week 10) ↓
SVG not supported

Login to reply

👍?
helpful
12:42am Fri 4th Oct, ANONYMOUS

I'm just wondering, since me and a lab facilitator had different views on the meaning of the specifications in flip, on quote: "the flip tool finds the largest 8-connected region of pixels all of the same colour containing the selected pixel, then flips the colour of each pixel in that region" does this mean for inputs like: 5 5 x.x.x .x.x. x.x.x .x.x. x.x.x is the answer 1? assuming that corners are also connecting regions? or is it 4? assuming that each of the dots and x are its own separate components?


SVG not supported

Login to reply

👍?
helpful
11:02am Fri 4th Oct, Andrew G.

ANONYMOUS wrote:

I'm just wondering, since me and a lab facilitator had different views on the meaning of the specifications in flip, on quote:

"the flip tool finds the largest 8-connected region of pixels all of the same colour containing the selected pixel, then flips the colour of each pixel in that region"

does this mean for inputs like:

5 5 x.x.x .x.x. x.x.x .x.x. x.x.x

is the answer 1? assuming that corners are also connecting regions? or is it 4? assuming that each of the dots and x are its own separate components?

As you have identified, the specification says "8-connected region". 8-connected is the standard term for referring to the 8 pixels surrounding a given pixel, and so does include diagonals. See (https://en.wikipedia.org/wiki/Pixel_connectivity#8-connected).

I am going to decline to provide a reference answer to your example, as I believe you have all the information you require to solve this problem.

Cheers, Gozz

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy