Toon posts:

[Matlab] sourcecode van prog met foutje, need solution

Pagina: 1
Acties:
  • 42 views sinds 30-01-2008

Verwijderd

Topicstarter
Probleem is dus dat hij een fout geeft aan lijn 15 contour(image_name); In de helpdesk vind ik niets over het commando dusja en het is wel degelijk zo oorspronkelijk.
De bedoeling is dus dat hij een ster isoleert van een hemelfoto... Maar vraag is hoe breng ik zo'n foto in en welke naam moet ik die geven, in welke map moet ik die plaatsen. Wat moet ik daar dus juist aan veranderen... En hoe zal hij dan de foto weergeven na het proces?
Als er nog fouten in zouden staan die erna komen corrigeren hé want zal waarschijnlijk toch oplossing niet vinden :+ Ben nog Matlabnoob :*)
so _/-\o_ aan diegene die mij een oplossing kan geven.


code:
--------------------------------------------------------------------------------
1 function star_image = isolate_star( image_name, box_size, tolerance )
2 % ISOLATE_STAR - Isolate a star on a known field and get its image
3 %
4 % ISOLATE_STAR( IMAGE, BOX_SIZE, TOLERANCE )
5 % - IMAGE is the grayscale image that the star is to be taken from
6 % - BOX_SIZE is the number of pixels in each direction that the box
7 % around the star should encompass
8 % - TOLERANCE is the pixel intensity which should be regarded as
9 % background noise
10 %
11 % NOTE: It is recommended that the tolerance be taken from a dark frame
12 % that has been run through PROCESS_IMAGE.
13
14 % Plot the entire image
15 contour(image_name);
16
17 % Give the user a chance to zoom in on the star they want to use
18 fprintf(1,'Press any key after zooming...\n');
19 pause;
20
21 % Capture the click location, then close the figure
22 spot = ginput(1);
23 close(gcf);
24
25 % Round off the point selected to an integer
26 spot = round(spot);
27
28 % Extract a box around the selected point of the selected size
29 star_image = image_name( spot(2)-box_size:spot(2)+box_size,...
30 spot(1)-box_size:spot(1)+box_size );
31
32 % Zero out values below the tolerance
33 for i=1:(box_size*2+1)
34 for j=1:(box_size*2+1)
35 if ( star_image(i,j) < tolerance )
36 star_image(i,j) = 0;
37 end
38 end
39 end
40
41 % Plot the resulting star
42 surface(star_image);


--------------------------------------------------------------------------------

  • whoami
  • Registratie: December 2000
  • Laatst online: 12:26
Debuggen en zoeken is the key.

Sorry hoor, maar dit is hier geen helpdesk. Het is hier niet de bedoeling dat je zomaar scriptjes post met fouten in , en dat wij die hier gaan oplossen.
Je zult zelf ook wat moeite moeten doen.
Zo werkt het hier niet. Wij houden niet van topics waar je zomaar code post met een omschrijving van het probleem en de verwachting dat wij die zo maar voorr jou fixen.

check ook:
Welkom in P&W (FAQ-28/11/2002)
Welkom in P&W -> Quickstart (update 2/10/2002)

[ Voor 14% gewijzigd door whoami op 24-01-2003 17:31 ]

https://fgheysels.github.io/


Dit topic is gesloten.