kingdavidek
Posts: 25
Joined: Fri May 29, 2015 12:27 pm

GPU YUV info to use in OpenCV

Wed Jul 08, 2015 5:27 pm

Hi,
I am trying to get Y(UV) information from the camera and use it in OpenCV in order to perform quick video processing. I only need Y information as I am trying to detect a laser.
Anyway, I stumbled accross this link http://robotblogging.blogspot.co.uk/201 ... ng-on.html
which seemed exactly suited to my needs. Unfortunately the API he is talking about won't compile properly so instead I downloaded a different API, which i'm pretty sure he refers to anyway. This is the API i DL'd : http://www.uco.es/investiga/grupos/ava/node/40

So this API worked fine when tested, I tried to download the code from the first link and then run a program that was included but it doesn't work. I get this error:

Code: Select all

In file included from mmalincludes.h:9:0,
                 from camera.h:3,
                 from picam.cpp:3:
bcm_host.h:50:45: fatal error: interface/vmcs_host/vc_dispmanx.h: No such file or directory
compilation terminated.
When i look in the directory, the file is definitely there, so I don't know what is going wrong, have i missed a step? Any helps with this would be highly appreciated.
Alternatively, if someone could point me to another way to get YUV info from the GPU in openCV i would bless you many times.
Cheers,
David

kingdavidek
Posts: 25
Joined: Fri May 29, 2015 12:27 pm

Re: GPU YUV info to use in OpenCV

Fri Jul 10, 2015 3:56 pm

Anyone??
:/

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: GPU YUV info to use in OpenCV

Wed Jul 15, 2015 1:37 pm

kingdavidek wrote:Anyone??
:/

I have no idea what you are talking about, if you have been developing software for a while you should know anything I will suggest.

I think you should really write a bit more background to allow people who know nothing to give you something relevant.

[*]First best person to ask for help on a particular software is the author.
[*]Have you tried

Code: Select all

find /opt/ -name vc_dispmanx.h -print
?
[*]Have you checked the Makefile/Imakefile/cmakefile etc for the list of include paths?
[*]Does the software actually need that include file sometimes people just paste boilerplate
[*]etc.......

Think it over, do some tests, spend some time trying to write a concise proper explanation of your problems and the surrounding field, post help request on forums, realize how to fix the problem yourself when the help offered was no use.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20059
Joined: Sat Jul 30, 2011 7:41 pm

Re: GPU YUV info to use in OpenCV

Wed Jul 15, 2015 2:16 pm

You can use raspistillyuv to output YUV data, you could easily modify it to output just the Y plane to stdout.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: GPU YUV info to use in OpenCV

Wed Jul 15, 2015 11:14 pm

jamesh wrote:You can use raspistillyuv to output YUV data, you could easily modify it to output just the Y plane to stdout.
:lol:

Aaah the unix way small sharp tools connected by pipes.....

I think the OP was asking why the raspicam opencv API would not compile?

As the author I would have thought you give better advice on your own program, I have to say raspistill is excellent but I am not sure piping to stdout will give the fastest performance. I think all the fastpath glsl gpu mmal should give huge performance for opencv if people can start coding glsl. I was of the opinion that wrapping the fastpath stuff in a library and allowing dumping glsl processed camera frames to opencv format data types with minimal memory copy would be preferable to pipes?

I am really just a hack so am probably wrong?

http://www.advancedlinuxprogramming.com ... 05-ipc.pdf
http://blog.superpat.com/2010/06/01/zer ... nd-splice/

I have a sort of working library hacked from referencing the raspistill code but I don't really have time to finish it and am probably missing something important as I have not actually benchmarked it or properly tested it.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20059
Joined: Sat Jul 30, 2011 7:41 pm

Re: GPU YUV info to use in OpenCV

Thu Jul 16, 2015 8:28 am

How rude!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: GPU YUV info to use in OpenCV

Sat Jul 18, 2015 12:42 am

jamesh wrote:How rude!
Wow you sound like a paranoid android?

Not sure what you think is rude?

My dear old grand dad god rest his soul used to say "politeness is for women, strangers and enemies"

I like to think everyone on this site is friends so being blunt or even rude should not be a problem. Rudeness is a matter of opinion not sure whos opinion, If you want something you should make a better case than 'How rude!'. I don't want to pick a fight with a site moderator as I know any victory would be pyrrhic, you have always seemed an okay and reasonable guy from what I see on this forum and I assume you just having a bad day. We all can have bad days when we have a thin skin and feel others are being rude, but I can assure you I was not being rude as far as I was aware.

If you want to explain my 'rudeness' I would be more than happy to take an explanation of your opinions into account and offer you reasoned reply.

:roll:

User avatar
ab1jx
Posts: 637
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: GPU YUV info to use in OpenCV

Fri Dec 01, 2017 3:26 am

Old question, I know. vc_dispmanx.h is at /opt/vc/include/interface/vmcs_host/vc_dispmanx.h at least if you've installed the vc userland stuff from https://github.com/raspberrypi/userland

This popped up because an imakefile is mentioned, I'm probably the only one that messes with stuff that old. The only hit I got on here. I'm trying to build the Motif demos dir.

Return to “Graphics programming”

Who is online

Users browsing this forum: No registered users and 2 guests