Rotate an image after clicking two times on reference points on the picture
Hello Community!
I am looking for a solution to rotate an image by clicking on two reference points on the image. The two coordinate pairs of the mouse clicking can give me the rotation angle with simple geometry. After that I will rotate the image with the calculated angle.
My problem is: How can I get those two coordinate pairs? I wanted to do it with an easy MatlabScript "input: path ... imread(path) ... imshow ... ginput(2) ... calculation ...output: angle". Apparently imshow doesnt work in Labview
I already have the Mouse Down event but I dont know how I can make Labview let me click EXACTLY and ONLY two times on my picture and store the coordinates.
Does anyone of you have a glue/ hint how to do that?
Best,
Annki
(Started LabView 2 weeks ago)
Solved!
Go to Solution.
Hi Annkitranky,
welcome to the forum!
Here is one that works well: http://en.wikipedia.org/wiki/Cyanoacrylate (Sorry, I couldn't resist...)
Check this out: http://forums.ni.com/t5/LabVIEW/Using-mouse-click-to-return-image-coordinates/m-p/890731 and http://forums.ni.com/t5/LabVIEW/How-to-find-cursor-position-on-an-image-in-LabVIEW/m-p/1862495 There is a suggestion not marked as a solution, but I think it is: see last posts there; User Event Structure with the position reported implicitly. Further, I would put the Event Structure in the While Loop, where I wait for user input, collect the user inputs and finish (execute rotation on a two-element array).
If you have a code or something, post it.
Cheers
Similar Messages
-
Calling images on website two times
Hi,
When I am calling the images of the contents in the website which is developped by PHP, there is no problem to display them. But i check the Access Logs of site, Only Firefox GETs the page TWO times. Other browsers GET the page for one time, but Firefox GETs two times.
Image URL like this : http://www.mysite.com/image/name-of-the-image.jpg (With htaccess rewrite, to an image.php PHP file)
in image.php file , Image Magick (Php Image Library) prints the image..
Internet explorer, chrome, opera vs. is normal. Firefox gets two times on Access Log...
What is the solution of this problem, i couldn't find a solution...Thanks David,
Yes it was a problem for development. I made the headers but still not worked. Then i tried different header, now problem solved... may be needed in the future, the correct header codes like this:
// Last Modified date for caching
$file_last_modified = filemtime($filename);
// Expires in two months
$expires = time() + (60 * 24 * 60 * 60);
header("Pragma: public");
header("Content-type: image/jpeg");
header("Expires: " . gmdate("D, d M Y H:i:s", $expires) . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $file_last_modified) . " GMT");
Thanks -
when trying to download Mountain Lion after click on buy I get this message: The product distribution file could not be verified. It may be damaged or was not signed.
The Apple Support Communities are an international user to user technical support forum. As a man from Mexico my first language is Spanish. I do not speak English, however I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
Always search the forum before posting. This is asked at least three times just below your post.
https://discussions.apple.com/thread/3604789?tstart=0
https://discussions.apple.com/thread/4153268?tstart=0 -
After Clicking on iTunes Download i just see the note that Thank you for downloading , However i do not see any files getting downloaded....
Hi there,
I would recommend taking a look at the troubleshooting steps found in the article below.
Trouble installing iTunes or QuickTime for Windows
http://support.apple.com/kb/HT1926
-Griff W. -
After converted a Words file to PDF. The picture / logo turned blurred.
After I converte a Words file to PDF, the picture / logo turne blurred. Please advise how I could fix it.
Change the job options file you are using.
-
I am using Adobe Photoshop Elements 11, I just transferred all of my data from an old computer to a new computer, all my pictures and documents transferred fine but, my albums are missing and the date and time that is usually under the picture are missing.. How do I get them back?
Hi,
Which operating system are you running on?
The date & Time can be displayed by going to the View menu and checking Details - also File Names if you want them displayed.
The Album information is saved within the catalog so it sounds as though you didn't do a catalog backup on the old computer and a catalog restore on the new computer which is the recommended way of transferring elements data. Did you just copy the photos over?
Brian -
One Click - two times the same event?
Hello guys, i have a little problem...
When I click on my button it seems to be that the event handler method is run two times. I cant understand why - its happening at all buttons. can anyone help me?
GUI.java
public void actionPerformed(ActionEvent event) {
transmit(); // transmit the textfields
p.translate(); // translate it to xml
html = p.newHTML(); // translate the xml to html
status.setText("<html>"+html); // set the translatet html in the preview panel
taHtml.setText(html); // set the translatet html in the text area
The problem is that it appears two times in both, the area and the label.
Here is the other code, if it helps.
public String newHTML() {
String tmp = xMLToHTMLParser.translate(xml);
return tmp;
public String translate(String delivered) {
xml = delivered;
html += "<b>";
try {
html += xml.substring(xml.indexOf("<Headline>")+10, xml.indexOf("</Headline>"));
catch(Exception e) {} // When nothing is in the Headline do nothing.
html += "</p>\n \n";
return html;
}Thnak you so much for you help!
TobyOk, here is the transmit():
/** Transmits the content of the Textfields to the Parser */
private void transmit() {
String Logoname = phases[phaseChoices.getSelectedIndex()];
p.setLogoURL("http://www.destinations2discover.com/images/icons/"+Logoname); // All icons are already saved on the Server
p.setHeadline(tfHeadline.getText());
// It's very tricky to get the correct dates in :)
// First Step: transfer the correct Items, for next Step see Parser.java
if( !tfAdditional.getText().equalsIgnoreCase("" )) {
try {
p.setDateline(tfAdditional.getText());
catch(Exception e) {
p.setDateline ("T Y P E C A S T E R R O R IN D A T E L I N E A D D I T I O N A L");
/*else*/ if(( (!tfStartDay.getText().equalsIgnoreCase("")) && (!tfStartMonth.getText().equalsIgnoreCase("")) && (!tfStartYear.getText().equalsIgnoreCase("" )) && (!tfEndDay.getText().equalsIgnoreCase("")) && (!tfEndMonth.getText().equalsIgnoreCase("")) && (!tfEndYear.getText().equalsIgnoreCase("")) )) {
try {
p.setDateline ( Integer.parseInt(tfStartDay.getText()), Integer.parseInt(tfStartMonth.getText()), Integer.parseInt(tfStartYear.getText()), Integer.parseInt(tfEndDay.getText()), Integer.parseInt(tfEndMonth.getText()), Integer.parseInt(tfEndYear.getText()) );
catch(Exception e) {
p.setDateline ("T Y P E C A S T E R R O R IN D A T E L I N E S T A R T / E N D");
else if(((!tfStartDay.getText().equalsIgnoreCase("")) && (!tfStartMonth.getText().equalsIgnoreCase("")) && (!tfStartYear.getText().equalsIgnoreCase("" )) ) ){
try {
p.setDateline ( Integer.parseInt(tfStartDay.getText()), Integer.parseInt(tfStartMonth.getText()), Integer.parseInt(tfStartYear.getText()) );
catch(Exception e) {
p.setDateline ("T Y P E C A S T E R R O R IN D A T E L I N E S T A R T");
//-->FIX:: Add Annual Event Checkbox if(!btnAnnual.getText().equalsIgnoreCase("StartDay"))
if(!tfImageURL.getText().equalsIgnoreCase("")) {
p.setImageURL(tfImageURL.getText());
if(!tfText.getText().equalsIgnoreCase("")) {
//p.setText(tfText.getText());
p.setText(taTxt.getText());
if(!tfHyperlink.getText().equalsIgnoreCase("")) {
p.setHyperlinkURL(tfHyperlink.getText());
}And here is the whole actionPerformed - just to make sure i have the listener not twice.
public void actionPerformed(ActionEvent event) {
if ("comboBoxChanged".equals(event.getActionCommand())) {
//Update the icon to display the new phase.
phaseIconLabel.setIcon(images[phaseChoices.getSelectedIndex()]);
// Set the article ID from the radio buttons
else if (event.getSource() == rbFOM) {
p.setID(1);
else if (event.getSource() == rbInsider){
p.setID(2);
else if (event.getSource() == rbMustSee){
p.setID(3);
else if (event.getSource() == rbMustDo){
p.setID(4);
else if (event.getSource() == rbMustExperience){
p.setID(5);
else if (event.getSource() == rbActivity){
p.setID(6);
else if (event.getSource() == sendContent) {
transmit(); // transmit the textfields
p.translate(); // translate it to xml
html = p.newHTML(); // translate the xml to html
status.setText("<html>"+html); // set the translatet html in the preview panel
taHtml.setText(html); // set the translatet html in the text area
// write in html in line.html and xml in line.xml file
try {
FileOutputStream fos = new FileOutputStream( "line.html" );
fos.write( html.getBytes() );
fos.close();
catch ( Exception e ) { System.out.println(e); }
xml = p.getXML();
try {
FileOutputStream fos2 = new FileOutputStream( "line.xml" );
fos2.write( xml.getBytes() );
fos2.close();
catch ( Exception e ) { System.out.println(e); }
show = true; // workaround
else if (event.getSource() == addContent) {
transmit(); // transmit the textfields
p.translate(); // translate it to xml
html = p.newHTML(); // translate the xml to html
status.setText("<html>"+html); // set the translatet html in the preview panel
taHtml.setText(html); // set the translatet html in the text area
// write in html in line.html and xml in line.xml file
try {
FileOutputStream fos = new FileOutputStream( "line.html" );
fos.write( html.getBytes() );
fos.close();
catch ( Exception e ) { System.out.println(e); }
xml = p.getXML();
try {
FileOutputStream fos2 = new FileOutputStream( "line.xml" );
fos2.write( xml.getBytes() );
fos2.close();
catch ( Exception e ) { System.out.println(e); }
show = true;
else if (event.getSource() == showInIE) {
if(show) { // workaround
try {
File fd= new File("");
path = fd.getAbsolutePath();
path = "C:\\Program Files\\Internet Explorer\\iexplore.exe " + path + "\\line.html";
System.out.println(path); // debug
// Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\iexplore.exe \"C:\\Dokumente und Einstellungen\\intern\\Eigene Dateien\\code kopie\\text2XML\\text2Destination\\line.html\"");
Runtime.getRuntime().exec(path);
catch ( Exception e ) { System.out.println(e); }
show = false; // workaround
showInIE.disable();
else if(show = false) { // workaround
show = true; // workaround
}This problem is not only at the Button with "sendContent" it is also with "addContent' and "showInIE".
Thank you two. -
Getting a black image after joining two images
Hey Guys,
I have joined two images. In the joined image. i am getting the first image but the second one im getting as a black image. Can you please tell me what is the problem??
Below is the code:
w = inv*img[inv].getWidth(null) + img1.getWidth(null);
h = Math.max(img[inv].getHeight(null), img1.getHeight(null));
BufferedImage[] joinedImg = new BufferedImage[lnuInvoiceIndex];
Graphics2D[] g = new Graphics2D[lnuInvoiceIndex];
JPEGImageEncoder[] encoder=new JPEGImageEncoder[lnuInvoiceIndex];
for(int join=0;join<=lnuInvoiceIndex;join++){
joinedImg[join]=new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
g[join] = joinedImg[join].createGraphics();
g[join].drawImage((BufferedImage)thumbImage[inv], 0,0, null);
encoder[join] = JPEGCodec.createJPEGEncoder(response.getOutputStream());
encoder[join].encode((BufferedImage)joinedImg[join]);
}import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.swing.*;
public class JoinImages {
private JPanel getContent(BufferedImage[] images) {
JPanel panel = new JPanel(new BorderLayout());
panel.add(wrap(join(images, 4)), "Before");
panel.add(wrap(join(images, 1)), "Last");
panel.add(wrap(join(images, 2)));
return panel;
private BufferedImage join(BufferedImage[] images, int rows) {
int cols = images.length/rows;
// For all images having the same size.
int iw = images[0].getWidth();
int ih = images[0].getHeight();
int w = cols*iw;
int h = rows*ih;
int type = BufferedImage.TYPE_INT_RGB;
BufferedImage image = new BufferedImage(w, h, type);
Graphics2D g2 = image.createGraphics();
for(int j = 0, index = 0; j < rows; j++) {
for(int k = 0; k < cols; k++) {
int x = k*iw;
int y = j*ih;
g2.drawImage(images[index++], x, y, null);
g2.dispose();
return image;
private JLabel wrap(BufferedImage image) {
return new JLabel(new ImageIcon(image),
JLabel.CENTER);
public static void main(String[] args) throws IOException {
String[] ids = { "-c---", "--g--", "---h-", "----t" };
BufferedImage[] images = new BufferedImage[ids.length];
for(int j = 0; j < images.length; j++) {
String path = "images/geek/geek" + ids[j] + ".gif";
images[j] = javax.imageio.ImageIO.read(new File(path));
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(new JoinImages().getContent(images));
f.pack();
f.setLocation(200,200);
f.setVisible(true);
}Geek images from [Using Swing Components: Examples|http://java.sun.com/docs/books/tutorial/uiswing/examples/components/index.html]. -
After click em 12c setup it's showing the abnormal progam termination
Hi,
after click em 12c setup(DISK 1) it's showing the abnormal progam termination.then it's terminated.in my sytem already ready having soa 11g with database xe 11.2 vesion.could you please solve the issues how to install the em 12c in my system with steps.
Thanks,Can you verify if you have downloaded the software correctly check the bytes and checksum from OTN to that on your system. Make sure that you have downloaded all the zips and extracted them in on folder. Go to Disk1 folder and see if you have following folders/dir :
Release_Notes.pdf install libskgxn plugins runInstaller wls
WT.zip jdk oms response stage
Note: i have paste d thsi from linux machine but the folders should be same.
Do you have sufficient space on this box? hard disk, ram, /tmp ? -
When Streaming a movie or tv show it stops after a short time and does not finish downloading. We watch the TV show or movie than nothing !!!
a message comes up An error occurred loading this content try again later. We have unplugged everything rebooted several times and nothing
helps. It was working fine until we did a upgrade that showed up on the Apple TV.
modle A1427 3rd generation
Any help would be GREATLY appreciated Nothing on regular TV miss my Apple TV stuff !!!!Welcome to the Apple Community.
Try the following steps, check whether things are working after each step where appropriate, before trying the next.
Restart the Apple TV (Settings > General > Restart).
Restart the Apple TV by removing ALL the cables for 30 seconds.
Restart your router.
Reset the Apple TV (Settings > General > Reset > Reset all settings)
Restore the Apple TV (Settings > General > Reset > Restore) -
Two different WCS instances, pointing to the same database
Hi,
for some unknown reason that came from the architecture fellows, I need to install 02 instances of WCS pointing to the same database server. I mean, both instances would need to "share" the database. They don't want a cluster schema because they need to have the option to deploy the app in one instance and, if wverything is ok, deploy to the remaining instance.
Do you know if such architecture is possible? I did the installation of one instance(instance A), but when trying to install the instance B referring to A's database, I get a ton of errors.
Any advice is much appreciated.
Regards,
Vinicius
Edited by: 1000164 on Apr 15, 2013 8:18 PMHi,
This is not the way Sites has been designed. Each instance should have their own schema and repository unless the two instances work as a Sites cluster.
So what you're trying to achieve is not possible using your approach. What I could suggest is to install two separate instances on its own, create the necessary data model, asset configurations, templates, etc. in one instance and replicate it to the other instance by publishing it to the other instance using real-time publish. If you use LDAP or any other supported directory server you would be able to use a singe directory for both sites instances.
Regards,
Rodney -
Two string references pointing to the same object
Look at the following code snippet String s1 = "hello";
String s2 = "world";
String s3 = "welcome";
String s4 = "here";
String s5 = "hello";
They say that references s1 and s5 point to the same object "hello".
At run time after creating objects from s1 to s4 how the Java run time knows that there is already an object "hello" and assigns a differernt reference.When the jvm load the class file, all suchconstants
found in the class are loaded in a global constant
pool. when you assign the constant to a variable,it
uses the same one from the constant pool.Suppose I intialize a string by getiing input
nput from the console which already exists, in that
case a new object will be created or the existing one
be used.A new object will always be created in that case, but you can get a reference to the string in the pool by calling intern. See the javadoc for intern in the String class.
Kaj -
Two iPhoto Library Names Point to the Same Path
I'm not sure how this happened, but I now have two libraries that point to the exact same path. One is uppercase and the other is normal. See pic:
How can I get rid of the uppercase library?Try trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder.
(On 10.7: Hold the option (or alt) key while clicking on the Go menu in Finder to access the User Library)
(Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
What's the plist file?
For new users: Every application on your Mac has an accompanying plist file. It records certain User choices. For instance, in your favourite Word Processor it remembers your choice of Default Font, on your Web Browser is remembers things like your choice of Home Page. It even recalls what windows you had open last if your app allows you to pick up from where you left off last. The iPhoto plist file remembers things like the location of the Library, your choice of background colour, whether you are running a Referenced or Managed Library, what preferences you have for autosplitting events and so on. Trashing the plist file forces the app to generate a new one on the next launch, and this restores things to the Factory Defaults. Hence, if you've changed any of these things you'll need to reset them. If you haven't, then no bother. Trashing the plist file is Mac troubleshooting 101. -
After install iLife '11, iWeb does not show the picture
After install iLife '11 , I need to edit some pages of an existing website (stored on my HD)
When I open the page I would edit (it's a page that contains some photo gallery) I see that the picture gallery is empty and if I try to publish the page when I browse it I see the page appear but there's no picture gallery on it.
there's any solution ?
gabrieleTry the following:
1 - Go to your user account home folder, and open the library folder within it.
Look for the folder named "Calendars" and inside you might find a bunch of different folders with weird names. If they are there that means your calendars might not be lost.
2 - Look for the file "Calendar Cache". That file might be corrupted. Trash it. You may want to save a copy of it elsewhere. Once trashed, re-open ical. This should force it to rebuild its library based on those folders with weird names you saw. Your calendars should be back. Good luck -
JSON content - can't display image after click
Hi to all,
I am trying to to load a JSON file and load images with text information.
I have a problem when i click the thumbnail, the large image can't displayed, i am receiving the following error:
Failed to load resource: the server responded with a status of 404 (Not Found)
my code in compositionReady:
$.getJSON("content.json",
function(data){
for(var i=0; i<=data.length; i++){
var s = sym.createChildSymbol("template","content");
s.$("title").html(data[i].title);
s.$("description").html(data[i].description);
s.$("seira").html(data[i].seira);
s.$("imageholder").css({"background-image":"url('"+data[i].image+"')"});
s.$("imageholder").click("click", function(e){
sym.getComposition().getStage().$("finte").css({"background -image":"url("+$(this).data('largeimage')+")"});
And the JSON File:
"title": "Titlos 1",
"description":"Descrpt 1",
"seira": "Number 1",
"image": "images/wheel.png",
"largeimage": "images/1.png"
"title": "Titlos 2",
"description":"Inter description 2",
"seira": "test",
"image": "images/wheel_cool.png",
"largeimage": "images/wheel_cool.png"
I tried also with this code:
$.getJSON("content.json")
.success(
function(data){
console.log("incoming data: ", data);
$.each(data, function(index, item){
var s = sym.createChildSymbol("template","content");
s.$("title").html(item.title);
s.$("description").html(item.description);
s.$("seira").html(item.seira);
s.$("imageholder").attr("src",(item.image));
s.play();
s.setVariable( "largeimage", item.largeimage)
and at the element that hold's the thumbnail image, I added on the click event :
sym.$("finte").css({"background-image":"url("+$(this).data('largeimage')+")"});
I believe that somewhere on +$(this).data('largeimage')+") is the mistake. But I can't find it.
Your help is needed.
Moreover, how, the thumbnails, can be displayed as a table of 4x5?
Thanks in advanced.Hi Zoze
you missed some lines, try this, i think this should work for you
$.getJSON("content.json",
function(data){
for(var i=0; i<=data.length; i++){
var s = sym.createChildSymbol("template","content");
s.$("title").html(data[i].title);
s.$("description").html(data[i].description);
s.$("seira").html(data[i].seira);
s.$("imageholder").css({"background-image":"url('"+data[i]. image+"')"});
s.$("imageholder").data('Large', data[i].largeimage);
s.$("imageholder").click("click", function(e){
sym.getComposition().getStage().$("fint e").css({"background-image":"url("+$(this).data('Large')+")"});
if you had problem again, let me know
Zaxist
Maybe you are looking for
-
Using Resultsets in Oracle without being Proprietary
Suns tutorial path for returning resultsets from stored procedures indicates that the following should work... CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}"); ResultSet rs = cs.executeQuery(); Thats if you build your stored procedure
-
Blackberry Desktop Manager version 7.1
I don't know where to download the new version 7.1 Blackberry Desktop Manager.
-
12c Grid Infrastructure 2 node instance redhat linux 6.3
I have a two node 12c rac database. I am frequently seeing one node get shutdown for no apparent reason. The alert log says Error: Controlfile sequence number in file header is different from the one in memory Please check that the correct mount opt
-
Hi there... I have a project that will be using well over 100 audio clips. I have done a little previous work with audio in flash but not to this extent. I am wondering if anyone out there has some ideas or favorites they have used regarding Audio in
-
History I down loaded the OS Yosemite, I have snow Lepord and the upgrade dialog said I had a STo update this application, sign in to the account you used to purchase it.MART Error on Drive,changed drive and backed up to old 10.8, I go to app store