[Ssc-dev] It works!
Andrew Senior
aws at andrewsenior.com
Sat Jun 11 23:49:22 EDT 2011
Thanks.
I was able to follow those instructions, despite my tenuous handle on
things-Androidy.
As you said... It worked!
However, when I tried my latest code it gave me a segmentation fault.
I'll have a look when I get a chance.
I'll have to do some Android logging from my code, and also work out how to
pass the filename/URI into the C++ code.
Andrew
On Fri, Jun 10, 2011 at 11:29 PM, Shawn Van Every <
vanevery at walking-productions.com> wrote:
> Hi Andrew,
>
> I unfortunately haven't gotten a chance to get further than doing that
> initial build and test with your code. I put the code from the test in the
> project and included it in the obscurav1 version as we still intend to
> continue with it.
>
> To build the native code, you have to run the ndk-build script from the
> android NDK download in the project directory. It builds the native code
> which is in the JNI directory and uses the Android.mk and Application.mk
> scripts which are standard for the Android NDK.
>
> The org_witness_securesmartcam_jpegredaction_JpegRedaction.cpp and .h file
> contains the native implementation of the method in the JpegRedaction.java
> file.
>
> The (non-existant) hook would be in the ImageEditor.java in the saveImage
> method. It could instantiate JpegRedaction and call the redactit method.
>
> If you are up to taking a stab at incorporating it, let me know. We can
> create a branch of the release version and go from there.
>
> Sorry for being slow with progress on this portion.
>
> -s
>
>
> On Jun 10, 2011, at 10:54 PM, Andrew Senior wrote:
>
> > Shawn,
> >
> > Can you give me a pointer as to how I could test JpegRedactionLibrary
> with obscura - I see the
> > org.witness.securesmartcam.jpegredaction;
> > item in the java, and my code, plus your wrapper under the jni directory.
> > In the v1.0.1 there isn't any UI hook to call my code, I presume.
> > How should I build the C++ code- when I clean the .o files don't
> disappear, so I presume I have to build it separately ?
> >
> > Andrew
> >
> > On Thu, Apr 21, 2011 at 1:40 PM, Shawn Van Every <
> vanevery at walking-productions.com> wrote:
> > Great! I'll checkout the latest version and give these examples a shot.
> I'll export the eclipse project and send it over so you can see how it is
> organized as well.
> >
> > Talk soon
> > -- mobile shawn
> >
> >
> > Andrew Senior <aws at andrewsenior.com> wrote:
> > Also, I didn't point out that the latest version will return a set of
> "strips" in the redaction object. Those can be saved and used later for
> reversing the redaction. You can save them externally (e.g. in the
> database), or I can store them in the JPEG file somehow- either way they
> need to be encrypted. If they're being stored in the JPEG then I'll need a
> later call to pass in the encrypted info, or perhaps even better a callback
> [that I can call while redacting] so that I can write out the JPEG in one
> go.
> >
> > Later if you pass back the same data (after decryption) I should be able
> to reverse the redaction, but haven't yet got this bit working.
> >
> > Andrew
> >
> > PS Perhaps these code snippets will make it clearer what I'm trying to
> say.
> >
> > // Usage case 1: The encrypted redaction data is stored in the JPEG image
> somehow. Encryption is done with
> > // a callback
> > jpeg_redaction::Jpeg j2("/sdcard/windows.jpg", true);
> > jpeg_redaction::Redaction::Rect rect(50, 600, 50, 600);
> > jpeg_redaction::Redaction redaction;
> > redaction.AddRegion(rect);
> > EncryptionCallback the_encryption_callback(key)
> > j2.ParseImage(redaction, the_encryption_callback);
> > j2.Save("/sdcard/testoutput_with_redaction_data.jpg");
> > ....
> > // Now restore the image
> > jpeg_redaction::Jpeg
> j2("/sdcard/testoutput_with_redaction_data.jpg", true);
> > DecryptionCallback the_decryption_callback(key)
> > j2.ReverseRedaction(the_decryption_callback);
> > j2.Save("/sdcard/unredacted.jpg");
> >
> > // Usage case 2: data is stored in the database.
> > jpeg_redaction::Jpeg j2("/sdcard/windows.jpg", true);
> > jpeg_redaction::Redaction::Rect rect(50, 600, 50, 600);
> > jpeg_redaction::Redaction redaction;
> > redaction.AddRegion(rect);
> > j2.ParseImage(redaction);
> > j2.Save("/sdcard/testoutput.jpg");
> >
> database.SaveRedactionDataAfterEncryption(the_database_key, redaction)
> >
> > // Now restore the image
> > jpeg_redaction::Jpeg j2("/sdcard/testoutput.jpg", true);
> > jpeg_redaction::Redaction redaction;
> > database.RetrieveRedactionDataAndDecrypt(the_database_key,
> redaction)
> > j2.ReverseRedaction(redaction);
> > j2.Save("/sdcard/unredacted.jpg");
> >
> > On Wed, Apr 20, 2011 at 5:19 PM, Andrew Senior <aws at andrewsenior.com>
> wrote:
> > Hey, that's great. That looks like a sensible sequence.
> >
> > The "rawgrey.pgm" is really a debugging thing- it returns the image that
> I get by decoding the intensity DC coefficients of each block, so ignoring
> colour, and giving an 8x8 downsampling.
> > You should be able to supply NULL to that parameter and it will be
> ignored.
> > However, since you're using "ParseImage", you're not using the latest
> version of the repository (now DecodeImage IIRC), so perhaps I didn't fix
> that check-for-null.
> > In practice it doesn't make sense to have this debugging parameter in
> there, so I'll get rid of it.
> > Let me know what things needed shifting around, and we can work out what
> the best way is, especially as I've checked in some changes since. Let me
> know your github ID and you can have write access.
> > Andrew
> >
> >
> > On Wed, Apr 20, 2011 at 12:56 PM, Shawn Van Every <
> vanevery at walking-productions.com> wrote:
> > Andrew,
> >
> > I was able to get a simple example using your library working on Android!
> >
> > Here is what I am running:
> >
> > jpeg_redaction::Jpeg j2("/sdcard/windows.jpg", true);
> > jpeg_redaction::Redaction::Rect rect(50, 600, 50, 600);
> > jpeg_redaction::Redaction redaction;
> > redaction.AddRegion(rect);
> > j2.ParseImage(redaction, "/sdcard/rawgrey.pgm");
> > j2.Save("/sdcard/testoutput.jpg");
> >
> > Does this make sense?
> >
> > Specifically, I am wondering what the rawgrey.pgm file is for in the
> ParseImage function.
> >
> > I had to do a bit a of moving things around to get it all to compile
> correctly for use on Android with the NDK so I am wondering if I should
> create another repo somewhere to house this or if we can check it in to your
> github repo?
> >
> > -s
> >
> >
> >
>
> Shawn Van Every
> vanevery at walking-productions.com
> Mobile and Streaming Consulting
> http://www.walking-productions.com/notslop
> Author: Pro Android Media: http://amzn.to/eYb48C
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mayfirst.org/pipermail/ssc-dev/attachments/20110611/3e1a571a/attachment-0001.htm>
More information about the Ssc-dev
mailing list