Why doesn't camera_calibration.cpp tutorial code read from my camera correctly? - opencv

I am getting the following error when trying to run camera_calibration.cpp in the calib3d module of OpenCV's tutorial code samples, in streaming mode: Input does not exist: Invalid input detected. Application stopping. The input line in the xml input file looks like this: <Input>0</Input>, which should get the "0th" camera on my system.

I fixed this by enclosing the camera index in double quotes: <Input>0</Input> became <Input>"0"</Input>. (Simplistic parser... oh well, hope this helps some people.)

Related

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 356: character maps to <undefined>

enter image description here
Its is a project of mobile app development by using library kivy.
after login in to the app there was a page which express feelings, I supposed to print feelings text like cotations which expressed by some great people.
But at that place I am getting so error like "UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 356: character maps to "
The issue is probably occurring since you did not specify a file encoding on line 55 in your main.py file as shown in your screenshot image.
I would recommend adding , encoding='utf-8' as another parameter in your call to open. If that does not work, try another file encoding.
So to be completely clear, that line should be:
with open(f"quotes/{feel}.txt", encoding='utf-8') as file:

How to Reproject GeoJSON without crs property to WGS84 (to use React Leaflet)

(Please help I've been struggling with the same problem for more than three days...🤖)
I got GeoJSON file from National Statistical Office, which means it's official data- and the coordinates in this file look like this- :
[959394.1770449197,1948599.8772112513],
... ,
[1140386.5164449196,1684523.5489112514],
It's a GeoJSON object without a member named "crs", and as you can see, it's not using the WGS84 datum. Seems like it's coordinates to draw polygons, which are the shape of each district. I assume that there is no problem with data structure.
I tried to create map using this file with React Leaflet, but failed continuously. To find out if it's the problem of GeoJSON that I'm using, I used other GeoJSON files and it worked fine(meaning that interactive map was created on web) - By comparing the GeoJSON files, I found out that coordinates should be in WGS84 if I want to work with leaflet. So I tried to transform GeoJSON to WGS84 using reproject. In my react app project, I installed reproject, epsg and put the code below:
import * as mapData from '../data/sigunguWithPopGeo.json'
import { toWgs84 } from 'reproject'
import 'epsg'
let epsg = require('epsg');
toWgs84(mapData, undefined, epsg);
And the error was returned:
Error: Unable to detect CRS, GeoJSON has no "crs" property.
Thanks for reading this long intro - Finally here is my question.
Is there any way to reproject GeoJSON without "crs" property to WGS84? I also tried making the coordinates WGS84 with mapshaper.org. Again, I got the error caused by undefined coordinate system of GeoJSON file:
Unable to project -- source coordinate system is unknown
Should I consider adding crs property to GeoJSON? It's my very first time to create the interactive map using GeoJSON with React-leaflet, so any kind of advice from people who experienced similar projects would really help me!
Luckily, solved the problem by myself..!
Instead of keep looking for the methods to convert GeoJSON with undefined coordinate system to WGS84, I visited National Statistical Office's website to figure out the code of coordinate system that was used in src data - which was EPSG 5179. Then I converted GeoJSON file from EPSG 5179 to EPSG 4326(WGS84) on MyGeoData Converter. Before downloading the converted data, I checked on the map to see if the coordinates of data was successfully converted to proper lat, lng values. Hope this solution helps who are struggling with similar problems..👩‍🔧

Convert scn to glb

I am trying to covert an scn file to GLB format. I used assimp and get the following error. It is in the supported import format
param = test.glb
assimp export: select file format: 'glb2' (GL Transmission Format v. 2 (binary))
Launching asset import ... OK
Validating postprocessing flags ... OK
ERROR: Failed to load file: COB: Could not found magic id: `Caligari`
Anyway to get past this? Or would any other CLI or API help in the conversion?
Could you please open an Issue-Report on Asset-Importer-Lib with a small issue, which can be used to reproduce the issue? The COB-Format is not so stable in the Assimp and it would be great to make this more stable.
I think this issue is caused by a not correctly parsed magic-token at the beginning, which needs to get fixes.

Implementing bag of word algorithm from opencv sample codes

I am trying to implement bagofwords_classification.cpp from opencv version 2.4.5 sample codes.cpp . What are the changes that we are required to make in this .cpp file for proper working of code. I am new to opencv and still trying sample codes.
How and where to add the Feature detector,descriptor extractor, descriptor matcher ?? in that .cpp code
Whenever i debug any code it never display results but just output the info about what that .cpp file is gonna do. In (EXAMPLE) matching_to_many_images.cpp even the images are saved in the file but still no results are shown.
To show an image, you can use cvShowImage("Title",image) or imshow(). This depends on wheter to image is an IplImage or Mat.
The code example is not 'false', the program uses commandline arguments, thus to start it you need to add certain commands.
From the code
[feature detector]
Feature detector name (e.g. SURF, FAST...) - see createFeatureDetector() function.
[descriptor extractor]
Descriptor extractor name (e.g. SURF, SIFT) - see createDescriptorExtractor() function.
[descriptor matcher]
Descriptor matcher name (e.g. BruteForce) - see createDescriptorMatcher() function.
then from those arguments it calls
Ptr<FeatureDetector> featureDetector = createFeatureDetector( ddmParams.detectorType );
Ptr<DescriptorExtractor> descExtractor = createDescriptorExtractor( ddmParams.descriptorType );

how to crop with node-imagemagick, with a buffer as input, and stdout as output?

I'm using node-imagemagick for the first time.
Disclaimer: I've never used imagemagick, and am not much of a javascript guy. Most experience is in C/C++, Objective-C.
I'm writing a snippet for a server side process that needs to take an input buffer, crop it to an arbitrary bounds, and then output that in stdout.
Currently, my code looks like this:
var im = require('imagemagick');
...
im.convert([
binaryDataBlock,
'-crop',
cropStr], function(err, stdout, stderr) {....
I know my input is good... I've done this with imagemagick's "resize" routine. "cropStr" is a string, "100x100+10+10" -- any arbitrary values go here.
But I still get errors back in stderr:
"result" : "convert: unable to open image `����': # error/blob.c/OpenBlob/2587.\nconvert: no decode delegate for this
image format ����' #
error/constitute.c/ReadImage/532.\nconvert: option requires an
argument-crop' # error/convert.c/ConvertImageCommand/1081.\n"
I've tried putting in a "-format" argument, which I thought would set the output format. But then it complains about the argument.
I feel like I'm missing something obvious here. It shouldn't be so hard to just crop to an arbitrary rectangle in an image.
Any help would be tremendously appreciated.

Resources