Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example 2 in "Image Processing and Computer Vision" - Code does not build in Xcode #238

Open
alexanderogle opened this issue Oct 25, 2016 · 7 comments

Comments

@alexanderogle
Copy link

After copying the code for example 2 from "Image Processing and Computer Vision" (Preliminaries to Image Processing) into Xcode and attempting to build the application, the build fails due to the following error:

In ofApp.cpp of example 2:
[line 30] unsigned char* pixelData = myVideoGrabber.getPixels();
Introduces the error:
“No viable conversion from ‘ofPixels’ (aka ‘ofPixels_’) to ‘unsigned char *’ "

screen shot 2016-10-25 at 11 27 45 am

@roymacdonald
Copy link
Member

hi @alexanderogle ,
that line should be
unsigned char* pixelData = myVideoGrabber.getPixels().getData();
can you please test it in order to make the fix? Please inform if any other issue.
best!

@alexanderogle
Copy link
Author

Hey @roymacdonald,

That was definitely the fix. I was able to build and run the program after that.

Nice work!

@ofZach
Copy link
Contributor

ofZach commented Oct 26, 2016

cc @golanlevin -- it's a small fix for getPixels (which now returns ofPixels() vs before when it returned a pointer to the data)... maybe you can take a look at your chapter and see if there are any updates you need to make to the code accordingly ?

@esnho
Copy link

esnho commented Jul 28, 2019

Hi, the issue with getPixels is still there, unfortunately it's a bit confusing because is hard to find a fix on google.

@alexanderogle I guess you should open back this issue.

@ofZach
Copy link
Contributor

ofZach commented Jul 28, 2019

I've re-opened the issue, I think it's not just as simple as adding getPixels().getData() everywhere but maybe also re-writing the chapter about low level vs high level access to explain the ofPixels object.

@ofZach ofZach reopened this Jul 28, 2019
@golanlevin
Copy link
Contributor

golanlevin commented Jul 28, 2019 via email

@roymacdonald
Copy link
Member

roymacdonald commented Jul 29, 2019

Hi there,
I wrote this some time ago as some sort of extension to Golan's ofBook chapter. I'd be glad if this is used as well as helping to improve this chapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants