Ask Your Question

jeanpat's profile - activity

2016-02-13 07:40:38 -0600 received badge  Supporter (source)
2016-02-10 13:42:31 -0600 commented answer Estimate white background

A top hat with a 15x15 structuring element succeeds in extracting the characters (see the link)

2016-02-10 13:37:59 -0600 received badge  Editor (source)
2016-02-10 10:38:46 -0600 commented answer Estimate white background

From your image:

board = mh.imread('/home/jeanpat/Images/paperboard.jpg',-1)
cut = board[40:,10:1000]
cut = cut.max()-cut
print cut.shape, cut.max()
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(15,15))
cut_f = cv2.morphologyEx(cut,cv2.MORPH_TOPHAT, kernel)

(mh is a shortcut for mahotas, but it should possible to load the image with cv2 itself) link text

2016-02-10 10:06:39 -0600 answered a question Estimate white background

What about a top-hat filtering? From an ipython console:

kernel18 = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(18,18))
filtered = cv2.morphologyEx(image, cv2.MORPH_TOPHAT, kernel18)

The image may has to be converted into a greyscaled image.

It's possible to get something like this image with a smaller kernel (clik on the link)

http://postimg.org/image/k7n2fjrfd/

2016-02-10 07:05:55 -0600 asked a question import cv2 fails (opencv 3.1 build from source,linux)

Hello,

I build opencv 3.1 from source on manjaro linux.

I used cmake-gui then make and sudo make install without visible problems.

I can find cv2:

$ pwd
/usr/local/lib/python2.7/site-packages
[jeanpat@dip4fish site-packages]$ ls
cv2.so

But python (2 or 3) is unable to import the cv2 module:

$ python2
Python 2.7.11 (default, Dec  6 2015, 15:43:46) 
[GCC 5.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named cv2

Thank you for your advices to fix that issue.

2014-11-06 11:59:47 -0600 asked a question Building opencv 3 alpha under Ubuntu 14.04 with CUDA failed

Hello As I try to build opencv 3 alpha with cuda support, I have the following message

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: CUDA_nvcuvid_LIBRARY (ADVANCED) linked by target "opencv_cudacodec" in directory /home/jeanpat/App/opencv-3.0.0-alpha/modules/cudacodec

Cuda 5.5 from repo is installed:

 * libcuda1-331

 *nvidia-cuda-dev  

 *nvidia-cuda-toolkit

Is it necessary to install the latest cuda-6.5.14_linux_64.run ?

2013-03-13 15:15:31 -0600 received badge  Scholar (source)
2013-03-13 07:10:05 -0600 commented question Regional maxima from python

There a definition in Castleman, K : http://bit.ly/13VyHL7

If you think of an image as a landscape, regional maxima yields the local tops. This not the max value of the image. I have browsing again the documentation but that morphological operator doesn't seem to be implemented.

2013-03-13 05:26:37 -0600 asked a question Regional maxima from python

Hello, Is it possible to compute the regional maxima of a grey scaled image (8bits or more) ?

thank you

jp

(opencv 244 build from source, python 2.7)