ofBook icon indicating copy to clipboard operation
ofBook copied to clipboard

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

Open alexanderogle opened this issue 9 years ago • 7 comments

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

alexanderogle avatar Oct 25 '16 18:10 alexanderogle

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!

roymacdonald avatar Oct 26 '16 02:10 roymacdonald

Hey @roymacdonald,

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

Nice work!

alexanderogle avatar Oct 26 '16 04:10 alexanderogle

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 ?

ofZach avatar Oct 26 '16 05:10 ofZach

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.

esnho avatar Jul 28 '19 18:07 esnho

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 avatar Jul 28 '19 20:07 ofZach

I somehow missed this issue in 2016. I'd be happy to give it some attention later this week. g

On Sun, Jul 28, 2019 at 4:16 PM ofZach [email protected] wrote:

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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openframeworks/ofBook/issues/238?email_source=notifications&email_token=AACG2BPSMKPVMNZTUJII5M3QBX5AVA5CNFSM4CUBKW62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD27FXKA#issuecomment-515791784, or mute the thread https://github.com/notifications/unsubscribe-auth/AACG2BN3VSSNEZMYRLJPBF3QBX5AVANCNFSM4CUBKW6Q .

golanlevin avatar Jul 28 '19 20:07 golanlevin

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.

roymacdonald avatar Jul 29 '19 00:07 roymacdonald