JAI: GaussianBlur problem
I have made a GaussianBlur class to control image Gauss blur .
but the larger radius I give the kernel, the thicker edge the image gets.
what's the problem?
// to generate gauss kernel
private static float[] makeKernel(double radius) {
radius += 1;
int s = (int)radius;
int size = s*s;
float[] kernel = new float[size];
double v;
for (int i=0; i<s; i++) {
for ( int j= 0; j < s; j++) {
kernel[i*s + j] = (float)(Math.exp(-0.5*(sqr(i)+sqr(j))/sqr(radius))/(2*Math.PI*sqr(radius)));
return kernel;
public void applyFilter(float radius) {
float[] elements = makeKernel(radius);
normalize(elements);
KernelJAI kernel = new KernelJAI((int)radius+1, (int)radius+1, elements);
// start convolve image on the kernel
ParameterBlock pb = new ParameterBlock();
pb.addSource(source);
pb.add(kernel);
RenderedImage target = JAI.create("convolve", pb, null);
the problem is how you want to treat to border of your image. The blur works by calculating the average value of the neighbouring pixels for a given center pixel. So you have to tell your algorithm what to do if your "center" pixel sits on the outside border and lacks its neighbours...
take a look at the docu on java.awt.image.ConvolveOp which specifies two types of "edge_conditions", i.e. solutions to the problem: EDGE_NO_OP, EDGE_ZERO_FILL
Similar Messages
-
[JAI] Palette problem
Hello,
I want to have a image with a palette looking like :
0->255 Red
256->512 Green
512->768 Blue
How can I do that with JAI ?the problem is how you want to treat to border of your image. The blur works by calculating the average value of the neighbouring pixels for a given center pixel. So you have to tell your algorithm what to do if your "center" pixel sits on the outside border and lacks its neighbours...
take a look at the docu on java.awt.image.ConvolveOp which specifies two types of "edge_conditions", i.e. solutions to the problem: EDGE_NO_OP, EDGE_ZERO_FILL -
Hi everybody,
I met a very tricky problem in using JAI to process tiff files. When I use JAI to process a small tiff stream of about 30k, it takes a hour and show the image successfully. The code I was using is as follows:
SeekableStream s=new MemoryCacheSeekableStream(new FileInputStream("c:/example.tif"));
ParameterBlock pb = new ParameterBlock();
pb.add(s);
TIFFDecodeParam param = new TIFFDecodeParam();
pb.add(param);
long nextOffset = 0;
do {
RenderedOp op = JAI.create("tiff", pb); // It takes a hour for JAI to execute this statement
//...some code to show the image of "op"
nextOffset = dir.getNextIFDOffset();
if (nextOffset != 0) {
param.setIFDOffset(nextOffset);
} while (nextOffset != 0);
Anybody has any idea or similar experiences? Thanks a lot.the problem is how you want to treat to border of your image. The blur works by calculating the average value of the neighbouring pixels for a given center pixel. So you have to tell your algorithm what to do if your "center" pixel sits on the outside border and lacks its neighbours...
take a look at the docu on java.awt.image.ConvolveOp which specifies two types of "edge_conditions", i.e. solutions to the problem: EDGE_NO_OP, EDGE_ZERO_FILL -
JAI installation problem, javax/media/jai/util/ not found?
Hi,
I am trying to use the JAI instllation in executing a class. However, I keep getting the following message.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/jai/util/
I have added some jars from the JAI instllation to my classpath. However, I still get this message.
What jar file do I have to reference so I do not get this message?Even more strange, I deploy it under Unix, there is no problem. The previous one is deployed
under Windowns XP. Anyone has same experience? -
JAI install PROBLEM...HELP HELP HELP
I have jdk 6 update 16 and Im trying to install JAI 1.1.2 or 1.1.3 so I can use it in my programs. When I try to install it [jdk or jre of JAI] then I get a message:
"The program requires the installation of Java 2 SDK version 1.3. Aborting Setup.". I'm trying to install it on Windows Seven AND on Windows XP but I get the same message on both O.S. Please help. How will I make it install???The old build 1.1.2 requires java 2.
Just download the jdk version 1.1.3 from "https://jai.dev.java.net/binary-builds.html" and you will get it installed.
I just try it 2 hours before ;) -
JAI - Colour problem converting GIF to JPEG
Hi
I'm using JAI to load a GIF, and then save it as a JPEG. When I save it (using the "filestore" operation in JAI.create(...) the resulting JPEG seems to be monochrome. However if I save the same image as a BMP, it's fine.
I think this has something to do with ColorModels, but I'm a bit lost and confused really. Please could someone point me in the right direction?
NB, because I can't get ImageIO installed on my machine (it refuses to believe I have the right JDK installed...) I'm restricted to methods available in JAI
ThanksThanks for the reply. Here's the complete solution for anyone whose interested (mostly copied from another post). I tested it and it works a treat for my app at least
(image is a RenderedOp)
BufferedImage realImage = image.getAsBufferedImage();
try{
BufferedImage rawImage = realImage;
realImage = new BufferedImage(rawImage.getWidth(), rawImage.getHeight(), BufferedImage.TYPE_INT_RGB); //CHANGE THIS TO TYPE YOU NEED
ColorConvertOp xformOp = new ColorConvertOp(null);
xformOp.filter(rawImage, realImage);
}catch(Exception e){
e.printStackTrace();
} -
HT5622 Bonjour jai un probleme avec mon apple id
Stp appeller moi
<Phone Number Edited by Host>We are fellow users here on these forums, you're not talking to iTunes Support nor Apple - I've asked the hosts to remove your phone number from your post (it's not a good idea to post personal info on any public forum).
If it's a problem that only iTunes Support can help with then you can contact them via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page
from http://translate.google.com :
Nous sommes ici d'autres utilisateurs sur ces forums, vous ne parlez pas à iTunes de soutien ni Apple - J'ai demandé aux hôtes de supprimer votre numéro de téléphone à partir de votre poste (ce n'est pas une bonne idée de poster des informations personnelles sur un forum public).
Si c'est un problème qui ne iTunes Assistance peut vous aider à vous pouvez les contacter via cette page: http://www.apple.com/support/itunes/contact/ - cliquez sur Contacter l’assistance de l’iTunes Store sur le côté droit de la page -
HT201210 jai un probleme avec le mise a jour du logiciel ios 6.1
je arrive pas a faire des mis a jour du logicile ios 6.1 et a chaque fois sa me affiche un probleme
Salut Melanie1,
Je suis Xandrex, j'ai un Curve et je suis chez SFR.
Peux-tu indiquer comment tu as fait la mise à jour de BlackBerry World s'il-te-plaît ?
J'ai besoin que tu expliques ce qu'il se passe maintenant. Fais ceci:
Ouvre la trappe de la batterie et retire-la. Ensuite attends 5 minutes, puis remets la batterie et referme la trappe.
Ce qui doit se passer, c'est un reboot, avec la ligne horizontale qui grandit, puis au bout d'un moment ton téléphone sera en état d'utilisation.
Tiens-moi au courant. -
Bonjour jai un probleme depuis mon achat sur ebay le vendeur est crati've Us Je vous ecrit car je connais pas boucoup l'anglais le probleme est
- lorsque je je branche mes ?couteurs sur ma carte directment le son est imp?cable
2- lorsque je branche mes ?couteur sur le li've dri've le sound est distortionner et tres sacader je disais meme quil nest pas ?coutable
3- Mes driver son ajour
4- Jai tester sur un autre pc meme probleme
5- jai r?installer winxp sp2 et le meme probleme
6- D?brancher tout sur mon pc apart le disque C meme probleme
7- jouer avec tout les setup meme probleme
8- ce que jai remarquer lorsque je branche mes ?couteurs dans le li've dri've j'entend des petit parasite dasn mes ?couteur.. . pourtant avec le meme ?couteur le les memes Jack _ connection) jaipas de trouble sur ma chaine hi fi
PS je crois vraiment que le li've Dri've est d?fecteux et ca depuis mon achat il est maintenant temps pour vous de faire quelque chose car personne ne m?coute depuis mon achat ... Je croyais que le service ?tait beaucoup mieux !
Jespere que vous pouvez faire quelque chose pour moi...
Jai plus de 5 ans dexp?rience et cest vraiment le li've dri've !!!
MerciI've had the same problem for 3 months now, tried just about everything posted on this board and still can't get it to work. Creative really dropped the ball on this one, and they haven't even released a response to it yet as to my knowledge.
-
OBY2 - how to eliminate existing G/L Accounts
Dear All,
I set up a company, company code, plant, Sloc.
I posted a MB1C+561 movement (average price was 0). After that I changed the material master V > S (from MAP to SP) and I set the SP to 1000/pc.
I had to create three G/L account for the company:
282500
300000
399000
How can I get rid of these existing G/L accounts to be able to use transaction OBY2 to copy G/L accounts from an existing company (I do not want to create G/L accounts step-by-step)?
I guess maybe it is posible to close/delete these accounts and after that I could use OBY2.
Which steps must be taken (and which transactions are related)?
I'd like to ask for your help and opinion. (Please consider I'm not familiar with FICO modul)
Thanks,
CsabaHi Jaya,
The problem is that when I'm trying to execute the transaction I get a warning message: 'Copying is not possible due to existing entries in the target co.cde' (Message no. FC024).
When I push enter I get the list of the above mentioned G/L accounts on the screen for the new company code and a lots of accounts for the reference company code. But the save button is not active.
I tried to do by blocking / marking with DF the accounts - result is the same.
What can I do?
Thanks,
Csaba -
salut jai un problem de reseau et le wifi et le bluthot aidez moi stp
Wondering how to download from update site? I have 10.6.8 and need to upgrade, do I jump to the most recent version, or to 10.7?
Also, if the automatic update doesn't work, what do I do to use something from the download site? -
Possible to set a system status that has been deleted again
Hi,
In the status profile, we have mapped the user status 'Approved' to ' CFAP Approve".
When we set the status of the transaction to 'approved', the system status of "TBAP To Be Approved" gets deleted in the system (this can be seen from the transaction BS33 by entering the system status CFAP).
As part of my requirement, I need to be able to allow the user to bring the status of the document back to 'To be approved'.
The lowest and highest status numbers are set such that the user can set the status of 'to be approved' from a document in the status 'approved'. The authorization key to set the status of 'to be approved' is also assigned to the user's role.
However, in the system, I do not see the option of selecting status value of 'to be approved' when I go to change mode of the transaction. Is it because of the fact that 'TBAP' system has been deleted? Is there someway I can allow it again?
Thanks
(will gladly award points for useful answers)Hello Jaya,
The problem seems to be caused by the lowest/highest status number set in the user status profile.
Based on the rules and user status profile settings:
- The status currently active determines the upper limit of the subsequent status.
- The status with status number which was the highest one ever active for the object determines the lower limit for the status number of the subsequent status.
For example, if there is the status profile set as following:
Number Status Lowest Highest
10 AAAA 10 40
20 BBBB 30 40
30 CCCC 20 40
40 DDDD 30 40
Whent status DDDD is set on, then CCCC and DDDD should be available in the drop down list.
Once you move back to CCCC, now the lowest and highest allowed status is 30(from DDDD's lowest)~40, so you will not see BBBB in the drop down list.
I hope this could be helpful.
Best regards,
Maggie -
Hi All,
We are on PI 7.11 SP6 and use CTS transport to move objects across PI landscape. Our project utilizes a large number of file comm channels. We are using the option "Archive Faulty Source Files" and specify the archive directory.
The problem we face during transport is, this value for the archive directory is lost when the channel is imported into a new environment and hence ativation of the object will fail unless we manually edit it, save it and activate it.
To make the problems worse, SAP has come up with a "feature" that activates the object directly upon import. The import fails because the channel does not have the archive directory value. We have now requested the BASIS team to disable this "auto activation" feature and then do the import.
I am still wondering why would SAP come up with this feature... The User Name/pwd and other attributes are env specific and we are not supposed to activate a channel with incorrect values.
Any one faced this? If so, do you think this feature is useful to you in any way?
Thanks
JaiHi Jai,
>>The problem we face during transport is, this value for the archive directory is lost
I think that's how it should be.
>>I am still wondering why would SAP come up with this feature
The feature is good if they provide an additional say checkbox while exporting ID objects with functionality to keep all parameters intact or remove environment specific parameters. I believe this option must be implemented based on suggestion from some SAP customers.
This is an improvement suggestion. Please add your suggestion in the wiki attached with this blog:
/people/prateek.srivastava3/blog/2011/05/16/suggesting-pi-improvements--features-functionalities-behavior
Regards,
Prateek Raj Srivastava -
Help with extraction from 0CO_OM_CCA_9
Hello Experts,
I need your help urgently.
Iam doing CO extraction with the 0CO_OM_CCA_9 DataSource.
I have made one append to the extraction structure and filled the fields in function module EXIT_SAPLRSAP_001.
Everything worked fine till this moment.
My problem is that I cant retrieve data only in productive system. In development and Quality systems the append fields are filled.
I have transported everything one more time, but the problem remained.
I have Go Live next Monday, and I would appreciate your help on this.
Best Regards,
João ArvanasHi Jaya,
The problem is solved.
Thank you for your suggestion.
The problem was with the Package in which the Exit was included.
I have awarded points.
Best regards. -
Issue with BAPI parameters - BAPI_SALESORDER_CHANGE
Hi,
I am trying to use BAPI_SALESORDER_CHANGE to modify the contents of the sales order item quantity. but the below code was not working, can any one correct the below program.
I have seen the same type of post few months back but no one provided the solution till now. I hope experts can correct my program. Surely i will reward.
regards
jaya
REPORT y_bapi1 .
TABLES: vbap.
DATA:
bapichdr LIKE bapisdh1,
bapichdrx LIKE bapisdh1x,
bapirtn LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
bapiitm LIKE bapisditm OCCURS 0 WITH HEADER LINE,
bapiitmx LIKE bapisditmx OCCURS 0 WITH HEADER LINE.
DATA: s_vbap LIKE vbap.
PARAMETERS: p_vbeln LIKE vbap-vbeln DEFAULT '40486',
p_posnr LIKE vbap-posnr DEFAULT '20'.
start-of-selection.
START-OF-SELECTION.
PERFORM get_data_4m_vbap.
PERFORM fill_header_in.
PERFORM fill_header_inx.
PERFORM fill_item_in.
PERFORM fill_item_inx.
PERFORM call_bapi_so_change.
PERFORM call_bapi_commit.
*& Form get_data_4m_vbap
text
FORM get_data_4m_vbap.
SELECT SINGLE * FROM
vbap
INTO s_vbap
WHERE vbeln = p_vbeln
AND posnr = p_posnr.
ENDFORM. " get_data_4m_vbap
*& Form fill_header_in
text
FORM fill_header_in.
*bapichdr
ENDFORM. " fill_header_in
*& Form fill_header_inx
text
FORM fill_header_inx.
bapichdrx-updateflag = 'U'.
ENDFORM. " fill_header_inx
*& Form fill_item_in
text
FORM fill_item_in.
bapiitm-itm_number = p_posnr.
bapiitm-target_qty = s_vbap-kwmeng + 5.
APPEND bapiitm.
CLEAR bapiitm.
ENDFORM. " fill_item_in
*& Form fill_item_inx
text
FORM fill_item_inx.
bapiitmx-itm_number = p_posnr.
bapiitmx-updateflag = 'U'. " I for insert & D for Delete
bapiitmx-TARGET_QTY = 'X'.
APPEND bapiitmx.
CLEAR bapiitmx.
bapiitmx-itm_number = p_posnr.
bapiitmx-updateflag = 'I'. " I for insert & D for Delete
bapiitmx-target_qty = 'X'.
APPEND bapiitmx.
CLEAR bapiitmx.
ENDFORM. " fill_item_inx
*& Form call_bapi_SO_change
text
FORM call_bapi_so_change.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = p_vbeln
order_header_in = bapichdr
order_header_inx = bapichdrx
SIMULATION =
BEHAVE_WHEN_ERROR = ' '
INT_NUMBER_ASSIGNMENT = ' '
LOGIC_SWITCH =
NO_STATUS_BUF_INIT = ' '
TABLES
return = bapirtn
order_item_in = bapiitm
order_item_inx = bapiitmx
PARTNERS =
PARTNERCHANGES =
PARTNERADDRESSES =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
SCHEDULE_LINES =
SCHEDULE_LINESX =
ORDER_TEXT =
ORDER_KEYS =
CONDITIONS_IN =
CONDITIONS_INX =
EXTENSIONIN =
READ TABLE bapirtn WITH KEY id = 'V1' number = '311'.
IF sy-subrc <> 0.
PERFORM bapi_errorlist.
ENDIF.
ENDFORM. " call_bapi_SO_change
*& Form call_bapi_commit
text
FORM call_bapi_commit.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
RETURN =
ENDFORM. " call_bapi_commit
*& Form bapi_errorlist
text
FORM bapi_errorlist.
DATA: bapierr TYPE c,
string TYPE string,
i TYPE i.
bapierr = 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
LEAVE TO LIST-PROCESSING.
SET PF-STATUS 'LIST'.
FORMAT INTENSIFIED ON.
WRITE: / 'BAPI ERROR OCCURED' COLOR COL_NEGATIVE INVERSE ON.
SKIP 1.
LOOP AT bapirtn.
CONCATENATE bapirtn-type bapirtn-number '(' bapirtn-id ')'
INTO string.
WRITE: / string.
i = strlen( bapirtn-message ).
WRITE bapirtn-message(i).
ENDLOOP.
LEAVE TO SCREEN 0100.
ENDFORM. " bapi_errorlistHello Jaya,
The problem would be you are not using SCHEDULE_LINES ,so try to use.
see the below program for referenec:
REPORT ZTRIALBAPICHANGE message-id z3d .
DATA:I_HEADER1 TYPE BAPISDH1.
DATA:I_HEADER1X TYPE BAPISDH1X.
DATA:I_PART1 LIKE BAPIPARNR OCCURS 0 WITH HEADER LINE.
DATA:I_ITEMS1 LIKE BAPISDITM OCCURS 0 WITH HEADER LINE.
DATA:I_ITEMS1X LIKE BAPISDITMX OCCURS 0 WITH HEADER LINE.
DATA:I_SCH1 LIKE BAPISCHDL OCCURS 0 WITH HEADER LINE.
DATA:I_SCH1X LIKE BAPISCHDLX OCCURS 0 WITH HEADER LINE.
data:err like bapiret2 occurs 0 with header line.
DATA:RETSALES LIKE VBAK-VBELN.
DATA:R(4).
R = '609'.
I_HEADER1-SALES_ORG = '0001'.
I_HEADER1-DISTR_CHAN = '01'.
I_HEADER1-DIVISION = '01'.
MOVE:'U' TO I_HEADER1X-UPDATEFLAG.
MOVE:'X' TO I_HEADER1X-SALES_ORG.
MOVE:'X' TO I_HEADER1X-DISTR_CHAN.
MOVE:'X' TO I_HEADER1X-DIVISION.
**PARTNER
CALL FUNCTION 'CONVERSION_EXIT_PARVW_INPUT'
EXPORTING
INPUT = 'SP'
IMPORTING
OUTPUT = I_PART1-PARTN_ROLE.
I_PART1-PARTN_NUMB = '0000000011'.
APPEND I_PART1.
**ITEM DETAILS
I_ITEMS1-MATERIAL = '000000000000000011'.
I_ITEMS1-ITM_NUMBER = '000011'.
APPEND I_ITEMS1.
MOVE:'U' TO I_ITEMS1X-UPDATEFLAG.
MOVE:'X' TO I_ITEMS1X-MATERIAL.
APPEND I_ITEMS1X.
**SCHEDULE LINE
I_SCH1-ITM_NUMBER = '000011'.
I_SCH1-REQ_QTY = '100'.
I_SCH1-SCHED_LINE = '0000'.
APPEND I_SCH1.
MOVE:'U' TO I_SCH1X-UPDATEFLAG.
MOVE:'X' TO I_SCH1X-ITM_NUMBER.
MOVE:'X' TO I_SCH1X-REQ_QTY.
MOVE:'X' TO I_SCH1X-SCHED_LINE.
APPEND I_SCH1.
UNPACK R TO RETSALES.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = RETSALES
ORDER_HEADER_IN = I_HEADER1
order_header_inx = I_HEADER1X
SIMULATION = 'X'
BEHAVE_WHEN_ERROR = ' '
INT_NUMBER_ASSIGNMENT = ' '
LOGIC_SWITCH =
tables
return = ERR
ORDER_ITEM_IN = I_ITEMS1
ORDER_ITEM_INX = I_ITEMS1X
PARTNERS = I_PART1
PARTNERCHANGES =
PARTNERADDRESSES =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
SCHEDULE_LINES = I_SCH1
SCHEDULE_LINESX = I_SCH1X
ORDER_TEXT =
ORDER_KEYS =
CONDITIONS_IN =
CONDITIONS_INX =
EXTENSIONIN =
loop at err.
format color 4.
write:/ err-type,
err-id,
err-number,
err-message,
err-log_no,
err-log_msg_no,
err-message_v1,
err-message_v2,
err-message_v3,
err-message_v4,
err-parameter,
err-row,
err-field,
err-system.
*WRITE:/10 ERR-MESSAGE.
endloop.
IF ERR-TYPE <> 'E'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
MESSAGE S101 WITH RETSALES.
ELSE.
MESSAGE S100.
ENDIF.
Thanks
Seshu
Maybe you are looking for
-
XI introductory Guide needed.
Hi everybody i am vey new to XI can any one please share me the usefull meterial to get into XI initially . When i look at the sap.help.com , its rather confusing me. Thankyou in Advance . Edited by: krishnakanth kakarla on Sep 8, 2008 1:41 PM
-
How to add purchased filter to Photoshop CC? [was:filter]
как добавить купленный фильтр в Photoshop cc? How can i add bought filter at photoshop cc?
-
Advice re: whether to get the Air
Ok- here is my situation- right now i have a macbook pro (less than a year old) that is my main and only computer- and a friend has offered to buy it from me if i want to purchase the Air Since the Air has come out I have been very much wanting it be
-
Exception thrown by DataRight IQ Library
I am attempting to use the library that ships with DataRight IQ to integrate this into our processes. Specifically, the library is drllib.dll and the function that I am having an issue with is drl_item_get_text. The error it returns is this: NULL out
-
HELP!! iPhone stuck in Recovery Mode after trying to update today w/new OS
Ok my phone is stuck in recovery mode, Ive already restarted my computer & tried to shut down itunes & start it back up, it gets almost done with the restore verification and then it gives me a 1013 or something what to do?! Message was edited by: Ps