title: streaking image with opencv
body: <p>So I've been working on some code for a couple weeks and it is far from complete, However the one thing keeping me from moving forward is a strange problem which I cannot figure out. I've been stuck for a few days now</p>
  
  <p>The code below is for a program which accepts to command line arguments, an infile and an outfile. The infile will be a small square binary tif image, somewhere between 200x200 and 400x400. At this point the program should tile the image, stretching each part to various lengths. The outfile should have a height of 768 pixels and a width in the ballpark of 50k to 60k pixels. I apologize, but I can't supply them for example, they are confidential.
  While it does work, sort of, it only replicates images to around 34k pixels and stops. The last row continues to display a black streak to the end.
  I think the problem is coming from my create1track() function. I have tried optimizing it with very few changes. If I use a while loop as opposed to a for loop I get three black streaks as opposed to one. Does anyone have any suggestions on why it might do this?
  It's a pretty simple function. I don't see why it shouldn't work</p>
  
  <p>I'm posting my entire code, hoping for some advice. A copy is stored is stored here:</p>
  
  <p><a href="https://www.dropbox.com/s/sp153rz252uikue/main_backup.cpp" rel="nofollow">https://www.dropbox.com/s/sp153rz252uikue/main_backup.cpp</a></p>
  
  <p>I'd accept any other criticism/input, just be nice, I just started teaching myself c++ about 2 months ago and since I'm pretty new to programming in general, I'm sure there is plenty of things I'm doing wrong.</p>