Create an area from a set of points
How to create an area from a set of points ? I searched everywhere but could not find a better solution for it. Let�s say that I have a matrix that contains the points for a shape. I�ll need a way to connect the points near each other continuously to form the outline for the shape.
Thanks fro any feedback.
... But I'll also need a way to connect
those points in an order so that they'll form the
path (edge) of the shape.Do you mean the Convex Hull [1] of a set of points?
If so, you could find it by implementing a Graham Scan [2] algorithm and then calculating the area of the polygon [3].
[1] http://mathworld.wolfram.com/ConvexHull.html
[2] http://en.wikipedia.org/wiki/Graham_scan
[3] http://mathworld.wolfram.com/PolygonArea.html
Similar Messages
-
How to create an Area(or shape) from a set of points?
In fact I want to accomplish a function which can fill an area of same color on an image, just like the Magic Wand tool in Photoshop.
I have written a function to figure out the points which should be included in the Area, but I don't know how to create the Area from a set of points...:(
I tried to create Rectengel2D from each point, the union them one by one, but it's too slow
Anyone can help me? Thanksyou should look att the fillPolygon api instead, it can draw more than one corner.
I would use it in a paintComponent method and a method that creates the x and y cordinates for each corner.
API HELP:
http://jdrawing.sourceforge.net/doc/0.2.1/api/org/jdrawing/graphics/FillPolygon.html -
Create waveform from a set of points with differtent time intervals
Hello,
I would like to create a waveform from a set of points like this
Time Data
0 0
0,5 1
0,6 2
1 1
2 0
5 1
The problem is that the time interval between each points are not the same.
The only idea I found was to create a waveform for each doublet of points with the same rate (100ms) and than to append them together.
Does anybody have a better idea?
Regards,
Risotto.If you use a Wave From data type, re-sampling is not required.
When using a WF datatype the chart (graph) will pick-up the X value from the t0 of the waveform.
The trick is to just build an array of the single update value and make sure the t0 value is correct.
Re-create this example
and try it for yourself.
Ben
Note: make sure the data you pass is consistant with the data already displayed. If you post a t0 value that is older than what is already displayed, the chart will clear the display and start over.
Message Edited by Ben on 09-15-2006 11:49 AM
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Attachments:
WF_Datatype.JPG 59 KB -
Problem: Creating groups out of a set of points in 2D space based on their relative proximity
Hi,
I'm new to LabVIEW and I've tried doing this several times, but I just can't solve it.
Problem:
I've got a set of points in the 2D space(x,y), and I want to calculate the mean of the sets of closely spaced points.
Example:
Consider 5 points, A(1,2); B(2,3); C(100,200); D(120,220); E(110,210); F(500,600)
I'm trying to get the output a set of points
P[ (1+2)/2 , (2+3)/2 ]
Q[ (100+120+110)/3, (200+210+220)/3 ]
S[ 500, 600 ]
Where the outputs are the means of the points taken in sets which are composed of "closely" paced points(within a limit).
I.e.., (A,B) are close; (C,D,E) are close, while E is separated from the rest, within a small limit(say 30).
This has been causing a lot of problems for me recently and I have to solve it. Image included.
Any suggestions/ideas are most welcome.
Thanks in advance.
Solved!
Go to Solution.
Attachments:
Problem_1.png 9 KBHi,
"Data clustering" is exactly what I was looking for, and I checked the link. Very informative. Thanks on that.
I didn't post my code intentionally because it's very cluttered and inefficient.(I've just started using Labview).
But my Algorithm is simple and trivial.
1. Take any one point and compare it with every other point within a limit(say L).
2. If comparable, then add an entry into a 2D array, if non-existent else just ignore(points have already been accounted for).
(The 2Darray has each column representing a collection of comparable points,i.e. 1 group and N such columns for N point in all)
3. Repeat steps 1 and 2 for the remaining points.
4. Finally, construct a 1D array, with each element representing the mean point based on values taken per column from the 2D array.
Also, this Algorithm works fine for my application(less than 30 points), so I haven't tested it for a large number of points.
I bet It'll be highly inefficient, considering the more widely use clustering algorithms out there.
However, if you know of any VI's or simple algorithms for such(small data set), it would be highly beneficial to me. -
Hello,
I've a board that cames with Labview VIs for each of its functions.
As I'd like to use it from CVI, I need a DLL.
NI support team gave me the procedure to make such a DLL, it works fine.
But, the create DLL can't be used by 2 application in same time, as it was possible with the old fashion driver on WindowsXP, delivered by the board supplier.
When I've an application launched using functions in the DLL, it is loaded and seems to be "privative" to this application: if an other one tries to load the DLL, there is an error frolm Labview wrapper.
Is there an option to make such DLL "reopenable" or "reentrant"?
RegardsThe DLL is written by Lavview tool to encapsulate VI and get them reachable from CVI: the board supplier no loger delivers a C-compatible DLL, only Labview driver and C# / .net / Java... modules, that implies heavy changes in our application to manage. NI support suggested to make this way a DLL from the set of VI delivered by supplier.
In our case, on XP, the main application was using the board but it was possible in parallel to send commands from an other application.
You're right it may be a question of locking resources by DLL / VIs functions: I'd like to know it there is a specific otpin when creating the DLL to make it reentrant and possibly get double access.
-
Creating a waveform from a set of data points
I have a set of Y values which are spaced 1/sampling rate apart. I am trying to build a waveform with them, but buildwaveform.vi does not seem to be working. Any suggestions? Thanks.
Intern NSWCCD Carderock.Did you try the build waveform function.
Look at annex,
Hope it helps,
Paulo
Attachments:
BuildWaveform.vi 27 KB -
How do I create package groups from a set of packages?
Hello,
Suppose I have a set of packages to be grouped together so that I can do
pacman -S <pkg_group_name>
to install all the packages in that group, how do I do this?
Thanks for your help,
Anandgroups=('pkg_group_name')
in the PKGBUILDS.
man makepkg, for future ref. -
Creating intensity graph from ywo sets of data?
Hi,
In my vi, I am getting two data set dependent on each other, i.e. amplitude(y) versus position(x). The data acquisition of x-y data happens in a for loop. This data is transferred outside the loop with index enabled. Outside the loop I want to plot an intensity graph out of these data, while z=amplitude, x=position,y=not important, say index. I don't want simply to transfer the amplitude data outside the loop and connect the 2D array of amplitude to the intensity graph. I want to preserve the position information in the intensity graph. How can I do this?
ThanksHere is a link to a posting that may have been yours also. Just some ideas I had. I hope it can help you get started somewhere.
J.R. Allen -
Can't create Area from Rectangle2D (SSCCE included)
Hi guys,
I'm trying to create an Area from a Rectangle2D as a workaround for being unable to create an Area from a Line2D.
It doesn't seem to work though; any idea why?
Here's a little SSCCE so you can see what I mean.
The area without any transformation applied displays fine (green). The 'line' produced from my Rectangle2D with the transformation also appears as desired (black). However, the Area produced from the transformation has no pixels in it (blue).
Help would be much appreciated x:o)
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.AffineTransform;
import java.awt.geom.Area;
import java.awt.geom.Rectangle2D;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Test implements ActionListener {
private static Shape shape;
private static Area area;
private static JPanel component;
public Test() {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel contentPane = new JPanel();
component = new JPanel();
component.setBackground(Color.WHITE);
component.setOpaque(true);
JButton button = new JButton("Draw");
button.addActionListener(this);
button.setActionCommand("draw");
button.setPreferredSize(new Dimension(100, 20));
component.setPreferredSize(new Dimension(400, 200));
frame.setPreferredSize(new Dimension(400, 300));
contentPane.add(component);
contentPane.add(button);
frame.setContentPane(contentPane);
frame.pack();
frame.setVisible(true);
public static void main(String[] args) {
new Test();
public void actionPerformed(ActionEvent event) {
if (event.getActionCommand().equals("draw")) {
// Create graphics context
Graphics2D g2d = (Graphics2D) component.getGraphics();
// Create arbitrary endpoints for 'line'
double x1 = 20;
double x2 = 60;
double y1 = 5;
double y2 = 70;
double deltaX = x1 - x2;
double deltaY = y1 - y2;
// Instantiate rectangle and derived area
Rectangle2D.Double rectangle = new Rectangle2D.Double(x1, y1, Math.abs(deltaX), 10);
area = new Area(rectangle);
// Display area without transformation
g2d.setColor(Color.GREEN);
g2d.draw(area);
// Construct matrix transformation for y = mx + c
double m = deltaY / deltaX;
double c = y1 / (m * x1);
AffineTransform matrix = new AffineTransform(1, m, 0, 0, 0, c);
// Transform Shape and Area by constructed matrix
shape = matrix.createTransformedShape(rectangle);
area = area.createTransformedArea(matrix);
// Display the transformed Shape (black)
g2d.setColor(Color.BLACK);
g2d.draw(shape);
// Shift 5 pixels right
g2d.translate(5, 0);
// Display the transformed Area (blue)
g2d.setColor(Color.BLUE);
g2d.draw(area);
// Display transformed Area bounds as String
g2d.drawString(area.getBounds().toString(), 80, 100);
}I just came back to this, and realised that Area probably doesn't like there being no fillable area, lol slaps forehead
So this altered version works perfectly for a line of thickness 1:
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.AffineTransform;
import java.awt.geom.Area;
import java.awt.geom.Rectangle2D;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Test implements ActionListener {
private static Shape shape;
private static Area area;
private static JPanel component;
public Test() {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel contentPane = new JPanel();
component = new JPanel();
component.setBackground(Color.WHITE);
component.setOpaque(true);
JButton button = new JButton("Draw");
button.addActionListener(this);
button.setActionCommand("draw");
button.setPreferredSize(new Dimension(100, 20));
component.setPreferredSize(new Dimension(400, 200));
frame.setPreferredSize(new Dimension(400, 300));
contentPane.add(component);
contentPane.add(button);
frame.setContentPane(contentPane);
frame.pack();
frame.setVisible(true);
public static void main(String[] args) {
new Test();
public void actionPerformed(ActionEvent event) {
if (event.getActionCommand().equals("draw")) {
// Create graphics context
Graphics2D g2d = (Graphics2D) component.getGraphics();
// Create arbitrary endpoints for 'line'
double x1 = 20;
double x2 = 60;
double y1 = 5;
double y2 = 70;
double deltaX = x1 - x2;
double deltaY = y1 - y2;
// Instantiate rectangle and derived area
Rectangle2D.Double rectangle = new Rectangle2D.Double(x1, y1, Math.abs(deltaX), 1); // Here's what's changed
area = new Area(rectangle);
// Display area without transformation
g2d.setColor(Color.GREEN);
g2d.draw(area);
// Construct matrix transformation for y = mx + c
double m = deltaY / deltaX;
double c = y1 - (m * x1); // ** Sidenote: typo in the above version, d'oh!
AffineTransform matrix = new AffineTransform(1, m, 0, 1, 0, c); // Here's what's changed
// Transform Shape and Area by constructed matrix
shape = matrix.createTransformedShape(rectangle);
area = area.createTransformedArea(matrix);
// Display the transformed Shape (black)
g2d.setColor(Color.BLACK);
g2d.draw(shape);
// Shift 5 pixels right
g2d.translate(5, 0);
// Display the transformed Area (blue)
g2d.setColor(Color.BLUE);
g2d.draw(area);
// Display transformed Area bounds as String
g2d.drawString(area.getBounds().toString(), 80, 100);
} -
Setting up new dbname/sid while creating oracle db from rman backups in 11g
Hi all,
I have rman backups and need to create another database from rman backups with different name... but it is unsuccessful..
created instance with new db...
running create new db connecting rman auxiliary sys/password@newdb
run {
SET NEWNAME FOR DATAFILE 1 TO 'F:\app\HOME\oradata\clonedb1\SYSTEM01.DBF';
SET NEWNAME FOR DATAFILE 2 TO 'F:\app\HOME\oradata\clonedb1\SYSAUX01.DBF';
SET NEWNAME FOR DATAFILE 3 TO 'F:\app\HOME\oradata\clonedb1\UNDOTBS01.DBF';
SET NEWNAME FOR DATAFILE 4 TO 'F:\app\HOME\oradata\clonedb1\USERS01.DBF';
SET NEWNAME FOR DATAFILE 5 TO 'F:\app\HOME\oradata\clonedb1\EXAMPLE01.DBF';
SET NEWNAME FOR TEMPFILE 1 TO 'F:\app\HOME\oradata\clonedb1\TEMP01.DBF';
DUPLICATE DATABASE TO clonedb
pfile 'D:\TESTDELETE\initclonedb1.ora'
BACKUP LOCATION 'F:\app\HOME\flash_recovery_area\orcl\'
LOGFILE GROUP 1 ('F:\APP\HOME\ORADATA\ORCL\REDO01.LOG') SIZE 60M REUSE,
GROUP 2 ('F:\APP\HOME\ORADATA\ORCL\REDO02.LOG.rdo') SIZE 60M REUSE,
GROUP 3 ('F:\APP\HOME\ORADATA\ORCL\REDO03.LOG') SIZE 60M REUSE;
Error it shown is in rman backup creation is as follows
<part>>
sql statement: alter system set db_name = ''ORCL'' comment= ''Modified by RMAN
duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 640286720 bytes
Fixed Size 1376492 bytes
Variable Size 314576660 bytes
Database Buffers 318767104 bytes
Redo Buffers 5566464 bytes
Starting restore at 20-DEC-11
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=133 device type=DISK
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
output file name=F:\APP\HOME\ORADATA\CLONEDB1\CONTROL01.CTL
output file name=F:\APP\HOME\FLASH_RECOVERY_AREA\CLONEDB1\CONTROL02.CTL
Finished restore at 20-DEC-11
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/20/2011 07:07:11
RMAN-03015: error occurred in stored script Memory Script
RMAN-06136: ORACLE error from auxiliary database: ORA-01102: cannot mount databa
se in EXCLUSIVE mode
RMAN> EXIT
how can i prevent rman setting db_name=orcl which is already exists in the db.. i need to create db from rman backups with different dbname...
whould someone help me out, how can i create database from another database rman backups with different dbname/sid on same host..
My pfile has new db_name , but while db creation rman setting to db_name to source dbname.. it should be new db name that i want create with new db name...
is there any RMAN command to specify new DB name it should set while running
sql statement: alter system set db_name = newdbname -- as part rman script execution...
it appears to be i should not touch the soruce db.. i have access to only source db rman backups and need to create another db with different dbname/sid.. please do help...When you performing RMAN duplicate why you making your script so complicated?
Your instance name and DB name can be different, But what is the contents in your pfile "D:\TESTDELETE\initclonedb1.ora" ? please do post
Have you started any other services related to ORACLE? check in start --> run --> services.msc any other active oracles services, Make sure you have clonedb1.
Startup in nomount
check the connectivity to target server.
SET NEWNAME FOR TEMPFILE 1 TO 'F:\app\HOME\oradata\clonedb1\TEMP01.DBF';Why you mentioning SET NEWNAME FOR DATAFILE ? You have option of db_file_name_convert/log_file_name_convert in case if your file system different in Target & auxiliary.
BACKUP LOCATION 'F:\app\HOME\flash_recovery_area\orcl\'When you have backup in same location why you are mentioning this clause?
First run duplicate from auxiliary server as
rman target sys/*****@prod auxiliary /
RMAN> duplicate target database to "db_name";
Am not sure what you are trying to do. is it 11gR1 or 11gR2?
You have option of duplicate from active database without having backup also..
here some links please check it.
http://docs.oracle.com/cd/E14072_01/backup.112/e10642/rcmdupdb.htm#BGBFDJHB
RMAN 11GR2 : DUPLICATE WITHOUT CONNECTING TO TARGET DATABASE [ID 874352.1]
knowledgespring
Newbie
Handle: knowledgespring
Status Level: Newbie (10)
Registered: Dec 26, 2007
Total Posts: 243
Total Questions: 77 (75 unresolved)
So sad that forum was able to help only in two answers out of your 77 questions :(
Edited by: CKPT on Dec 21, 2011 5:12 PM -
Create randomized fill from set of images
I have a set of images that are all different, but tile nicely together. I would like to create a pattern (or similar) that I can use to fill an area using those images randomly selected. That is, they should all be aligned in a grid, but each tile of the grid should be chosen at random from one of the images. The purpose of this is to have a tiling that doesn't repeat, a la http://en.wikipedia.org/wiki/Wang_domino and, more generally, http://en.wikipedia.org/wiki/Penrose_tiling
Here are a few images from a set as an example of what I would like to randomly tile:
Of course I could place them manually, but I may need to fill an area with thousands of these, and even if I did place them by hand, it wouldn't be very flexible as far as reshaping/resizing the tiled area, etc.
I'm trying to do this with Illustrator CS6 if it helps. Thanks in advance for any help!
-GregMike Gondek wrote:
Does this help?
Not in any way I can see. That (basically) just downsamples the selected image to create a tiled look that mimcs the original image. I need to fill a space exactly like a pattern would, but with each tile of the pattern being randomly selected from a set of images.
For clarity, here's a full example:
Given these three tiles:
Fill a space with random tiles to generate something like the following:
Note that in the above example, I did the placement by hand, which is both tedious and probably not very random on a large scale, nor flexible at all for different fills or later modification. -
Hello People,
are there many others experiencing problems creating Genius Playlists from their iPhone 5's???
I have a 64GB Black iPhone 5 and a 32GB White iPhone 5, I have recently performed a fresh install (wiped phone memory and installed Apps individually again) yet even after this and no less then several calls to Apple I am still unable to create a genius playlist on either phone. The message I receive after hitting the Genius "star" is "The operation couldn't be completed. Operation timed out" Operation timed out."
I have tried this also on 3G and receive the same message........Lawrence Finch
ShadowDancer1000 wrote:
I wish Apple would have provided more detail on how it worked. I wouldn't have posted this if I new that SMS & Mac Calling had nothing to do with Bluetooth pairing.
You mean like this? Get help using Continuity with iOS 8 and OS X Yosemite
Please note how Apple articulates this though.
Check your settings
Check the following settings on your iPhone, iPad, or iPod touch:
Go to Settings > Wi-Fi and turn on Wi-Fi if necessary.
Make sure your iOS devices are connected to the same Wi-Fi network by going to Settings > Wi-Fi and comparing the name of the network each is on.
Go to Settings > Bluetooth and turn on Bluetooth if necessary.
Go to Settings > General > Handoff & Suggested Apps and make sure Handoff is on.
Go to Settings > Phone. If you see Wi-Fi Calling, turn it off.
Sometimes things have to be explained in more detail for the general consumer who has been conditioned for decades to think about wireless cellphone audio / light data to [anything other device else] connectivity in a certain fashion. That is to say Bluetooth dependent ...
For the non-technical person, which overwhelmingly many Apple users are, they would see that bulleted point and think if Bluetooth is not paired and active, then they would not received the full scope of their Continuity features.
It would have been better for the copywriter who wrote this to (*) footnote this entry and explain that while Bluetooth recognition may be necessary between Yosemite and iPhone, SMS Push to iMessage and Mac Calling does not require an actively paired connection as these functions are dependent on iCloud and both devices being registered on the same WiFi network.
Thank you to all who helped me get my mind around and figure this out.
It has also opened my eyes to how iCloud has become a critical link in Apple's overall walled garden and business strategy. -
Where are files downloaded to on the mac when creating a pdf from web pages?
where on the mac HD are files downloaded to when creating a pdf from web pages?
Im creating web pages from the whole site so creating a large document, so wondered where these fiels are stored on the mac so I can delete when finished as dont want to clog up the hard drive.Look at the LiveCycle server products.
-
How to hide or remove several areas from a clip and create a generator
Hello dear comnunity,
I'm in an urgent need an assistance:
I need to proeuce a video of a screen recoding.
I'm using Camtasia in order to record. The meterial is pretty static.
The problem:
I have a lot of information on the screen while I'm recoding which I'd like to remove in post.
Basically what you see is a poker table. Each circle represents a player.
What I need is to be able to "remove" all these colorful numbers in order to provide with a "cleaner" look.
I understand that this can be accomplished by "layers" i.e.
Use this as a "background":
and then remove all of the areas with the colorful numbers.
In short:
I'd like to remove multiple areas from a single clip without having "holes".
Note:
Since I producing multiple vidoes I would like to be able to have some sort of effect\preset\generator etc in order to automate the process every time.
I have FCP X as well as Motion 5.
I saw some split screen generators with multiple areas. It looks like what I need but I do need to make my own custom splits.
PLEASE try to provide with detailed information as much as possible. I'm not a noobie but not an expect as well.
Thanks in advance, I really really appreciate your assistance.By default, the toolbar cannot be hidden.
However, you can add button items to the toolbar, hook up to the event handlers, and create new menus and menu-items in your gadgets.
What version of Smart Space are you using? The SDK is slightly different between 9.3.1 and 11.1.x
There are ways to work around the toolbar and do some other slick UI renderings in regards to these topics.
Please drop me an email and we can have a phone conversation around what you are trying to do. I may be able to provide some ideas for you.
Thanks,
Rob Hull
Oracle Smart Space
Development Manager
[email protected] -
I am unable to get the information from I cloud to my new device from the latest restore point.
If your old iPhone was more up-to-date it won't restore a newer version's backup.
Set up as a new device (Skip Apple ID Sign-in to save time) and update iOS, then do Settings > General > Reset > Erase All Content & Settings to restart the iOS Setup Assistant and restore your iCloud Backup.
If it still won't work, contact AppleCare as there may be a problem with the iCloud Backup. They never charge for troubleshooting iCloud issues.
Maybe you are looking for
-
Tiger 10.4.11 connection to server shows Zero KB available
For some reason the two Macs in our company running Mac OS X 10.4.11 are not able to save to our company's server for a certain drive. There is 3.9 T of free space available but at the bottom of the finder window this is what reads "Zero KB available
-
I need help please I have my i phone, im setting the icloud and it keeps telling me to accept the new terms and conditions but the page wont populate for me to accept it, im getting annoying with it the pop up us making me crazy plase help.
-
Songs Purchased on iPod Touch WiFi iTunes Store Will not Sync Back to PC
I bought a few songs on the WiFi iTunes store on my iPod Touch today. When I connect the iPod to the computer, it syncs as normal, but the songs I bought are not transferring over. I tried right clicking on the iPod section and pressed "Transfer Purc
-
I thought this was supposed to be a seemless transistion. How do I get the info from the apps from my last iphone (2g) onto the 4S? Do I have to re-register and sign in to the apps?
-
ActiveSync only works for Contacts, not for Calendars and Email
So it seems that the ActiveSync is only working partially for me... When syncing with our company's OWA, my Contacts sync fine (though some create duplicates). However, the Calendar doesn't sync at all, and the Email only syncs the folder structure,