Image from raw UYVY(YUV_422) bytes

Hey everyone,
First off, I'm a JMF & imaging noob, so take it easy on me lol. I've been searching through the forum, and this is as far as I've been able to go.
Here's the problem, we have a Sony DFW-X710 camera that came with IC Imaging Control software & SDK. The JMF Registry doesn't pick up the device. So we've used some lovely JNI to get the raw bytes back to Java. As far as I can tell, the image information is coming back thru to Java just fine. When I try to create an image file thru BufferToImage.createImage(..), it displays as all black. The camera settings are:
1024x768
15 FPS
UYVY
The code I'm using minus the standard GUI stuff:
//raw bytes from the JNI
byte[] array = triggerAndReturnImage();
Buffer buf = new Buffer();
YUVFormat yuv = new YUVFormat(new java.awt.Dimension(1024,768) ,
Format.NOT_SPECIFIED, Format.byteArray,
15f,YUVFormat.YUV_422,2,4,1,0,2);
buf.setFormat(yuv);
buf.setData(array);
BufferToImage buf2Image = new BufferToImage(yuv);
Image newImage = buf2Image.createImage(buf);
System.out.println("New image is: " + newImage);
The image seems to create fine, but like I said, a pure black image.
The output I get from the println is as follows:
New image is: BufferedImage@1ea0252: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 IntegerInterleavedRaster: width = 1024 height = 768 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0
1024,768
Any insight anyone can give would be much appreciated.
-Jeff
FYI: I've ensured/tried the following:
*the lense cap is off
*the camera takes pictures fine
*I can save them from the C++ side (but I don't want to do that because that will take too long to save and reopen in Java for the app we're working on),
*I've reversed the byte order (because the SDK says the images are stored bottom up)
*I've tried without reversing the bytes
*The CINEPAK VideoFormat but for some reason won't return an image                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

It is supposed to work, you can create a Buffered Image of given height, width and imagetype and you can set single Pixels with setRGB. I assume this will be quite slow, but it will work.
If your data is in the form of int[]rgb (rgb each 8 bit + 8 fill bits) than you can use a setRGB variant, which copies a complete area (read array) into the buffered image, which is presumeably faster especially if you choose int[]rgb as image type for your BufferedImage as well.
Regards
SH

Similar Messages

  • When converting an image from raw to jpeg , the jpeg can look flat compared to the original raw image . Is there anything I can do about this ?

    When converting an image from raw to jpeg , the jpeg can look flat compared to the original raw image . Is there any way to prevent this ?

    Hi Joe , Thank you for your quick response . I am viewing the jpeg in Microsoft Picture Manager and Flickr. It 's not always really noticeable , but for example if I shoot into the light with dew on the grass , the dew glistens in LRoom and I'm happy with the shot but when I convert it to jpeg ,it looks dull. I have changed the setting to sRGB - from Adobe 1998 ,but don't see much difference.  Kind regards   Alberto.

  • Migrationg all images from RAW 1.1 to 2.0

    Hi,
    I'm struggling on how to change all my images from RAW 1.1 to RAW 2.0 in Aperture?
    I am sure this is easy, but I have been searching all over and can't find anything.
    Have read this article from Apple:
    http://docs.info.apple.com/article.html?artnum=307399
    Which leads to me believe that this possible, I just don't know how?
    TIA,
    JM

    Great! Thanks!
    By the life of me, when I saw that dialog box, I would have never guess that hsi was doing this!
    Regards,
    JM

  • In Photoshop CS5, using Bridge, I will not be able to open a psd image from RAW, due to memory

    I open 25mb photos from Bridge CS5, make adjustments in RAW, then open them in Photoshop to apply filters & masks etc.. Once opened in Photoshop, I can work with a multi layered 200mb psd file without any issues.
    However, after closing it, then opening another image in RAW, adjusting it, then opening that image in Photoshop, I will suddenly get an error message saying Not enough memory (RAM), even though this is a far smaller file (26mb), than the psd file I just had opened earlier (200mb).
    I can work for a while without problems, then suddenly I start to get the error messages, even though I have closed all my other programs, & all other files.
    I have also regularly cleaned out my temp files.
    I don't know much about hardware, but asked for a fast machine that could handle editing of large hi-res still photos, running the Adobe Standard suite.
    I only work with still photos from photoshoots, or layouts in InDesign & Illustrator. I don't do any 3D or animation, or run any games, so I was told the PC & graphics card I bought would handle what I do.
    I have set my Prefs in Photoshop Performance at the higher end of 'the ideal range'.
    I have a brand new PC & Windows 7 & have only had it for 3 months, but only work on it 3 days a week so shouldn't need much defragging:
    i7 - 860 CPU,
    4GB DDR3 1333MHZ (2x2GB) RAM
    500GB 7200RPM SATA HDD
    ATI Radeon   4550 512MB PCle Graphics
    I thought I should get 4GB more RAM but my computer boffin friend says that won't make a difference - as he checked my CPU usage in Task Manager & it is handling it. He thinks I might need a bigger Graphics Card, but he's not sure.
    Does anyone know why I get the error messages? Will a better graphics card fix it, or there something else I need to reset, or do I have to put up with having to clean out temp files, shut down totally, then reboot, every 2 hours?
    Thanks,
    Gerooster.

    Sorry for the late reply. My email firewall has become a little over zealous & sent a lot of my emails straight to my junk email folder, so I have only just now discovered your reply in my junk mail folder.
    The only "don't open files exceeding xxx megabytes" instruction I can find in my Prefs, is in the Bridge Prefs for Thumbnails, & mine is set at 1000mb. The biggest files I handle are bigger than 200mb so I should be able to open a few, not just one.
    However, this doesn't explain why I can open a psd format file of 180mb, close it, but then can't open a RAW format file of only 26mb immediately after.
    I can open the RAW file only if I restart my computer - very annoying!
    However, thanks for the advice about the video card & memory.
    So, I'm still stuck as to what the issue is.

  • Display an image from an array of bytes

    Hi, I'm trying to display an image from the raw pixel values. lets say i read a bmp file to an array, chuk the header off and want to display the pixel. How can I do this? I don't want any file formats, just want to display the pixels and creat the image. Is this possible?
    Many thanks,
    H

    Thanks for the reply. I had a look at MemoryImageSource and other classes that relates to it. I wrote the example given, but it doesn't identify createImage(). I've implemented ImageProducer, but still complains. Have you any idea why? Thanks for your help.
    H

  • Psychadelic effects when opening second image from RAW

    Photoshop CS6 beta 64 bit, Windows 7 Pro 64 Bit
    Radeon HD4850
    Working on PSD file, then opened second image from ACR.  After choosing 'Open Image' from ACR the second file appeared onscreen, with the first image behind it in psychadelic colours.
    Zooming caused the second image to leave ghost images on the psychadelic background.
    Unable to work in either image, had to close down using Task Manager.

    Sounds like it could possibly be a graphic card issue. Have you updated your drivers recently? Up to date drivers usually take care of issues like this. You might even want to reinstall the drivers.
    If that doesn't work, make sure to post your system info as a reply. System Info from Photoshop

  • IPhone SDK: How to create an image from raw data

    Creating a UIImage from some form of bitmap file format is easy, whether you let UIImage load the file itself or create it with an NSData. But what if you have raw bitmap data in memory and you want to create an image?
    In Cocoa NSBitmapImageRep can be created by passing it a pointer to a block of memory and the relevant heigh, width, bit depth etc. information. From that you can easily create an NSImage. There doesn't seem to be anything equivalent on the iPhone. CGImage can be created but it looks like you have to write a CGImageProvider. CGBitmapContextCreate takes a void * to a block of memory. Does it clear that block?
    Is there a good way to do this?

    ElNono wrote:
    You can't do RGB565 on a CGImageRef/CGContextRef. The only 5bpp modes supported are 1555 ARGB or 5551 RGBA. If you just need to display the image, use OpenGL. One of the supported texture formats is RGB565. If you need to save the image then you're going to have to pre-convert it to RGB888.
    hi ElNono , i have test the RGB888 data now , the image can show , but another problem is the image just like serveral picture over lap together , also is blurred , my code is here:
    const size_t width = 1024;
    const size_t height = 768;
    const size_t bitsPerComponent = 8;
    const size_t bitsPerPixel = 32;
    const size_t bytesPerRow = (bitsPerPixel * width)/8;
    CGBitmapInfo bitmapInfo = kCGImageAlphaPremultipliedLast;
    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
    NSString *imagePath = [[NSBundle mainBundle] pathForResource: @"Test" ofType: @"rgb"];
    NSFileHandle* file = [NSFileHandle fileHandleForReadingAtPath:imagePath];
    NSData* imageData = [file readDataToEndOfFile];
    CGContextRef context = CGBitmapContextCreate((void*)[imageData bytes], width, height, bitsPerComponent, bytesPerRow, colorSpace, bitmapInfo);
    CGImageRef imageRef = CGBitmapContextCreateImage (context);
    UIImage*rawImage = [UIImage imageWithCGImage:imageRef];
    CGColorSpaceRelease(colorSpace);
    CGContextRelease(context);
    CGImageRelease(imageRef);

  • Change in images from RAW to Editor

    Dear community,
    I open my Raw pictures in Photoshop Raw and make adjustments.  At this point the images are sharp, some pin sharp.  I then open the images in Editor to make other adjustments.  When the image opens I either have to zoom in or out to get the sharpness back.  Sometimes it is further than "fill the screen" and the consequence is that the composition is changed.  The pictures do become sharp again but they are not the pictures I wanted.  Am I just being stupid or is there an explanation?
    I would be grateful for any advice on this issue.
    Andrew

    Hi again Sarika,
    I think I've got it.
    1. Open in Camera Raw.
    2. Make adjustments
    3. Save image
    4. Open (comes up in Camera Raw again) and "open Image" into Editor
    5. Make adjustments in editor
    6. Save
    I have been making adjustments in Camera Raw and then, before saving it, have opened the image in Editor.  This has possibly caused my problem.  Do you think I'm right?
    Andrew

  • No preview images from raw files during import any suggestions?

    Lightroom will not display preview images during import of raw images. Any images in other formats display fine but with raw images I get a gray window the size of the preview image and the words "preview unavailable for this file". Adobe tech support has been no help they don't what is going on. Running Windows XP 64, Lightroom 3.3. Any suggestions?

    I have the same problem when pluging the camera directly to PC. But if I use the card reader, everything is normal. Win7 64bit.

  • Help, bridge will not convert the images from my Canon 7D into raw

    Has anyone else had problems converting images from a Canon 7D into Raw format?  Bridge downloads them and then tells me it could not convert them.  Hopefully someone out there has a fix.  Aah the joys of new equipment and software.
    EW

    Bridge should be converting image FROM raw format, not TO raw format.
    If you have Photoshop CS4 you should update to the latest Camera RAW plugin:
    http://www.adobe.com/downloads/updates/
    If you have an earlier version of Photoshop (CS, CS2, CS3) then you can download the latest free DNG Converter and convert the 7D RAWs to DNGs and then an older version of Camera RAW can open them.
    http://www.adobe.com/support/downloads/product.jsp?product=106&platform=Windows
    CS5 will be announced in a few weeks/months, and when it is available there will only be an upgrade path from CS2, CS3 and CS4, so if you have PS CS then you need to upgrade to CS4, now, before CS4 is available, otherwise to upgrade to CS5 you will need to pay full price.
    If you have a PS version newer than CS then you can wait and upgrade to CS5 when it is out.
    With either CS4 (and the newest Camera RAW update) and CS5, you won't have to convert 7D RAWs to DNGs to work on them.

  • Write permission error message when I try to 'save image' from elements 12 raw camera to main editing section?

    I get a 'write permission error' message when I try to 'save image' from Raw Camera sector to the main editing section of Elements 12. How can I overcome this problem?

    Well, first of all Save Image doesn't have anything to do with moving a raw file into the regular editor. That's the DNG converter. Evidently you are trying to create a dng file in a place where you don't have permission to write. Take a look at the location and change it to someplace where you can write. An example would be opening a file that's on a disc and trying to save back to that disc.
    But you should still be clicking the Open button instead of the Save Image button if you want to do anything other than make a DNG file.

  • How to create Image from 8-bit grayscal pixel matrix

    Hi,
    I am trying to display image from fingerprintscanner.
    To communicate with the scanner I use JNI
    I've wrote java code which get the image from C++ as a byte[].
    To display image I use as sample code from forum tring to display the image.
    http://forum.java.sun.com/thread.jspa?forumID=20&threadID=628129
    import java.awt.*;
    import java.awt.color.*;
    import java.awt.image.*;
    import java.io.*;
    import java.util.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class Example {
    public static void main(String[] args) throws IOException {
    final int H = 400;
    final int W = 600;
    byte[] pixels = createPixels(W*H);
    BufferedImage image = toImage(pixels, W, H);
    display(image);
    ImageIO.write(image, "jpeg", new File("static.jpeg"));
    public static void _main(String[] args) throws IOException {
    BufferedImage m = new BufferedImage(1, 1, BufferedImage.TYPE_BYTE_GRAY);
    WritableRaster r = m.getRaster();
    System.out.println(r.getClass());
    static byte[] createPixels(int size){
    byte[] pixels = new byte[size];
    Random r = new Random();
    r.nextBytes(pixels);
    return pixels;
    static BufferedImage toImage(byte[] pixels, int w, int h) {
    DataBuffer db = new DataBufferByte(pixels, w*h);
    WritableRaster raster = Raster.createInterleavedRaster(db,
    w, h, w, 1, new int[]{0}, null);
    ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);
    ColorModel cm = new ComponentColorModel(cs, false, false,
    Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
    return new BufferedImage(cm, raster, false, null);
    static void display(BufferedImage image) {
    final JFrame f = new JFrame("");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(new JLabel(new ImageIcon(image)));
    f.pack();
    SwingUtilities.invokeLater(new Runnable(){
    public void run() {
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    And I see only white pixels on black background.
    Here is description of C++ method:
    GetImage
    Syntax: unsigned char* GetImage(int handle)
    Description: This function grabs the image of a fingerprint from the UFIS scanner.
    Parameters: Handle of the scanner
    Return values: Pointer to 1D-array, which contains the 8-bit grayscale pixel matrix line by line.
    here is sample C++ code which works fine to show image in C++
    void Show(unsigned char * bitmap, int W, int H, CClientDC & ClientDC)
    int i, j;
    short color;
    for(i = 0; i < H; i++) {
         for(j = 0; j < W; j++) {
         color = (unsigned char)bitmap[j+i*W];
         ClientDC.SetPixel(j,i,RGB(color,color,color));
    Will appreciate your help .

    Hi Joel,
    The database nls parameters are:
    select * from nls_database_parameters;
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET CL8MSWIN1251
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 9.2.0.4.0
    Part of the email header:
    Content-Type: multipart/alternative; boundary="---=1T02D27M75MU981T02D27M75MU98"
    -----=1T02D27M75MU981T02D27M75MU98
    -----=1T02D27M75MU981T02D27M75MU98
    Content-Type: text/plain; charset=us-ascii
    -----=1T02D27M75MU981T02D27M75MU98
    Content-Type: text/html;
    -----=1T02D27M75MU981T02D27M75MU98--
    I think that something is wrong in the WWV_FLOW_MAIL package. In order to send 8-bit characters must be used UTL_SMTP.WRITE_ROW_DATA instead of the UTL_SMTP.WRITE_DATA.
    Regards,
    Roumen

  • Create an image from Component

    I have created an ImageLoader that stores images loaded from the filesystem. I do however need a default image that is not reliant on loading an image from the filesystem, in case any images on the filesystem are not found.
    I have tried to use Components createImage() method, until I read that this can only be used if the Component is visible on screen, which my Component never will be.
    What I really want is a grey rectangle as an ImageIcon by what means I get this I'm not bothered,
    hopefully someone can help

    Use the java.awt.image.BufferedImage class. To create a BufferedImage object, no component need to be visible. Here is some sample code:       BufferedImage image = new BufferedImage(wid, ht, BufferedImage.TYPE_INT_RGB);
           Graphics2D gc = image.createGraphics();
           gc.drawRect(x,y, width, height);Note that BufferedImage is a subclass of Image. So, you can create ImageIcon from a BufferedImage object.
    If you don't want to use BufferedImage, an option would be to create the image from an array of bytes.

  • Digital photo professional - export JPG from RAW

    Hello!
    i have a problem with program Digital photo professional, when i want export images from RAW format to JPG.
    The problem is, that quality of image is much more worse, then in RAW format in DPP. JPG looks blurred and fuzzy.
    IMAGE LINK:
    Please check image, on the left side is print screen from RAW in DPP, on the right is exported JPG from DPP.
    I want export JPG with the same quality as i see in RAW
    Is there anybody to help me?
    Thanks a lot.
    Vit

    1. open *.CR2 (raw file) in DPP
    2.file/convert and save
    3.type of file - EXif JPEG (JPG, JPEG)
    4.image quality 10
    5.output resolution 350dpi
    6.check -  embed icc profile in image
    There are not another settings, so i dont know, why has exported JPG so bad quality...
    When i open *.CR2 file in PS5, i see the same bad quality as exported JPG from DPP, but i read, that PS5, cannot
    open CR2 file in best quality, because PS5 doesnt have all function, that have DPP.
    I tested it on two PC, so problem is not only on my PC...
    Thanks.

  • I am unable to import Raw still images from a Nikon D 80 into Premiere Pro cs 4. All jpeg images ok

    I am unable to Import RAW still Images from a Nikon D 80 camera into
    Premiere Pro. All jpeg images import Ok. A web search suggests I need "plug-ins" for RAW, but I can not find  same. Any suggestions as to how to inport RAW files to PP CS 4 would be appreciated. I have just updated from Premiere Elements 4 which had no problem importing RAW still images.
    Roygo

    The way I see it (correct me if I'm wrong) but Raw is supposed to be where you have total editing control of the shot (as opposed to the camera). I believe the next step is to do the editing (i.e. color balance, exposure, etc) then make a regular image from that to use in whatever output you desire (print, web, etc.) Think of raw as the negative. Just being in raw doesn't in it self make it better.
    Edit. This is from premiere help files....
    Supported still‑image and sequence file formats
    Adobe Premiere Pro supports 8-bit per-channel (4 bytes per pixel) and 16-bit per-channel (8 bytes per pixel) still-image files. It converts images with lower bit-depths to 8-bits per channel and images with higher bit-depths to 16-bits per channel on import. High bit-depth files are supported at one single-precision float per channel (16-bytes per pixel).
    AI, EPS (Adobe Illustrator and Illustrator sequence)
    BMP, DIB, RLE (Bitmap and Bitmap sequence)
    EPS
    GIF
    ICO (Icon File) (Windows only)
    JPEG and JPEG sequence (JPE, JPG, JFIF)
    PICT and PICT sequence (PIC, PCT)
    PNG (Portable Network Graphics)
    PSD (Adobe Photoshop and Photoshop sequence)
    PSQ (Adobe Premiere 6 Storyboard)
    PTL, PRTL (Adobe Premiere title)
    TGA, ICB, VDA, VST (Targa and Targa sequence)
    TIF (TIFF and TIFF sequence)

Maybe you are looking for

  • My jsp page does not get refreshed

    I have a jsp page which looks like - the top portion of the page has 3 textboxes and a submit button to add an entity. the rest of the page displays a list of all the entities in the system. when i load the jsp and add a new entity, the new entity sh

  • Since latest iTunes update my iPod Classic no longer plays in Bose Sound Dock - how can I fix?

                   My iPod Classic charges, but no longer has sound when plugged into my Bose Sound Dock. I have tried resetting my iPod per troubleshooting instructions on both the Apple and Bose websites. I have not had any issues with speakers before.

  • How to add an image to the JPanel

    i have been searching for many to add in an iamge to the JPanel...but with error..can anyone kndly help? import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.event.*; public class adv extends JPanel { ImageIcon pic = n

  • Flex 2 with FDS in Chrome

    I have an application that was developed in Flex 2 using FDS for communications.  I've upgraded to Flash Play 11,0,1,152 in Google Chrome and I can no longer connect to my project either running locally on my machine or on the production site.  It ru

  • Using weblogic unit-of-order (UOO) in osb proxy service

    Hi, I have a JMS Queue deployed to Weblogic server. The messages inside the queue are grouped using the JMS_BEA_Unit-of-order (UOO) Weblogic feature. Now i have a OSB 10g Proxy Service which reads messages from this Queue. The problem is, on recievin