Git Product home page Git Product logo

nft-marker-creator's Introduction

NFT MARKER CREATOR

This editor creates NFT markers for ARTOOLKIT 5.x, and it is part of the efforts to bring NFT tracking to jsartoolkit5 (and eventually projects like AR.js).

A Node version (preferred) and Web version are provided.

Check out the wiki to learn how to generate good markers! https://github.com/Carnaux/NFT-Marker-Creator/wiki/Creating-good-markers

If any errors occours, please, open a issue.

ZFT File

The zft file compresses the iset, fset and fset3 files into one!

Node version

How to use it

  1. Clone this repository.

  2. Install all dependencies.

    npm install

  3. Put the image you want inside the app folder. You can just paste it or you can create a folder. e.g

    • markerCreatorAppFolder
      • app.js
      • NftMarkerCreator.min.js
      • IMAGE.PNG ⬅️
      • ...

    or

    • markerCreatorAppFolder
      • app.js
      • NftMarkerCreator.min.js
      • FOLDER/IMAGE.PNG ⬅️
      • ...
  4. Run it

    node app.js -i PATH/TO/IMAGE

    In the end of the process an "output" folder will be created(if it does not exist) with the marker files.

You can use additional flags with the run command.

e.g node app.js -i image.png -level=4 -min_thresh=8

-zft
      Flag for creating only the zft file
-noConf 
      Disable confirmation after the confidence level
-Demo
      Creates the demo configuration
-level=n
     (n is an integer in range 0 (few) to 4 (many). Default 2.'
-sd_thresh=<sd_thresh>
-max_thresh=<max_thresh>
-min_thresh=<min_thresh>
-leveli=n
     (n is an integer in range 0 (few) to 3 (many). Default 1.'
-feature_density=<feature_density>
-dpi=f: 
      Override embedded JPEG DPI value.
-max_dpi=<max_dpi>
-min_dpi=<min_dpi>
-background
     Run in background, i.e. as daemon detached from controlling terminal. (macOS and Linux only.)
--help -h -?  
      Display this help
  1. The generated files will be on the "output" folder.

  2. (OPTIONAL) You can test your marker using the demo folder!

    If you want to create the demo configuration when you create a marker, add -Demo to the command parameters.

    e.g node app.js -i image.png -Demo

Web version

https://carnaux.github.io/NFT-Marker-Creator/

This version is less efficient for images with width and/or height with 1000px or higher.

Advanced options coming soon.

Instructions

  1. Upload any JPG/PNG image.
  2. If the Number of Channels is missing, it will ask for it.
  3. Click the generate button.
  4. Choose between ZFT or the iset, fset, fset3 files.
  5. The files will be automatically downloaded when the generation finishes.

If you want to generate you own NftMarkerCreator.min.js use the dev branch.

nft-marker-creator's People

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

nft-marker-creator's Issues

sometimes stuck at "Loading, please wait..." screen and marker not working

I am using node version marker creator. I have tested on different devices like android and IOS. In some devices stuck at "Loading, please wait..." screen, and some other devices after 'Loading of NFT data complete' marker scanning and sometimes marker not scanning. Can anyone please tell me how can I solve this issue?

Empty EXIF data

Using the Pinball example, which clearly has EXIF data, I receive this message: "The EXIF info of this image is empty or it does not exist. Do you want to inform its properties manually?[y/n]"

Screenshot 2019-12-18 at 17 51 58

Any thoughts on why this is? The file has read rights.

FLAGS += ' -s ERROR_ON_UNDEFINED_SYMBOLS=0'; is not needed

Hi @Carnaux i'm trying to improve the makem.js script i noted that there is the flag:

-s ERROR_ON_UNDEFINED_SYMBOLS=0

if you comment out the line

FLAGS += ' -s ERROR_ON_UNDEFINED_SYMBOLS=0';

the code compile fine, probably some sources are not needed as the AR, ARICP, ARMulti
that sould be added by this part of the code:

let arSources = glob.sync(srcTest + 'AR/' +'/**/*.c', {});
let arIcpSources = glob.sync(srcTest + 'ARICP' +'/**/*.c', {});
let arMultiSources = glob.sync(srcTest + 'ARMulti' +'/**/*.c', {});

infact this is my result in the console for libar.bc compilation:

walter@walter-RC530-RC730:~/kalwalt-github/NFT-Marker-Creator$ npm run build

> [email protected] build /home/walter/kalwalt-github/NFT-Marker-Creator
> node tools/makem.js; echo Built at `date`


Running command: /home/walter/emsdk/fastcomp/emscripten/emcc -I/home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/include -I/home/walter/kalwalt-github/NFT-Marker-Creator/build/ -I/home/walter/kalwalt-github/NFT-Marker-Creator/emscripten/ -I/home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher -I/home/walter/kalwalt-github/jsartoolkit5/emscripten/libjpeg /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/Video/video.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/ARUtil/log.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/ARUtil/file_utils.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/handle.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/imageSet.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/jpeg.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/marker.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/featureMap.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/featureSet.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/selectTemplate.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/surface.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/tracking.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/tracking2d.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/matching.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/matching2.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/template.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/searchPoint.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/coord.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/AR2/util.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/kpmHandle.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/kpmRefDataSet.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/kpmMatching.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/kpmResult.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/kpmUtil.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/kpmFopen.c /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/detectors/DoG_scale_invariant_detector.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/detectors/gaussian_scale_space_pyramid.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/detectors/gradients.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/detectors/harris.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/detectors/orientation_assignment.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/detectors/pyramid.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/facade/visual_database_facade.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/matchers/hough_similarity_voting.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/matchers/freak.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/framework/date_time.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/framework/image.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/framework/logger.cpp /home/walter/kalwalt-github/jsartoolkit5/emscripten/artoolkit5/lib/SRC/KPM/FreakMatcher/framework/timers.cpp -O3  -Wno-warn-absolute-paths  -s TOTAL_MEMORY=268435456  -s ALLOW_MEMORY_GROWTH=1  -s USE_ZLIB=1 -s ASSERTIONS=1 --memory-init-file 0  -s FORCE_FILESYSTEM=1   -D HAVE_NFT  -o /home/walter/kalwalt-github/NFT-Marker-Creator/build/libar.bc 

you can see that these files are not added, Do you have the same result?
I think we can modify the script to not include them. I'm working on this because i'm trying to develop a cross platform makem.js script for jsartoolkit5 see my PR
In this last case ( jsartoolkit5 ) the flag -s ERROR_ON_UNDEFINED_SYMBOLS=0 does not help because that files are requested.

i also noted that is used the flags var OPTIMIZE_FLAGS = ' -O3 '; // -Oz for smallest size
have you tried to optimize the code with the -Oz flag?

last thing probably also the option FLAGS += ' -s ALLOW_MEMORY_GROWTH=1 '; should be verified i think...

Confidence level not calculating

I am trying to calculate the confidence level for a small png file, I have tried using the online generator as well as node version but both have outputted all my images as 0 confidence unless I manipulate the shannon entropy

Buf is not defined

  1. Cloned repo
  2. Ran npm install
  3. Ran node app.js

Received error:

ReferenceError: buf is not defined
    at Object.<anonymous> (/Users/jonas/Documents/GitHub/NFT-Marker-Creator/app.js:34:12)

npm 6.13.2
node 12.13.1

Had a quick look at app.js and seems to be a typo on line 34:

useJPG(buf);

buf, should be buff. Runs now. Was there an intention with the "buf"?

Enhance node version

The node version is very good, but I think that the input/output configuration can be better. Actually, to have two folders and place the image in one is ok but can be annoying, also provided the limitation of having just one image on the input folder.

A little improvement, that in my opinion can enhance the user interaction on the node app and makes it more flexible, would be to use command line parameters to specify the input image path and output directory path.
This will be much similar to the majority of terminal scripts UI on which users are comfortable with.

Something like:

node app.js -i inputImage.png -o output -..... other options

where output is a new directory containing the three, generated files (if directory is not present, create it on the fly).

display featureset

Hi

I want the dispFeatureSet feature

dispFeatureSet displays trained NFT datasets by overlaying representations of the data points on the source images.

It's a good reference when trying to create a good marker image

Demo does not start, Webcam Error

I created a marker and ran npm run demo but I get the following error

Webcam Error
Name:
Message: WebRTC issue-!
navigator.mediaDevices not present in your browser

I was able to run AR examples in this browser before. Any hint what the problem could be?

not detecting exif data in image files

D:\LAB\arjs\nft\NFT-Marker-Creator>node app.js -i /image/cn.jpg
The EXIF info of this image is empty or it does not exist. Do you want to inform its properties manually?

How to design markers to have more accuracy ?

I have the following marker
image
but the confidence level im getting is zero, so i made few more tests and added more entropy at each step, but the confidence level stayed at zero
image
now, i have scaled up the image 300% times, added bunch of noise and distortions to a ridiculous amount, and finally it results in 5 stars confidence
image

Is there a better way to make markers from vector images ?

Edit : Using AFrame + AR.JS ( latest versions )

the fset/iset files created from web are different from node

Hi Guys

looking for any assistance,

i tried running the node.js application and provide it with a png left arguments at the default.
it produced 3 files but when i run them in the demo they are not be detected.

i then provided the same png to the website replaced the nodejs generated fset/iset files with the ones from the website and they are been detected.

please see attached, the nodejs ones are a different size than the website ones.
i am not sure if i should be passing in any addtional args etc

output.zip

duplicate url with jsartoolkit5

Trying to use both NftMarkerCreator and jsartoolkt5 in a single web page.

both project need to specify wasm url like

<script type='text/javascript'> var artoolkit_wasm_url = './lib/NftMarkerCreator_wasm.wasm'; </script> <script type='text/javascript'> var artoolkit_wasm_url = '../build/artoolkit_wasm.wasm'; </script>

Error on console
Uncaught RangeError: Maximum call stack size exceeded

Wasm version of NFT-Marker-Creator

It would be interesting to try a wasm version of the app (node and web). In theory It shouldn't be too difficult but of course we have to test it.

Feature request: Downloadable packages.

It will be nice if it will be possible to download the project and the apps as a zip file or a npm package. This would be the preferable action for user that are not used to git and all git commands/procedures.
I'm writing a little tutorial and i'm facing this "problem" that if you want to use the node app you are obliged to install git and run git clone to download the project.

ImageSet generation error

After "fixing" the 'buf' typo I receive:

[info]    (Source image xsize=1637, ysize=2048, channels=0, dpi=220.0).
[error] ImageSet generation error!!
exit(70) called, but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)

Based on the original pinball image. I had to enter the EXIF data manually. No output generated.

On Mac Mojave.

Some restrictions about input files

Hi,

My idea is, with this issue, to try to list all input images requirements and known problems.
Not all of the following have to be fixed: some of them may become requirements, other may be bugs to fix.

Known requirements/limitations:

  • file has to have .jpg extension
  • file name has to contain .jpg extension (e.g. on Mac verify that extension is present)
  • after resizing the image (e.g. Using Mac OS Preview tool) the system gives an error
  • I have used a black and white image, set NC=1, but does not work (generates .iset files but not recognised). Someone can try this too? Maybe can be something on the NFT app side, maybe missing some parameters.

Other?

Testing NFT-Marker-Creator with SIMD instructions

According to this article is possible to compile and build WASM code with SIMD instructions. This could be improve the performances for the NFT-Marker-Creator and maybe require less time to produce a NFT Marker, at least for who want to try this feature. I would try this but not sure if i have the time to do now....

RuntimeError when trying to process a '.jpg' file (node version)

Hello, and thank you for providing this very useful tool!

I have been able to successfully use the web version of NFT-Marker-Creator to process both '.png' and '.jpg' files.
I can also successfully generate descriptor files from '.png' files with the node version. (NOTE: I have not been able successfully recognize the image for any .png file I've created descriptor files for)

However, I am unable to process '.jpg' files with the node version. I get a RuntimeError.
Here is the image: https://avo-content-dev.s3.amazonaws.com/image-tracking-proto.jpg
(I did try a different .jpg file, which fails as well)

Note this image succeeds when using the web version, but fails with the node version.

I followed the 'How to use it' steps in the README, to install and run the node version.

Here is the error...

Output

[13:29:07] smarsh:NFT-Marker-Creator git:(test-run*) $ node app.js -i greenlight.jpg -noConf -noDemo
Check output path: /Users/smarsh/dev_projects/source/reference-projects/NFT-Marker-Creator/output/

TypeError: Cannot read property '0' of undefined

I stepped through the application in the debugger, and at line 221 in app.js, the call to inkjet.decode() returns an error.

I noticed there is a new version of the inkjet package available. I tried that version of the package, and still get a failure. The output is different however.

Output when using npm package inkjet v3.0.0

[13:17:24] smarsh:NFT-Marker-Creator git:(test-run*) $ node app.js -i greenlight.jpg -noConf -noDemo
Check output path: /Users/smarsh/dev_projects/source/reference-projects/NFT-Marker-Creator/output/
TypeError: Cannot read property 'value' of undefined
TypeError: Cannot read property 'value' of undefined
/Users/smarsh/dev_projects/source/reference-projects/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:1
var Module=typeof Module!=="undefined"?Module:{};var scope;if(typeof window!=="undefined"){scope=window}else if...


RuntimeError: abort(TypeError: Cannot read property 'value' of undefined) at Error
    at jsStackTrace (/Users/smarsh/dev_projects/source/reference-projects/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:1:23770)
    at stackTrace (/Users/smarsh/dev_projects/source/reference-projects/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:1:23941)
    at process.abort (/Users/smarsh/dev_projects/source/reference-projects/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:1:20844)
    at process.emit (events.js:314:20)
    at processPromiseRejections (internal/process/promises.js:245:33)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
    at process.abort (/Users/smarsh/dev_projects/source/reference-projects/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:1:20875)
    at process.emit (events.js:314:20)
    at processPromiseRejections (internal/process/promises.js:245:33)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)

Any suggestions for fixes, or settings for me to try, are greatly appreciated! Thanks.

Error on processing jpg images: abort(TypeError: Cannot read property 'value' of undefined) at Error

When running node app -i imgname I get a big fat error that ends with the following:

RuntimeError: abort(TypeError: Cannot read property 'value' of undefined) at Error
    at jsStackTrace (/home/boris/webdev/personal/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:1:23770)
    at stackTrace (/home/boris/webdev/personal/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:1:23941)
    at process.abort (/home/boris/webdev/personal/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:1:20844)
    at process.emit (node:events:376:20)
    at emit (node:internal/process/promises:202:22)
    at processPromiseRejections (node:internal/process/promises:223:25)
    at processTicksAndRejections (node:internal/process/task_queues:94:32)
    at process.abort (/home/boris/webdev/personal/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:1:20875)
    at process.emit (node:events:376:20)
    at emit (node:internal/process/promises:202:22)
    at processPromiseRejections (node:internal/process/promises:223:25)
    at processTicksAndRejections (node:internal/process/task_queues:94:32)

node version: 15.5.1
manjaro v20.2.1
kernel 5.10.2.2-manjaro

I've tried two jpg images: one is a random internet image and the other is an image of myself.
png files are processed without errors.

upd. I found that big error text is just the code of the NftMarkerCreator_wasm file...
The actual error is:

TypeError: Cannot read property 'value' of undefined
TypeError: Cannot read property 'value' of undefined
/home/boris/webdev/personal/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:112
      throw ex;
      ^

RuntimeError: abort(TypeError: Cannot read property 'value' of undefined) at Error
    at jsStackTrace (/home/boris/webdev/personal/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:1033:13)
    at stackTrace (/home/boris/webdev/personal/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:1047:12)
    at process.abort (/home/boris/webdev/personal/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:903:44)
    at process.emit (node:events:376:20)
    at emit (node:internal/process/promises:202:22)
    at processPromiseRejections (node:internal/process/promises:223:25)
    at processTicksAndRejections (node:internal/process/task_queues:94:32)
    at process.abort (/home/boris/webdev/personal/NFT-Marker-Creator/libs/NftMarkerCreator_wasm.js:905:9)
    at process.emit (node:events:376:20)
    at emit (node:internal/process/promises:202:22)
    at processPromiseRejections (node:internal/process/promises:223:25)
    at processTicksAndRejections (node:internal/process/task_queues:94:32)

Python related error

stderr: cache:INFO: generating port: libz.a... (this will be cached in "C:\Users\Daniel.emscripten_cache\asmjs\libz.a" for subsequent builds)
Traceback (most recent call last):
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\emcc.py", line 3262, in
sys.exit(run(sys.argv))
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\emcc.py", line 1641, in run
compile_source_file(i, input_file)
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\emcc.py", line 1626, in compile_source_file
args = get_clang_args([input_file]) + ['-c', '-o', output_file]
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\emcc.py", line 1607, in get_clang_args
args = system_libs.process_args(args, shared.Settings)
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\tools\system_libs.py", line 1029, in process_args
args = port.process_args(Ports, args, settings, shared)
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\tools\ports\zlib.py", line 55, in process_args
get(ports, settings, shared)
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\tools\ports\zlib.py", line 46, in get
return [shared.Cache.get('libz.a', create, what='port')]
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\tools\cache.py", line 127, in get
temp = creator()
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\tools\ports\zlib.py", line 42, in create
ports.run_commands([[shared.EMAR, 'rc', final] + o_s])
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\tools\system_libs.py", line 817, in run_commands
run_commands(commands)
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\tools\system_libs.py", line 35, in run_commands
call_process(command)
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\tools\system_libs.py", line 28, in call_process
shared.run_process(cmd, stdout=stdout, stderr=stderr)
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\emscripten\1.38.29\tools\shared.py", line 170, in run_process
proc = Popen(cmd, *args, **kw)
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\python\2.7.13.1_64bit\python-2.7.13.amd64\lib\subprocess.py", line 390, in init
errread, errwrite)
File "C:\Users\Daniel\Desktop\webAssembly\emsdk\python\2.7.13.1_64bit\python-2.7.13.amd64\lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 193] %1 n�o � um aplicativo Win32 v�lido

exec error: 1

Marker Quality

@kalwalt @nicolocarpignoli ThorstenBux So, I was testing with some images of packagings and with the NFT-Marker-Creator it generated ok, found the features, but it didn't track at all, but with the original GenTexData.exe, it works fine, so the quality of the markers generate by this generator are not equal to the original software. Any idea why? @kalwalt I believe we can use your marker visualization tool to compare them.

RuntimeError: abort(undefined) at Error

Hello,
Thank you very much for this tool!

I'm having issues creating FeatureSet files using the nodejs variant, the conversion is working up until these lines:
Saving FeatureSet...
[info] Done.
[info] Generating FeatureSet3...
[info] (4961, 7023) 300.000000[dpi]

Then it crashes with stacktrace:

Assertion mData.get() failed in C:\wamp64\www\emscripten\emsdk\NFT-Marker-Creator-dev\emscripten\artoolkit5\lib\SRC\KPM\FreakMatcher\framework\image.cpp line 149: Data pointer is NULL
undefined
undefined
RuntimeError: abort(undefined) at Error
at jsStackTrace (C:\WebAR\NFT-Marker-Creator\libs\NftMarkerCreator_wasm.js:1:23770)
at stackTrace (C:\WebAR\NFT-Marker-Creator\libs\NftMarkerCreator_wasm.js:1:23941)
at abort (C:\WebAR\NFT-Marker-Creator\libs\NftMarkerCreator_wasm.js:1:20844)
at _abort (C:\WebAR\NFT-Marker-Creator\libs\NftMarkerCreator_wasm.js:1:85471)
at wasm-function[362]:373
at wasm-function[1068]:162
at wasm-function[1161]:51
at wasm-function[1059]:127
at wasm-function[1061]:207
at wasm-function[1048]:67
RuntimeError: abort(undefined) at Error
at jsStackTrace (C:\WebAR\NFT-Marker-Creator\libs\NftMarkerCreator_wasm.js:1:23770)
at stackTrace (C:\WebAR\NFT-Marker-Creator\libs\NftMarkerCreator_wasm.js:1:23941)
at abort (C:\WebAR\NFT-Marker-Creator\libs\NftMarkerCreator_wasm.js:1:20844)
at _abort (C:\WebAR\NFT-Marker-Creator\libs\NftMarkerCreator_wasm.js:1:85471)
at wasm-function[362]:373
at wasm-function[1068]:162
at wasm-function[1161]:51
at wasm-function[1059]:127
at wasm-function[1061]:207
at wasm-function[1048]:67
C:\WebAR\NFT-Marker-Creator\libs\NftMarkerCreator_wasm.js:1
var Module=typeof Module!=="undefined"?Module:{};var scope;if(typeof window!=="undefined"){scope=window}else if(typeof window=="undefined"){scope=global}else{scope=global}if(scope.artoo
lkit_wasm_url){var downloadWasm=function(url){return new Promise(function(resolve,reject){var wasmXHR=new XMLHttpRequest;wasmXHR.open("GET",url,true);wasmXHR.responseType="arraybuffer";
wasmXHR.onload=function(){resolve(wasmXHR.response)};wasmXHR.onerror=function(){reject("error "+wasmXHR.status)};wasmXHR.send(null)})};var wasm=downloadWasm(scope.artoolkit_wasm_url);Mo
dule.instantiateWasm=function(imports,successCallback){console.log("instantiateWasm: instantiating synchronously");wasm.then(function(wasmBinary){console.log("wasm download finished, be
gin instantiating");var wasmInstantiate=WebAssembly.instantiate(new Uint8Array(wasmBinary),imports).then(function(output){console.log("wasm instantiation succeeded");successCallback(out
put.instance)}).catch(function(e){con

What I do not quite understand is this line:

C:\wamp64\www\emscripten\emsdk\NFT-Marker-Creator-dev\emscripten\artoolkit5\lib\SRC\KPM\FreakMatcher\framework\image.cpp line 149

as I don't have that folder on my machine.

Image type: jpg or png
Image Width 4961px
Image Height: 7023px
DPI: 300dpi

Any help is appreciated. Thank you!

QR Images are not working

Tied creating NFT marker using a genrated QR code, it showing the confidence level as 0 star. But the Same QR having 5 star Rating on Vuforia's Image target creator. Kindly help me to create the QR as NFT marker. Thanks in advance

Screenshot 2020-11-22 155928
Screenshot 2020-11-22 155912

Is there a way to create the nft markers in native app, using opencv or similar lib?

NFT tracker creator is pretty slow at the moment and prone to hangups when the image is not too good or is too big .
What is the description method for creating the nft markers? Is it creating some king of lookup table to speed up recognition?
Is there a way to use other libraries (like opencv or accord.net) to create similar files compatible with ar.js?

I build a js file. What's next?

Greetings! Could you please help me?

I managed to build NftMarkerCreator.min.js, libar.bc and libjpeg.bc files using my Mac.
What's next? How can I convert JPEG images?

Thanks in advance!

Calibrating the confidence level

@kalwalt @nicolocarpignoli @jonasjohansson With the last commit I added a confidence level based on Shannon's entropy equation. To calculate the level( 0 - 5 ) I tested with this image that gives an entropy of 4.6, I couldn't get it to be detected by my webcam so i set its entropy as the minimum (0), the maximum(5) its an entropy of 5.17 of the pinball image.

The node app logs at the end:
Confidence level: [ * * * * * ] 5/5 || Entropy: 5.17 || Current max: 5.17 min: 4.6
And the web version display stars.

If you find any image that does not correspont to it's confidence level, please report in this issue!

Using the flag '-s USE_LIBJPEG'

Recently we merged this PR kalwalt/jsartoolkit5#13 Into my branch fixing-nft because by emscripten v1.38.31 libjpeg It can be included in the project simply with the flag -s USE_LIBJPEG . We also strongly suggest to use the Docker container to build the jsartoolkit5 project. Because the NFT-Marker-Creator is based in part on jsartoolkit5, it is recommended to do the libjpeg changes. That Is, i would do but i don't know when...

More information about the parameters ( level / leveli )

Hi,

the documentation for getting started is great but some paramaters are really dark to me like level and leveli ?

I would love to have more information about what they are doing, thanks!

the most dark parameters :

-level=n
     (n is an integer in range 0 (few) to 4 (many). Default 2.'
-sd_thresh=<sd_thresh>
-max_thresh=<max_thresh>
-min_thresh=<min_thresh>
-leveli=n
     (n is an integer in range 0 (few) to 3 (many). Default 1.'
-max_dpi=<max_dpi>
-min_dpi=<min_dpi>

Memory issues when creating two NFTs one after the other

Hi @Carnaux as mentioned I've created a WS version of your marker creator. Code here: https://github.com/augmentmy-world/NFT-Marker-Creator

Now the issue I'm facing is that if I create two markers one after the other I'm getting

[error] Error: unrecognised option '(null)'
RuntimeError: memory access out of bounds
    at wasm-function[373]:0x147ae
    at wasm-function[249]:0xbc17
    at wasm-function[742]:0x2ce93
    at wasm-function[209]:0xa0fa
    at wasm-function[175]:0x7cad
    at wasm-function[118]:0x4ac6
    at wasm-function[893]:0x47067
    at Object.Module._createImageSet (/Users/thorstenbux/repos/2dTracking/nft-marker-creator/nftCreatorWS/libs/NftMarkerCreator_wasm.js:1:106898)
    at runtime (/Users/thorstenbux/repos/2dTracking/nft-marker-creator/nftCreatorWS/create.js:111:12)
    at create (/Users/thorstenbux/repos/2dTracking/nft-marker-creator/nftCreatorWS/create.js:202:5)

I've seen this in your original version too if you run the Node version locally and create two marker one after the other you run in a similar issue. Any hint highly appreciated.

Nft pattern creation is slow with nodejs marker creator but fast with web marker creator

Do you want to request a feature or report a bug?

bug

What is the current behavior?

If I try to create a marker from a 2000x2000 hiro image it takes 10min with nodejs version (https://github.com/Carnaux/NFT-Marker-Creator) but only a few second with web version (https://carnaux.github.io/NFT-Marker-Creator/)

If the current behavior is a bug, please provide the steps to reproduce.

Create a 2000x2000 image from hiro and use the creators.

Please mention other relevant information such as the browser version, Operating System and Device Name

windows 10, google chrome, the nodejs version tried in linux

What is the expected behavior?

The nodejs marker creator creates marker fast like the web version.

A better compression for the exported files.

I am wondering if we can in some way compress the features set files and in this sense we can have a gain in uploading time of all .fset. At the moment i don't know if It is possibile or what technique can be used, but if you know post here your idea.

Expected identifier in jmorecfg.h

In file included from assemble.c:14:
In file included from headers\jpegHeaders/jpeglib.h:27:
headers\jpegHeaders/jmorecfg.h:263:17: error: expected identifier
 typedef enum { FALSE = 0, TRUE = 1 } boolean;
                ^
headers\AR/ar.h:104:17: note: expanded from macro 'FALSE'
#  define FALSE 0
                ^
In file included from assemble.c:14:
In file included from headers\jpegHeaders/jpeglib.h:27:
headers\jpegHeaders/jmorecfg.h:263:28: error: expected identifier
 typedef enum { FALSE = 0, TRUE = 1 } boolean;
                           ^
headers\AR/ar.h:101:16: note: expanded from macro 'TRUE'
#  define TRUE 1

Custom image doesn't display flamingo in demo despite it being tracked

Hi @Carnaux, I'm trying to create an NFT marker from a custom image.
The image has a rather poor quality (only 1 star) and the flamingo doesn't seem to display when I run the demo.

However when I log "scene.visible" to the console. It returns true when I try to track my image. (along with multiple logs like: "[info] Tracked page 15794384 (max 0).")
Is additional configuration required for a marker to be able to display a marker when It can already be tracked?

I tried to set the model scale to 0.0001 and multiple it by 10 every second in case it wasn't shown due to size differences. But this still didn't show anything.

When I generate a marker from the pinball image downloaded from the web, the flamingo model is shown without any issues or demo code modifications.

I've attached the image and generated markers which I generated.
boter_marker.zip
boter

Thank you for your help!

Use of EXIF-JS and errors

Using the code to read jpeg headers from https://github.com/exif-js/exif-js is possible to get all properties listed in #6.

Problems detected:

  1. Not all jpg can be read by the library, so it is needed to create default values for them.
  2. The ones that can be read, give the error "Empty JPEG image (DNL not supported)" during the creation of the .iset file.

Maybe related with 2:
https://stackoverflow.com/questions/16470268/empty-jpeg-image-dnl-not-supported-node-canvas

KhronosGroup/WebGL#1533

Bugs with new update

Errors on node app:

  • Cannot read property description

  • Invalid file signature

Errors on Web:

  • Not possible to open the NFTtoZFT page(Path issue)
  • NFTtoZFT rename

Erros on Jsartoolkit5:

  • Warping models when turning image.

cannot process image

hi @Carnaux, there are some problems when processing images with .jpg or jpeg extension.

  1. clone project
  2. npm install (node version 13.4.0)
  3. copy https://raw.githubusercontent.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex-image-big.jpeg to root folder of the project
  4. node app.js -i trex-image-big.jpeg

after executing this, it says: TypeError: Cannot read property '0' of undefined
image

however, if i use the web version of marker creator with the same image, it works~

Web app version

I think a good enhancement will be to have a good web app version.

Now the node app version works very good with PNG and JPEG, but many users will likely use the browser one (like the Marker generator for pattern marker of AR.js).

I'd like to open this discussion to understand:

  • where is the source code of the web app version? we should include it on the master branch
  • how can we make it better?

ImageSet generation error

There was an error upon running the command it says that writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead! but when I change writeStringToMemory to stringToUTF8 I got other errors 'stringToUTF8' was not exported

Node Flags Documentation

Hi @Carnaux, testing out images with different settings applied and would like to request additional information of these parameters and how they might affect the output.

level, sd_thresh, max_thresh, min_thresh, leveli, feature_density.

Would be great if there could be an "advanced" section in the documentation.

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.