04-16-2012 12:54 PM
Hello,
Any one have a Emboss Algorithem if possible then given me idea or code .
Thanks.
Solved! Go to Solution.
04-16-2012 07:14 PM - edited 04-16-2012 07:14 PM
I note that you have looked at the code given here:
http://supportforums.blackberry.com/t5/Java-Develo
I have had a chance to look at this code now.
The code in the Thread appears to be an implementation of the source from the following link (and uses the "Convolution Matrix"). :
http://xjaphx.wordpress.com/2011/06/22/image-proce
Unfortunately, the implementation is not correct, in fact it is wrong in a number of places. But despite a suggestion to debug the code,
(http://supportforums.blackberry.com/t5/Java-Develo
the OP appeared to have no intention of looking hard at the code himself, but asked a number of similar questions on and off the forum:
http://stackoverflow.com/questions/10023303/apply-
In fact, I think the code supplied in the link can be used - I have managed to implement this code and it seems to be working. When compared with the supplied implementation, the changes I made to get the code working were not tricky, if you spent the time understanding what the code was doing and how get/setargb work, I suspect you could fix it too.
To demonstrate I got it working, here is the link showing a number of image manipulations, including emboss:
http://xjaphx.wordpress.com/2011/06/22/
and attached is screen shot from a BlackBerry 9800 Simulator showing emboss:
So have a look at the implementation supplied by the OP, review the Android code from the link above, correct the code as necessary and give it a shot,
Good luck.
04-17-2012 02:26 AM
I try it and resloved error but now there are no get the output same as a Emboss.So i attached code so check it out and if any problem then told me.
I am waiting for your reply .
Thanks.
04-17-2012 04:38 AM
Only had a very quick look, but these lines look wrong to me:
A = pixels[q][r] >> 24;
R = pixels[q][r] >> 16;
G = pixels[q][r] >> 8;
B = pixels[q][r];
Remove A from here, you don't need it in this loop.
The others should be anded with 0xFF, for example:
R = (pixels[q][r] >> 16) & 0xFF;
I would also change this:
A = pixels[1][1] >> 24;
to
A = pixels[1][1] & 0xFF000000;
Then use it later:
arb[y * width + x] = A | R << 16 | G << 8 | B);
Hope this helps.