Convert 8 bit RGB Bayer Image in Monochrome

I'm looking for a way to perform an edge detect algorithm on the camera sensor image which was released in 8 bit RGB of Bayer (cannot specify the monochrome output sensor).  The image is read on the gray u8 IMAQ camera, but then the edge detect does not work because of the rasterization of bayer.  After the conversion of bayer in a u32, vi of detection errors color image edge by saying the image type is not supported (logic).  I wonder if there is a function that would allow me to take the image RGB U32 and then convert it back into an image in grayscale which has no pixel with the raw data read problems and will work with the edge detection algorithm.

If there is a function to convert an image IMAQ from color to grayscale so I could make the edge detect would be great (I didn't see one).  I think it would be a common place because many functions run only with images in grayscale.  If a function does not exist, what is the best way to go on the conversion of the image using LabVIEW.  I'm not an image of expertise so I'm not sure of the best way to go about it.

Thanks for your help.

Use IMAQ Convolution with a 3 x 3 table.  The elements of the array are numbers that I entered previously.  The convolution function only like arrays of odd sizes so that the image does not move during the convolution.  You can ignore the idea of 2 x 2 - I think it is cleaner.

So, to summarize:

1 acquire U8 Bayer image as grayscale image.

2. apply the filter convolution 3 x 3 to remove artifacts from Bayer.

3. use the Sobel filter to find the edges.

4. use IMAQ quantify for the average or STD dev of intensity.  It is a very good measure of the development.

Now to confuse you even more: you can speed up the extent of the development if necessary by reducing the resolution of the image.  You must insert a step after 2 (or instead of 2) allowing to extract from every other column and row of the image.  The focus indicator always follows the development very well, and treatment is a bit faster.  I used this trick a few years back, but it is perhaps not necessary on modern computers.

Bruce

Tags: NI Hardware

Similar Questions

  • ImgBayerColorDecode of NOR-IMAQ to produce 64-bit RGB images?

    According to reference Help feature, imgBayerColorDecode can be called with a void * pointer source and destination, so in principle it should be able to handle Bayer encoded images to 16 bits per pixel, right?

    However, when I look at this old net, it seems that it is not possible, because only 32-bit RGB can be taken out. When I look at the "Bayer Color Decode.vi IMAQ" on our system, the dll call is one of:

    "int32_t imgBayerColorDecode (int32_t dst, int32_t CBC, lines uint32_t, CLO uint32_t, int32_t dstRowPixels, int32_t srcRowPixels, const uint32_t * redGain, const uint32_t * greenGain, const uint32_t * blueGain, uint8_t bayerPattern, int32_t bitDepth, uint32_t reserved);

    But settings can be changed apparently. So my guess is that imgBayerColorDecode can now convert 16 bit Bayer coded images in RGB (A) 48-bit or 64-bit images (+ alpha), but I can't find any mention of this in the page "What's new with NOR-IMAQ".

    Can someone from OR Please confirm that it is possible today or is the old NET still valid?

    Hi Oliver,.

    During the period of SP1 2012, new Bayer decoding support added to the Vision. Bayer functions exported from the DLL IMAQ are discouraged because they don't have any of the new features. The functions are now in the Vision, but I think they do not need a license of the Vision Development Module (they are part of the basic API).

    The new functions of Bayer are significantly faster, have many algorithms of quality varying and support the conversion of > 8 bit to RGB64.

    imaqBayerToRGB() is what you should look into nivision.h.

    Eric

  • Image from 16 bits to 8 bits/RGB

    Hi all

    I have been using the clip and save to AVI examples OR but it does not work for me.  My mistake is that my images are 16-bit and the necessary images are either 8 bit/RGB to be converted to avi.

    How would I achieve that?  Please see screenshot.

    Kind regards

    Miika

    After a bit of a Eureka! now, a solution has been found.

    IMAQ Vision module and development as well as other LabVIEW software has not been downloaded.  Downloaded and the vi IMAQ Cast Image (among others) jumped upward and the program now works perfectly.

    Thank you very much!!

  • Convert a sweep of 16-bit grayscale tif to DNG and getting 48-bit RGB?

    I have scanned hundreds of old black and white negative using Vuescan to TIFF 16-bit grayscale. If I open in Photoshop CC2014 the tab indicates that they are a single 16-bit grayscale channel. But if I have Lightroom convert them into DNG and then open them in Photoshop, they appear as 48 bit RGB or three 16-bit RGB channels. The three channels are identical. What happens here? Is it only returned as a 48-bit RGB or the DNG image byPhotoshop to store the RGB image? The DNG format is not much bigger than the TIF, so it doesn't seem to be store 48 - bits of information. I lose all the data on your way to the DNG format with a scanning in grayscale?

    Given that I can export the DNGs to a tif and it refers to a single channel 16-bit, I suppose I don't lose all the information, but I'd rather not use DNG for scans in grayscale? Or should I edit in Photoshop with the three RGB channels on and understand that I am change the grayscale channel should ever export back to tiff?

    It seems at least that there is a gap in the rendering of the shades of gray DNG in Photoshop?

    I think that the best way to answer here is to explain my own workflow.

    I have to be a little brief: it's getting very late, and I start tomorrow a roadtrip of six weeks.

    I do a lot of work with TIFF scanned, and it never occurred to me to convert to DNG.

    I start with rough tonal corrections, noise reduction and retouching in PS and then import the image (with all the shadow and highlight details present) in LR.

    Here, I'm very good tuning and capture sharpening, but sometimes the image must return to the PS for editing. I use then change the Original and the image opens grayscale in PS. After check-in PS, I click on the exclamation mark on the thumbnail and choose import disk settings and updates to images in LR.

    Given that I find the release of LR sharpening unsuitable for scanned images (it's probably optimized for digital capture), I export a new LR tiff image, open it in PS, conversion of RGB to grayscale and use Smart Sharpen for output sharpening. I wish you that LR could export in grayscale, but I've learned to live with it. You could easily implement an action of conversion in levels of gray (and 8 bits) and use it regularly.

    My knowledge of the technical aspects of the dng files is limited, but my impression is that they are files in grayscale, which explains the small size of the file.

    The color is added in the process of deconvolution in LR.

    I do not think that your workflow with convertin to DNG will affect the quality, so stick with it if you wish.

    I gladly carry on this discussion, but since I'll be on the road, you answer could take some time.

  • CS6 - trying to convert an RGB bitmap image

    CS6 - trying to convert an RGB bitmap image (the image is actually a tif).  I click on: Image > Mode and bitmap is enabled; everything is grayed out except grayscale.  How can I fix it?  Thank you!

    Convert to grayscale first, followed by RGB.

  • Polygon color with RGB U64 images / Image conversion of RGB U64 in RGB U32

    Hi guys,.

    I want to use the color polygon feature, but I have an input RGB U64 image. The only supported is image RGB U32 type. Is it possible to convert the image to U64 U32 and use the color polygon feature?  I know I'll lose accuracy, but what for the moment.

    Otherwise, you know the functions of polygon that supports RGB U64 images as input?

    Please let me know.

    Thank you

    ARE

    IMAQ Cast Image VI Converts the current image type for the image type specified by Type of Image.

    How Casting works: The VI shifts the value from the source to the range of 8-bit using the depth of specific bit of the source image. Then the VI defines each color component in the destination value for the corresponding component in the value of the source.

  • Photomerge DNG files stitches 16-bit/32-bit RGB/8 * panoramas

    Hello

    I'm trying of Photomerge in Photoshop (via file/automate/Photomerge) lets you assemble multiple RAW files in a panorama. I tried the two 12-bit ORF and DNG files 16-bit/32-bit, but for some reason the stitched panorama is always in RGB 8-bit (RGB/8 *).

    I also tried poking the OpenEXR (32 bit) files, and for these, I get the panorama in 32-bit.

    If any idea why O.r.f.s. and DNG is stitched only in 8 bit?

    Thank you!

    You have 8-bit output value in ACR? Change in the workflow options; the blue link under the main image window.

  • How can I convert 16-bit files to 8-bit in 5 Lightroom?

    How can I convert 16-bit files to 8-bit in 5 Lightroom?

    You can actually convert a 16-bit image to 8-bit using Lightroom image. You can export a copy and make the copy an 8-bit image. Lightroom does not change the content of the image or makeup. The images that you import into Lightroom are kept in State of origin. But you can export copies in different configurations.

  • Is there a simple way to convert the bits to 16 bit depth?

    It seems there are specific methods PDF/BITMAP to convert 8-bit depth, but I can't find any documentation to make it easily the file as a whole. Is there a way to do this? I want to convert from 32 to 16 bit.

    I have the Image Processor Pro code that looks like this:

      // Bit Depth
      var bd = toNumber(task.@bitDepth) || 0;
      if (bd) {
        var bpc = doc.bitsPerChannel;
        try {
          if (bd == 8) {
            doc.bitsPerChannel = BitsPerChannelType.ONE;
          } else if (bd == 8) {
            doc.bitsPerChannel = BitsPerChannelType.EIGHT;
          } else if (bd == 16) {
            doc.bitsPerChannel = BitsPerChannelType.SIXTEEN;
          } else if (bd == 32) {
            doc.bitsPerChannel = BitsPerChannelType.THIRTYTWO;
          }
        } catch (e) {
          LogFile.logException(e, "Error selecting bit depth " + bd);
        }
      }
    

    Then, later, I have this code that modifies the document mode so that you can save it as a bmp file:

      if (ImageProcessorOptions.JDI && ext == "bmp") {
        // We need to make adjustments depending the number of
        // bmp save bits selected
        if (saveOpts.depth == BMPDepthType.ONE ||
            saveOpts.depth == BMPDepthType.SIXTEEN ||
            saveOpts.depth == BMPDepthType.TWENTYFOUR ||
            saveOpts.depth == BMPDepthType.THIRTYTWO) {
          saveOpts.rleCompression = false;
        }
        if (saveOpts.depth == BMPDepthType.FOUR ||
            saveOpts.depth == BMPDepthType.EIGHT) {
          doc.changeMode(ChangeMode.GRAYSCALE);
        }
        if (saveOpts.depth == BMPDepthType.ONE) {
          if (doc.mode != ChangeMode.BITMAP) {
            doc.changeMode(ChangeMode.GRAYSCALE);
          }
          var cnvtOpts = new BitmapConversionOptions();
          doc.changeMode(ChangeMode.BITMAP, cnvtOpts);
        }
      }
    

    I don't think I've tested with PDF files.

    I hope this helps.

  • How to display 16-bit RGB information?

    I use Photoshop CS4 v 11.0.  I opened a .tif that is 16-bit RGB.  Photoshop recognizes as 16 bits.  The tab on the image says RGB/16 *. (I do not understand the asterisk)  Image > Mode confirms that it is of 16-bit/channel.

    However the info panel shows that the values of RGB 8 bits (0,255). The Panel options include a bit of depth of detection.  How can I see the RGB values, perhaps (0,32767), image .tif using Photoshop?

    Simple answer-in your info panel, there is a small pipette beside RGB values. If you click this it gives you different options. Including the ability to read 16-bit values.

  • Save 12-bit without imaq image

    I saw this http://forums.ni.com/t5/LabVIEW/Store-a-12-bit-gray-scale-image/td-p/566500

    and began to worry, because at the beginning, it has been indicated for 12/16-bit gray-scale, you must use IMAQ.

    I do not have IMAQ, but I have 12-bit grayscale images generated by ThorLabs camera - what can I do?

    ... what I have accomplished so far with this:

    ... is to get completely distorted images.

    Alessandro

    • Use OR-IMAQ to acquire digital analog, parallel, Camera Link cameras; (Free) OR smart cameras
    • Use OR-IMAQdx with USB3 Vision, GigE Vision, IP (Ethernet), IEEE 1394 devices (requires a license)

    I don't remember exactly what is included in that (or if you need the vision development module and not the acquisition of vision module), but you should be able to download it and try it

  • How to convert 32 bit 64 bit os os

    Hai...

    I'm prabhakar computer lab technician... I don't know... I have 64-bit processor, but I use 32 bit windows7 ultimate version 6.2, build 7601 operating system... now I need to change the os 64-bit without formatting... so how do to convert 32 bit 64 bit os...

    Pls answer my qus...

    You will need to do a clean install, there is no place on the way to upgrade Windows 7 32 bit to 64 bit.

    Using the disk of 64-bit Windows 7, install Windows 7 Windows Easy Transfer Utility from the DVD (to find it, simply navigate to x:\support\migwiz, "x:" is the name of your hard drive. (In this case, you will see a collection of files, the important"that you must search for and double-click is 'migsetup'.) run it and create a DAMP (Windows Easy Transfer file), if you have an external hard drive, you can access it later when you perform a clean install of Windows 7 64-bit disk so you can stored there.

    Once you have done this, just do a clean install of Windows 7 64 bit disc. In Windows 7 64 bit disk, start Windows Easy Transfer, follow the wizard screen, tap on which is stored the WET file (external hard drive) and it will restore your personal files and settings. Reinstall the applications needed.

    http://www.notebooks.com/2009/10/07/using-Windows-easy-transfer-in-Windows-7/

    Boot from the Windows 7 DVD
    Click Install now
    Accept the license agreement
    When the option is displayed to select a type of installation, click (Custom advanced)

    Select the disk partition where you want to install Windows 7 click Next.

    You will receive the following warning:

    The partition you have selected may contain files from a previous Installation of Windows. If so, these files and folders will be moved to a folder named Windows.old. You will be able to access the information in Windows.old, but you will be able to use your previous version of Windows.

    (At all costs, do NOT click on anything in Format, deletion or Partition name.) So even do a custom installation, your personal files are still kept. Click OK

    The installation program will now begin installation. During installation, your computer will be restarted several times.

    Once the installation is complete, you can complete the Out of Box experience as the choice of your laptop, create a username, password, your time zone. You can then proceed to download the latest updates for Windows and reinstall your applications and drivers.

    You can then retrieve your personal files from the Windows.old folder and reinstall all of your applications and drivers.

    http://notebooks.com/2010/11/09/how-to-recover-documents-music-and-email-after-upgrading-with-the-Windows-old-folder/

  • I need to convert a pdf to jpeg image

    How to convert a pdf to jpeg image?

    No way with just the free reader. Can be done with Acrobat or ExportPDF service.

  • I have a subsscription but I can't convert any of my jpeg images

    I have a subsscription but I can't convert any of my jpeg images.

    Salvation RUN.

    Make sure that you use Adobe Acrobat Reader DC using the service to export it to PDF help of Acrobat Reader Acrobat Reader DC Learn & Support | Export PDF to Acrobat Reader DC.

    You can also use this service online at https://cloud.acrobat.com/exportpdf

    I would like to know if it works.

    Kind regards
    Nicos

  • Cannot save a big TIFF 16-bit RGB Image in JPEG format

    Hi all

    I use Photoshop CS5 Extended on Windows 7 64 bit (Home Premium).

    I sewed a panorama in Photoshop using the fusion of 19 RAW (Canon 5 d mkII) files in 16-bit. Everything was fine, I saved the image merged under TIFF 16 and worked on it. Panoramic image resolution is approximately 33000 x 4900. Place the flattened selections and active left.

    Once I was happy, I ran the Image processor on it with a watermark action and add the copyright EXIF data. There is no need to say that it cannot save in JPEG format (he performed the action correctly, just stopped to save). Normally, this works very well with other images RGB TIFF 16 I did.

    I tried to save it manually, but at this time, I noticed that the "Save for web" option is grayed out and the dialog box "save under" showed no JPEG options.

    What I did:

    1.) tried to open it with ACR and save it in JPEG format. It worked well

    2.) tried to resize to 20000 x 3600 (more or less) and it worked fine (which means that the option to save it as a JPEG back where it)

    3.) tried to convert it to full-size 8-bit and who did not

    I'm not too bothered because I have the solution of ACR, but it's boring and in the past, I've done more large panoramas with CS4 and I never had this problem before.

    Any ideas?

    The image is nearly 1 GB, so I'll not post...

    Thanks for your help!

    The CAB code has a limit of 64 k according to the width and height of JPEG files.

    The Photoshop code has a 32 KB limit, because of the old code for JPEG.

Maybe you are looking for

  • Firefox forget the popup allowed sites

    I continue to add sites to its list in the menu under options popup blocker. I can confirm the site are added and allowed the popups after that I have add URLS to the list of exceptions.When I close Firefox and reopen it, his list is a party. I have

  • Yesterday, I asked a question on local binary operations, and I can't find it now!

    I asked a question on 8/25 the performance of binaries of html/xml using Hypertext and can not find the question on a forum or the page. I know that I'm not in the right place. Help

  • P6 2137ezm: Question

    Nice day for many years, pay on Fust in Oerlikon Zurich. HP Pavilion p6 2137ezm with Win7 32 bit German profesional. Without DVD, everything has been installed. Where can download 64-bit Version of their share. Cuisne evrybody help me for the link, a

  • Error in Windows7 on Satellite L510

    Senior I have a problem installing windows 7 64 bit my laptop is toshiba satellite L510 T6600 3 MB memory, appearing a massage that "pilot," missing but when install windows7 32 bit it success. is that my laptop cannot support windows7 64-bit?

  • When I go to install xp, the menu to install xp is dimmed.

    I had to reformat my hard drive because of the many irreparable errors. I formatted the hard drive and checked, he is in good health. When I put my Windows XP installation disc there are 3 options. Option 1, which is to install XP is dimmed, and I ca