Open_cv code sw implementation getting a partial output