Difference between revisions of "KIAS primer"

From Cinemachines
Line 1: Line 1:
 
== Basic Image Processing ==
 
== Basic Image Processing ==
 
=== Displaying an Image ===
 
=== Displaying an Image ===
<nowiki>for( int y = 0; y < h; y++ ) {
+
<nowiki><pre>for( int y = 0; y < h; y++ ) {
 
for( int x = 0; x < w; x++ ) {
 
for( int x = 0; x < w; x++ ) {
 
dist.at<Vec3b>(y,x)[0] = sources[1].at<Vec3b>(y,x)[0];
 
dist.at<Vec3b>(y,x)[0] = sources[1].at<Vec3b>(y,x)[0];
Line 7: Line 7:
 
dist.at<Vec3b>(y,x)[2] = sources[1].at<Vec3b>(y,x)[2];
 
dist.at<Vec3b>(y,x)[2] = sources[1].at<Vec3b>(y,x)[2];
 
}
 
}
}</nowiki>
+
}</pre></nowiki>
  
 
where h = screen height, w = screen width and sources[1] = input
 
where h = screen height, w = screen width and sources[1] = input

Revision as of 11:08, 27 October 2019

Basic Image Processing

Displaying an Image

<pre>for( int y = 0; y < h; y++ ) { for( int x = 0; x < w; x++ ) { dist.at<Vec3b>(y,x)[0] = sources[1].at<Vec3b>(y,x)[0]; dist.at<Vec3b>(y,x)[1] = sources[1].at<Vec3b>(y,x)[1]; dist.at<Vec3b>(y,x)[2] = sources[1].at<Vec3b>(y,x)[2]; } }</pre>

where h = screen height, w = screen width and sources[1] = input