Ask Your Question

ChaoyuanYeh's profile - activity

2019-10-28 08:44:14 -0600 received badge  Famous Question (source)
2019-08-20 03:17:54 -0600 received badge  Notable Question (source)
2018-11-28 09:53:13 -0600 received badge  Nice Question (source)
2018-11-28 09:53:02 -0600 received badge  Nice Answer (source)
2018-05-22 02:43:49 -0600 received badge  Popular Question (source)
2018-04-13 06:55:17 -0600 received badge  Teacher (source)
2017-10-20 08:21:23 -0600 received badge  Notable Question (source)
2017-08-02 06:55:42 -0600 received badge  Nice Question (source)
2017-06-27 05:12:44 -0600 received badge  Popular Question (source)
2017-04-28 05:14:32 -0600 received badge  Famous Question (source)
2016-09-28 03:43:12 -0600 received badge  Notable Question (source)
2016-04-15 00:33:28 -0600 received badge  Popular Question (source)
2015-09-24 21:13:32 -0600 asked a question Whats' the best way to speed up filtering a very large image by multi-processing?

I'd like to perform Guassian filtering on a very large image (80,000 x 60,000) in memory using multiple cores. After some reading, I concluded that there are two possible route: 1) Using multiprocessing module and split the filtering task to multiple worker. 2) Since NumPy supports openMP, use the multiprocessing function provided by NumPy.

  1. Which way is better?

If option 2 is better, then

  1. Should I build NumPy with openMP or should I build OpenCV with OpenMP or both?
  2. How do I actually use it in a python script?
2015-09-08 18:05:23 -0600 asked a question Is there function in OpenCV similar to ind2rgb in MATLAB ?

I have a 16-bit indexed image that I'd like to convert to color image using my own lookup table. In MATLAB, this can be done with

color_img = ind2rgb(ind_img, colormap)

I'm wondering if there is any OpenCV function that does the same thing? I've only found cvtColor, which I don't think gives user any control over the colormap it's using.

2015-08-30 01:04:16 -0600 received badge  Self-Learner (source)
2015-08-29 22:01:38 -0600 answered a question Failure to import cv2 in python : DLL load failed.

As it turned out, it's a rather silly mistake. Because I was still thinking it could be due to bad path variable setup, I tried using PATH editor to look at it. Somehow, it marks the path to OpenCV binaries as missing folder while printing the content corretly. I clicked Edit, did nothing and clicked Save and the problem was solved. Lesson learned here: use a better tool to edit path variable.

2015-08-28 14:50:15 -0600 commented question Failure to import cv2 in python : DLL load failed.

Thanks! That's a very good suggestion !

2015-08-27 21:46:31 -0600 asked a question Failure to import cv2 in python : DLL load failed.

Two weeks ago, I built openCV-3.0.0, using Visual Studio 2013 x64 on Windows 7, with Python 3.4.3. I've copied cv2.pyd into the Python34\Lib\site-packages folder. It was working.

Today, when I typed import cv2, I was given this error message: ImportError: DLL load failed: The specified module could not be found.

I couldn't remember everything I did to my computer in the past two weeks, but I did remember I installed openSSH for windows. When I checked my path variable, surprisingly, there is only one entry left for this software. Apparently this software erase previously existing path variable entries. While I suspect this could be the cause of the problem, I couldn't solve it. I added the path to opencv binaries, and Windows\System32, Windows\SysWow64 back but they didn't help.

When I use dependency walker, I saw the same list of missing dlls as reported [here]. (, which, according to the original poster, was misleading.

Then I'm wondering : 1) Is it indeed the path variable that gave me problem? If so, how can I restore it? 2) Could it be something other than path variable? How then can I troubleshoot?

2015-08-27 20:38:11 -0600 received badge  Enthusiast
2015-08-19 04:09:52 -0600 asked a question Do I have to worry about borders when I resize a large image in blocks?


If I first divide an image into 4 (2x2) blocks, resize them by 50% in each dimension separately and put them back together, will the image be different from an image directed resized from the original. I mean will I have to worry that borders between blocks will have some artifacts because they now lose neighbors during calculation?

2015-08-15 16:05:41 -0600 commented answer How to build OpenCV 3.0.0 with libjpeg turbo?

Thank you. I actually used turbojpeg-static.lib and I can build openCV successfully. Now I'm wondering, between jpeg-static.lib and turbojpeg-static.lib, which one should I use?

2015-08-15 12:10:27 -0600 received badge  Editor (source)
2015-08-15 11:59:24 -0600 received badge  Organizer (source)
2015-08-15 11:58:49 -0600 asked a question How to build OpenCV 3.0.0 with libjpeg turbo?


I'm trying to build OpenCV 3.0.0 with libjpeg turbo 1.4.1. The only relevant information I can find is a post from Stack Overflow :

I try to follow this and did the following in cmake-gui: 1) uncheck : BUILD_JPEG, 2) add entry(PATH) : JPEG_INCLUDE_DIR=C:/libjepeg-turbo64/include/, 3) add entry(STRING) : JPEG_LIBRARY=C:/libjpeg-turbo64/lib/libjpeg.a C:/OpenCV-3.0.0

When I hit generate in cmakge-gui, the log reads : "Found JPEG: C:/libjpeg-turbo64/lib/libjpeg.a C:/opencv-3.0.0_turbo" But when I build the solution in openCV, a great majority of the projects failed, showing fatal link error.

I have two questions here: 1) What does "JPEG_LIBRARY=C:/libjpeg-turbo64/lib/libjpeg.a C:/OpenCV-3.0.0" really mean? I just copy the line and make some changes that I understand but it doesn't quite make sense to me. I can't find any file named libjpeg in the lib folder, but there is a jpeg.lib.

2) What should I do if I want to build OpenCV 3.0.0 with libjpeg-turbo?


2015-08-14 12:31:19 -0600 received badge  Supporter (source)
2015-08-14 11:56:47 -0600 commented answer How to resize an extremely large image

After I commented out the line and rebuilt openCV, it did solve my problem. and Yes, I have followed LBerger's suggestion and reported a ticket.

2015-08-14 03:48:20 -0600 commented answer How to resize an extremely large image

That sounds like a solution to me. I know exactly what I need to resize so I think I can probably just comment this out. I'll see if this will work. Thanks !

2015-08-14 03:45:42 -0600 received badge  Scholar (source)
2015-08-14 02:04:51 -0600 received badge  Student (source)
2015-08-13 16:42:30 -0600 asked a question How to resize an extremely large image

Hi, I'm using Python 3.4.3 and OpenCV 3.0.0. While I'm trying to resize a very large RGB image (107162,79553,3) using the following code:

import cv2
image = cv2.resize(image, None, fx=0.5, fy=0.5, interpolation=cv2.INTER_AREA)

I got the error message "cv2.error: C:\opencv-3.0.0\source\modules\imgproc\src\imgwarp.cpp:3208: error: (-215) ssize.area() > 0 in function cv::resize" I did some further testing and realized this is an integer overflow problem because the code would work on image of the size (46340,46340,3) but not (46341,46341,3).I understand I can perform bloc processing but I'm still interested in knowing if there is a direct solution to this problem.

My naive thought is that if I can identify where exactly this int that gave me the trouble is, I can then go in and change it to int64. So my questions are : 1) Is this approach plausible? 2) If so, exactly what should I change to solve this? If not, how can I solve this problem?