Question: C++ vectors: count holes function needed. readImage: Creates a two dimensional vector (a matrix) of 1's and 0's based off of the input files which
C++ vectors:
count holes function needed.
readImage: Creates a two dimensional vector (a matrix) of 1's and 0's based off of the input files which you send it.
printImage: Takes the matrix which was created in readImage and prints it out.
countHoles: You must come up with a way to iterate through the matrix which you have been dealing with in the past two functions and identify where, and what type, of holes are in the data. Internal holes (i) are made up of three 0's and one 1; External holes (e) are made up of three 1's and one 0. All other combinations are meaningless and should not be taken into account. Then, with the number of external and internal holes that you determined, use the formula provided ((#e - #i) / 4) to determine how many holes are in the matrix as a whole.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
