<commit_before><commit_msg>added vizualization of simalarity graph<commit_after>#include "depixelizing.h"

void Depixelizing::showSimilarityGraph() {
	int scale = int(m_scale);
	cv::Mat graph(scale * m_height, scale * m_width, CV_8UC3, cvScalar(0,0,0));

	for (int i = 0; i < m_height; ++i) {
		for (int j = 0; j < m_width; ++j) {
			if (m_connections[i * m_width + j] & NEIGHBOUR_BOTTOM) {
				cv::line(graph, cvPoint( (scale + 1) / 2 + j * scale, (scale + 1) / 2 + i * scale), cvPoint( (scale + 1) / 2 + j * scale, (scale + 1) / 2 + (i + 1) * scale), cvScalar(255,255,255));

			}

			if (m_connections[i * m_width + j] & NEIGHBOUR_BOTTOM_RIGHT) {
				cv::line(graph, cvPoint( (scale + 1) / 2 + j * scale, (scale + 1) / 2 + i * scale), cvPoint((scale + 1) / 2 + (j + 1) * scale, (scale + 1) / 2 + (i + 1) * scale), cvScalar(255,255,255));
				
			}

			if (m_connections[i * m_width + j] & NEIGHBOUR_BOTTOM_LEFT) {	
				cv::line(graph, cvPoint( (scale + 1) / 2 + j * scale, (scale + 1) / 2 + i * scale), cvPoint((scale + 1) / 2 + (j - 1) * scale, (scale + 1) / 2 + (i + 1) * scale), cvScalar(255,255,255));
				
			}

			if (m_connections[i * m_width + j] & NEIGHBOUR_RIGHT) {
				cv::line(graph, cvPoint( (scale + 1) / 2 + j * scale, (scale + 1) / 2 + i * scale), cvPoint((scale + 1) / 2 + (j + 1) * scale, (scale + 1) / 2 + i * scale), cvScalar(255,255,255));
				
			}

			if (m_connections[i * m_width + j] & NEIGHBOUR_LEFT) {
				cv::line(graph, cvPoint( (scale + 1) / 2 + j * scale, (scale + 1) / 2 + i * scale), cvPoint((scale + 1) / 2 + (j - 1) * scale, (scale + 1) / 2 + i * scale), cvScalar(255,255,255));
				
			}

			if (m_connections[i * m_width + j] & NEIGHBOUR_TOP_RIGHT) {
				cv::line(graph, cvPoint( (scale + 1) / 2 + j * scale, (scale + 1) / 2 + i * scale), cvPoint((scale + 1) / 2 + (j + 1) * scale, (scale + 1) / 2 + (i - 1) * scale), cvScalar(255,255,255));
				
			}

			if (m_connections[i * m_width + j] & NEIGHBOUR_TOP) {
				cv::line(graph, cvPoint( (scale + 1) / 2 + j * scale, (scale + 1) / 2 + i * scale), cvPoint((scale + 1) / 2 + j * scale, (scale + 1) / 2 + (i - 1) * scale), cvScalar(255,255,255));
			
			}

			if (m_connections[i * m_width + j] & NEIGHBOUR_TOP_LEFT) {
				cv::line(graph, cvPoint( (scale + 1) / 2 + j * scale, (scale + 1) / 2 + i * scale), cvPoint((scale + 1) / 2 + (j - 1) * scale, (scale + 1) / 2 + (i - 1) * scale), cvScalar(255,255,255));
				
			}

		}
	}

	for (int i = 0; i < m_height; ++i) {
		for (int j = 0; j < m_width; ++j) {
				cv::circle(graph, cv::Point(cvRound((scale + 1) / 2 + j * scale), cvRound((scale + 1) / 2 + i * scale)), 1, cv::Scalar(0, 255, 255), 2);
		}
	}

	cv::imshow("SimilarityGraph", graph);
	cv::waitKey(0);


}
{'fraction_non_alphanumeric': 0.20984455958549222, 'fraction_numerical': 0.06328645447816432, 'mean_word_length': 2.8504273504273505, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2612982', 'n_tokens_mistral': 1367, 'n_tokens_neox': 1112, 'n_words': 302}