Ask Your Question

adamsss's profile - activity

2018-03-09 01:11:49 -0600 received badge  Notable Question (source)
2017-06-28 01:28:32 -0600 received badge  Popular Question (source)
2016-04-09 06:17:38 -0600 asked a question Alternative library for image_slicer

I'm working with large tiff images (~~16k x 16k). I used slicing image for 9 tiles in my algorithm (library: image_slicer) before image processing.

I'm looking for some faster alternative method of slicing image for tiles. This one is so slow - when i open 4-5 images in once time, algorith slicing images for few minutes.

I tried to use img=img[x:y , x:y], but this method crashed my python application.

2016-03-30 02:56:00 -0600 asked a question OpenCV Error: Insufficient memory when i use template matching

I'm working in my programme with "huge" tiffs (8411x8361,60Mb). When i tried use template matching function on the unprocessed image, console showed me this kind of error:

OpenCV Error: Insufficient memory (Failed to allocate 140682288 bytes) in cv::OutOfMemoryError, file ......\sources\modules\core\src\alloc.cpp, line 52 OpenCV Error: Assertion failed (u != 0) in cv::Mat::create, file ......\sources\modules\core\src\matrix.cpp, line 424

I understand meaning of this error (I hope so), so i sliced my image for 4 tiles and use cutted part of my TIFF in template matching algorithm. Console showed me the same error message - of course with lower number of "failed to allocate X bytes".

Moreover, template matching is only one part of my programme. In previous steps it wasn't any problems with open,use and edit unprocessed huge TIFFs.

2016-03-22 01:35:27 -0600 commented question Template matching python error

Any ideas?

2016-03-17 16:43:19 -0600 received badge  Student (source)
2016-03-13 04:56:06 -0600 commented question Template matching python error

It was loaded correctly. I can show it in grayscale and colour.

2016-03-12 10:57:55 -0600 commented question Template matching python error

Additionally, this code works fine with "test.jpg", but doesn't work with TIF file

2016-03-12 10:30:14 -0600 commented question Template matching python error

My code, now:

image_dir='7_7026_polowa.tif'   
image = cv2.imread(image_dir)
..........
img_gray = cv2.imread(image_dir, 0)
template = cv2.imread('template.tif', 0)
w, h = template.shape[::-1]

res = cv2.matchTemplate(img_gray,template,cv2.TM_CCOEFF_NORMED)
threshold = 0.8
loc = np.where( res >= threshold)
for pt in zip(*loc[::-1]):
      cv2.rectangle(image, pt, (pt[0] + w, pt[1] + h), (0,0,255), 2)

 cv2.imwrite('res.png',image)
2016-03-12 10:28:48 -0600 commented question Template matching python error

Ok, i corrected it, but now another error:

res = cv2.matchTemplate(img_gray,template,cv2.TM_CCOEFF_NORMED)
cv2.error: ..\..\..\sources\modules\core\src\matrix.cpp:424: error: (-215) u != 0 in function     cv::Mat::create
2016-03-12 04:52:11 -0600 asked a question Template matching python error

Hello, I would like to use this code in my programme:

img_rgb = image
img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
template = roi
w, h = template.shape[::-1]

res = cv2.matchTemplate(img_gray,template,cv2.TM_CCOEFF_NORMED)
threshold = 0.8
loc = np.where( res >= threshold)
for pt in zip(*loc[::-1]):
     cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0,0,255), 2)

cv2.imwrite('res.png',img_rgb)

image and roi are the images (tiff format) readed in earlier part of my code

Now, i got error:

w, h = template.shape[::-1] ValueError: too many values to unpack (expected 2)

Where is the problem?!

2016-03-04 08:00:38 -0600 received badge  Enthusiast
2016-02-29 13:02:42 -0600 asked a question Angle and Scale Invariant template matching code for python

Hello,

I found angle and scale invariant template matching code, but not for python language... Have anybody got it?

I will be very grateful !

2016-02-22 17:46:32 -0600 commented question DLL load failed with opencv 3.1 and python 3.5

Ok, i try again and it works now correctly. Thanks for all advices!

2016-02-22 16:35:08 -0600 commented question DLL load failed with opencv 3.1 and python 3.5

I see, that cv2.pyd file is not created in both places: in opencv folder and in python's libraries folder ...

2016-02-22 16:18:57 -0600 commented question DLL load failed with opencv 3.1 and python 3.5

I tried all process again and now it was built successfull ... but when i try import cv2 in IDLE still error msg:

 import cv2

Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> import cv2 ImportError: No module named 'cv2'

2016-02-22 08:34:53 -0600 commented question DLL load failed with opencv 3.1 and python 3.5

BTW... results from RELEASE mode: ========== Build: 2 succeeded, 1 failed, 53 up-to-date, 0 skipped ==========

and still doesn't work

2016-02-22 08:33:38 -0600 commented question DLL load failed with opencv 3.1 and python 3.5

both in RELEASE mode?

2016-02-22 08:25:20 -0600 commented question DLL load failed with opencv 3.1 and python 3.5

Now, i'm trying build in DEBUG mode (BUILD_SHARED_LIBS set off) ...

Result: ========== Build: 55 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

and result of build the INSTALL:

========== Build: 55 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

but still doesn't work...

2016-02-22 07:19:02 -0600 received badge  Editor (source)
2016-02-22 06:07:12 -0600 commented question DLL load failed with opencv 3.1 and python 3.5

Link to raport from cmake: link text

2016-02-22 05:57:04 -0600 commented question DLL load failed with opencv 3.1 and python 3.5

========== Build: 3 succeeded, 1 failed, 53 up-to-date, 0 skipped ========== and python 3.5 folder is still empty :(

2016-02-22 05:33:28 -0600 commented question DLL load failed with opencv 3.1 and python 3.5

I built it from src... like this: link text

but it still doens't import cv2 (the same error) !

2016-02-22 02:41:27 -0600 asked a question DLL load failed with opencv 3.1 and python 3.5

Hello,

I installed library OpenCV 3.1 successfully - i used whl file, but i can't import cv2 anyway in my script. I saw this topic: link text ,but installing Microsoft Visual C++ 2015 Redistributable still didn't solve my problem:

ImportError: DLL load failed: The specified module could not be found

When i used pip list module opencv-python is successful installed.

Any suggestions?

PS. I tried different versions of whl files, but it still doesn't help.

CMake output:

Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "2.7" (found C:/Python27/ArcGIS10.2/python.exe)
Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "2.6" (found )
Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
Could NOT find Matlab (missing:  MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) 
VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
Caffe:   NO
Protobuf:   NO
Glog:   NO
Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
Tesseract:   NO
Could NOT find PROTOBUF (missing:  PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR) 
Build libprotobuf from sources:
    libprotobuf not found into system
    The protocol buffer compiler not found
Tesseract:   NO

General configuration for OpenCV 3.1.0 =====================================
  Version control:               unknown

  Platform:
    Host:                        Windows 6.1 AMD64
    CMake:                       2.8.11.2
    CMake generator:             Visual Studio 10
    CMake build tool:            C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe
    MSVC:                        1600

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe  (ver 16.0.40219.1)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /wd4251 /wd4324 /wd4275 /wd4589 /MP4  /MD /O2 /Ob2 /D NDEBUG  /Zi
    C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /wd4251 /wd4324 /wd4275 /wd4589 /MP4  /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe
    C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast    /MP4  /MD /O2 /Ob2 /D NDEBUG  /Zi
    C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast    /MP4  /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    Linker flags (Release):      /machine:X86   /INCREMENTAL:NO  /debug
    Linker flags (Debug):        /machine:X86   /debug /INCREMENTAL 
    Precompiled headers:         YES
    Extra dependencies:
    3rdparty dependencies:

  OpenCV modules:
    To be built:                 core flann imgproc ml photo reg surface_matching video dnn fuzzy imgcodecs shape videoio highgui objdetect plot superres ts xobjdetect xphoto bgsegm bioinspired dpm face features2d line_descriptor saliency text calib3d ccalib datasets rgbd stereo structured_light tracking videostab xfeatures2d ximgproc aruco optflow stitching python3
    Disabled:                    world contrib_world
    Disabled by dependency:      -
    Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 viz ...
(more)
2016-02-22 01:53:15 -0600 commented question opencv-python 3.0 with python 3.5 on windows

I have the same problem with "ImportError: DLL load failed: The specified module could not be found" with OpenCV 3.1 and Python 3.5 ... but installed Microsoft Visual C++ 2015 Redistributable still didn't solve my problem. Why? Any suggestions?