Code Monkey home page Code Monkey logo

fspy's Introduction

What is this?

fSpy is an open source, cross platform app for still image camera matching. See fspy.io for more info. The source code is available under the GPL license.

fSpy screenshot

Backstory

Once upon a time I wrote BLAM, a Blender add-on for still image camera calibration that, despite its clunky UI, has gained some popularity in the Blender community. fSpy is an attempt to bring BLAM's functionality to a wider audience in the form of a stand alone app.

Using the computed camera parameters in other applications

In theory, camera parameters computed by fSpy could be used in any application that has a notion of a 3D camera and provides some way of setting the camera parameters. If you're a Blender user, have a look at the offical fSpy importer add-on. If you're using an application without a dedicated importer, you may still be able to manually copy the camera parameters from fSpy.

Interested in writing an importer for your favorite application? Then the fSpy project file format spec is a good starting point.

Building and running

The following instructions are for developers. If you just want to run the app, download the latest executable for your platform.

fSpy is written in Typescript using Electron, React and Redux. Visual Studio Code is recommended for a pleasant editing experience.

To install necessary dependencies, run

yarn

The src folder contains two subfolders main and gui, containing code for the Electron main and renderer processes respectively.

Here's how to run the app in development mode

  1. Run yarn dev-server in a separate terminal tab to start the dev server
  2. Run yarn build-dev to build both the main and GUI code. This build step is needed to generate main process code used to start up the app.
  3. Run yarn electron-dev in a separate terminal tab to start an Electron instance which uses the dev server to provide automatic reloading on GUI code changes.

⚠️ The current build process is not ideal. For example, it lacks support for live reloading on main process code changes. Changes to main process code require a manual rebuild, i.e steps 2-3, in order to show up in the app.

Creating binaries for distribution

To create executables for distribution, run

yarn dist

which invokes Electron builder.

fspy's People

Contributors

kant avatar stuffmatic avatar tiktuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fspy's Issues

Support for translations

Hi,
The first thanks for the application, I have created the Localizable.strings file for Spanish language, is it possible give support for translations?
Here the zip file that includes the Localizable.strings file:

es.zip

Waiting your answer,

Greetings

Cmd arguments - sensor size

It would be great to be able to send filmback info to fspy as a command line argument when launching. Something like:

fspy.exe -sensor_size 26.4x14.85

It would be useful for an exporter tool.

Zoom

Feature request:
It would be really cool if you would be able to zoom in.
It would just make things a lot easier.

How to download Fspy Application for Mac

Hi I've been trying to download the application for Mac and I can't seem to find the separate application in the zip files. I've gotten the blender addon to work and it imports the test files fine. Is there a special way to import the app to mac?

image filtering options

It would be great to have an option to use nearest filtering for exemple so we can more clearly see corners and lines on a low resolution image.

in my use case: I use a lot of obscure old image, most of the time in low resolution.

Minor linux issues

From blndrusr on blenderartists.org

I noticed a couple of minor issues which I wanted to share - maybe you’d like to have a look on them: The title of the app window remains ‘Untitled’ after saving a file, Hitting ctrl+S (or ctrl+shift+S) brings the path to fSpy location - I think I would be handy to land on the image location instead.

Won't Start, "dns.js" Error

I used the Win64 build, not the installer, and when I try to open fSpy nothing appears. When I run it from PowerShell I get this:

dns.js:246
this._handle = new ChannelWrap();
^

Error: EFILE
at new Resolver (dns.js:246:20)
at dns.js:377:25
at dns.js:431:3
at NativeModule.compile (bootstrap_node.js:606:7)
at NativeModule.require (bootstrap_node.js:550:18)
at net.js:45:13
at net.js:1730:3
at NativeModule.compile (bootstrap_node.js:606:7)
at NativeModule.require (bootstrap_node.js:550:18)
at internal/child_process.js:6:13

I suspect it may be related to not having an internet connection at the time because now that I'm at the library with an internet connection it's not giving me this error. I don't think this should be happening at all though, can't see what having an internet connection has to do with this; it should all be done on the local machine, right?

Reference distance issues

I am having difficulty with the Reference distance in fSpy.

The input box where you would type the variable (default 4) does not accept input. The drop down next to it allows you to select the unit as expected (Meters, Millimeters, Inches etc), but not the input box.

I am likely doing something wrong as I would assume that this would have been picked up as an issue prior to this.

In my example, I know the size/width of the Evacuation Diagram (315mm) , and am hoping to scale the entire scene so when in Blender, I can import scaled models without having to adjust by eye.

Anyone else having this issue?

Example

Specify default folder in CLI

Would be good to specify a default path for filesystem windows to open up in (eg file import, JSON export, etc). At the moment they always open up to the same folder as the last time they were used, but in the context of a VFX pipeline you often have a specific folder somewhere in a big file structure where a file needs to go.

Related to the 3rd party software importer/exporter workflow discussed in #11.

Ideally, it would be awesome to be able to run something to the effect of fSpy open "/path/to/myShot/plate/plate.jpg" wd "/path/to/myShot/projectFiles/fspy/" that tells it to open plate.jpg and open up all dialogs to the default fspy/ folder. This is pretty much my current workflow with it, but would speed up the process dramatically.

Can it read metadata from and image file?

Many pictures contain data about the focal length & camera body (sensor size). Is it possible for fSpy to read metadata and look for information to fill in some details that way?

How does the Camera Parameter Data relate to the Axis Angle values in the Gui?

I'm trying to work with the json/binary camera parameter data and I've noticed that none of the numbers in the json file seem to line up with the values in the gui. I'm assuming some sort of conversion is happening. If I have everything set to degrees, how do I convert the json/binary camera parameters into the numbers I see in the gui?

Build failure: trash: command not found

My Archlinux doesn't seem to have "trash" (moves to trash?):

$ git clone https://github.com/stuffmatic/fSpy
$ cd fSpy
$ yarn dist
yarn run v1.15.2
$ yarn run build-dist
$ trash build
/bin/sh: trash: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
hrehfeld@herbert ~/projects/ext/fSpy
$ 

Zoom on image?

Hello. I love fspy, but for some reason I can't get this image
92d1e9a2-0e24-478f-9190-f07ae4d5f723 jpg 1000x1000_q95
to line up correctly in blender. I think it would be much easier if I could zoom in on the image. Can you please add that feature?
Very respectfully
Moonie68

Two enhancements

(enhancement)

  1. Can it be made possible to place the manual principal point outside the image area?

  2. Is it also possible to make an extra (checkbox) option for:

If there are two vanishing points and manual principal point is chozen,
-then it sticks to the (invisible) horizon line between the two vanishing points?

Principal point
● Manual
--restricted to horizon ◯

Thank you

Remember GUI settings

It would be great if fSpy could remember settings (or set default values somehow).

For example, I constantly uncheck the "dim" checkbox and also change the display geo to xz grid.

Could I edit some file in ../AppData/Roaming/fSpy already or are the default values hard coded?

Microsoft Windows Defender found the threat in fspy-1.0.3-x86_64.AppImage

Default name/extension while saving

Sequence for reproduce on windows 7:

  1. Start fspy.
  2. Drag and drop jpg file in program window.
  3. Set points.
  4. menu - File-> Save.
  5. On file menu, go to folder with source .jpg file. Click on .jpg filename.
  6. Click save.
    What I suppose to do: save .fspy file with same name with .jpg file in one folder.
    What I really get: warning that "file with this name already exist in folder, Replace?". Message box show me filename with .jpg extension.
    I click "Yes, replace" and create file with jpg name, and .jpg.fpsy extension.

I think ".jpg" doesn't need in middle of name, and warning message is mistake, because in fact file saved with .fspy name.

Compile issue

I have cloned the repository from Github in a workspace folder in Visual Studio Code. I have executed yarn to download all dependencies packages, but I can't compile the project. Visual Studio Code request to edit launch.json file. How can I compile and debug the project?

Install for MAC

I cant install FSPY to MAC. Doesn t recognize it because it is for windows. Can somebody help me?

Multiple Versions Installed - Can't tell which is running

Love this tool!

I have fSpy versions 1.0.2 & 1.0.3 installed on Win10. Still using Blender 2.79, as well as 2.80.

They look identical when started. Is there a way to quickly tell which version I'm using?

I can't find an About dialog or version number anywhere in the interface.

Fspy app window isn't opening

I used fspy few times without any problems and everything worked great, but for some reason it just stopped working.
(I have a 64 bit Windows 10 laptop)

The problem is that it shows up on my taskbar as an active program and when I hover my mouse over the icon on taskbar, it shows the window like it would show it for any other program. Here's an image, of how it looks:

fspy

But the fspy window just isn't anywhere. This is very similar to what would be happening, if I had another screen connected and the window would be placed there, but I don't have 2 screens, and my project setting is set to PC screen only. Here's a gif of me switching my programs, you can see when i stop on the fspy tab, nothing appears, as if it was transparent:

fspygif

I have tried restarting my computer, connecting to a second screen, reinstalling the program and I even installed the 1.0.2 version, but the problem is still there.

Judging from this, it's most likely a problem on my PC, but I have no idea how to fix it and I haven't found any alternatives to fspy. I really need fspy for some blender projects I have planned, so any help on how to fix this problem is appreciated

fSpy file import to mac vs. Windows

When I import fSpy files to Blender using the mac (with the exception of the example file) the import displays the image used, but no vanishing points, also no geometry appear. Performing the same operation using Windows everything works as it should.

installation problem : fspy file not showing in the add-ons folder

Hi everybody !

I am using a mac.

When i try to install Fspy, i correctly import the source code and then when i want to tick it in the add-on menu I don't find it anywhere. I tried to download it several other times
<img width="944" alt="Capture d’écran 2019-10-08 à 01 35 28"
and it won't show up...

If anybody has some idea of what is happening it would be amazing

src="https://user-images.githubusercontent.com/24400032/66356637-f3a59b80-e96b-11e9-9fe6-20d02825f636.png">
Thxxxxx

Export does not save with extension; Show extension name in Save/Export dialog extension list

There are two problems here.

I was wondering whether files were being saved correctly or not because depending on what option I chose, the file would get saved as an extensionless file.

Specifically, if I use any of the Export options, the aforementioned happens.

If I use Save or Save As, then the file gets saved as an .fspy file.

In the Save dialog, the only misinformation in display is the text "All Files". That is why I could not tell whether the file was being saved with an extension or not until I checked the folder it was saved to.

Possible improvements

I've used F-spy for a while with mixed results, I'm recreating buildings demolished years ago, most being built before the 1940. Some have few plans available and some don't contain any detailed drawings so using images is a necessity to accurately recreate them. Some images are over a century old and knowing the focal length/camera used to take them is impossible, all images are negatives. Some of my own images from a modern DSLR aren't aligning properly either.

I've got a few suggestions to improve usability and accuracy.

Scrolling into the images instead of the magnifying bubble, large resolution images are almost impossible to see.

Ability to pin the Grid/Box corners to a place on the image.

Alternatively being able to use the box to lineup the perspective completely, Looking back at corner pinning, it's easy to align the X & Z axies. Y is often a problem when working on a single facade not a corner building.

Being able to resize the box would be essential.

I'm happy to donate to get these improvements done. My project is strongly supported project from my local Museums, National & Council Archives.

Cheers
William.

Segmentation fault (core dumped)

When I try to start the AppImage on Ubuntu 18.10 it says Segmentation fault (core dumped) in the terminal and then quits. App Images are supposed to be portable so I don't know if that's a distro-wide problem but it certainly does make the program unusable. Google tells me that it's probably a bug so I hope you'll be able to fix it. I would love to use this program, it seems pretty cool. Thanks in advance ;)

More low-res compatible menu design?

As far as i read, this is a standalone and improved version of a blender add-on, Can we inspire from the UI a bit?
Well, I mean making the menus collapsable (more like properties editor) like this:
image
And making them scrollable?
image

This will add ability to be fit in lower resolution screens and being able to minimize the UI more.
As i am currently having this bug #12 and trying to find a nice solution. :P

I am not a programmer (yet?) but I would like to help if i can somehow?

Enhancement Idea

First of all—you are AMAZING for making this awesome tool! Now for an idea:

I am not a math genius, so I have no idea if this is possible. But I'm trying to match a scene that has few right angles. However it does contain a perfectly round plate.

Is it possible to calculate the perspective from an ellipse that relates to a real-world circle? Or a combination—say if we have one tabletop running through the scene providing one straight edge, and a circular clock on a wall providing the chance to match an ellipse?

Anyway, it's awesome as-is. Thank you!

Obstructed Focal length components

image

The Focal length comboBox and the textBox is obstructed, maybe scrolling the panel would help be enough


- A glad user who is thankful for keeping the project as open :)

Launch with image path?

Is there a way to launch fSpy with an image path? It would be a pretty useful feature as it would allow you to start fspy from a separate application with the image path set automatically.

Something like:
fspy -i /path/to/image.jpg

Image orientation incorrect after import

Image file direct from Samsung S9 camera is interpreted on import (drag and drop) as landscape.
20200614_164453.jpg

After opening the file in Photoshop and saving as jpeg (same file format as source) that file is imported with the correct portrait orientation
bollard.jpg

Photos.zip

I cant make z axis straight up

Hello Stuffmatic

i want to use fspy for furniture modeling every thing is correct except z axis i cant make it straight even if i choose manual principal point , regular if i draw with one/two vanishing point i can make any straight line in z axis
Capture02
Capture01

Handling EXIF orientation

It seems fSpy doesn't compensate for the EXIF encoded orientation at all. Would be nice to support that.

Zoom while dragging

Need a zoomed area while dragging point for preciese postioning. (Like in blender while placing motiontracking points). It will be allow pixel precision without any additional sortcuts or user action.
This area will be good in left or right panel, or near cursor while drag and drop point.

Camera Data questions

Hello, I'm having trouble understanding the data in the json file

I'm copy and pasting the radian orientation values from the gui into a search/find function in my code editor to find the values but they are nowhere to be found in the file. I asked before about the data and was told it is stored in radians, but I cannot find the value in the json file.

I've been able to decipher the fourth value of the first 3 entries in cameraTransform -> rows section as the translation values of the camera. What are the first three values in each of these arrays?

I also cannot find the focal length value, where is this stored in the json file? I'm just looking for a little more clarity on the file format if possible. I can see the relativeFocalLength value, but this differs significantly from the focal length value in the gui, what is the relationship between relativeFocalLength and focal length in the gui?

I need the rotation values ( x, y & z) and the focal length. Any help would be greatly appreciated, thank you.

Zoom

hi there, I know it's not properly an Issue but I'd like to know if there is a way of zooming the image ( the whole image and not only the Shift+drag spot magnifier) Thank you in advance for your time. I think that could be useful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.