opencvsharp icon indicating copy to clipboard operation
opencvsharp copied to clipboard

PNG Images isn't working for osx arm

Open grinay opened this issue 1 year ago • 2 comments

Hey guys. I faces the issue. The current packages for osx 4.7.0 works for osx, however PNG format isn't working properly. When you try to open png file , for example with Cv2.IMRead, the hight and width always 0 values. I'm not sure where the issue is, as I tried to make a cusom build as well and the same issue. Libpng is included into opencv. But what I found when I do install opencv with brew, brew install opencv, and then build opencvsharpextern in linked variant to this installation like cmake -DCMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/opt/homebrew/lib .. , everything is working. But I don't like to use linked variant of library as it's hard to move it to other developers systems. Any Idea what can be wrong there? Trying to build proper static version.

grinay avatar Oct 31 '23 06:10 grinay

When build opencv with this configuration " cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=../../opencv_macos
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.8.1/modules
-D BUILD_SHARED_LIBS=OFF
-D BUILD_JAVA=OFF
-D BUILD_opencv_python2=OFF
-D BUILD_opencv_python3=OFF
-D BUILD_TESTS=OFF
-D BUILD_PERF_TESTS=OFF
-D BUILD_DOCS=OFF
-D BUILD_EXAMPLES=OFF
-D WITH_IPP=OFF
-D WITH_OPENMP=ON
-D WITH_FP16=ON
-D WITH_EIGEN=OFF
-D WITH_OPENEXR=OFF
-D WITH_VTK=ON
-D WITH_FFMPEG=ON
-D WITH_TBB=OFF
-D OPENCV_ENABLE_NONFREE=ON
.." PNG is working correct.

grinay avatar Oct 31 '23 08:10 grinay

@grinay

you might need pass these options to cmake when building OpenCv library.

-DBUILD_PNG=ON 
-DWITH_PNG=ON 

AvenSun avatar Nov 21 '23 00:11 AvenSun