Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Please help me, image as background and have coordinate on it

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
what i need to do is :
1.floor image as background
2.plot the contour on image

but the problem is ....
how to set coordinate in java ? Because im using coordinate to draw the signal strength (green)
i aready have signal data, but it is difficult to draw !
Anyone can help me ?
sample.jpg
[Thumbnail for sample.jpg]
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Do you know the floor plan dimensions in distance units (feet / metres), or the scale factor of the diagram?
 
motress zlting
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Karthik Shiraly wrote:Do you know the floor plan dimensions in distance units (feet / metres), or the scale factor of the diagram?



actually i have measure the distance between the access point and the signal strength at distance 12m (green colour), signal is -68dbm
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,

I understood the question to be: how to decide the values of {x, y, radius} in pixels, so that Graphics2D.draw(Ellipse2D) can be used.

To translate the radius of 12m into pixel units appropriate to the floor plan picture, you need the dimensions of the floor plan or the scale factor of the picture.

As an example calculation:
Assume the floor plan is on A4 paper (8.27" x 11.69") with a scale 1 inch = 10 feet.
It's digitized at 72 dpi.
So the resulting original image will be 8.27x72=596 pixels by 11.69x72=842 pixels, and 72 pixels represents 10 ft.
Say this image is loaded into your app JPanel (assume the layout is resizable).
At current layout, the JPanel is 400 by 300 pixels.
So the image will be scaled down to fit the JPanel, with scaling factors 400/596 for x-axis, and 300/842 for y-axis.
This means, in the JPanel, 10 feet is represented by (72 x 400/596) pixels on x-axis and (72 x 300/842) pixels on y-axis.
So 12 feet will be represented by (12/10 x 72 x 400/596) pixels on x-axis and (12/10 x 72 x 300/842) pixels on y-axis.

All this is possible only if you knew the floor plan dimensions or knew 1 inch=10feet (or x metres). Without that, it's not possible to translate 12m to pixels.
 
motress zlting
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Karthik Shiraly wrote:Hi,

I understood the question to be: how to decide the values of {x, y, radius} in pixels, so that Graphics2D.draw(Ellipse2D) can be used.

To translate the radius of 12m into pixel units appropriate to the floor plan picture, you need the dimensions of the floor plan or the scale factor of the picture.

As an example calculation:
Assume the floor plan is on A4 paper (8.27" x 11.69") with a scale 1 inch = 10 feet.
It's digitized at 72 dpi.
So the resulting original image will be 8.27x72=596 pixels by 11.69x72=842 pixels, and 72 pixels represents 10 ft.
Say this image is loaded into your app JPanel (assume the layout is resizable).
At current layout, the JPanel is 400 by 300 pixels.
So the image will be scaled down to fit the JPanel, with scaling factors 400/596 for x-axis, and 300/842 for y-axis.
This means, in the JPanel, 10 feet is represented by (72 x 400/596) pixels on x-axis and (72 x 300/842) pixels on y-axis.
So 12 feet will be represented by (12/10 x 72 x 400/596) pixels on x-axis and (12/10 x 72 x 300/842) pixels on y-axis.

All this is possible only if you knew the floor plan dimensions or knew 1 inch=10feet (or x metres). Without that, it's not possible to translate 12m to pixels.




Do you know how can i have a layer of coordinate on that image ?
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,

Sorry, I didn't understand your question about layer of coordinates. Can you try and explain what you're looking for? Are you asking how to overlay the circle on top of the floor plan so that the floor plan pixels are not overwritten?
 
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This is a cross post to https://coderanch.com/t/491417/Java-General/java/plot-this-contour

Admins please note.
 
Marshal
Posts: 80133
417
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

salvin francis wrote: . . . Admins please note.

Done.

Hope you don't mind, Robert, Rob and Jesper
 
New rule: no elephants at the chess tournament. Tiny ads are still okay.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
    Bookmark Topic Watch Topic
  • New Topic