vlfeat matlab error Attempt to execute SCRIPT vl_imsmooth as a function: - computer-vision

I am trying to use the VLFEAT function vl_imsmooth but matlab gives me an error:
'Attempt to execute SCRIPT vl_imsmooth as a function:'
Why this happens?
Might it be because of some mex files?
Should I recompile the c++ code for vl_feat?

The problem shuold be fixed by copying correct mexw32 or mexw64 file folder from ..\vlfeat\toolbox\mex to ..\vlfeat. In my case my operating system is 64 bit My folder looks like ..\vlfeat\mexw64

You are getting this error because your path ".../vlfeat-0.9.16/toolbox/imop/vl_imsmooth.m"
has a higher precedence than " ...../vlfeat-0.9.16/toolbox/mex/mexa64/vl_imsmooth.mexa64"
so you can simply run
pathtool
and then navigate the mexa64 path above the imop and you are done !!

Related

mex file compiled successfuly. DependencyWalker cannot find many of the dlls

I have compiled a mex file using MATLAB. I am having trouble since every time I try to run the code, MATLAB crushes.
I have tried using feval() function with a mexhost in order to separate the processes and debug, following this guide. When I am executing using feval(mh,'functionName',input), all I am getting is:
Invalid C++ MEX-file 'test_c'
However, when I am executing using feval(mh,functionName,input) I am getting an nrhs of size 0.
I have followed throw with this guide and used the DependancyWalker utility to get the following result:
A lot of the DLLs are missing. Even the basic LIBMEX.DLL can't be found. Am I doing something wrong here? How do I debug?
Probably some of MATLAB's folders aren't in your system path variable (%PATH% on Windows).

invalid board header windows

I am trying to process a binary file generated by a PSI DRS4 for work. I tried this using a C++ code given in the src folder of the software used to run the board.
A friend of mine compiled and executed this code on his linux computer just fine. I wanted to adapt this code to windows. I went through the compilation step pretty easily but then when I try to execute it, it just crashes...
After some further investigation, what I understand is that the header(s) cannot be read properly (probably leading to the crash when they're supposed to be used later in the code)
I thus tried to read the file with HexEditor Neo and here is what I get: screenshot binary file Hexeditor
As you see the part after EHEADER becomes unreadable... Is it normal? Has anyone faced this situation before ?

Python subprocess is unstable on Windows 10?

p = subprocess.Popen([executable_file])
This is only code that I am using to run the python subprocess. However, it has unknown issue that cause my program cannot open the executable file as expected.
executable_file is one file link (PATH) that locate executable program.
Ex. C:\Users\SharkIng\Dev\WhatEverSystem\Builds\Windows\program-123456789-123456789.exe
The python subprocess.Popen should run the program. However, sometime it works and sometime it is not (I did not change any code between this two situation)
OS: Windows 10
Python: 2.7.*
Error: [Error 2] The system cannot find the file specified
BUT: It is working if you manually run subprocess.Popen([executable_file_path_string]) (with same file and path) it work.
WHY this happen?? Is that because some problem with Windows Python? or it is because my setting mess me up?
UPDATE: It is not some reason such as NOT FULL PATH. I can have it working with exact same code. If I ran same code in a python shell, by typing each line of code. It works. But if I put exact same code in a .py file and run it with python file.py, it showing the error
UPDATE 2: Another team member have same error with Windows 7 and Python 2.7.* This code used to work this morning. AGAIN I didn't change anything. That is way I am asking if it is unstable.
There is no problem with subprocess. If you want to run a specified executable, you need to give the full path to that file. The most likely reason you're seeing variable behavior is that sometimes you're in the directory with the .exe, and other times you're not.

Setting up build command to get the runtime of C++ program in Geany

Is there any way that I can see the run time of my C++ program in Geany? I am trying to add a execute command like this "time(./%e<i.txt)" it is giving error
./geany_run_script.sh: 5: ./geany_run_script.sh: time(./g<i.txt): not found
I have i.txt in the same directory as output file.I just want to know the runtime of my C++ programs while taking input from .txt file without writing the commands every time in the terminal myself any way I can do this?

How do you run a command line program after compiling with GCC on OSX?

Some of Facebooks programmer puzzles look fun, so I'm trying to get set up to code in C++ on my mac. I decided to try compiling some of my old CS homework with GCC to get started.
My code compiles fine, but when I try to run the executable (called "encrypt") I get this:
-bash: encrypt: command not found
I checked the permissions on the file and it seems to have execute permission. What am I missing here?
The current directory isn't in your $PATH, so you have to tell the shell to execute encrypt in the current directory.
./encrypt
or
/path/to/directory/encrypt
You need to execute it as ./encrypt
Try ./encrypt rather than encrypt. Bash won't look for executables with relative paths outside the path.