cv2.imread() gives diffrent results on Mac and Linux
<p><code>cv2.imread(JPG_IMAGE_PATH)</code> gives different arrays on Mac and Linux. </p>

<p>This may be because of the reason described <a href="http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=imread#imread" rel="nofollow">here</a> (see Note).</p>

<p>Is there any solution to get the same arrays on Mac and Linux?</p>

<p>you can build opencv &amp; libjpg from source in both linux &amp; mac. Using cmake you can build opencv with libjpg support (from source code). Hope this will give you same result.</p>

<pre><code>cmake -DWITH_JPEG=ON -DBUILD_JPEG=OFF -DJPEG_INCLUDE_DIR=/path/to/libjepeg-turbo/include/ -DJPEG_LIBRARY=/path/to/libjpeg-turbo/lib/libjpeg.a /path/to/OpenCV
</code></pre>

<p>One of the libjpg source: <a href="https://github.com/libjpeg-turbo/libjpeg-turbo" rel="nofollow">link</a></p>

<p>Currently it is giving different result due to different version of libjpg in these OS.</p>

python opencv