Ask Your Question

HappyForce's profile - activity

2020-07-20 16:30:47 -0600 received badge  Notable Question (source)
2019-03-07 21:02:33 -0600 received badge  Popular Question (source)
2015-12-30 05:35:48 -0600 received badge  Necromancer (source)
2015-12-30 05:05:38 -0600 answered a question Problem with findContours and drawContours

I had the exact same problem. Made me sleep awfully bad... Anyways I solved it now

When you link OpenCV to VS then it is important that it is linked to the right build of OpenCV.

For example:

VS2013 <--> D:\opencv\build\install\x64\vc12

In my case VS2015 <--> D:\opencv\build\install\x64\vc14 (which does not exist and you have to make yourself)

Your case would be VS2012 <--> D:\opencv\build\install\x64\vc11

The guide I followed to install it correctly is: http://inside.mines.edu/~whoff/course...

2015-12-30 05:01:19 -0600 commented question Problem with findContours and drawContours

@sturkmen I have now reinstalled openCV with a different guide and it works now :)

2015-12-29 17:32:20 -0600 commented answer Problem with findContours and drawContours

Yes, VS2015 reinstalling right now following this guide

Sadly there I am stuck since I get an error for example when building ALL_BUILD I get: "unable to start program... ALL_BUILD". access denied (I ran VS with admin rights... so ...)

2015-12-29 16:29:05 -0600 commented answer Line segment detection Near horizontal

@theodore

Exception thrown at 0x00007FFFA339562C (ntdll.dll) in LineDetection.exe: 0xC0000005: Access violation reading location 0x000000000000FF7F. Unhandled exception at 0x00007FFFA339562C (ntdll.dll) in LineDetection.exe: 0xC0000005: Access violation reading location 0x000000000000FF7F.

Seems in findContours a loop goes out of bounds?

EDIT: I am working in VS2015 64 bit I am now following the guide linked below to reinstall OpenCV. guide for VS2015

EDIT2: @theodore I solved it. I linked a build for VS2013 to VS2015 seems that does not go very well. I posted the solution at this ticket

2015-12-29 16:27:18 -0600 received badge  Editor
2015-12-29 16:26:47 -0600 answered a question Problem with findContours and drawContours

@Kien Huynh Same question as @riccardo.via did you find what the problem was?

2015-12-29 10:40:01 -0600 commented answer Line segment detection Near horizontal

@theodore ... Reinstalled my computer... did not back up my code. Sadly the code here gives an exception when I try to find the contours for the horizontal part.

cv::findContours(horizontal, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE, Point(0, 0));

I had it working though :(. Has it something to do because of the x64 setup?

Actually linked ticket is my problem: ticket on opencv

2015-04-15 04:16:56 -0600 received badge  Student (source)
2015-04-14 13:43:41 -0600 commented answer Line segment detection Near horizontal

Theodore, I will ask for the full code now. I have written code and it works mostly but I would like to compare to yours. Especially since I have some places where my code fails. (e.g. too many horizontal rows)

2015-04-10 10:01:12 -0600 received badge  Enthusiast
2015-04-08 12:19:25 -0600 commented answer Line segment detection Near horizontal

I am trying to do it myself with the methods you provided. Am I correct that I should be able to find the lines with this link and the song numbers with this link

Or do I need to combine them for both? ---

EDIT:

Well I'm making progress I got the horizontal and vertical lines with the first method as mentioned and now I see how I can use the second method to draw the lines you have shown in your example !! I like this alot !!!

2015-04-06 09:00:41 -0600 received badge  Supporter (source)
2015-04-06 09:00:38 -0600 received badge  Scholar (source)
2015-04-05 18:11:03 -0600 asked a question Line segment detection Near horizontal

Hi,

I started my search on stackoverflow. As you may read in the given link I have several PDF's which I have now converted to JPG's in a decent format. With following script:

        "C:\Program Files\gs\gs9.15\bin\gswin64c.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r150 -sOutputFile=' ."$without_extension.jpg $_"

With perl for who is wondering.

So I have a bunch of JPG's which are like:

C:\fakepath\Opwekking0001.jpg

C:\fakepath\Opwekking0002.jpg

C:\fakepath\Opwekking0003.jpg

Most important part of these pictures is the thick black vertical and horizontal lines and the thick number which represents the number of the song.

The goal is to get the coordinates of the sections split by horizontal lines (and the pages are all in 2 columns).

I have researched and found that HoughP would be the solution. Correct me if I'm wrong please. So as test I constructed C++ code with OpenCV to recognize the horizontal and the vertical lines since I'll have to split on these. I have drawn an example on stackoverflow.

As extra I would like to detect the thick black number which points to the number of the song. But first things first. Detection of the lines is not going as expected:

Result:

C:\fakepath\LineDetection1.jpg

C:\fakepath\LineDetection2.jpg

C:\fakepath\LineDetection3.jpg

Same order as the originals. As you can see not all horizontal lines are given. And some are not completely till the end or they are broken up in pieces. Example 2 on the other hand is exactly what I want.

The code I have pasted on pastebin since this post is getting quite long.

http://pastebin.com/vxyLW6i3

I hope this is clear enough. I'll provide anything if you need more information. Maybe I'm even taking the wrong angle to getting the sections if you have a better idea please do share.