<p>I need to display 2d images in opengl using textures.<br>
The image dimensions are not necessarily powers of 2.<br>
I thought of creating a larger texture and restricting the display to the part I was using but the image data will be shared with openCV so I don't want to copy data a pixel at a time into a larger texture.</p>

<p>EDIT - it turns out that even the simplest Intel on board graphics under Windows supports none-power-of-2 textures.</p>

<p>EDIT2 - and even if you don't have arb texture size, then making your image smaller and rescaling to the window size it is very fast even on low end hardware</p>

First of all, most modern videocards actually support texture dimensions that are both non-square and non-power-of-two sized. But for maximum compatibility, using only power of two textures is probably recommended.
Start off by determining the closest power of two that is larger for each of the image dimensions (width and height) and creating a texture of that size.
Then you have two options. The first one is to do a software resize of the pixel data to fit the image, and then size your quad according to the original aspect ration when you need to display it. Or, you can just fill part of the texture with your image data and put transparent pixels in the rest.