Image processing with BLOBS: how to write BufferedImage to a BLOB

Hi everybody - thanks in advance for any input on that topic.
I'm doing image processing using AWT and 2D. Images are stored in a RDBMS as BLOB Type, which I get using JDBC and convert to a BufferedImage using a JDBCImageDecoder.
Now, I have my BufferedImage and I can process them using the appropriate filters (ConvolveOp e.g.)
Writing the BufferedImages to disk or display on screen is easy. But I can't get to write them to a BLOB Object. Any Hint ?
(Of course, I'm speaking of oracle.sql.BLOB objects, not java.sql.Blob).
Thanks and have a nice day

Billy,
Thank you for your answer. I have two questions.
First what that means "Bob's your uncle ?" I'm a french man, not used to english special sentences ou jargon. Would enjoy to know !
Second, I have created a PL/SQL procedure to update my table. I face a problem.
I want to initialize b_lob with the img_blob value but I get an error : "ORA-22922: nonexistent LOB value". WHere do my error comes from ? I am fairly new in this stuff of BLOB.
Below my procedure.
Thank for your kind help.
Christian.
create or replace
procedure insert_img as
f_lob bfile;
b_lob blob;
loops number default 0 ;
lines number default 0;
stmt varchar2(4000);
cursor c1 is select img_blob, file_name, pk from photos FOR UPDATE ;
begin
NULL;
dbms_output.enable(900000);
stmt := 'SELECT COUNT(*) FROM PHOTOS';
EXECUTE IMMEDIATE stmt INTO LINES ;
for ligne in c1 loop
exit when loops >= lines ;
loops := loops+1;
update photos set img_blob= empty_blob() where CURRENT OF C1;
-- return img_blob into b_lob;
b_lob := ligne.img_blob ;
f_lob := bfilename( 'MY_FILES', ligne.file_name );
IF (DBMS_LOB.FILEEXISTS(f_lob) != 0)
THEN
      DBMS_OUTPUT.PUT_LINE('BFILE exist: '|| ligne.file_name || ', ligne :'|| ligne.pk);
      dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
      dbms_lob.loadfromfile( b_lob, f_lob, dbms_lob.getlength(f_lob) );
      dbms_lob.fileclose(f_lob);
      dbms_output.put_line('ligne.pk :' || ligne.pk || ', lines : ' || lines || ', loops ' || loops);
  ELSE
    DBMS_OUTPUT.PUT_LINE('BFILE does not exist: '|| ligne.file_name || ', ligne :'|| ligne.pk);
  END IF;
end loop;
commit;
end insert_img;

Similar Messages

  • Image processing with imaq vision with 2 webcams on the same computer

    Hi,
    I'm currently trying to set up 2 usb webcams (logitech quickcam for notebooks pro). I want to be able to have them both run simultaneously and do some image processing with the images that I get from both cameras with labview and imaq vision.
    As of right now, I'm having trouble getting both cameras to run at the same time. Any help would be gladly appreciated. Thanks.

    The USB IMAQ driver will not support running 2 USB cameras at a time (I believe it is a limitation of the DirectShow interface). You could open one camera, acuqire an image, close the reference to that camera and then do the same for the second camera.
    If you need simultaneous acquisition, look at possibly moving to 1394 cameras or analog cameras.

  • Fixed 5.2rc: ...images processed with PV2003 were adding a post-crop vignette...

    From the release notes:
      "Catalog containing images processed with PV2003 were adding a post-crop vignette when catalog upgraded to Lightroom 5"
    Does that mean all my PV2003 images (10,000+) now have a post-crop vignette included in their edit history?  Or some?  Or some special combination?
    I converted my v4.4 catalogue a couple of days after v5.0 was released, so I really don't want to go back to my old v4.4 catalogue and re-convert...
    Any ideas?

    The "fix" works as follows:
    1. If you use LR5.2 RC to upgrade a catalog containg some PV2003 images, there will be no issue....i.e. you will not see the unexpected "Post Crop Vignette Style: Paint Overlay" entry in the develop History.
    2. If you open an LR5 catalog which was created by upgrading from an earlier version using LR5.0, any PV2003 images will STILL show the "Post Crop Vignette Style: Paint Overlay" entry in the develop History, BUT it will no longer have the problem of losing all intervening history steps should you click on a prior history step.
    3. Any already-lost history steps caused by the problem in LR5.0 will remain lost.

  • Image processing with applets

    Hi
    I need to create a website with several image processing applets on it. however although the applets work locally they will not load at all through a server (i'm a student) my supervisor tells me i cant use an applet to display an image stored on a server. but as applets specifically have getImage methods which must be able to get images from the server i think he is wrong but do not know how to do it.
    Any advice will result in some really great Karma directed your way.
    thanks

    here's the code I use, make special note of the getDocumentBase(), as this request will be a URL based request, rather than a file read
    try {
    img = getImage(getDocumentBase(), "logo.gif");
    }catch(Throwable t) {
    System.out.println("Unable to load logo image",t);
    t.printStackTrace();
    hope this helps

  • Image processing with cRIO-9074

    Hii...
           I am working on Image Processing. Can anybody send an example of cRIO (fpga interface mode) for Image processing applications.
    I need example for how to use DMA FIFO for sending an image to FPGA, and back to host VI after processing on FPGA.
    Thanks
    Prashanth 

    hey sorry,
      It is job openings board.  Ignore the above thread
    Thanks 

  • Can anyone share with me how you  write Javadoc?

    Can anyone share with me how their companies write Javadoc?
    Are your developers solely responsible for it? Do your technical writers own it or review it? How do you make sure it's good?
    Right now, my software developers are mostly responsible for writing all the API info and it's of poor quality and really lacking details. I don't mean spelling/grammar-type problems. My developers just don't seem to "get" what information to include, no matter how many guidelines or checklists I give them.
    A very simple example is:
    * Gets the status
    public java.lang.Integer getStatus() {...}With no indication of what status values may be returned and what the values might mean.
    How do you ensure that what you write is actually useful? Please help!
    I'm aware of the method Sun recommends, but I want to know what others do.
    Thank you

    Hi,
    Well, concerning the question what a good API documentation should be. Just imagine, you are a programmer and you want to use that API. You need to know how it works. There can be only three ways to find it:
    (1) The API documentation
    (2) Probing experiments. Even a good documentation may not describe everything. Sometimes, the only way to understand certain things you particularly need may be guessing something, writing a code basing on it and see how it works. Then, guessing something again, more precisely now, and so on. Even a very good documented API (for instance, javax.swing) may require that sort of approach to be able to use it eventually.
    (3) At last, when source codes are available, one may look at them and try to understand precisely, what a particular method actually does.
    I think the better the API documentation the less one may need to endeavor those two last steps. There is actually a limit about it. Without any proper explanation at all, one may never be able to use a particular API, neither after probing it nor after looking at source codes (that is not to say the sources may be simple unavailable at all).
    Concerning how to write the API documentation, that's mostly the question of managing your team. I think, basically, the original source of the ultimate information about everything implemented in the projects are those very programmers (developers) and, probably, some software architects. But those guys normally are not especially eager to write any documentation (especially developers). That your example just demonstrates it. It seems, your programmers just wrote that "Gets the status" for you to make them leave in rest after that. In addition, the programmers normally have such a sort of work and activity that does not match particularly well with the writing literature and doing their main job simultaneously. You should not enforce them to do that!
    To write a good documentation, you will need to engage a technical writer. That's normally a guy with some programming background. However, writing some literature is actually what he does the best. (Sometimes, such people do something else about written word beyond the technical writing.) The job of that guy would be to write the documentation. This will take from him (or her) two basic things:
    (1) The ability to understand the whole software system (that's where his programming background will be needed!);
    (2) To communicate with the programmers who have developed the stuff and to obtain from them all the necessary information they know. That may require some personal (verbal) communication with them, because asking them to write everything again will only result in the same "Gets the status" explanations. However, to be successful in this, the technical writer needs to have some explicit management approval behind him. Otherwise, some of the guys will avoid speaking to him at all (saying they lack the time). So, the management should assign them the necessary priority for such communications.
    Particularly big projects may even need to have the whole team of technical writers.
    Anyway, writing docs is a hard work. But it is extremely important! The good documentation may both increase your sales and eliminate lots of expense on further support of your customers.
    Regards,
    Leonid Rudy
    http://www.docflex.com

  • Spry image gallery with filmstrip - how to display all thumbnails?

    Hello,
    I'm using the Spry image gallery with filmstrip and want to be able to show all thumbnails. So instead of scrolling across to see all the thumbnails I would like to display them in a couple of rows. I thought it would be a case of changing the css from overflow: hidden to overflow: visible and increasing the height but this didn't make a difference.
    An example of my gallery is here http://www.demo.femmewebsites.com/gallery.html (This site doesn't have many thumbnails but I have others with 20+ images that need to be displayed)
    Your help would be much appreciated.
    Thanks

    Hello Krista,
    did you have a look here: http://labs.adobe.com/technologies/spry/demos/pe_gallery.html, where you will find DW "Photo Gallery Demos". In every demo, are arranged a large number of images in several rows and rows. Therefrom you can use their source codes.
    Hans-Günter

  • Automator query: I want to batch process with a program that doesn't offer batch processing.

    After much searching and experimenting I'm resorting to asking the direct question to see if you good folks can help me.
    I would like to be able to automate some image processing with the software "SketchMee". Unfortunately this is not something that the stand alone can do on it's own. I assume Otto can help me. I would like to essentially have a directory with "raw" (unprocessed) images. Have automator...
    1. open file in SketchMee (SketchMee will automatically render with previous settings)
    2. save new file in new directory
    3. repeat 100's and/or 1000's of times.
    Seems pretty straight forward but I'm having trouble making it happen.
    Does anyone have any advice or info for me here?
    Note: this is not a process that can be done in iPhoto, Photoshop or Graphics Convertor.

    Way better, IMHO of course, is Photoshop Elements.  It is not free but you can find deals on it but if not it really isn't too expensive.  For the amateur or advanced amateur it is far better than DPP (free included software) and even Lightroom.
    Lightroom is designed more for a person that takes 1000's and 10,000's of photos.  It has limited editing featuers.
    PSE is also more user friendly that full blown Photoshop.  Which you can not purchase any longer as it must be rented from Abode on a monthly basis.
    There is the free Gimpshop but it is the least user friendly of the bunch and has a steep learning curve.  But it is free.
    Lightzone is a free copy-cat version of Lightroom.
    But when you are ready for the best photo editing and RAW conversion software there is, there is nothing at the top except Photoshop.
    EOS 1Ds Mk III, EOS 1D Mk IV, EF 50mm f1.2 L, EF 24-70mm f2.8 L,
    EF 85mm f1.2 L II USM, EF 70-200mm f2.8 L IS II,
    Sigma 120-300mm f2.8 EX APO, Photoshop CS6, ACR 9, Lightroom 6

  • How to write Select statement for this codition

    I need to check whether SGTXT contains BELNR value.
    SGTXT is a text field and It should be matched with BELNR
    How to write select statement for this.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT should have the given BELNR Value.
    Plz note : Here I cannot give as SGTXT = BELNR as coz BELNR have only 10 digits.

    Hi,
    data temp(12).
    concatenate '%' belnr '%' into temp.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT like temp.
    If belnr is having multiple values,just create a internal table as follows.
    types : begin of ty,
            belnr....
            temp(12),
            end of ty.
    data itab_ type standard table of ty.
    data wa type ty.
    loop at itab into wa.
    concatenate '%' wa-belnr '%' into wa-temp.
    modify itab from wa index sy-tabix transporting temp.
    endloop.
    Change your select statement accordingly.
    Kindly reward poits if it helps.

  • No Image - 1473R With Vision Assistant

    Hopefully this is a simple fix and I'm missing something very obvious, so here is what's up. I'm originally a text programmer but for this project I'm stuck using LabVIEW which is completely unfamiliar; I've been working on this for days with no progress so I thougt I'd see if anyone had some pointers. The goal of the project is to use the PCIe-1473R FPGA to do live gain control, overlay, and maybe some recognition.
    I started with the "Image Processing with Vision Assistant on FPGA" example and made a few simple changes to just attempt to get a video feed through. The camera we are using is a Pulnix TM 1325 CL, which outputs a 1 tap/10 bit Camera Link signal. Since this example VI is originally configured 1 tap/8 bit I changed the incoming pixel to be read as 1 tap/10 bit and compiled and tested. When I try to start video acquisition I get no errors but no frames are grabbed. The frame's acquisitioned count does not increase and nothing is displayed. If I switch to line scan I get a scanning static image, but this is not a line scan camera and my other NI frame grabber card shows an image from the camera fine.
    I wasn't all that surprised with this result, as the input is 10 bit and the acquisition FIFO and DMA FIFO are both 8 bit orginally. So, I changed them to U16 and also changed IMAQ FPGA FIFO to Pixel Bus and IMAQ FPGA Pixel Bus to FIFO blocks on either side of the Vision Assistant to U16. With this configuration, I again get no image at all; same results. I suspect this is because the incoming image is signed, so the types should be I16 instead. However, there is no setting for I16 on the Pixel Bus conversion methods. Am I not understanding the types happneing here or is there an alternative method for using Vision Assistant with signed images? I'd think it'd be odd not have support for signed input.
    Anyway, I've tried all the different combos of settings I can think of. Does anyone have any input? I feel like it must be either a buffer size problem or a signing problem, but I don't really know. Any and all input is welcome!
    Thanks for helping out a new guy,
    Kidron

    I ended up resolving this issue by switching cameras. The end goal was to use a FLIR SC6100, so I switched to it and was able to get things working shortly. The FLIR does use unsigned ints, so I believe that's what resovled the issue for anyone running into this in the future.

  • How to write code for page up and page down buttons on alv screen?

    Hi,
    Page up and page down buttons are not working in general alv report. Thease buttons are in disable mode. But is stnd. transactions (tcode : fbl5n)  these are enabled and working properly, but we can't debug this with /h
    How to write code for page up and page down buttons on alv screen?

    Poonam,
    On doing the screen debugging it took me over to    Include LSTXWFCC ,kindly check the below code.
    module cc_display.
      fcode = sy-ucomm(4).
      case sy-ucomm(4).
        when 'P--'.
          perform cc_firstpage.
        when 'P-'.
          perform cc_prevpage.
        when 'P+'.
          perform cc_nextpage.
        when 'P++'.
          perform cc_lastpage.
        when 'EX--'.
          perform cc_firstcopy.
        when 'EX-'.
          perform cc_prevcopy.
        when 'EX+'.
          perform cc_nextcopy.
        when 'EX++'.
          perform cc_lastcopy.
    I guess it can give you some lead.
    K.Kiran.

  • How to get blob image width with ordimage?

    Hello,
    I have trouble getting image width with ordimage. I have quite the same program for processing images as here: http://spendolini.blogspot.com/2005/10/manipulating-images-with-database.html
    so I have declared image files as BLOB files. How can I get the width for the them?
    There is a sample from ordimage reference:
    DECLARE
    image ORDSYS.ORDImage;
    width INTEGER;
    BEGIN
    SELECT p.product_photo INTO image FROM pm.online_media p
    WHERE p.product_id = 3515;
    -- Get the image width:
    width := image.getWidth();
    DBMS_OUTPUT.PUT_LINE('Width is ' || width);
    COMMIT;
    END;
    the ORDSYS.ORDIMAGE is used instead of BLOB here. when i do the same then i can't select BLOB content into the ORDSYS.ORDIMAGE variable. And otherwise I can't use the getWidth with the BLOB variable.
    Can anybody help please?

    Hi,
    the column blob_content is not suitable for storing into v_image2 because variable v_image2 is of type ORDSYS.ORDIMAGE and the column is BLOB.
    I used the following method instead:
    declare
    image blob;
    attributes clob;
    img_mimeType varchar2(32);
    img_width integer;
    img_height integer;
    img_contentLength integer;
    fileFormat varchar2(32);
    contentFormat varchar2(32);
    compressionFormat varchar2(32);
    begin
    DBMS_LOB.CREATETEMPORARY(attributes, TRUE, DBMS_LOB.CALL);
    select img
    into image
    from image_repository
    where id = 0;
    ORDSYS.ORDImage.getProperties(image,
    attributes,
    img_mimeType,
    img_width,
    img_height,
    fileFormat,
    compressionFormat,
    contentFormat,
    img_contentLength);
    dbms_output.put_line(img_mimeType);
    dbms_output.put_line(img_width);
    dbms_output.put_line(img_height);
    dbms_output.put_line(fileFormat);
    dbms_output.put_line(compressionFormat);
    dbms_output.put_line(contentFormat);
    dbms_output.put_line(img_contentLength);
    DBMS_LOB.FREETEMPORARY(attributes);
    end;
    try adapting this code and think about the possibility of "caching" image properties, because it takes some time to retrieve them every time.
    Bye,
    Flavio
    http://oraclequirks.blogspot.com/search/label/Apex

  • How can I process Raw Images taken with a Nikon D7000 in PS4  Extended?

    How can I process Raw Images taken with a Nikon D7000 in PSE Extended?

    Hi there
    Unfortunately, CS4 does not support the Nikon D7000. You'll have to download the Adobe DNG converter (links below) to process RAW files from your camera.
    DNG converter 6.3 - Mac
    DNG converter 6.3 - Windows
    Here are some answers to similar questions asked over in the Photoshop General discussion:
    If you need further information on this topic, please feel free to post in the Photoshop General Discussion or in the Camera Raw forum.
    Camera Raw | Supported cameras
    Camera Raw | compatible applications
    Cheers,
    Kendall

  • How To:  write a logo image in a list display report

    I have a simple list report that I create with a bunch of write statements.  How can I insert a Logo image on this report ?
    I have my Logo image loaded in SE78 as a bitmap graphic.
    Not sure if with the write statement, I can write out this logo on my report.
    I would think this should be able to be done, just not sure how.
    Thanks,
    David

    Hi David, check this code.
    REPORT zdem_555 .
    DATA: docking TYPE REF TO cl_gui_docking_container,
    picture_control_1 TYPE REF TO cl_gui_picture,
    url(256) TYPE c .
    DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE,
    html_table LIKE w3html OCCURS 1,
    return_code LIKE w3param-ret_code,
    content_type LIKE w3param-cont_type,
    content_length LIKE w3param-cont_len,
    pic_data LIKE w3mime OCCURS 0,
    pic_size TYPE i.
    START-OF-SELECTION.
    PERFORM show_pic.
    WRITE : /'hello see the picture ........'.
    *& Form show_pic
    FORM show_pic.
    DATA: repid LIKE sy-repid. repid = sy-repid.
    CREATE OBJECT picture_control_1
    EXPORTING parent = docking.
    CHECK sy-subrc = 0.
    CALL METHOD picture_control_1->set_3d_border
    EXPORTING
    border = 5.
    CALL METHOD picture_control_1->set_display_mode
    EXPORTING
    display_mode = cl_gui_picture=>display_mode_stretch.
    CALL METHOD picture_control_1->set_position
    EXPORTING
    height = 100
    left = 700
    top = 1
    width = 200.
    *CHANGE POSITION AND SIZE
    IF url IS INITIAL.
    REFRESH query_table.
    query_table-name = '_OBJECT_ID'.
    *CHANGE IMAGE NAME BELOW
    query_table-value = 'BIKER'.
    APPEND query_table.
    CALL FUNCTION 'WWW_GET_MIME_OBJECT'
    TABLES
    query_string = query_table
    html = html_table
    mime = pic_data
    CHANGING
    return_code = return_code
    content_type = content_type
    content_length = content_length
    EXCEPTIONS
    object_not_found = 1
    parameter_not_found = 2
    OTHERS = 3.
    IF sy-subrc ne 0.
    * MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-*msgno
    * WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
    type = 'image'
    subtype = cndp_sap_tab_unknown
    size = pic_size
    lifetime = cndp_lifetime_transaction
    TABLES
    data = pic_data
    CHANGING
    url = url
    EXCEPTIONS
    OTHERS = 1.
    ENDIF.
    CALL METHOD picture_control_1->load_picture_from_url
    EXPORTING
    url = url.
    ENDFORM. "show_pic

  • Batch processing with an image overlay

    Is it possible to do batch processing with an image overlay in FW CS4?
    I'm trying to resize several hundred images and place rounded corners on them.
    If this cannot be done in FW, does anyone know of another program that could accomplish this?

    Hi Marje,
    It's possible to include both resizing and image overlay in a custom Fireworks command that can be used in batch processing.  To get started, you could check out this tutorial that deals with the first step.
    That article describes how to perform image resize and overlay (in that case, a watermark), and then how to record the steps and turn them into a custom command that can be later used in batch processing.
    Once you saved the custom command, click File >> Batch Process, and follow the steps below:
    In the first window, select the images you want to process.
    On the next screen, open the Commands dropdown menu and select the custom command you created (it'll probably be on the bottom of the list), and click the Add button to include it in the batch process list.
    Finally, on the next screen select the location of the processed files, and optionally save the batch script for later use.
    Good luck!

Maybe you are looking for

  • Wrapper program when run in background not generating SPOOL

    I have created Program A which calls internally Program B or C based on the condition. When I run the program B or C independently in Background it generates the spool on completion. But When I run the program A in Background, Spool is not getting ge

  • Function or trigger to calculate cost

    Hi, I have a question regarding a function or trigger. Not sure what to use. I have the following table: CREATE TABLE STAY_LOG      LOGID NUMBER(4) NOT NULL,      FLIGHTID NUMBER(5),      ARRIVALDATE DATE,      DEPARTUREDATE DATE,      COST NUMBER(6)

  • Setting intensity graph to blinking causes LV2012 to crash

    Hi, This VI crashes when setting blinking to TRUE, using LV2012, Win7 32 bit. I saw that this was a bug in 2004 , hasn't it been fixed yet? Or am I missing something obvious? Thanks, Danielle "Wisdom comes from experience. Experience is often a resul

  • Choose a picture to share with Facebook widget

    It is possible to choose a personal picture to share with Facebook when i use the dedicated widget on my published site ? I've only 3 or 4 pictures that i can choose and they are wrong... Somebody can help me to find a solution ? Thanks

  • No Way To Crop To 2.35:1

    Suppose you wanted to crop a photo in Aperture to an exact aspect ratio, such as 2.35:1, there's no way to do it, is there? The crop tool only allows 2 digits per width and height. So, you can't type in 2.35 to 1 or even 235 to 100. Isn't that a bit