Ask Your Question

dastaan90's profile - activity

2020-10-10 23:10:39 -0600 received badge  Good Answer (source)
2019-10-29 12:38:35 -0600 received badge  Popular Question (source)
2017-03-19 17:22:36 -0600 received badge  Nice Answer (source)
2015-12-14 01:57:13 -0600 answered a question Errors while building OpenCV 3.0.0 with -D BUILD_TBB flag.

This issue was raised on and solved. (link : http://code.opencv.org/issues/4438)

2015-12-14 00:48:13 -0600 commented question Are there versions 2.XX available on Centos7?

You can always compile an older branch from the source.

2015-07-21 01:32:15 -0600 received badge  Scholar (source)
2015-07-20 07:26:26 -0600 received badge  Self-Learner (source)
2015-07-20 07:26:04 -0600 received badge  Self-Learner (source)
2015-07-20 06:04:09 -0600 answered a question Possibility on defect detection.

I ended up using histogram comparison for thresolded image for my defected pieces. System has to be calibrated earlier for "good" pieces and any defect will result in less histogram values. If it's below a certain thresold, it is declared as a rejected piece.

Angle of camera and piece position are very significant in this use case as certain variation will lead to totally different data.

Hope it helps.

2015-07-20 06:00:12 -0600 answered a question Reliable color detection in difference lightings.

I ended up using DC light source with a kind of diffusion paper with my entire setup covered so that natural light doesn't affect it anymore. It works so reliable with this simple idea. It can help in any light sensitive image processing application.

Hope it helps someone who stumbles across this. :)

2015-07-16 00:44:24 -0600 received badge  Critic (source)
2015-07-15 12:43:25 -0600 commented question error cross compiling for ARM

It might be because it is searching for those libraires in native environment and somehow failing to get it. An ideal way should be to build 3rd party libraries on the go by giving cmake parameter -D BUI:D_<lib>=ON. I'm not sure if it includes zlib. But i have done it with TBB and it helped me. Hope it helps.

2015-07-09 04:15:13 -0600 commented question how to use opencv2 face detection with opencv3

Can you tell us what you're using ? Haar / LBP ?

2015-07-07 02:32:23 -0600 asked a question Reliable color detection in difference lightings.

I am working on a project where I need to detect color of a particular region of the object. While It's very easy to get RGB value from the frame of a particular object. Results fluctuate a lot when lighting changes. Ie, from natural light to artificial ones. I am wondering if there is anything to eliminate minor lighting changes to get a reliable color detection.

Things I have tried so far.

  1. Tried converting RGB to YCrCy and try hist_equalization on Y part.
  2. Converted from BGR to gray, hist_equalizarion and converted back to RGB.

Any suggestions ? Thanks in advance.

2015-07-05 04:10:20 -0600 commented question raspberry camera module with opencv issue

If you're having a linux box, use "ssh -X ..". If using putty, there is a seperate option for X11 forwarding. You will have to enable it from there. Hope it helps.

2015-07-04 11:06:11 -0600 commented question raspberry camera module with opencv issue

How are you invoking ./raspicamtest ? If you're invoking it over ssh connection, you may need to enable X11 forwarding in your ssh connection. You can't invoke a GUI application over simple SSH connection.

2015-07-02 03:17:05 -0600 received badge  Organizer (source)
2015-07-01 23:26:00 -0600 commented question Possibility on defect detection.

@theodore Not necessarily. Sometimes, defects are so minor / major that convexity defects can not be used to measure it. I will try to add some more images just to give you more hints on defect types.

2015-07-01 08:32:13 -0600 asked a question Possibility on defect detection.

Hello, I'm working on a project where I need to find minor defects and report if it is defected.

Here are pictures of good and bad samples. Please note that these images are a result of post thresolding stage. Ie, noice removal and all pre-processing has been done. Gray outline that you see is convexHull curve for the contour (object).

Good sample

image description

Bad sample (defect at top left corner)

image description

Things I've tried till now.

  1. Histogram matching of thresolded images.
  2. Contour area and minAreaRect area comparing.

However, each of this method works on a particular defect but not all.

Any suggestions / tips for better results ?

2015-07-01 07:55:32 -0600 commented question Best Face and eye detection algorithms for opencv

It reminds me of one of my project while I was studying. First let me ask you something. What do you mean by direction ? If you meant iris position, you can detect eye and take iris template at the start of the program and later do template matching in your region of interest and keep track of the iris. Hope it helps.

2015-06-30 05:52:52 -0600 commented question when i try to access a pixel i am getting this error

Can you post your program ? So that ppl can help you in debuggin. To me it looks like, image is not getting stored in img.

2015-06-30 01:29:04 -0600 answered a question install multiple versions of OpenCV on ubuntu

It shouldn't be very difficult. You should have different paths while "cmaking" it. For example, you should specify different install paths using -DCMAKE_INSTALL_PREFIX= flag.

For example,

for opencv 2.4.9,

-DCMAKE_INSTALL_PREFIX=/path/to/opencv2.4.9/

while

for opencv 3.0.0

-DCMAKE_INSTALL_PREFIX=/path/to/opencv3.0.0

Do not confuse this path with source path.

And then real "magic" is in the makefile to compile your own code. Linking path and include paths have to be specified as per the opencv version you want.

For example : You have opencv 2.4.9 installed in /path/to/opencv2.4.9/lib/ and opencv 3.0.0 install in /path/to/opencv3.0.0/lib/ as per mentioned in that link, you will have makefile as per below:

Makefile for opencv 2.4.9

 CPP = g++

# OpenCV 2.4.9
CPPFLAGS = -L/path/to/opencv2.4.9/lib \
       -I/path/to/opencv2.4.9/include

all: test

test: main.cpp
    $(CPP) $(CPPFLAGS) $^ -o $@

and Makefile for opencv 3.0.0

 CPP = g++

# OpenCV 2.4.9
CPPFLAGS = -L/path/to/opencv3.0.0/lib \
       -I/path/to/opencv3.0.0/include

all: test

test: main.cpp
    $(CPP) $(CPPFLAGS) $^ -o $@

You might be confused as in that link, there are two CPPFLAGS defined in the same file.

Hope it clears your doubt.

2015-06-30 00:55:25 -0600 received badge  Enthusiast
2015-06-29 04:27:54 -0600 commented question OpenCV 2.4.11 Failed to Build

Cool. Looks like you didn't have ffmpeg path set.

2015-06-29 03:41:05 -0600 commented question OpenCV 2.4.11 Failed to Build

Can you post your cmake parameters as well ?

2015-06-29 01:39:19 -0600 commented question Does anyone know how to convert a vector into a 1D Mat?

Did you look at this link ?

2015-06-28 13:50:41 -0600 received badge  Teacher (source)
2015-06-27 23:05:11 -0600 answered a question In Python, how can I reduce a list of contours to those of a specified size?

I am not sure if this would work for you but you can make use of contourArea method to get contour area and filter out some small contours on a basis of that. Here is the link.. Example code as below:

threshold_area = 10000     #threshold area 
contours, hierarchy = cv2.findContours(threshold,cv2.RETR_TREE,cv2.CHAIN_APPROX_NONE)   
for cnt in contours:        
    area = cv2.contourArea(cnt)         
    if area > threshold_area:                   
         #Put your code in here

Another elegant solution would be get a minimum area rect and get width and height from rect's 4 coordinates (by calculating distance on your own). But I'm not sure if you're using it to detect regular shaped contours and not.

And as far as I understand, you code should be rearranged as follow for it to work:

contours, hierarchy = cv2.findContours(im,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)
for cnt in contours
    rect = cv2.minAreaRect(cnt)       #I have used min Area rect for better result
    width = rect[1][0]
    height = rect[1][1]
    if (width<widthmax) and (height <heightmax) and (width >= widthMin) and (height > heightMin):
        #put your code here if desired contour is detected

Hope it helps.

2015-06-27 02:17:29 -0600 commented answer unable to build ocv 3.0.0 due to undefined references

@ryanvade Let us know if it worked or not.

2015-06-26 07:11:44 -0600 commented question Hi, m trying to display image(mat) on windows but i am getting black imageicon

Can you tell us what you have tried so far by posting your code ?

2015-06-26 06:55:06 -0600 received badge  Supporter (source)
2015-06-26 03:42:59 -0600 answered a question unable to build ocv 3.0.0 due to undefined references

There could be two possibilities.

  1. You don't have IPP installed and trying to compile opencv with IPP.
  2. You don't have IPP installed properly ie, paths are not properly installed.

Possible solution.

  1. Make sure IPP is installed properly and run basis IPP tests if necessary.
  2. If it's not installed, you can add this flag -D BUILD_IPP=ON to build library with opencv compilation.

Hope it helps.

2015-06-26 03:13:13 -0600 commented question Errors while building OpenCV 3.0.0 with -D BUILD_TBB flag.

@LBerger You're correct, ie you can make use of already installed libraries (like you mentioned with dll) or you can build a 3rd party library from source at the time of building OpenCV as per I understand and BUILD_TBB is for later option, ie, building on the go as you compile OpenCV.

2015-06-26 00:43:40 -0600 answered a question Loading opencv3 Libraries: Not such file or directory

Try executing following to make it permanent.

sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
2015-06-26 00:37:19 -0600 received badge  Editor (source)
2015-06-26 00:37:19 -0600 edited question Errors while building OpenCV 3.0.0 with -D BUILD_TBB flag.

Originally, I wanted to compile opencv 3.0.0 with TBB support on my Raspberry pi. However, libtbb-dev is not available on official raspbian repository. So, I decided to compile OpenCV 3.0.0 from the source to with -D BUILD_TBB=ON -D WITH_TBB=ON cmake flags. It threw me following errors.

[ 56%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_abs.cpp.o [ 58%] Built target opencv_features2d [ 58%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::task_group_context::cancel_group_execution()' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference totbb::interface5::internal::task_base::destroy(tbb::task&)' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::task_scheduler_init::initialize(int)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task::note_affinity(unsigned short)' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::handle_perror(int, char const*)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::internal::allocate_child_proxy::allocate(unsigned int) const' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::NFS_Free(void*)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_group_context::is_group_execution_cancelled() const' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::throw_exception_v4(tbb::internal::exception_id)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_scheduler_init::terminate()' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::task_scheduler_init::initialize(int, unsigned int)' ../../lib/libopencv_core.so.3.0.0: undefined reference totypeinfo for tbb::task' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned int) const' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference totbb::task_group_context::reset()' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::internal::allocate_continuation_proxy::allocate(unsigned int) const' ../../lib/libopencv_core.so.3.0.0: undefined reference tovtable for tbb::task' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_group_context::init()' ../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::NFS_Allocate(unsigned int, unsigned int, void*)' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_scheduler_init::default_num_threads()' ../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::internal::get_initial_auto_partitioner_divisor()' ../../lib/libopencv_core.so.3.0.0: undefined reference totbb::task_group_context::~task_group_context()' ../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned int) const' collect2: error: ld returned 1 exit status

So, I decided to compile OpenCV 2.4.9 with the same cmake flags and it worked fine. To see if it's an Rpi problem or -D BUILD_TBB=ON problem, I decided to compile OpenCV 3.0.0 on my ubuntu 15.04 machine with the same cmake configuration and it threw me the same error. What do I need to do to fix this problem ? Has anyone faced the same problem ? I appreciate the help. Thanks.

Update:

I also tried changing tbb source file (in 3rdparty/tbb/CMakeList ... (more)