Include rotation angle in a style?

I do a lot of photo credits where a text box is rotated 90 degrees up the photo, like this:
Anyway, is there a way to specify a style (either character, paragraph or object) that automatically rotates the text box 90 degrees so I can save this style? I figure it should be an object style, but I'm just missing it.
Thanks.

Here is the script.
It works here on my french system but was not tested elsewhere, so let's hope for the best.
//text-2-©
//  An InDesign CS3 JavaScript
// Takes a paragraph of text and puts it in 90° anti-clockwise rotated autosized block with object style
// The two or three lines that need to be edited are noted thus : TO BE EDITED
main() ;
function main() {
// testing if a document exists
     if (app.documents.length != 0) {
          // testing if we have a selection
          if (app.selection.length > 0) {
               // testing the kind of selection we got
               switch(app.selection[0].constructor.name) {
                    case "InsertionPoint" :
                    case "Character" :
                    case "Word" :
                    case "Line" :
                    // for these 4 cases, we nee to select the entire paragraph before going on
                         func_SelectionParagraphe() ;
                         func_PassageBlocCopyright(app.selection[0]) ;
                         break ;
                    case "Paragraph" :
                    // correct case, we can go on without touching anything
                         func_PassageBlocCopyright(app.selection[0]) ;
                         break ;
                    case "Text" :
                    // counting paragraphs before deciding what to do
                         if (app.selection[0].paragraphs.count() > 1) {
                              // too many paragraphs, alert the user and abort.
                              alert ("Too many paragraphs. Place the selection inside one paragraph and try again.") ;
                         else {
                              // correct number of paragraphs, going on
                              func_SelectionParagraphe() ;
                              func_PassageBlocCopyright(app.selection[0]) ;
                         break ;
                    case "TextStyleRange" :
                         // bad case, alert the user and abort
                         alert ("Text was found \"" + app.selection[0].constructor.name + "\" note the selection" ) ;
                         break ;
                    default :
                         // pas de texte dans la sélection, alert the user and abort
                         alert ( "Place the cursor in a text paragraph. \"" + app.selection[0].constructor.name + "\"" ) ;
                         break ;
          // cursor not in text, alert the user and abort.
          else { alert ("Place the cursor in a text paragraph. Try again.") ; }
     // no open document, alert the user and abort
     else { alert ("No open document. Open one and try again.") ; }
function func_SelectionParagraphe() {
     // making sure that the full paragraph is selected
     app.selection = app.selection[0].paragraphs[0] ;
function func_PassageBlocCopyright(monCopyPara) {
     var monDoc = app.documents[0] ;
     // we assign the name of the objectStyle. NEEDS TO BE EDITED
     var monStyle = monDoc.objectStyles.itemByName("bloc - copyright") ;
     var monBlocCopy = monDoc.pages.item(0).textFrames.add() ;
     // we assign a default size to the box. MAY NEED TO BE EDITED
     monBlocCopy.geometricBounds = [50, 50, 100, 150] ;
     monBlocCopy.textFramePreferences.ignoreWrap = true ;
     monBlocCopy.contents = monCopyPara.contents ;
// we check if the text begins with a '©', if not we add it at the start
     app.findGrepPreferences = app.changeGrepPreferences = null ;
     app.findGrepPreferences.findWhat = "^\\s+" ;
     monBlocCopy.changeGrep() ;
     app.findGrepPreferences.findWhat = "\\s+$" ;
     monBlocCopy.changeGrep() ;
     app.findGrepPreferences.findWhat = "^([^~2])" ; // ~2 = copyright
     app.changeGrepPreferences.changeTo = "~2 $1" ;
     monBlocCopy.changeGrep() ;
     app.findGrepPreferences = app.changeGrepPreferences = null ;
// adjusting the size of the block, now that the text is complete
     monBlocCopy.applyObjectStyle ( monStyle, 1, 1 ) ;
     if (monBlocCopy.overflows) {
          monBlocCopy.textFramePreferences.ignoreWrap = true ;
          monBlocCopy.fit ( FitOptions.frameToContent ) ;
          monBlocCopy.textFramePreferences.ignoreWrap = false ;
     } else {
          monBlocCopy.fit ( FitOptions.frameToContent ) ;
// rotating the block
     monBlocCopy.absoluteRotationAngle = 90 ;
     // selecting the block, and putting it at the center of the screen,
     app.selection = monBlocCopy ;
     app.cut () ;
     app.paste () ;
     // selecting the black arrow tool. NEEDS TO BE EDITED FOR LANGUAGE
     app.menuActions.itemByName( "Outil Sélection" ).invoke () ;
     // removing the original paragraph.
     monCopyPara.remove() ;

Similar Messages

  • Find the rotation angle for an 8bit grayscale image

    Hi all,
    I have an 8bit grayscale image of dimension 3969 X 600, the image is slightly tilted. i need to find the rotation angle and apply the rotation before i do the processing.
    Is there any transformation functions readily available in LabVIEW to find the rotation angle?
    Need your suggestions folks,
    Regards,
    KM
    Solved!
    Go to Solution.

    Hi Klemen,
    Thanks for your time,
    I am not sure which points i need to use as reference to calculate the degree of rotation, is there any functions available to calculate the rotation, I have attached the 2d array of image. I need a little more help.
    Can i use the vi (rotate 8bit) which can be found in the following link below?
     http://www.ni.com/example/26943/en/
    Regards,
    KM
    Attachments:
    2d array1.xlsx ‏3561 KB

  • Is it possible to get out the rotation angle between template and shape using shape matching.vi?

    I want to determine the orientation of a particle shape.
    Using pattern matching is influenced by the texture of the particle.
    Shape matching would be the right but I don't see a possibility to get the rotation angle of the found shape and template respectively.
    Any idea?

    You could try using particle analysis to give you the particle orientation. There is an example of this that ships with the Vision toolkit. Go to the Vision examples and look under Funtions>Binary Analysis and it is called Particle Orientation Example.
    Cheers,
    JRA
    Application Engineer
    National Instruments

  • Using Javascript to rotate images with the style.backgroundImage property & I leave the onload pg & return, the images have trouble loading.

    I'm using Javascript to rotate background images -->
    function rotateImages() {
    setInterval("startRotator()", 7000);
    var counter = 0;
    function startRotator() {
    var images = ["images/finance1.jpg","images/finance2.jpg","images/finance3.jpg","images/finance4.jpg","images/finance5.jpg","images/finance6.jpg"];
    if( counter >= images.length ) {
    counter = 0;
    var image = "url('" + images[counter] + "')";
    counter++;
    document.body.style.backgroundImage=image;
    The script is triggered by the load event when the homepage loads and the script only runs on the homepage. Everything works fine upon opening the homepage.
    If I leave the home page and return, the images will have trouble loading for about 3 to 5 cycles and I'll get white backgrounds for part of the time. The same thing happens if I enter the site from a page other than the homepage and then go to the homepage.
    I discovered, however, that if I enter the site at the homepage and then leave the homepage and return using the back button, everything runs fine. Apparently it then accesses a cached version of the homepage? Seems having two cached versions creates a conflict?
    This problem only happens with Firefox (I have ver 29.0.1). It does not happen on IE ver 11, Chrome ver 34, or Safari ver 5.1.7.
    I get the same problem with XP, Win7, and Win8 but, only on Firefox.
    Can you please fix this?

    Hey, I am trying to reproduce this here: [http://jsfiddle.net/u3TLb/]
    Mozillazine forums and the [http://webcompat.com] are more specialized in Web Compatibility, please ask there as well.

  • IPhoto Questions (including rotating movie & save locations)

    I've owned my new Macbook Pro for a little over a month now. Prior to this I have been using Linux (Red Hat, SuSE, Ubuntu, etc...) on my primary computer and MS Windows for many, many years. I am very used to the way Linux and Windows handle files including imported photos. Prior to my Macbook purchase, I was managing my iPhone and iPad with Windows 7. Please pardon my Mac OS X ignorance. I am new to this.
    Here's my hardware:
    Macbook Pro 15" Retina 512gb (mid 2014) with OS X 10.10.1
    iPhone 5s (16gb)
    iPad 4 retina (64gb)
    Now the questions... When I import photos from my iPad or iPhone into iPhoto, the photo's do not go into the "Pictures" directory unlike Windows. I did some research and apparently iPhoto stores your photos in a database similar to the way iTunes works with music. However, unlike iTunes, you cannot browse the .jpg's and .mov's in the finder, you have to open them in iPhoto to see them. This creates a problem for me in that I can't back up my photos manually anymore to an external hard drive. I have to rely solely on Time Machine. I don't like that. Also, I'd just like to be able to browse my photos in finder. I want access to the .jpg's and .mov files so that I can copy them to USB thumb drives, etc... Is there a way to import your photos from the iPhone or iPad into the "Pictures" folder on my Macbook, then into a date sub folder similar to the way Windows imports photos? This would be preferable for me because I want access to the original files in finder, not just through iPhoto. If there is an "open in finder" option in iPhoto, obviously the photos are stored in folders on the Macbook. Why can't you just browse them from finder without using iPhoto? iTunes lets you do this. Is there a setting in iPhoto that I am missing that will allow this? If not there should be one similar to the iTunes "keep iTunes media folder organized" option.
    Also, when I have to rotate a movie that is located in the iPhoto library, I know that I can click "open in finder" from iPhoto and open the .mov in Quicktime to rotate the movie. However, when saving (there's no save option, you have to close and are prompted to export) there is no option to save in the original location and rewrite the movie in iPhoto. The only option is to store in one of the browsable file folders (Movies, Pictures, Documents, etc...). Consequently, when opening iPhoto, the movie file remains in the original rotation, unchanged. How do I have Quicktime save to the original location of the movie in the iPhoto library? You can not open iPhoto Library.photolibrary from within Quicktime and browse to the folder containing the original movie. This is mind boggling to me. I suppose I could delete the original movie in iPhoto and import the rotated movie into iPhoto, but this seems like a huge waste of steps, time and is really inefficient.
    I don't like not having control over my photos. I'd like to be able to view all of them in my finder. Am I missing a preferences setting or something? Any help would be greatly appreciated.

    I don't like not having control over my photos. I'd like to be able to view all of them in my finder.
    You have far more control over your Photos with iPhoto than with the Finder. But you can simply use the Finder or any other app to manage your photos, iPhoto is not compulsory in any way. If you are going to use iPhoto then there is a conceptual leap to make, and then it begins to make sense.
    That leap is this: that Jpeg is not your Photo. That .doc file is not your novel. That .mp3 is not the song. In each case, these files are containers for the data - with characteristics attuned to the nature of the data, sure - but your data is the photo, the novel, the song. Or put another way, they're the shoebox, your data is the shoes.
    iPhoto is about the Photo and not the file. If you want to manage files by all means do, and best to use a file manager. iPhoto is for managing Photos. The best analogy I can come up with is the Contacts.app. (and like all analogies, it's limited but here goes.) The Contacts.app is a central store and repository for anything to do with your address book, emails, phone numbers. Somewhere on the HD is a file or files with all this data, but you never go there. You either use the Contacts.app or any of the many hooks built-in to the OS to access, edit, share and manipulate this data.
    Now try the same with iPhoto: iPhoto is a central store and repository for anything to do with your photos. Somewhere on the HD is a file or files with all this data, but you never go there. You either use iPhoto or any of the many hooks built-in to the OS to access, edit, share and manipulate this data. So, iPhoto replaces the file manager for anything to do with your photos, because it's about the photos and not the files.
    Coming from Windows and Linux, especially, this level of abstraction can be confusing, but that's what it is. Added to this is the level of virtualisation used in iPhoto - all edits are virtual until you export - the non-destructive editing feature can also be confusing. But that's why iPhoto can't be navigated via the Finder. Comparing it with iTunes, which has no editing, is not comparing like with like. iPhoto will always preserve your original data - the photo as shot.
    To specifics:
    For help accessing your photos in iPhoto see this user tip:
    https://discussions.apple.com/docs/DOC-4491
    This User Tip
    https://discussions.apple.com/docs/DOC-4921
    has details of the options in the Export dialogue.
    This creates a problem for me in that I can't back up my photos manually anymore to an external hard drive.
    Of course you can. Simply Export them. File -> Export. Now you can choose exactly what to export: the original, an edited version, if different qualities and different formats. But again, simply backing up a version of the photos is not really backing up your work, just the raw data. So you need to back up the Library as well.
    have to rely solely on Time Machine. I don't like that.
    No you don't.
    Most Simple Back Up:
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex: Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
    Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store
    Is there a way to import your photos from the iPhone or iPad into the "Pictures" folder on my Macbook, then into a date sub folder similar to the way Windows imports photos?
    Two ways:
    1, With iPhoto you can run a Referenced Library. But I cannot urge you enough not to do this. iPhoto does not have the tools to manage this and you're only strong up grief for further down the road. It's unnecessary and only makes more work for exactly zero advantage.
    For more on iPhoto and file management see this User Tip:
    https://discussions.apple.com/docs/DOC-6361
    2. Use some other system for managing your photos. Image Capture (in the Applications Folder) will get your images from your camera/phone/whatever and put them wherever you like. Just don't use iPhoto.
    However, when saving (there's no save option, you have to close and are prompted to export) there is no option to save in the original location and rewrite the movie in iPhoto.
    Again, this has got to do with non-destructive  processing and that's why you're better importing movies to iMovie and processing them there and then exporting them to the finder, and only when you've finished them, importing them to iPhoto. (Or just not shooting video in portrait).

  • How do you export & print photos that have been cropped/rotated/angled?

    I have found that if I straighten a photo in Lightroom and then export it, it will not print correctly.  The photo will print with the edges of the photo not straight with the borders of the paper.  The angle the photo is printed askew is the same angle that I used to straighten the photo.
    This is only apparent on prints with borders, but I assume it is happening on borderless prints as well.

    Jay_Brennan wrote:
    I then applied the photo settings to the other two images.
    How did you so this? Did you use <Sync> in the Develop Module? Make sure when you press <Sync> that in the dialog that comes up <Lens Correction / Transform> is checked.
    Jay_Brennan wrote:
    On a related note, how do I discard all changes made to a photo in Lightroom and revert back to the original image?
    Hit <Reset> bottom right corner, just above the film strip in develop Module.

  • Gradient fill not displayed correctly after applying a rotation angle

    Hello,
    I've created a rectangleframe and applied a gradient fill, and afterwards I have applied a rotation of -90 to the gradient fill. After the rotation the gradient does not display correctly anymore (after saving the document to .idml I've noticed that the property GradientFillLength was not recalculated after rotation). Is there a command to force the update or am I missing something? This problem occurs in InDesign CS3/CS4.
    Thank you
    UIDList targetList(m_SplineUIDRef);
    InterfacePtr<ICommand> applyCmd(Utils<IGraphicAttributeUtils>()->CreateFillRenderingCommand(
                    gradientUid, &targetList, kTrue, kTrue));
    CmdUtils::ProcessCommand(applyCmd);
    InterfacePtr<ICommand> angleCmd(Utils<IGraphicAttributeUtils>()->CreateGradientFillAngleCommand(
                    gradientAngle, &targetList, kTrue, kTrue));
    CmdUtils::ProcessCommand(angleCmd);

    Thanks. I saw those threads but this is not that issue. I really think that this is a bug in the latest update for illustrator.

  • N95 update includes Rotate me lol

    If you update the N95 to V30
    in the settings you can now set the screen to rotate
    basicly it is what Rotate Me did
    so all the peeps who could not get it signed can now have it on V30 with the update
    it may not be Rotate me but it does the same orientates the screen to how you hold the phone
    N96 has it too now
    Nokia user / modder since Nokia Orange and Mobira user too before that

    Yep it sure does but this has been known for a while, where have you been?
    Grayburn @ www.nokiausers.net & www.dailymobile.se....come say Hello!!!
    If you appreciate ANY help from a member,then show it by clicking on the Blue Star button, cheers

  • Trouble trying to rotate a gradient in Flash

    I understand that making a rectangle in object drawing mode
    and then filling that rectangle with a gradient fill that I can
    then rotate that fill using the Gradient Transform Tool. The
    problem is it is out of control when I select the corner rotate
    handle: It does not constrain to 90 degrees when I hold the shift
    key down and the indicators that show the rotate angle on the stage
    disappear off the screen in a strange fashion.
    Something is wrong but I've never used this feature before
    and wondered if someone with experience using edits to gradient
    fills in Flash could set me straight.
    TIA,
    Ken

    Give your "box" an #ID and .class name.
    #divName {
    your main CSS styles here
    .unique_style {
    width: 400px;
    padding: 12px;
    <div id="divName" class="unique_style">
    </div>
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • Rotating object to follow mouse

    Okay, say I have an object (a bee in this case) that I want
    to follow the
    mouse around, that part's easy:
    property my,oldLoc
    on beginSprite me
    my = sprite(me.spriteNum)
    oldLoc = my.loc
    end
    on exitFrame me
    my.loc = the mouseLoc
    if diff(my.locV,oldLoc.locV) + diff(my.locH,oldLoc.locH)
    > 5 then
    my.member = "BeeBuzz"
    else my.member = "BeeStill"
    oldLoc = my.loc
    end
    It even includes a cute little function to make the wings
    buzz when it's
    moving, and not when it's standing still. The tricky part is
    I want to have
    some way of making the bee rotate to move in the direction
    the mouse moves.
    This seems to *almost* work, except that when the locV
    doesn't change, it
    results in a divide-by-zero error:
    my.rotation = atan((oldLoc.locH - my.locH) / (oldLoc.locV -
    my.locV)) *
    57.2958
    I could check and artificially add a small amount to avoid
    the
    divide-by-zero, but that seems like a hash. Is there a better
    way to do
    this correctly?
    (And does anybody mind if I rant a bit about how all rotation
    properties in
    the program operate in degrees, while all the trig functions
    operate in
    radians? And the program doesn't include a method to convert
    between them
    either. That's just annoying.)

    Thanks. I generally try to avoid the Library behaviors
    because I've found
    that they mostly seem to be 98% unnecessary error-checking
    and 2% functional
    code, and it can often be very difficult to find and extract
    that tiny
    little bit of code that actually DOES anything. However, in
    this case I was
    able to pull a bit of useful code out of the Turn Towards
    Mouse behavior -
    extremely simplified of course. It didn't work at all out of
    the box. For
    the record, the code I used looks like this:
    angle = GetAngle(oldLoc - my.loc) - 90
    if my.rotation <> angle then my.rotation = angle
    With the following code copied (mostly verbatim, but
    simplified) from the
    Turn Towards Mouse:
    on GetAngle slope
    deltaH = slope[1]
    deltaV = slope[2]
    if deltaH then
    slope = float (deltaV) / deltaH
    angle = atan (slope)
    if deltaH < 0 then angle = angle + pi
    else
    if deltaV > 0 then angle = pi / 2
    else if deltaV < 0 then angle = (3 * pi) / 2
    else angle = 0
    end if
    return (angle * 180) / pi
    end GetAngle
    It seems to do pretty much what my original code did, only it
    considers
    those divide-by-zero situations separately as special cases.
    Still seems
    like more code than should be necessary to do what it does -
    this feels like
    the sort of thing that should be possible with 1-2 lines of
    code, but
    apparently it's not that simple...

  • Questions about using Styles Window for formatting a book in Apple Works.

    Help says "You can create your own styles in any document type." Not clear on how to do that.
    I wish to have one Style or group of Styles associated with one document of say 500 pages for a book. Each chapter Heading. as a single column layout, is separated by Section Breaks from previous and following text in 2 column layout.
    Question 1. How do I make Styles window settings (Edit/Done) specific for this entire document? Can I edit settings in Styles window and have them remain specific and locked to this particular document? Or are the Styles window settings constant across all documents?
    Question 2. (If Styles window settings are not specific and locked to this document) Do I need to make a NEW Style for each purpose within the document, as in Book Heading, Book Subheading, Book Body, Book special paragraph style, and etc.
    Question 3. When importing multiple sections of the work (by copy and paste) from other AW documents how can I have the imported text follow the book’s Style settings (and vice versa how to keep tab settings that are specific in some areas). Sometimes the imported work refuses to conform to the Book document’s style say line spacing for instance.
    Thank you
    Hilary Fish
    iBook G4 Mac OS X (10.4.8) AppleWorks 6.2.9

    Hi Hilary,
    I haven't used styles enough to give definitive answers to your questions, but I'm sure others will join in and correct any errors in what follows.
    A "Style" is essentially a set of paragraph level format settings that can be collectively applied to a paragraph or contiguous set of paragraphs as a set, rather than having to apply each attribute individually. Once a style is applied to various parts of a document, changes made to the style specification will apply to every part of the document to which that style has been applied.
    AppleWorks also includes two other types of Styles—Outline styles (Diamond, Harvard and Legal), used to identify hierarchical levels of paragraphs, and Table styles, used to format tables.
    Question 1: From the Help article "Using Styles":
    You can copy the collection of all the styles available in a document and make them available in another document. This is called exporting and importing a stylesheet.
    I read this as saying that styles you create are specific to the document in which they are created, but may be exported to other documents. "Other documents" would includes documents saved as templates, which could be used to create the various sections of a book.
    Question 2:
    As the set of styles is specific to the document it is created in (or into which it is imported), you can probably leave "Book " off the names of the styles (but may decide that leaving it on makes it easier to know what the styles are for). You will need to use an existing style or create a new one for each purpose within the document.
    Question 3:
    Copy copies the text AND formatting of the selected material.
    Paste pastes the text AND formatting of the selected material.
    Paste also inserts the pasted material into the target document at the insertion point. All of the pasted material goes into the same Section. If the pasted material includes a section break, then a new section will be created in the target document.
    If you export the set of styles from the master document and apply them to the parts of the source document before transferring the material to the master document, I suspect the formatting will be carried over.
    Another possibility is to leave the source document with no formatting at all beyond paragraph breaks, and to apply the formatting (styles) after transferring the text.
    Regards,
    Barry

  • Problem with JPanel after rotation

    Hi,
    I am developing a graphics editor like mspaint. I have JPanel as my drawing canvas. now the problem is when I rotate the canvas, co-ordinates on the canvas are also getting rotate with it. for example if top-left corner is (0,0) initially then after rotating it 90 degree top-right corner becomes (0,0) and same for all the points on the canvas.
    the code i m using for rotation is
    contentPanel = new JPanel(){
    @Override
    protected void paintComponent(Graphics g) {                       
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D) g;
    Rectangle rect=g2.getClipBounds();
    if(rotation!=0){
    double angle = rotation * Math.PI/2;
    g2.rotate(angle,getWidth()/2,getHeight()/2);
    rect=g2.getClipBounds();
    setPreferredSize(new Dimension(rect.width,rect.height));
    super.paintComponent(g);
    revalidate();
    };

    Whats your question?
    If you rotate it, of course the points will rotate, they have to.

  • How to measure the rotational speed by using rotary encoder and 1 counter?

    I want to measure the rotational speed of a shaft, and I have below hardware:
    1, a rotary encoder, with A,B,Z signals output;
    2, PCI-E6363 card.
    I do konw how to use such a  encoder to measure the rotational angle by using the function "DAQmxCreateCIAngEncoderChan", but this time I need to measure the speed(rpm), as well as the dirction of the speed, which means a negative speed represent a CCW rotate direction.
    More detail informations:
    for the encoder, the A,B signal is 600ppr, and Z signal is 1ppr
    the rotatinal speed is in range: -300 ~ 5000 rpm.
    some one suggested me that I can use the "DAQmxCreateCIAngEncoderChan" task to measure the angle firstly and then do the differential analysis with the angle. but I have to enable the Z index function, and it's hard to calculate when the shaft speed is fast then 2500rpm.
    Anyone can help me on this issue?
    Thanks in advance!

    RobertoBozzolo:
    Thansk for your reply. You are right that measure frequency to get the speed is the best way, but it's hard to get the dirction at the same time. You suggest me that "perform two angle measurements to get the sense of rotation", but I'm not sure I catched what you mean about this. I try to understand your opinion like this: distribute the signals to 2 counters, and start 2 tasks, one for frequency, the other for angle which used for deciding the dirction?
    And by the way, in my application, the counter is limited:
    I'm using PCI-E6363, which have 4 counters totally, and I have to measure 4 different speed sensors at the same time, so that means only 1 counter for me to measure the speed and the dirction.
    RobertoBozzolo 已写:
    To measure the speed from the encoder you can simply follow some of the frequency measurement examples that ship with DAQmx, considering that speed (rpm) is given by frequency (Hz) on one encoder output / 600 (ppr) * 60 (s->min)  = frequency / 10.
    Difficult is to add a sign to this measurement: frequency measurement gives you no information about sense of rotation, so I suppose you could perform two angle measurements to get the sense of rotation and then get the speed as above.

  • Error 1074395241: The template descriptor does not contain data required for rotation-invariant matching.

    Hello all,
    I am using the IMAQ Match Pattern 4 to detect the rotation angle of a template image. However, it shows the error: "Error 1074395241: The template descriptor does not contain data required for rotation-invariant matching." What is the problem exactly? How to solve this? The details are explained below.
    My project is a little bit complicated. Part of the block diagram containing the IMAQ Match Pattern 4 is shown below:
    The source image is a series of frames of images read from an AVI video (I used a for loop to process the images frame by frame). The template image is a selected region of the first frame. So it means, the user selected the object of ineterst in the first frame of the video, and in each of the following frames, we need to find the matched object of interest & determine its rotation angle. When I run the block diagram shown above, it does not have any error. However, it shows the rotation angle as zero no matter what it "really" is. Therefore, I changed the block diagram by adding the parameters, shown below:
    But in this case, when I run it, it shows the error that I have indicated in the subject line.
    If you need more details about my project to identify the problem, please let me know.
    Thanks in advance.
    Solved!
    Go to Solution.

    -Please go through pattern matching example which comes along with labview fiirst
    Go to labview Help>>Find Examples and you can search for example.
    -You have create template with angle range and what type of pattern matching you want use.
    -For this you have to use IMAQ Learn Pattern before using IMAQ Match Pattern 4
    Refer :http://zone.ni.com/reference/en-XX/help/370281U-01/imaqvision/imaq_match_pattern_4/
    Thanks
    uday,
    Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
    Certified LabVIEW Associate Developer (CLAD) Using LV13

  • How to find out the coordinates of rotated textframe

    Hi All,
    With the help of (idml) itemtransform horizontal / vertical distances and path point arrays, I can find out the coordinates of text frame (x1,y1), (x2,y2), (x3,y3), (x4,y4). If the textframe is rotated then item transform values are getting changed, but the path point array values are same. I can find rotation angle by the matrix [cos(θ) sin(θ) -sin(θ) cos(θ) 0 0], But I could not get the exact coordinates of rotated textframe. The textframes are given below.
    Normal Text frame
    <TextFrame Self="u136" ParentStory="u124" ItemTransform="1 0 0 1 101.72727272727272 -349.41818181818184">
                <Properties>
                    <PathGeometry>
                        <GeometryPathType PathOpen="false">
                            <PathPointArray>
                                <PathPointType Anchor="-101.72727272727272 -46.581818181818164" LeftDirection="-101.72727272727272 -46.581818181818164" RightDirection="-101.72727272727272 -46.581818181818164"/>
                                <PathPointType Anchor="-101.72727272727272 -0.3272727272727103" LeftDirection="-101.72727272727272 -0.3272727272727103" RightDirection="-101.72727272727272 -0.3272727272727103"/>
                                <PathPointType Anchor="115.9090909090909 -0.3272727272727103" LeftDirection="115.9090909090909 -0.3272727272727103" RightDirection="115.9090909090909 -0.3272727272727103"/>
                                <PathPointType Anchor="115.9090909090909 -46.581818181818164" LeftDirection="115.9090909090909 -46.581818181818164" RightDirection="115.9090909090909 -46.581818181818164"/>
                            </PathPointArray>
                        </GeometryPathType>
                    </PathGeometry>
                </Properties>         
    </TextFrame>
    Rotated textframe
    <TextFrame Self="u136" ParentStory="u124" ItemTransform="0 1 -1 0 320.3805483338268 -125.07900895050204">
                <Properties>
                    <PathGeometry>
                        <GeometryPathType PathOpen="false">
                            <PathPointArray>
                                <PathPointType Anchor="-101.72727272727272 -46.581818181818164" LeftDirection="-101.72727272727272 -46.581818181818164" RightDirection="-101.72727272727272 -46.581818181818164"/>
                                <PathPointType Anchor="-101.72727272727272 -0.3272727272727103" LeftDirection="-101.72727272727272 -0.3272727272727103" RightDirection="-101.72727272727272 -0.3272727272727103"/>
                                <PathPointType Anchor="115.9090909090909 -0.3272727272727103" LeftDirection="115.9090909090909 -0.3272727272727103" RightDirection="115.9090909090909 -0.3272727272727103"/>
                                <PathPointType Anchor="115.9090909090909 -46.581818181818164" LeftDirection="115.9090909090909 -46.581818181818164" RightDirection="115.9090909090909 -46.581818181818164"/>
                            </PathPointArray>
                        </GeometryPathType>
                    </PathGeometry>
                </Properties>        
    </TextFrame>
    When I converted the values of rotated textframe in to coordinates and drawn in a screen then  I am not getting the exact position where it drawn in the original.
    Can anyone help me to find out the cordinates of rotated textframe.
    Thanks in advance.

    It seems pretty straightforward to me.
    Your center point is (42.375 mm, 27.458 mm) and your box is 58.417 mm x 28.417mm.
    IDML defines the rectangle by its corners, not its center, so let's find the upper-left corner. Divide the width by two and subtract from the x, same for the height and the y. You get (13.665 mm, 13.2495 mm).
    That is in page coordinates relative to the upper-left corner of the page, we can see from your rulers.
    But IDML coordinates are spread-relative from the center of the spread. Your spread is a single page that is 85 mm x 55 mm.
    So if we translate your upper-left corner, it is (13.665, 13.2495) mm - (85/2, 55/2) => (29.3335 mm, 14.2505mm) in spread-relative coordinates.
    But IDML coordinates are in points, not in mm. So we convert (multiply by 2.835). And we get (83.150 pt, 40.395 pt).
    But that doesn't match up with your IDML file, which has  (-82.650 pt, -39.890pt).
    But look at the difference: (0.500 pt, 0.505 pt). That's really 1/2 point, because your box has a 1-pt border and that gets split evenly across all 4 sides. And there's 0.005 of round-off error, bceause floating point math sucks.
    Any questions?

Maybe you are looking for

  • Access to the JAVA Stack of PI system

    Hi, User want access to JAVA Stack in PI System. Below is the message while user try to logon to Integration Builder in SAP NetWeaver for the PI Portal: "No authorization for this action". Kindly let us know how access to JAVA stack is possible? Than

  • How to detect if a file download was OK

    Hi all, I would like to know if exists any way to detect if a file sent out by a servlet to a browser was succesfully saved on the client. At least I would be happy to know if the user pressed the "OK" button or the "CANCEL" button I am sending the f

  • Custom template works only on page 1

    I created a whole new template from a template already on Pages. Looks fine, but when I jump to a second page by hitting the Enter key, it displays the original design and not my new design. How Can I apply the new to design to everypage

  • XMLSocket NULL byte generation

    Hi, I'm trying to get an external script to communicate with an application instance running on my Flash Interactive Media Server installation. I've got the following server side actionscript in my AppStart(): this.socket = new XMLSocket("test"); thi

  • Standalone Scenario - GR not possible

    Hi All,      I have created Standalone scenario, after SC is ordered i am getting local PO number, after that if i try to do Good Recipt/confirmation , GR icon is disabled. It does not allow me to do GR.     I did manintained local number range for G