Image compression using dct(example program)

this programs outputs the  restored image, how to view the compressed image? after applying dct to the image the output is an array containing 16 bit unsigned integer, how to conert this into image??

The DCT VI expects a 2D array, and for a color image you may be actually using a 3D array (three channels - red, green, and blue). You may want to extract these channels individually and perform compression on the individual 2D layers. 
The following example demonstrates the use of the DCT on 2D array images:
http://www.ni.com/example/30769/en/
Hope that clears things up!
Rick C.

Similar Messages

  • How do I start using the example programs?

    Hi, I am trying to write a program/driver that will write and read from a couple analog output/input ports. I have a PCI-6220 and I'm running Slackware Linux.
    I've been trying to compile the examples (aiex2 is a good choice), but I can't figure out how to make it compile successfully.
    I do not consider myself a programmer (I'm a masters student of mechanical engineering), but I have modified drivers written in C for DOS before.
    Ultimately, I want to use my program/driver to control a physical system by using the analog output/input ports, and I want to do it as fast as possible. I want my program/driver to run as a real-time process.
    If there's a good reference for me to start reading, please send me a link. I can't find a good whitepaper or manual for writing drivers with the DDK.
    Thanks!
    -idbeu

    Hi,
    Here's a link to some MHDDK Knowledge bases:
    http://search.ni.com/nisearch/nisearchservlet?nistype=default&ddown=2&filter=%2Btaxonomy:knowledgebase+%2Blanguage:en&q=MH_DDK
    I don't know if they'll address your partiucular problem.  If not, could you post the compilation errors you are getting.
    DiegoF

  • How can I get information of the switched channel in an example program from NI?

    When I use the example program "niSwitch DMM Switch Synchronous Scanning.vi", I'am not able to get any information, wich channel is active. Wich block has to be used and how must I connect it to see this.
    The other one is, that te sytax for the scan list, described in the help does not switch through the channel, how has this to be modified?
    Im using a SCXI 1128 in Slot 8 of a 1052 combo chassis and the DMM is a PXI 4070 in the Slot 2.
    Attachments:
    niSwitch DMM Switch Synchronous Scanning.vi ‏145 KB

    Bigmatzeman,
    finally, i got a working solution which should suite you!
    Ok, here is what you have to do/what is missing in your setup:
    First, you can leave the modules as they are already inserted in your chassis.
    Second, you will need a special AUX-cable to synchronize the DMM and the switch. You can find infos on that here
    in the section "Single Module Scanning". Connect the cable between the
    DMM and the front connector of the switch (1331, scanadv. and
    externaltrig.)
    Third, i advise you to use the HV8-BAN4-cable to connected the signals
    to your DMM. This is because the cable is specified for the appropriate
    voltage the DMM and the switch are capable of (300 V). The connection
    of the HV8 can be done in the 1052 above the PXI-slots.
    And at last, open the example "niSwitch DMM Switch Handshaking.vi", set
    the devices to the appropriate identifiers. Select for both triggers
    for the DMM "External" and for both triggers of the switch "Front
    Connector". Change the Scanlist to "ch0:5->com0;". If you are using
    the HV8-BAN4 instead of direct front connector-connection, you have to
    change the code a bit, too: insert a "niSwitch Connect Channels" VI in
    front of the "niSwitch Configure Scan Trigger" which connects "ab0" and
    "com0".
    Ok, now the example should work correctly and you should be able to use all other SCXI modules together with your 6281.
    Hope this helps,
    Norbert
    [Edit]: My setup was 4072, 6052E, 1127 and 1011 (instead of 4070, 6281,
    1128 and 1052 as you do). But that should work just the same way.
    Message Edited by Norbert B on 08-04-2006 10:36 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Example program forces front panel screen size

    I am somewhat of a novice at LabView programming.  I used an example program as the starting point.  I expanded the front panel, added buttons and displays, and added code to do additional things.  But when the program gets to the example code, it forces the front panel screen down to its original (example) size.  The help messages talk about going to File > VI properties > screen size but none of the settings solve the problem.  The code that I wrote starts with a full screen front panel and runs fine until the program gets to the example code then the front panel shrinks.  There must be something in that portion of the code that is setting the properties.  Anyone know what is happening?

    Hi Gary,
    Anyone know what is happening?
    You already answered that on your own:
    There must be something in that portion of the code that is setting the properties.
    All you have to do is find that part of code!
    Start searching using breakpoints and step-by-step execution (aka basic debugging techniques)…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Unable to count fast pulses with DAQ(pcmcia card)AI-16E-4, using the example vi

    I am using the AI-16E-4 PCMCIA Daq card to count pulses from a device that has an open collector pulse output. I am current just trying it out to see if I can get it to count the pulses correctly before I go ahead and further develop the program. I am using the Example program for counting pulses with this device.
    What I am finding is that when I increase the pulse rate above about 20,000hz it slows down and then stops counting pulses. The documentation for this device states the max input frequency is 20mhz, therefor it should be able to count the pulses I am planing on providing. The fastest rate the device I am connected is around 2.mhz. Can someone tell me how to get the AI-16E-4
    to count these open collector pulses.
    Attachments:
    regulation_tester.vi ‏89 KB

    Hello;
    You need, first of all, to provide a pull up resistor for the open collector device, in a way that its high state fits within the TTL levels.
    Once that is done, you just connect its output to the counter source input. The device should be able to go up to 20MHz, with no problem.
    Regards
    Filipe A.
    Applications Engineer
    National Instruments

  • How to get rid of the "time out" when using DAQ AI in the example program

    I try an example file called "AcqVoltageSamples_IntClkDigRef" (Visual C++ .NET). It works great. However, if the program has not recieved the data, it sent out a timeout message. How to get rid of the "time out"? I cannot find anywhere in the code. Is this a property I have to reset somewhere else?
    Thank you,
    Yajai.

    Hello Yajai,
    The example program will use the default value for timeout, 10 seconds. To change this, you will have to set the Stream.Timeout value. I inserted this function into the example and set it equal to -1, and the program will wait indefinitely for the trigger signal without timing out. Please see the attached image to how this was implemented.
    I hope this help. Let me know if you have any further questions.
    Regards,
    Sean C.
    Attachments:
    SetTimeout.bmp ‏2305 KB

  • Can I use Photoshops example images on my companies web site?

    On the Photoshops CD, there is a lot of example images, Can I use these example images on my companies web site?

    Here's the process to roll back:
    First, I recommend backing up your Firefox settings in case something goes wrong. See [https://support.mozilla.com/en-US/kb/Backing+up+your+information Backing up your information]. (You can copy your entire Firefox profile folder somewhere outside of the Mozilla folder.)
    Next, download and save Firefox 3.6 to your desktop for future installation. http://www.mozilla.com/firefox/all-older
    Close Firefox 4.
    You could install Firefox 3.6 over it (many have reported success) or you could uninstall Firefox first. If you uninstall, do not remove your personal data and settings, just the program.
    Unless you have installed an incompatible add-on, Firefox 3.6 should pick up where you left off. If there are serious issues, please post back with details.
    Note: I haven't actually tried this myself!
    Does that resolve the NASA issues?

  • Need a simple example program code to use SF_EXAMPLE_01

    Hi all,
    I have just try to learn smartforms. As i have SAP NW4 for learning.
    I found SF_EXAMPLE_01 in the system.
    Can any body help me out how to use this example in abap program code?
    Thanks.
    rob

    Smart Forms, try this steps.. it will teach you how to create smart form and how to use it.
    1) Tcode --> SmartForms
    2) Form name --> Z_SF_TEST Create
    3) Under Global settings
    a) Form Interface  
        Table Tab
       ITAB LIKE EKPO
    b) GLOBAL Definitions
    WA_NETPR LIKE EKPO-NETPR
    In smart forms if we want to display quantity and currency fields. We can't directly display currency field and quantity fields
    For that we have to create an extra variable in global definitions
    Ex: netpr FIELD of EKPO
    CREATE program lines and specify WA_NETWR = itab-netpr.
    4) RT CLick on main Window
       CREATE --> TABLE
      Click Table painter
    DEFAULT %LTYPE will be Created
    a) If you want more like Header footer etc add by rt click on %LTYPE1
    Table (Tab)
    %LTYPE  Radio(SELECT) 5 CM 5 CM 6 CM
    CLICK on DATA (Tab)
    INTERNAL TABLE ITAB LIKE ITAB
    5)RT click on table control and create --> program lines
    General attribute (Tab)
    INPUT PARAMETER               OUTPUT PARAMETER
    itab                               WA_NETPR
    Code Area
    WA_NETWR = ITAB-NETPR.
    6) RT CLcick on table ctl and create 3 text to display the fields
    a) % text1 +button(insert field)
       FIELD name &itab-ebeln&
    Output options (tab)
    Check New line   LINETYPE   %Ltype1
    check new cell
    b) % text2
       & itab-ebelp&
    output options
    check new cell
    c) % text2
       & wa_netpr&
    output options
    check new cell
    Report ac
    Tables ekpo.
    Data: itab1 like ekpo occurs 0 with header line.
    select * into table itab1 from ekpo.
    Call function module   "to know function module name goto smartform and execute the smart form name it will give you the function module name.
    If your question is answered, close the thread and reward all useful answers...
    Regards,
    Sairam

  • Error in compiling boost example program using sun studio 12

    I am trying to compile the below example program from boost using sun studio 12 C++ compiler.
    #include <boost/interprocess/shared_memory_object.hpp>
    #include <boost/interprocess/mapped_region.hpp>
    #include <cstring>
    #include <cstdlib>
    #include <string>
    int main(int argc, char *argv[])
    using namespace boost::interprocess;
    if(argc == 1)
    {  //Parent process
    //Remove shared memory on construction and destruction
    struct shm_remove
    shm_remove() { shared_memory_object::remove("MySharedMemory"); }
    ~shm_remove(){ shared_memory_object::remove("MySharedMemory"); }
    } remover;
    //Create a shared memory object.
    shared_memory_object shm (create_only, "MySharedMemory", read_write);
    //Set size
    shm.truncate(1000);
    //Map the whole shared memory in this process
    mapped_region region(shm, read_write);
    //Write all the memory to 1
    std::memset(region.get_address(), 1, region.get_size());
    //Launch child process
    std::string s(argv[0]); s += " child ";
    if(0 != std::system(s.c_str()))
    return 1;
    else
    //Open already created shared memory object.
    shared_memory_object shm (open_only, "MySharedMemory", read_only);
    //Map the whole shared memory in this process
    mapped_region region(shm, read_only);
    //Check that memory was initialized to 1
    char mem = static_cast<char>(region.get_address());
    for(std::size_t i = 0; i < region.get_size(); ++i)
    if(*mem++ != 1)
    return 1; //Error checking memory
    return 0;
    Using the below command :
    CC -c 1.cpp -I/home/syogacha/satish/boost_1_43_0 -library=stlport4
    "/home/syogacha/satish/boost_1_43_0/boost/interprocess/shared_memory_object.hpp", line 284: Error: The function "shm_open" must have a prototype.
    "/home/syogacha/satish/boost_1_43_0/boost/interprocess/shared_memory_object.hpp", line 307: Error: The function "shm_unlink" must have a prototype.
    "/home/syogacha/satish/boost_1_43_0/boost/interprocess/mapped_region.hpp", line 549: Error: Formal argument 1 of type char* in call to shmdt(char*) is being passed void*.
    3 Error(s) detected.
    I even tried to include sys/mman.h but got the same compilation errors.
    Do we need to take care of few other specific things while using boost headers.
    Thanks in advance ...

    Hope this helps....
    #include <sys/mman.h>
    #include <boost/interprocess/shared_memory_object.hpp>
    #include <boost/interprocess/mapped_region.hpp>
    #include <cstring>
    #include <cstdlib>
    #include <string>
    #include <iostream>
    #include <iterator>
    int main(int argc, char *argv[])
    {      //main
            using namespace boost::interprocess;
            if(argc == 1)
            {  //Parent process
                    //Remove shared memory on construction and destruction
                    struct shm_remove
                            shm_remove() { shared_memory_object::remove("MySharedMemory"); }
                            ~shm_remove(){ shared_memory_object::remove("MySharedMemory"); }
                    } remover;
                    //Create a shared memory object.
                    shared_memory_object shm (create_only, "MySharedMemory", read_write);
                    //Set size
                    shm.truncate(1000);
                    //Map the whole shared memory in this process
                    mapped_region region(shm, read_write);
                    //Write all the memory to 1
                   std::memset(region.get_address(), 1, region.get_size());
                    //Launch child process
                    std::string s(argv[0]); s += " child ";
                    if(0 != std::system(s.c_str()))
                    return 1;
            else
                    //Open already created shared memory object.
                    shared_memory_object shm (open_only, "MySharedMemory", read_only);
                    //Map the whole shared memory in this process
                    mapped_region region(shm, read_only);
                    //Check that memory was initialized to 1
                    char *mem = static_cast<char*>(region.get_address());
                    for(std::size_t i = 0; i < region.get_size(); ++i)
                    if(*mem++ != 1)
                    return 1;   //Error checking memory
            return 0;
    }

  • How to used parameter in example program with visaul basic

    i have some proplem about away to used parameter in visual basic example program for ex. As Status ,As ViSession because it can't complier

    Jone –
    Greetings from National Instruments! I hope you are finding your use of the Developer Exchange discussion forum advantageous. We really believe that this is a great resource for programmers to gather and work with each other, sharing tips and working together to answer questions.
    I am not 100% sure about which specific Visual Basic you are inquiring. However, the NI-VISA User Manual contains many specific Visual Basic examples that I think would greatly help you in these programming pursuits. I would suggest that you take a look at this link (http://digital.ni.com/manuals.nsf/websearch/266526277DFF74F786256ADC0065C50C?OpenDocument&node=132100_US), specifically Appendix A. There you will find many examples, including specific declarations,
    which I think is the point of your entry here.
    I hope that this helps you out! Thanks again for your support of National Instruments and your use of the Developer Exchange!!
    Best Regards,
    Greg Wempe
    Applications Engineer

  • Using a mobile program to interpret Archived media

    Hopefully i'll make this clear;
    I'm developing a program in Java ME that will provide a variety of media to the mobile user. They will navigate by way of a map, which will have 'hotspots' on it. When a hotspot is activated, they will be able to view a variety of media, from text to images and small soundbytes.
    The actual content will be written by scholars; my job is to create a program that allows them to write the content, and then drop it into the delivery system (also devised by me) and distribute it. The data itself may be changed, and as such, it must be possible to reload and edit the data.
    What I had in mind to solve my dilemma was a program with a standard swing interface which allows the scholars to enter their data into the system. Then, what I wanted to do was to 'grab' a pre-prepared ME program, and then use the Jar editor in Java to enter my media into the Jar file. In theory, this will also allow me to compress some of the text, saving valuable space.
    However, I'm not certain how to go about:
    1) Changing the Jar file. Will I also need to make changes to the Jad file? Will there be other changes?
    2) How to get my media (images, audio, text) into the program once this has been accomplished.
    Also, are there any additional API's for Java ME that I could safely assume are on most Java capable phones? The base ME API's are a little bare to say the least.
    Any and all assistance in this is very much appreciated.
    -Dave

    Hi,
    According to
    Why can't I find or install an app from the Windows Store?
    If you can’t install an app and are using a mobile connection, it may be because you are on a metered connection. By default, tethered and mobile broadband connections are metered, meaning you can be charged by the amount of data you use. To switch your
    connection to unmetered:
    Step 1: Swipe in from the right edge of the screen, and then tap Settings.
    (If you're using a mouse, point to the upper-right corner of the screen, move the mouse pointer down, and then click Settings.)
    Step 2: Tap or click Change PC settings, tap or click Network, and then tap or click Connections.
    Step 3: Tap or click the connection you want to change, and then, under Data usage, turn Set as a metered connection on or off.
    If this method was no use, please feel free let me know.
    Roger Lu
    TechNet Community Support

  • Extracting information about image compression settings

    Hi,
    Is there any way using SDK 7.0.5 to determine what image compression settings were used for color, grayscale, and monochrome images for a given pdf file?
    Also, is it possible to determine which color management policy was used?
    Thanks,
    Daniel Sheiner

    Okay, Distiller was a bad example. The same range of settings are available for exporting PDFs from Word. What if someone converted a Word document to a PDF?
    Supposing some or most of the information I'm looking for is lost, how much can I infer? For example, if a given PDEImage has the PDEColorSpace DeviceRGB or CalRGB, that at least tells me the user didn't select Color Management Policies -> Convert All Colors to CMYK. It would actually be tremendously helpful if you could tell me which other ColorSpace names, if any, would indicate the user didn't select Convert All Colors to CMYK.
    It would also be quite helpful to know if there is some indirect way to determine that a given color or grayscale PDEImage has not been compressed using ZIP, or that a monochrome PDEImage has not been compressed using CCITT Group 4.
    Thanks!

  • Re-size an image in using the Image class?

    Is there a way to resize an image using the com.day.cq.wcm.foundation.Image class?  I wanted to extend the foundation image componet and have it resize to a specific height and width.  Is there a way to change the size of the image before you call image.draw(out) ?

    You also don't want to insert you resizing efforts prior to calling the image.draw method. The draw method doesn't actually render the image,  it draws the HTML img tag that your components print out. If you were to use the ImageHelper to get the layer and resize it that would not actually change the size of the image.
    Now that img tag will contain a URL to the image, and that URL will generally look something like this (unless you have customized your image components):
    /path/to/your/page/_jcr_content/par/textimage/image.img.jpg/1323947520848.jpg
    This URL is going to trigger a script or servlet that will be responsible for rendering the image. In the example above because the textimage component extends the parbase component and because URL includes the img selector it will end up triggering the servlet at /libs/foundation/components/parbase/img.GET.java. If you go into CRXDE Lite you can go to this file and look at the source code of this servlet and see an example of how it uses the layer to resize the image if that author edited the image in the smart image widget.
    You can also see example of servlets that resize and image ot specific preset sizes (as you want to do) you can look at /apps/geometrixx-outdoors/components/product/image/thumbnail.GET.java and /apps/geometrixx-outdoors/components/product/image/nav.GET.java.
    So what you would want to do is something like this:
    Create your own component at /apps/mysite/components/foo
    Create a servlet at /apps/mysite/components/foo/bar.GET.java - put your logic to resize the image here based on some of the examples
    Create your component JSP at /apps/mysite/components/foo/foo.jsp
    Create your component's dialog and in this dialog include a smart image widget - make sure you store your image on component node, not a sub-node. If you store your image on a sub-node you need to make sure the sub-node includes the same resource type as your main node).
    In your component JSP when you create your foundation Image object make sure to image.setSelector("bar") before you call image.draw()
    That should result in an image URL that looks like /path/to/your/page/_jcr_content/par/textimage/image.bar.jpg/1323947520848.jpg
    Those steps aren't tested - so I may have missed something or mistyped something, but it should point you in the right direction.

  • Report to check authorization object used in customized programs

    Hi Guys,
    An auditor came and he raised a question to us, he asked whether all of our customized transactions and programs are maintained with authorization checks? The question is how can we check what authorization objects are used for our customized programs and transaction codes? The developer did not maintain the objects used for that program in SU24 table. Is there a program or a report to show us all the authorization object used for a customised program or transaction? Example : T-code MIGO we can check in SU24 table for all the authorization object used. How do we check for customized tcodes? Please advise. Thanks!
    Edited by: Jarod Tan on Nov 25, 2010 9:42 AM

    Note that some programs are built in such a way that no (visible) auth check is necessary, or even desired at all.
    To determine the necessity of an auth check, you should check that starting it has an entry point (tcode, rfc, service) which is appropriately restricted. The rest (whether and where and how a further check is evaluated) is entirely dependent to what the program actually does.
    Well designed applications generally have centralized functions and methods, and the checks are in there or a "base check" they use.
    Others again use the same in UI programming to determine the visibility of functions, to make the application more intuitive for the user. This on it's own is however not a sufficient auth check to rely on.
    Code review is an art form!
    Cheers,
    Julius

  • How to use another java program to stop this running prpgram???

    Dear Sir:
    I have following code and I run it success,
    import java.util.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.*;
    public class CertainAndRepeatTime{
      public static void main(String[] args) throws IOException{
        int delay = 1;
        Timer timer = new Timer();
        ActionListener actionListener = new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              System.out.println("Hello World Timer");
        System.out.println("What do you want (Certain time or Repeat time)?");
        System.out.print("Please enter \'C\' or \'R\' for that: ");
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String ans = in.readLine();
        System.out.print("Please enter  ans=" + ans  + " IsTrue=  " + (ans.equals("R") || ans.equals("r")) +"\n");
        if (ans.equals("C") || ans.equals("c")){
          //System.out.println("This line is printed only once start...");
          timer.schedule(new TimerTask(){
            public void run(){
              System.out.println("This line is printed only once.");
          },delay,1);
        else if(ans.equals("r") || ans.equals("R")){
            timer.scheduleAtFixedRate(new TimerTask(){
              public void run(){
                System.out.println("This line is printed repeatedly.");
            },delay, 1000);
          while(true){
               //System.out.println("Charles print This line is printed repeatedly.");          
          } //This will make your main thread hang.
        else{
          System.out.println("Invalid Entry.");
          System.exit(0);
        System.exit(0);
    }But I hope to use another java program to stop it when it is running instead of pressing CRTL + C to stop it.
    How to do it??
    Any example??
    Thanks a lot!!

    Sorry, I think i did not express cearly. It is my fault.
    I re-write my requirements again:
    I have
    Class AAA1.java,
    Class AAA2.java,
    Class AAA3.java,
    Class AAA20.java...
    etc
    they all look like the program I posted first time,, once executed, they will run for ever, and they will be stopped until I press CRTL + C;
    Now I hope to use another java class StopProgram.java to stop them 1 by 1 or at once instead of pressing CRTL + C;
    In this case, how to code this StopProgram.java ??
    Thanks

Maybe you are looking for

  • How to print two sides with one page?

    I have a PDF that is one page long and I'd like to print the same thing twice (front and back) on one page. Can I do that? I've tried printing two copies with the printer set to double-sided, but it just printed two sheets with one side on each sheet

  • HT1296 how do i sync my ipod touch with windows media player?

    so.....................any ideas????

  • Checkbox cant be updated in ALV Grid

    Hi in my requirement, ALV Grid contains checkbox, when I check that, the internal table for checkbox is not updated. In code I am writting: Final Internal Tbale: Data:   BEGIN OF T_FINAL occurs 0,         CHK_BOX,         END OF T_FINAL.   LS_FIELDCA

  • Deployed J2EE application successfully. But cannot access the application

    I installed SAP Netweaver 2004s and tried to create a Web application and an ear file looking at the example given at http://help.sap.com/saphelp_nw04/helpdata/en/7f/5c93acbd1343d4be7d79dc298faa7b/frameset.htm I followed all the steps listed there. T

  • My USA iPad and how to get a specific app? (I'm British)

    I bought an iPad in the USA because it was cheaper and I got tax back. I think the iPad is identical to a British model, except for things like the dollar sign etc! I want an app called OnLive Desktop - but apparently it is not available to me in my